Skip to content

Commit

Permalink
[Video] Rename grTexSource to gfxTexSource
Browse files Browse the repository at this point in the history
  • Loading branch information
zilmar committed Jul 20, 2017
1 parent 628b9ad commit e78abaf
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 27 deletions.
12 changes: 6 additions & 6 deletions Source/Project64-video/FBtoScreen.cpp
Expand Up @@ -152,7 +152,7 @@ static void DrawRE2Video256(FB_TO_SCREEN_INFO & fb_info)
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
grTexSource(tmu,
gfxTexSource(tmu,
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
Expand Down Expand Up @@ -244,7 +244,7 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
}
}
gfxTexDownloadMipMap(tmu, tex_adr, GR_MIPMAPLEVELMASK_BOTH, &t_info);
grTexSource(tmu, tex_adr, GR_MIPMAPLEVELMASK_BOTH, &t_info);
gfxTexSource(tmu, tex_adr, GR_MIPMAPLEVELMASK_BOTH, &t_info);
tex_adr += tex_size;
float ul_x = (float)(fb_info.ul_x + 256 * w);
float ul_y = (float)(fb_info.ul_y + 256 * h);
Expand Down Expand Up @@ -369,7 +369,7 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
grTexSource(tmu,
gfxTexSource(tmu,
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
Expand Down Expand Up @@ -447,7 +447,7 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
dst += cur_tail;
}
gfxTexDownloadMipMap(tmu, tex_adr, GR_MIPMAPLEVELMASK_BOTH, &t_info);
grTexSource(tmu, tex_adr, GR_MIPMAPLEVELMASK_BOTH, &t_info);
gfxTexSource(tmu, tex_adr, GR_MIPMAPLEVELMASK_BOTH, &t_info);
tex_adr += tex_size;
float ul_x = (float)(fb_info.ul_x + 256 * w);
float ul_y = (float)(fb_info.ul_y + 256 * h);
Expand Down Expand Up @@ -517,7 +517,7 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
FXFALSE,
FXFALSE);
// gfxAuxBufferExt( GR_BUFFER_AUXBUFFER );
grTexSource(rdp.texbufs[0].tmu, rdp.texbufs[0].begin, GR_MIPMAPLEVELMASK_BOTH, &(t_info));
gfxTexSource(rdp.texbufs[0].tmu, rdp.texbufs[0].begin, GR_MIPMAPLEVELMASK_BOTH, &(t_info));
float ul_x = (float)rdp.scissor.ul_x;
float ul_y = (float)rdp.scissor.ul_y;
float lr_x = (float)rdp.scissor.lr_x;
Expand Down Expand Up @@ -606,7 +606,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
grTexSource(tmu,
gfxTexSource(tmu,
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
Expand Down
6 changes: 1 addition & 5 deletions Source/Project64-video/Renderer/OGLEStextures.cpp
Expand Up @@ -639,11 +639,7 @@ void gfxTexDownloadMipMap(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrT

int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info);

FX_ENTRY void FX_CALL
grTexSource(GrChipID_t tmu,
FxU32 startAddress,
FxU32 evenOdd,
GrTexInfo *info)
void gfxTexSource(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info)
{
WriteTrace(TraceGlitch, TraceDebug, "tmu = %d, startAddress: %d evenOdd: %d", tmu, startAddress, evenOdd);

Expand Down
8 changes: 2 additions & 6 deletions Source/Project64-video/Renderer/OGLtextures.cpp
Expand Up @@ -635,11 +635,7 @@ void gfxTexDownloadMipMap(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrT

int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info);

FX_ENTRY void FX_CALL
grTexSource(GrChipID_t tmu,
FxU32 startAddress,
FxU32 evenOdd,
GrTexInfo *info)
void gfxTexSource(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info)
{
WriteTrace(TraceGlitch, TraceDebug, "tmu = %d, startAddress: %d evenOdd: %d", tmu, startAddress, evenOdd);

Expand Down Expand Up @@ -699,7 +695,7 @@ grTexSource(GrChipID_t tmu,
need_to_compile = 1;
}
}
grDisplayGLError("grTexSource");
grDisplayGLError("gfxTexSource");
}

FX_ENTRY void FX_CALL
Expand Down
1 change: 1 addition & 0 deletions Source/Project64-video/Renderer/Renderer.h
Expand Up @@ -69,6 +69,7 @@ void gfxLoadGammaTable(FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
void gfxGetGammaTableExt(FxU32 /*nentries*/, FxU32 *red, FxU32 *green, FxU32 *blue);
void gfxGammaCorrectionRGB(FxFloat gammaR, FxFloat gammaG, FxFloat gammaB);
void gfxTexDownloadMipMap(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info);
void gfxTexSource(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info);

extern uint32_t nbTextureUnits;
extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y;
8 changes: 4 additions & 4 deletions Source/Project64-video/TexBuffer.cpp
Expand Up @@ -426,7 +426,7 @@ int CloseTextureBuffer(int draw)
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
};

grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxClipWindow(0, 0, g_res_x, g_res_y);
gfxDrawTriangle(&v[0], &v[2], &v[1]);
gfxDrawTriangle(&v[2], &v[3], &v[1]);
Expand Down Expand Up @@ -481,7 +481,7 @@ int CopyTextureBuffer(COLOR_IMAGE & fb_from, COLOR_IMAGE & fb_to)
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
};

grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxDrawTriangle(&v[0], &v[2], &v[1]);
gfxDrawTriangle(&v[2], &v[3], &v[1]);
gfxRenderBuffer(GR_BUFFER_BACKBUFFER);
Expand Down Expand Up @@ -538,7 +538,7 @@ int CopyDepthBuffer()
};

