mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
Clarify texture cache code. Previously, there were THREE sets of texture dimensions, and it was hard to tell which set was for what purpose.
Now, there are two: Real dimensions: Width and height of the original GameCube texture Virtual dimensions: Width and height of the texture used by dolphin-emu's renderer git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6291 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -125,7 +125,7 @@ bool TextureCache::TCacheEntry::Save(const char filename[])
|
||||
std::string tga_filename(filename);
|
||||
tga_filename.replace(tga_filename.size() - 3, 3, "tga");
|
||||
|
||||
return SaveTexture(tga_filename.c_str(), GL_TEXTURE_2D, texture, w, h);
|
||||
return SaveTexture(tga_filename.c_str(), GL_TEXTURE_2D, texture, realW, realH);
|
||||
}
|
||||
|
||||
TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
|
||||
@ -298,7 +298,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(bool bFromZBuffer, bool bScaleB
|
||||
glEnable(GL_TEXTURE_RECTANGLE_ARB);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, read_texture);
|
||||
|
||||
glViewport(0, 0, scaledW, scaledH);
|
||||
glViewport(0, 0, virtualW, virtualH);
|
||||
|
||||
PixelShaderCache::SetCurrentShader(bFromZBuffer ? PixelShaderCache::GetDepthMatrixProgram() : PixelShaderCache::GetColorMatrixProgram());
|
||||
const float* const fConstAdd = colmat + 16; // fConstAdd is the last 4 floats of colmat
|
||||
@ -344,7 +344,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(bool bFromZBuffer, bool bScaleB
|
||||
{
|
||||
static int count = 0;
|
||||
SaveTexture(StringFromFormat("%sefb_frame_%i.tga", File::GetUserPath(D_DUMPTEXTURES_IDX),
|
||||
count++).c_str(), GL_TEXTURE_2D, texture, w, h);
|
||||
count++).c_str(), GL_TEXTURE_2D, texture, realW, realH);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user