I added a "retro" cvar to my customized Dquake psp engine to enable / disable it:
Its inside the video_hardware_draw.cpp file:
EDIT: MDave, if you really want to continie on Kurok you should try to contact me or Shpuld
via Skype, we have a few new things done for the psp engines which are really neat
Code:
void GL_Bind (int texture_index)
{
int tex_m = (int)r_mipmaps_func.value;
// Binding the currently bound texture?
if (currenttexture == texture_index)
{
// Don't bother.
return;
}
// Remember the current texture.
currenttexture = texture_index;
// Which texture is it?
const gltexture_t& texture = gltextures[texture_index];
if(texture.format == GU_PSM_T8) //only for 8 bit textures
{
if(texture.palette_active == qtrue)
{
// Upload the palette.
sceGuClutMode(GU_PSM_8888, 0, 255, 0);
#ifdef STATIC_PAL
sceKernelDcacheWritebackRange(texture.palette, sizeof(texture.palette));
#else
sceKernelDcacheWritebackRange(texture.palette, 256);
#endif
sceGuClutLoad(256 /8 , texture.palette);
reloaded_pallete = 0;
}
else
{
if(!reloaded_pallete)
{
VID_SetPaletteTX(); //Restore old palette for bars and models
}
}
}
// Set the texture mode.
sceGuTexMode(texture.format, texture.mipmaps , 0, texture.swizzle);
if (texture.mipmaps > 0 && r_mipmaps.value > 0)
{
float slope = 0.4f;
sceGuTexSlope(slope); // the near from 0 slope is the lower (=best detailed) mipmap it uses
sceGuTexFilter(GU_LINEAR_MIPMAP_LINEAR, GU_LINEAR_MIPMAP_LINEAR);
sceGuTexLevelMode(tex_m, r_mipmaps_bias.value); // manual slope setting
}
else
// dr_mabuse1981: "retro filter" start.
if (r_retro.value)
sceGuTexFilter(GU_NEAREST, GU_NEAREST);
else
sceGuTexFilter(texture.filter, texture.filter);
// dr_mabuse1981: "retro filter" end.
// Set the texture image.
const void* const texture_memory = texture.vram ? texture.vram : texture.ram;
sceGuTexImage(0, texture.width, texture.height, texture.width, texture_memory);
if (texture.mipmaps > 0 && r_mipmaps.value > 0)
{
int size = (texture.width * texture.height * texture.bpp);
int offset = size;
int div = 2;
for (int i = 1; i <= texture.mipmaps; i++)
{
void* const texture_memory2 = ((byte*) texture_memory)+offset;
sceGuTexImage(i, texture.width/div, texture.height/div, texture.width/div, texture_memory2);
offset += size/(div*div);
div *=2;
}
}
}
Leave a comment: