1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Correct background images usage in frame buffer emulation.

This commit is contained in:
Sergey Lipskiy 2013-06-09 18:55:21 +07:00
parent e3c77c7b8e
commit 3f98553ad2
3 changed files with 22 additions and 5 deletions

View File

@ -513,3 +513,18 @@ void FrameBuffer_ActivateBufferTexture( s16 t, FrameBuffer *buffer )
// FrameBuffer_RenderBuffer(buffer->startAddress);
TextureCache_ActivateTexture( t, buffer->texture );
}
void FrameBuffer_ActivateBufferTextureBG( s16 t, FrameBuffer *buffer )
{
buffer->texture->scaleS = OGL.scaleX / (float)buffer->texture->realWidth;
buffer->texture->scaleT = OGL.scaleY / (float)buffer->texture->realHeight;
buffer->texture->shiftScaleS = 1.0f;
buffer->texture->shiftScaleT = 1.0f;
buffer->texture->offsetS = gSP.bgImage.imageX;
buffer->texture->offsetT = (float)buffer->height - gSP.bgImage.imageY;
// FrameBuffer_RenderBuffer(buffer->startAddress);
TextureCache_ActivateTexture( t, buffer->texture );
}

View File

@ -33,5 +33,6 @@ void FrameBuffer_RestoreBuffer( u32 address, u16 size, u16 width );
void FrameBuffer_RemoveBuffer( u32 address );
FrameBuffer *FrameBuffer_FindBuffer( u32 address );
void FrameBuffer_ActivateBufferTexture( s16 t, FrameBuffer *buffer );
void FrameBuffer_ActivateBufferTextureBG( s16 t, FrameBuffer *buffer );
#endif

View File

@ -863,15 +863,16 @@ void TextureCache_Update( u32 t )
TextureCache_Init();
}
if (gDP.textureMode == TEXTUREMODE_BGIMAGE)
{
switch(gDP.textureMode) {
case TEXTUREMODE_BGIMAGE:
TextureCache_UpdateBackground();
return;
}
else if (gDP.textureMode == TEXTUREMODE_FRAMEBUFFER)
{
case TEXTUREMODE_FRAMEBUFFER:
FrameBuffer_ActivateBufferTexture( t, gDP.loadTile->frameBuffer );
return;
case TEXTUREMODE_FRAMEBUFFER_BG:
FrameBuffer_ActivateBufferTextureBG( t, gDP.loadTile->frameBuffer );
return;
}
maxTexels = imageFormat[gSP.textureTile[t]->size][gSP.textureTile[t]->format].maxTexels;