mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Code cleaup: fix idents, replace spaces by tabs.
This commit is contained in:
parent
4d93ddac4f
commit
389a46c394
12
OpenGL.cpp
12
OpenGL.cpp
|
@ -206,12 +206,12 @@ void OGL_InitExtensions()
|
||||||
|
|
||||||
void OGL_InitStates()
|
void OGL_InitStates()
|
||||||
{
|
{
|
||||||
glEnable( GL_CULL_FACE );
|
glEnable( GL_CULL_FACE );
|
||||||
glEnableVertexAttribArray( SC_POSITION );
|
glEnableVertexAttribArray( SC_POSITION );
|
||||||
glEnable( GL_DEPTH_TEST );
|
glEnable( GL_DEPTH_TEST );
|
||||||
glDepthFunc( GL_ALWAYS );
|
glDepthFunc( GL_ALWAYS );
|
||||||
glDepthMask( GL_FALSE );
|
glDepthMask( GL_FALSE );
|
||||||
glEnable( GL_SCISSOR_TEST );
|
glEnable( GL_SCISSOR_TEST );
|
||||||
|
|
||||||
if (config.frameBufferEmulation.N64DepthCompare) {
|
if (config.frameBufferEmulation.N64DepthCompare) {
|
||||||
glDisable( GL_DEPTH_TEST );
|
glDisable( GL_DEPTH_TEST );
|
||||||
|
|
6
RSP.cpp
6
RSP.cpp
|
@ -177,13 +177,13 @@ void RSP_ProcessDList()
|
||||||
switch (Debug.level)
|
switch (Debug.level)
|
||||||
{
|
{
|
||||||
case DEBUG_LOW:
|
case DEBUG_LOW:
|
||||||
DebugMsg( DEBUG_LOW | DEBUG_ERROR, "ATTEMPTING TO EXECUTE RSP COMMAND AT INVALID RDRAM LOCATION\n" );
|
DebugMsg( DEBUG_LOW | DEBUG_ERROR, "ATTEMPTING TO EXECUTE RSP COMMAND AT INVALID RDRAM LOCATION\n" );
|
||||||
break;
|
break;
|
||||||
case DEBUG_MEDIUM:
|
case DEBUG_MEDIUM:
|
||||||
DebugMsg( DEBUG_MEDIUM | DEBUG_ERROR, "Attempting to execute RSP command at invalid RDRAM location\n" );
|
DebugMsg( DEBUG_MEDIUM | DEBUG_ERROR, "Attempting to execute RSP command at invalid RDRAM location\n" );
|
||||||
break;
|
break;
|
||||||
case DEBUG_HIGH:
|
case DEBUG_HIGH:
|
||||||
DebugMsg( DEBUG_HIGH | DEBUG_ERROR, "// Attempting to execute RSP command at invalid RDRAM location\n" );
|
DebugMsg( DEBUG_HIGH | DEBUG_ERROR, "// Attempting to execute RSP command at invalid RDRAM location\n" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
40
Textures.cpp
40
Textures.cpp
|
@ -276,7 +276,7 @@ bool TextureCache_Verify()
|
||||||
{
|
{
|
||||||
s16 i = 0;
|
s16 i = 0;
|
||||||
CachedTexture *current;
|
CachedTexture *current;
|
||||||
|
|
||||||
current = cache.top;
|
current = cache.top;
|
||||||
|
|
||||||
while (current)
|
while (current)
|
||||||
|
@ -317,8 +317,8 @@ void TextureCache_RemoveBottom()
|
||||||
|
|
||||||
free( cache.bottom );
|
free( cache.bottom );
|
||||||
|
|
||||||
cache.bottom = newBottom;
|
cache.bottom = newBottom;
|
||||||
|
|
||||||
if (cache.bottom)
|
if (cache.bottom)
|
||||||
cache.bottom->lower = NULL;
|
cache.bottom->lower = NULL;
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ CachedTexture *TextureCache_AddTop()
|
||||||
if (!cache.bottom)
|
if (!cache.bottom)
|
||||||
cache.bottom = newtop;
|
cache.bottom = newtop;
|
||||||
|
|
||||||
cache.top = newtop;
|
cache.top = newtop;
|
||||||
|
|
||||||
cache.numCached++;
|
cache.numCached++;
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ void TextureCache_LoadBackground( CachedTexture *texInfo )
|
||||||
if (((imageFormat[texInfo->size][texInfo->format].autoFormat == GL_RGBA) ||
|
if (((imageFormat[texInfo->size][texInfo->format].autoFormat == GL_RGBA) ||
|
||||||
((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16)) || (cache.bitDepth == 2)) && (cache.bitDepth != 0))
|
((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16)) || (cache.bitDepth == 2)) && (cache.bitDepth != 0))
|
||||||
{
|
{
|
||||||
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 2;
|
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 2;
|
||||||
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
||||||
{
|
{
|
||||||
if (texInfo->size == G_IM_SIZ_4b)
|
if (texInfo->size == G_IM_SIZ_4b)
|
||||||
|
@ -469,7 +469,7 @@ void TextureCache_LoadBackground( CachedTexture *texInfo )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 1;
|
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 1;
|
||||||
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
||||||
{
|
{
|
||||||
if (texInfo->size == G_IM_SIZ_4b)
|
if (texInfo->size == G_IM_SIZ_4b)
|
||||||
|
@ -555,7 +555,7 @@ void TextureCache_Load( CachedTexture *texInfo )
|
||||||
if (((imageFormat[texInfo->size][texInfo->format].autoFormat == GL_RGBA) ||
|
if (((imageFormat[texInfo->size][texInfo->format].autoFormat == GL_RGBA) ||
|
||||||
((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16)) || (cache.bitDepth == 2)) && (cache.bitDepth != 0))
|
((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16)) || (cache.bitDepth == 2)) && (cache.bitDepth != 0))
|
||||||
{
|
{
|
||||||
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 2;
|
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 2;
|
||||||
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
||||||
{
|
{
|
||||||
if (texInfo->size == G_IM_SIZ_4b)
|
if (texInfo->size == G_IM_SIZ_4b)
|
||||||
|
@ -575,7 +575,7 @@ void TextureCache_Load( CachedTexture *texInfo )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 1;
|
texInfo->textureBytes = (texInfo->realWidth * texInfo->realHeight) << 1;
|
||||||
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
if ((texInfo->format == G_IM_FMT_CI) && (gDP.otherMode.textureLUT == G_TT_IA16))
|
||||||
{
|
{
|
||||||
if (texInfo->size == G_IM_SIZ_4b)
|
if (texInfo->size == G_IM_SIZ_4b)
|
||||||
|
@ -692,18 +692,18 @@ u32 TextureCache_CalculateCRC( u32 t, u32 width, u32 height )
|
||||||
lineBytes = gSP.textureTile[t]->line << 3;
|
lineBytes = gSP.textureTile[t]->line << 3;
|
||||||
|
|
||||||
line = gSP.textureTile[t]->line;
|
line = gSP.textureTile[t]->line;
|
||||||
if (gSP.textureTile[t]->size == G_IM_SIZ_32b)
|
if (gSP.textureTile[t]->size == G_IM_SIZ_32b)
|
||||||
line <<= 1;
|
line <<= 1;
|
||||||
|
|
||||||
crc = 0xFFFFFFFF;
|
crc = 0xFFFFFFFF;
|
||||||
for (y = 0; y < height; y++)
|
for (y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
crc = CRC_Calculate( crc, src, bpl );
|
crc = CRC_Calculate( crc, src, bpl );
|
||||||
|
|
||||||
src += line;
|
src += line;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSP.textureTile[t]->format == G_IM_FMT_CI)
|
if (gSP.textureTile[t]->format == G_IM_FMT_CI)
|
||||||
{
|
{
|
||||||
if (gSP.textureTile[t]->size == G_IM_SIZ_4b)
|
if (gSP.textureTile[t]->size == G_IM_SIZ_4b)
|
||||||
crc = CRC_Calculate( crc, &gDP.paletteCRC16[gSP.textureTile[t]->palette], 4 );
|
crc = CRC_Calculate( crc, &gDP.paletteCRC16[gSP.textureTile[t]->palette], 4 );
|
||||||
|
@ -760,7 +760,7 @@ void TextureCache_UpdateBackground()
|
||||||
|
|
||||||
crc = CRC_Calculate( 0xFFFFFFFF, &RDRAM[gSP.bgImage.address], numBytes );
|
crc = CRC_Calculate( 0xFFFFFFFF, &RDRAM[gSP.bgImage.address], numBytes );
|
||||||
|
|
||||||
if (gSP.bgImage.format == G_IM_FMT_CI)
|
if (gSP.bgImage.format == G_IM_FMT_CI)
|
||||||
{
|
{
|
||||||
if (gSP.bgImage.size == G_IM_SIZ_4b)
|
if (gSP.bgImage.size == G_IM_SIZ_4b)
|
||||||
crc = CRC_Calculate( crc, &gDP.paletteCRC16[gSP.bgImage.palette], 4 );
|
crc = CRC_Calculate( crc, &gDP.paletteCRC16[gSP.bgImage.palette], 4 );
|
||||||
|
@ -770,8 +770,8 @@ void TextureCache_UpdateBackground()
|
||||||
|
|
||||||
CachedTexture *current = cache.top;
|
CachedTexture *current = cache.top;
|
||||||
|
|
||||||
while (current)
|
while (current)
|
||||||
{
|
{
|
||||||
if ((current->crc == crc) &&
|
if ((current->crc == crc) &&
|
||||||
(current->width == gSP.bgImage.width) &&
|
(current->width == gSP.bgImage.width) &&
|
||||||
(current->height == gSP.bgImage.height) &&
|
(current->height == gSP.bgImage.height) &&
|
||||||
|
@ -811,7 +811,7 @@ void TextureCache_UpdateBackground()
|
||||||
cache.current[0]->maskT = 0;
|
cache.current[0]->maskT = 0;
|
||||||
cache.current[0]->mirrorS = 0;
|
cache.current[0]->mirrorS = 0;
|
||||||
cache.current[0]->mirrorT = 0;
|
cache.current[0]->mirrorT = 0;
|
||||||
cache.current[0]->clampS = 1;
|
cache.current[0]->clampS = 1;
|
||||||
cache.current[0]->clampT = 1;
|
cache.current[0]->clampT = 1;
|
||||||
cache.current[0]->line = 0;
|
cache.current[0]->line = 0;
|
||||||
cache.current[0]->tMem = 0;
|
cache.current[0]->tMem = 0;
|
||||||
|
@ -954,7 +954,7 @@ void TextureCache_Update( u32 t )
|
||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
clampWidth = gSP.textureTile[t]->clamps ? tileWidth : width;
|
clampWidth = gSP.textureTile[t]->clamps ? tileWidth : width;
|
||||||
clampHeight = gSP.textureTile[t]->clampt ? tileHeight : height;
|
clampHeight = gSP.textureTile[t]->clampt ? tileHeight : height;
|
||||||
|
|
||||||
if (clampWidth > 256)
|
if (clampWidth > 256)
|
||||||
|
@ -963,7 +963,7 @@ void TextureCache_Update( u32 t )
|
||||||
gSP.textureTile[t]->clampt = 0;
|
gSP.textureTile[t]->clampt = 0;
|
||||||
|
|
||||||
// Make sure masking is valid
|
// Make sure masking is valid
|
||||||
if (maskWidth > width)
|
if (maskWidth > width)
|
||||||
{
|
{
|
||||||
gSP.textureTile[t]->masks = powof( width );
|
gSP.textureTile[t]->masks = powof( width );
|
||||||
maskWidth = 1 << gSP.textureTile[t]->masks;
|
maskWidth = 1 << gSP.textureTile[t]->masks;
|
||||||
|
@ -981,8 +981,8 @@ void TextureCache_Update( u32 t )
|
||||||
// current = cache.top;
|
// current = cache.top;
|
||||||
|
|
||||||
current = cache.top;
|
current = cache.top;
|
||||||
while (current)
|
while (current)
|
||||||
{
|
{
|
||||||
if ((current->crc == crc) &&
|
if ((current->crc == crc) &&
|
||||||
// (current->address == gDP.textureImage.address) &&
|
// (current->address == gDP.textureImage.address) &&
|
||||||
// (current->palette == gSP.textureTile[t]->palette) &&
|
// (current->palette == gSP.textureTile[t]->palette) &&
|
||||||
|
@ -1044,7 +1044,7 @@ void TextureCache_Update( u32 t )
|
||||||
cache.current[t]->maskT = gSP.textureTile[t]->maskt;
|
cache.current[t]->maskT = gSP.textureTile[t]->maskt;
|
||||||
cache.current[t]->mirrorS = gSP.textureTile[t]->mirrors;
|
cache.current[t]->mirrorS = gSP.textureTile[t]->mirrors;
|
||||||
cache.current[t]->mirrorT = gSP.textureTile[t]->mirrort;
|
cache.current[t]->mirrorT = gSP.textureTile[t]->mirrort;
|
||||||
cache.current[t]->clampS = gSP.textureTile[t]->clamps;
|
cache.current[t]->clampS = gSP.textureTile[t]->clamps;
|
||||||
cache.current[t]->clampT = gSP.textureTile[t]->clampt;
|
cache.current[t]->clampT = gSP.textureTile[t]->clampt;
|
||||||
cache.current[t]->line = gSP.textureTile[t]->line;
|
cache.current[t]->line = gSP.textureTile[t]->line;
|
||||||
cache.current[t]->tMem = gSP.textureTile[t]->tmem;
|
cache.current[t]->tMem = gSP.textureTile[t]->tmem;
|
||||||
|
|
20
gDP.cpp
20
gDP.cpp
|
@ -439,7 +439,7 @@ void gDPSetTile( u32 format, u32 size, u32 line, u32 tmem, u32 tile, u32 palette
|
||||||
gDP.tiles[tile].shifts = shifts;
|
gDP.tiles[tile].shifts = shifts;
|
||||||
|
|
||||||
if (!gDP.tiles[tile].masks) gDP.tiles[tile].clamps = 1;
|
if (!gDP.tiles[tile].masks) gDP.tiles[tile].clamps = 1;
|
||||||
if (!gDP.tiles[tile].maskt) gDP.tiles[tile].clampt = 1;
|
if (!gDP.tiles[tile].maskt) gDP.tiles[tile].clampt = 1;
|
||||||
|
|
||||||
if (tile == gSP.texture.tile || tile == gSP.texture.tile + 1) {
|
if (tile == gSP.texture.tile || tile == gSP.texture.tile + 1) {
|
||||||
u32 nTile = 7;
|
u32 nTile = 7;
|
||||||
|
@ -614,7 +614,7 @@ void gDPLoadTile( u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt )
|
||||||
if (y & 1) Interleave( dest, line );
|
if (y & 1) Interleave( dest, line );
|
||||||
|
|
||||||
src += gDP.textureImage.bpl;
|
src += gDP.textureImage.bpl;
|
||||||
dest += line;
|
dest += line;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -630,11 +630,11 @@ void gDPLoadBlock( u32 tile, u32 uls, u32 ult, u32 lrs, u32 dxt )
|
||||||
gDP.loadTile->loadType = LOADTYPE_BLOCK;
|
gDP.loadTile->loadType = LOADTYPE_BLOCK;
|
||||||
gDP.loadTile->imageAddress = gDP.textureImage.address;
|
gDP.loadTile->imageAddress = gDP.textureImage.address;
|
||||||
|
|
||||||
u32 bytes = (lrs + 1) << gDP.loadTile->size >> 1;
|
u32 bytes = (lrs + 1) << gDP.loadTile->size >> 1;
|
||||||
u32 address = gDP.textureImage.address + ult * gDP.textureImage.bpl + (uls << gDP.textureImage.size >> 1);
|
u32 address = gDP.textureImage.address + ult * gDP.textureImage.bpl + (uls << gDP.textureImage.size >> 1);
|
||||||
|
|
||||||
if ((bytes == 0) ||
|
if ((bytes == 0) ||
|
||||||
((address + bytes) > RDRAMSize) ||
|
((address + bytes) > RDRAMSize) ||
|
||||||
(((gDP.loadTile->tmem << 3) + bytes) > 4096))
|
(((gDP.loadTile->tmem << 3) + bytes) > 4096))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -690,10 +690,10 @@ void gDPLoadTLUT( u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt )
|
||||||
{
|
{
|
||||||
gDPSetTileSize( tile, uls, ult, lrs, lrt );
|
gDPSetTileSize( tile, uls, ult, lrs, lrt );
|
||||||
|
|
||||||
u16 count = (u16)((gDP.tiles[tile].lrs - gDP.tiles[tile].uls + 1) * (gDP.tiles[tile].lrt - gDP.tiles[tile].ult + 1));
|
u16 count = (u16)((gDP.tiles[tile].lrs - gDP.tiles[tile].uls + 1) * (gDP.tiles[tile].lrt - gDP.tiles[tile].ult + 1));
|
||||||
u32 address = gDP.textureImage.address + gDP.tiles[tile].ult * gDP.textureImage.bpl + (gDP.tiles[tile].uls << gDP.textureImage.size >> 1);
|
u32 address = gDP.textureImage.address + gDP.tiles[tile].ult * gDP.textureImage.bpl + (gDP.tiles[tile].uls << gDP.textureImage.size >> 1);
|
||||||
|
|
||||||
u16 *dest = (u16*)&TMEM[gDP.tiles[tile].tmem];
|
u16 *dest = (u16*)&TMEM[gDP.tiles[tile].tmem];
|
||||||
u16 *src = (u16*)&RDRAM[address];
|
u16 *src = (u16*)&RDRAM[address];
|
||||||
|
|
||||||
u16 pal = (u16)((gDP.tiles[tile].tmem - 256) >> 4);
|
u16 pal = (u16)((gDP.tiles[tile].tmem - 256) >> 4);
|
||||||
|
@ -712,7 +712,7 @@ void gDPLoadTLUT( u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt )
|
||||||
|
|
||||||
dest += 4;
|
dest += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
gDP.paletteCRC16[pal] = CRC_CalculatePalette( 0xFFFFFFFF, &TMEM[256 + (pal << 4)], 16 );
|
gDP.paletteCRC16[pal] = CRC_CalculatePalette( 0xFFFFFFFF, &TMEM[256 + (pal << 4)], 16 );
|
||||||
pal++;
|
pal++;
|
||||||
}
|
}
|
||||||
|
@ -850,7 +850,7 @@ void gDPSetKeyGB(u32 cG, u32 sG, u32 wG, u32 cB, u32 sB, u32 wB )
|
||||||
|
|
||||||
void gDPTextureRectangle( f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, f32 s, f32 t, f32 dsdx, f32 dtdy )
|
void gDPTextureRectangle( f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, f32 s, f32 t, f32 dsdx, f32 dtdy )
|
||||||
{
|
{
|
||||||
if (gDP.otherMode.cycleType == G_CYC_COPY)
|
if (gDP.otherMode.cycleType == G_CYC_COPY)
|
||||||
{
|
{
|
||||||
dsdx = 1.0f;
|
dsdx = 1.0f;
|
||||||
lrx += 1.0f;
|
lrx += 1.0f;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user