trying to fix "hollow" sprite

(displayed because priority is set, but bckgnd color)
This commit is contained in:
damdoum 2007-01-26 16:26:43 +00:00
parent 4396a117c7
commit 0493245d87
1 changed files with 11 additions and 11 deletions

View File

@ -556,9 +556,6 @@ void renderline_checkWindows(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL *draw, BOOL
} }
if (windows) { if (windows) {
wwin0 = wwin0 && gpu->dispCnt.bits.Win0_Enable;
wwin1 = wwin1 && gpu->dispCnt.bits.Win1_Enable;
wwobj = wwobj && gpu->dispCnt.bits.WinOBJ_Enable;
/* /*
// HOW THE HELL THIS DOES NOT WORK !!! // HOW THE HELL THIS DOES NOT WORK !!!
@ -600,12 +597,12 @@ void renderline_checkWindows(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL *draw, BOOL
// PIXEL RENDERING // PIXEL RENDERING
/*****************************************************************************/ /*****************************************************************************/
INLINE void renderline_setFinalColor(GPU *gpu,u32 passing,u8 bgnum,u8 *dst,u16 color,u16 x, u16 y) { INLINE BOOL renderline_setFinalColor(GPU *gpu,u32 passing,u8 bgnum,u8 *dst,u16 color,u16 x, u16 y) {
BOOL windowDraw = TRUE, windowEffect = TRUE ; BOOL windowDraw = TRUE, windowEffect = TRUE ;
/* window priority: insides, if no rule, check outside */ /* window priority: insides, if no rule, check outside */
renderline_checkWindows(gpu,bgnum,x,y,&windowDraw,&windowEffect); renderline_checkWindows(gpu,bgnum,x,y,&windowDraw,&windowEffect);
if ((gpu->BLDCNT & (1 << bgnum)) && (windowEffect)) /* the bg to draw has a special color effect */ if (((gpu->BLDCNT>>bgnum)&1) && (windowEffect)) /* the bg to draw has a special color effect */
{ {
switch (gpu->BLDCNT & 0xC0) /* type of special color effect */ switch (gpu->BLDCNT & 0xC0) /* type of special color effect */
{ {
@ -630,12 +627,13 @@ INLINE void renderline_setFinalColor(GPU *gpu,u32 passing,u8 bgnum,u8 *dst,u16 c
/* when we dont take any fraction from existing pixel, we can just draw */ /* when we dont take any fraction from existing pixel, we can just draw */
u16 targetR, targetG, targetB; u16 targetR, targetG, targetB;
color = T2ReadWord(dst, passing) ; color = T2ReadWord(dst, passing) ;
//if (color & 0x8000) { //if (color & 0x8000) {
/* the existing pixel is not invisible */ /* the existing pixel is not invisible */
targetR = ((color & 0x1F) * targetFraction) >> 4 ; /* weighted component from color we draw on */ targetR = ((color & 0x1F) * targetFraction) >> 4 ; /* weighted component from color we draw on */
targetG = (((color>>5) & 0x1F) * targetFraction) >> 4 ; targetG = (((color>>5) & 0x1F) * targetFraction) >> 4 ;
targetB = (((color>>10) & 0x1F) * targetFraction) >> 4 ; targetB = (((color>>10) & 0x1F) * targetFraction) >> 4 ;
sourceR = min(0x1F,targetR+sourceR) ; /* limit combined components to 31 max */ /* limit combined components to 31 max */
sourceR = min(0x1F,targetR+sourceR) ;
sourceG = min(0x1F,targetG+sourceG) ; sourceG = min(0x1F,targetG+sourceG) ;
sourceB = min(0x1F,targetB+sourceB) ; sourceB = min(0x1F,targetB+sourceB) ;
//} //}
@ -680,7 +678,8 @@ INLINE void renderline_setFinalColor(GPU *gpu,u32 passing,u8 bgnum,u8 *dst,u16 c
if (((windowEffect) && (gpu->BLDCNT & (0x100 << bgnum))) || (windowDraw)) if (((windowEffect) && (gpu->BLDCNT & (0x100 << bgnum))) || (windowDraw))
T2WriteWord(dst, passing, color) ; T2WriteWord(dst, passing, color) ;
} }
} ; return windowDraw;
}
/*****************************************************************************/ /*****************************************************************************/
@ -1084,8 +1083,9 @@ void extRotBG(GPU * gpu, u8 num, u8 * DST)
#define RENDER_COND(cond) \ #define RENDER_COND(cond) \
if ((cond)&&(prio<=prioTab[sprX])) \ if ((cond)&&(prio<=prioTab[sprX])) \
{ \ { \
prioTab[sprX] = prio; \ /* if we don't draw, do not set prio, or else */ \
renderline_setFinalColor(gpu, sprX << 1,4,dst, color, sprX ,l); \ if (renderline_setFinalColor(gpu, sprX << 1,4,dst, color, sprX ,l)) \
prioTab[sprX] = prio; \
} }
/* if i understand it correct, and it fixes some sprite problems in chameleon shot */ /* if i understand it correct, and it fixes some sprite problems in chameleon shot */