mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Optimize compositing cases slightly
This commit is contained in:
parent
c207675dfb
commit
5aec67a0f7
1
CHANGES
1
CHANGES
|
@ -71,6 +71,7 @@ Misc:
|
|||
- 3DS: Adjustable filering
|
||||
- PSP2: Screenshots are now saved into the Photo Gallery
|
||||
- Qt: Make reseting when pasued frame-accurate
|
||||
- GBA Video: Optimize compositing cases slightly
|
||||
|
||||
0.4.1: (2016-07-11)
|
||||
Bugfixes:
|
||||
|
|
|
@ -40,9 +40,6 @@
|
|||
y += background->dy; \
|
||||
\
|
||||
uint32_t current = *pixel; \
|
||||
if (!IS_WRITABLE(current)) { \
|
||||
continue; \
|
||||
} \
|
||||
MOSAIC(COORD) \
|
||||
if (pixelData) { \
|
||||
COMPOSITE_256_ ## OBJWIN (BLEND, 0); \
|
||||
|
|
|
@ -51,6 +51,9 @@ static inline void _compositeBlendObjwin(struct GBAVideoSoftwareRenderer* render
|
|||
}
|
||||
|
||||
static inline void _compositeBlendNoObjwin(struct GBAVideoSoftwareRenderer* renderer, uint32_t* pixel, uint32_t color, uint32_t current) {
|
||||
if (!IS_WRITABLE(current)) { \
|
||||
return; \
|
||||
} \
|
||||
if (color >= current) {
|
||||
if (current & FLAG_TARGET_1 && color & FLAG_TARGET_2) {
|
||||
color = _mix(renderer->blda, current, renderer->bldb, color);
|
||||
|
@ -84,6 +87,9 @@ static inline void _compositeNoBlendNoObjwin(struct GBAVideoSoftwareRenderer* re
|
|||
}
|
||||
|
||||
#define COMPOSITE_16_OBJWIN(BLEND, IDX) \
|
||||
if (!IS_WRITABLE(current)) { \
|
||||
continue; \
|
||||
} \
|
||||
if (objwinForceEnable || (!(current & FLAG_OBJWIN)) == objwinOnly) { \
|
||||
unsigned color = (current & FLAG_OBJWIN) ? objwinPalette[paletteData | pixelData] : palette[pixelData]; \
|
||||
unsigned mergedFlags = flags; \
|
||||
|
@ -97,6 +103,9 @@ static inline void _compositeNoBlendNoObjwin(struct GBAVideoSoftwareRenderer* re
|
|||
_composite ## BLEND ## NoObjwin(renderer, &pixel[IDX], palette[pixelData] | flags, current);
|
||||
|
||||
#define COMPOSITE_256_OBJWIN(BLEND, IDX) \
|
||||
if (!IS_WRITABLE(current)) { \
|
||||
continue; \
|
||||
} \
|
||||
if (objwinForceEnable || (!(current & FLAG_OBJWIN)) == objwinOnly) { \
|
||||
unsigned color = (current & FLAG_OBJWIN) ? objwinPalette[pixelData] : palette[pixelData]; \
|
||||
unsigned mergedFlags = flags; \
|
||||
|
|
Loading…
Reference in New Issue