gfxAuxBufferExt(GR_BUFFER_AUXBUFFER);
grTexSource(rdp.texbufs[0].tmu, rdp.texbufs[0].begin, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxTexSource(rdp.texbufs[0].tmu, rdp.texbufs[0].begin, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT);
gfxTextureBufferExt(rdp.texbufs[1].tmu, rdp.texbufs[1].begin, LOD, LOD,
GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH);
Expand Down Expand Up @@ -592,7 +592,7 @@ int SwapTextureBuffer()
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
};

grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
gfxTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
texbuf->tile_uls = rdp.tbuff_tex->tile_uls;
texbuf->tile_ult = rdp.tbuff_tex->tile_ult;
texbuf->v_shift = rdp.tbuff_tex->v_shift;
Expand Down
8 changes: 4 additions & 4 deletions Source/Project64-video/TexCache.cpp
Expand Up @@ -477,7 +477,7 @@ int ChooseBestTmu(int tmu1, int tmu2)
static void SelectTBuffTex(TBUFF_COLOR_IMAGE * pTBuffTex)
{
WriteTrace(TraceRDP, TraceDebug, "SelectTBuffTex: tex: %d, tmu: %d, tile: %d", rdp.tex, pTBuffTex->tmu, pTBuffTex->tile);
grTexSource(pTBuffTex->tile, pTBuffTex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(pTBuffTex->info));
gfxTexSource(pTBuffTex->tile, pTBuffTex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(pTBuffTex->info));
}

//****************************************************************
Expand Down Expand Up @@ -767,7 +767,7 @@ void TexCache()
rdp.cur_cache[0] = cache;
rdp.cur_cache[0]->last_used = frame_count;
rdp.cur_cache[0]->uses = rdp.debug_n;
grTexSource(tmu_0,
gfxTexSource(tmu_0,
(voodoo.tex_min_addr[tmu_0] + cache->tmem_addr),
GR_MIPMAPLEVELMASK_BOTH,
&cache->t_info);
Expand Down Expand Up @@ -798,7 +798,7 @@ void TexCache()
rdp.cur_cache[1] = cache;
rdp.cur_cache[1]->last_used = frame_count;
rdp.cur_cache[1]->uses = rdp.debug_n;
grTexSource(tmu_1,
gfxTexSource(tmu_1,
(voodoo.tex_min_addr[tmu_1] + cache->tmem_addr),
GR_MIPMAPLEVELMASK_BOTH,
&cache->t_info);
Expand Down Expand Up @@ -1682,7 +1682,7 @@ void LoadTex(int id, int tmu)
voodoo.tmem_ptr[0] += texture_size;
voodoo.tmem_ptr[1] = voodoo.tmem_ptr[0];
gfxTexDownloadMipMap(tmu, tex_addr, GR_MIPMAPLEVELMASK_BOTH, t_info);
grTexSource(tmu, tex_addr, GR_MIPMAPLEVELMASK_BOTH, t_info);
gfxTexSource(tmu, tex_addr, GR_MIPMAPLEVELMASK_BOTH, t_info);
}
WriteTrace(TraceRDP, TraceDebug, " | | +- LoadTex end");
}
2 changes: 1 addition & 1 deletion Source/Project64-video/Util.cpp
Expand Up @@ -1981,7 +1981,7 @@ void set_message_combiner()
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
grTexSource(GR_TMU0,
gfxTexSource(GR_TMU0,
voodoo.tex_min_addr[GR_TMU0] + offset_font,
GR_MIPMAPLEVELMASK_BOTH,
&fontTex);
Expand Down
2 changes: 1 addition & 1 deletion Source/Project64-video/ucode06.cpp
Expand Up @@ -140,7 +140,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
rdp.texbufs[1].begin,
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
grTexSource(rdp.texbufs[1].tmu,
gfxTexSource(rdp.texbufs[1].tmu,
rdp.texbufs[1].begin,
GR_MIPMAPLEVELMASK_BOTH,
&t_info);
Expand Down

0 comments on commit e78abaf

Please sign in to comment.