always clear before drawing 2d image

This commit is contained in:
olebeck 2025-07-07 15:09:27 +02:00
parent 8158bca0ab
commit e135bf5595
2 changed files with 7 additions and 0 deletions

View File

@ -1424,6 +1424,7 @@ void GXMRenderer::StartScene()
sceGxmSetCullMode(gxm->context, SCE_GXM_CULL_CCW);
gxm->sceneStarted = true;
this->quadsUsed = 0;
this->cleared = false;
sceGxmNotificationWait(&this->vertexNotifications[this->currentVertexBufferIndex]);
sceGxmNotificationWait(&this->fragmentNotifications[this->currentFragmentBufferIndex]);
@ -1554,6 +1555,7 @@ void GXMRenderer::Clear(float r, float g, float b)
{
this->StartScene();
gxm->clear(r, g, b, false);
this->cleared = true;
}
void GXMRenderer::Flip()
@ -1579,6 +1581,10 @@ void GXMRenderer::Flip()
void GXMRenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect, FColor color)
{
this->StartScene();
if(!this->cleared) {
gxm->clear(0,0,0, false);
this->cleared = true;
}
#ifdef DEBUG
char marker[256];

View File

@ -161,6 +161,7 @@ class GXMRenderer : public Direct3DRMRenderer {
Vertex2D* quadVertices[GXM_VERTEX_BUFFER_COUNT];
uint16_t* quadIndices;
int quadsUsed = 0;
bool cleared = false;
SceGxmNotification vertexNotifications[GXM_VERTEX_BUFFER_COUNT];
SceGxmNotification fragmentNotifications[GXM_FRAGMENT_BUFFER_COUNT];