winport - fix OamView bug (proper obj priority wasn't being used when rendering it, causing many composite sprites to be rendered more or less in the opposite Z-order due to LATER obj drawing on top (whereas lower obj are supposed to draw on top). fixes #358
This commit is contained in:
parent
316103d2ec
commit
e654d1e7e9
|
@ -4956,7 +4956,11 @@ FORCEINLINE void GPUEngineBase::_RenderSpriteUpdatePixel(GPUEngineCompositorInfo
|
|||
|
||||
if (ISDEBUGRENDER)
|
||||
{
|
||||
//sprites draw in order, so EQUAL priority also trumps later sprites
|
||||
if(prioTab[frameX] <= prio)
|
||||
return;
|
||||
dst[frameX] = (ISOBJMODEBITMAP) ? *srcPalette : LE_TO_LOCAL_16(srcPalette[palIndex]);
|
||||
prioTab[frameX] = prio;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5164,6 +5168,11 @@ void GPUEngineBase::_SpriteRender(GPUEngineCompositorInfo &compInfo, u16 *__rest
|
|||
this->_SpriteRenderPerform<SpriteRenderMode_Sprite2D, ISDEBUGRENDER>(compInfo, dst, dst_alpha, typeTab, prioTab);
|
||||
}
|
||||
|
||||
void GPUEngineBase::SpritePrepareRenderDebug(u16 *dst)
|
||||
{
|
||||
memset(this->_sprPrio, 0x7F, GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT);
|
||||
}
|
||||
|
||||
void GPUEngineBase::SpriteRenderDebug(const u16 lineIndex, u16 *dst)
|
||||
{
|
||||
GPUEngineCompositorInfo compInfo;
|
||||
|
@ -5202,7 +5211,7 @@ void GPUEngineBase::SpriteRenderDebug(const u16 lineIndex, u16 *dst)
|
|||
compInfo.target.lineColor32 = (FragmentColor *)compInfo.target.lineColorHeadNative;
|
||||
compInfo.target.lineLayerID = NULL;
|
||||
|
||||
this->_SpriteRender<true>(compInfo, dst, NULL, NULL, NULL);
|
||||
this->_SpriteRender<true>(compInfo, dst, NULL, NULL, &this->_sprPrio[lineIndex][0]);
|
||||
}
|
||||
|
||||
template <SpriteRenderMode MODE, bool ISDEBUGRENDER>
|
||||
|
|
|
@ -1637,6 +1637,7 @@ public:
|
|||
|
||||
const BGLayerInfo& GetBGLayerInfoByID(const GPULayerID layerID);
|
||||
|
||||
void SpritePrepareRenderDebug(u16 *dst);
|
||||
void SpriteRenderDebug(const u16 lineIndex, u16 *dst);
|
||||
void RenderLayerBG(const GPULayerID layerID, u16 *dstLineColor);
|
||||
|
||||
|
|
|
@ -211,10 +211,11 @@ LRESULT OamView_OnPaint(HWND hwnd, oamview_struct *win, WPARAM wParam, LPARAM lP
|
|||
SetWindowText(GetDlgItem(hwnd, IDC_PROP1), "");
|
||||
}
|
||||
|
||||
for(i = 0; i < 192; ++i)
|
||||
{
|
||||
win->gpu->SpriteRenderDebug(i, (u16*)(bitmap + i*256));
|
||||
}
|
||||
win->gpu->SpritePrepareRenderDebug(bitmap);
|
||||
for(i = 0; i < 192; ++i)
|
||||
{
|
||||
win->gpu->SpriteRenderDebug(i, (u16*)(bitmap + i * 256));
|
||||
}
|
||||
|
||||
u32 width = dimm_int[(oam->attr1>>14)][(oam->attr0>>14)][0];
|
||||
u32 height = dimm_int[(oam->attr1>>14)][(oam->attr0>>14)][1];
|
||||
|
|
Loading…
Reference in New Issue