From 33d8caba16506030f672272f471710e728455a95 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 26 May 2017 07:48:24 +1000 Subject: [PATCH] [Video] Rename grRenderBuffer to gfxRenderBuffer --- Source/Project64-video/Main.cpp | 10 +++++----- .../Project64-video/Renderer/OGLEScombiner.cpp | 2 +- .../Renderer/OGLESglitchmain.cpp | 7 +++---- .../Project64-video/Renderer/OGLglitchmain.cpp | 9 ++++----- Source/Project64-video/Renderer/Renderer.h | 1 + Source/Project64-video/TexBuffer.cpp | 18 +++++++++--------- Source/Project64-video/rdp.cpp | 2 +- Source/Project64-video/ucode06.cpp | 4 ++-- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index ae704ce51..3910c83c8 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -240,9 +240,9 @@ void guLoadTextures() GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); tbuf_size = grTexCalcMemRequired(GFX_LOD_LOG2_1024, GFX_LOD_LOG2_1024, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565); - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); grBufferClear(0, 0, 0xFFFF); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); } else { @@ -250,9 +250,9 @@ void guLoadTextures() GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); tbuf_size = grTexCalcMemRequired(GFX_LOD_LOG2_2048, GFX_LOD_LOG2_2048, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565); - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); grBufferClear(0, 0, 0xFFFF); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); } rdp.texbufs[0].tmu = GR_TMU0; @@ -549,7 +549,7 @@ int InitGfx() gfxCullMode(GR_CULL_DISABLE); gfxDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); gfxColorMask(FXTRUE, FXTRUE); gfxDepthMask(FXTRUE); grBufferClear(0, 0, 0xFFFF); diff --git a/Source/Project64-video/Renderer/OGLEScombiner.cpp b/Source/Project64-video/Renderer/OGLEScombiner.cpp index f8a99ffc1..7abf62ff0 100644 --- a/Source/Project64-video/Renderer/OGLEScombiner.cpp +++ b/Source/Project64-video/Renderer/OGLEScombiner.cpp @@ -166,7 +166,7 @@ SHADER_VARYING "void main() \n" "{ \n" " float q = aPosition.w; \n" -" float invertY = vertexOffset.z; \n" //Usually 1.0 but -1.0 when rendering to a texture (see inverted_culling grRenderBuffer) +" float invertY = vertexOffset.z; \n" //Usually 1.0 but -1.0 when rendering to a texture (see inverted_culling gfxRenderBuffer) " gl_Position.x = (aPosition.x - vertexOffset.x) / vertexOffset.x; \n" " gl_Position.y = invertY *-(aPosition.y - vertexOffset.y) / vertexOffset.y;\n" " gl_Position.z = aPosition.z / Z_MAX; \n" diff --git a/Source/Project64-video/Renderer/OGLESglitchmain.cpp b/Source/Project64-video/Renderer/OGLESglitchmain.cpp index 9c1ebea5c..1a70fca56 100644 --- a/Source/Project64-video/Renderer/OGLESglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLESglitchmain.cpp @@ -1181,15 +1181,14 @@ void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mod } } -FX_ENTRY void FX_CALL -grRenderBuffer(GrBuffer_t buffer) +void gfxRenderBuffer(GrBuffer_t buffer) { #ifdef _WIN32 static HANDLE region = NULL; int realWidth = pBufferWidth, realHeight = pBufferHeight; #endif // _WIN32 WriteTrace(TraceGlitch, TraceDebug, "buffer: %d", buffer); - //printf("grRenderBuffer(%d)\n", buffer); + //printf("gfxRenderBuffer(%d)\n", buffer); switch (buffer) { @@ -1298,7 +1297,7 @@ grRenderBuffer(GrBuffer_t buffer) render_to_texture = 1; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grRenderBuffer : unknown buffer : %x", buffer); + WriteTrace(TraceGlitch, TraceWarning, "gfxRenderBuffer : unknown buffer : %x", buffer); } } diff --git a/Source/Project64-video/Renderer/OGLglitchmain.cpp b/Source/Project64-video/Renderer/OGLglitchmain.cpp index 2b57c0cef..070dc67ed 100644 --- a/Source/Project64-video/Renderer/OGLglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLglitchmain.cpp @@ -1453,15 +1453,14 @@ void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mod } } -FX_ENTRY void FX_CALL -grRenderBuffer(GrBuffer_t buffer) +void gfxRenderBuffer(GrBuffer_t buffer) { #ifdef _WIN32 static HANDLE region = NULL; //int realWidth = pBufferWidth, realHeight = pBufferHeight; #endif // _WIN32 WriteTrace(TraceGlitch, TraceDebug, "buffer: %d", buffer); - //printf("grRenderBuffer(%d)\n", buffer); + //printf("gfxRenderBuffer(%d)\n", buffer); switch (buffer) { @@ -1569,9 +1568,9 @@ grRenderBuffer(GrBuffer_t buffer) render_to_texture = 1; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grRenderBuffer : unknown buffer : %x", buffer); + WriteTrace(TraceGlitch, TraceWarning, "gfxRenderBuffer : unknown buffer : %x", buffer); } - grDisplayGLError("grRenderBuffer"); + grDisplayGLError("gfxRenderBuffer"); } void gfxAuxBufferExt(GrBuffer_t buffer) diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index e07dfc179..abbccd693 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -56,6 +56,7 @@ GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origi void gfxAuxBufferExt(GrBuffer_t buffer); FxU32 gfxGet(FxU32 pname, FxU32 plength, FxI32 *params); void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mode); +void gfxRenderBuffer(GrBuffer_t buffer); extern uint32_t nbTextureUnits; extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y; diff --git a/Source/Project64-video/TexBuffer.cpp b/Source/Project64-video/TexBuffer.cpp index 474bb5426..0fe0bc552 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -255,13 +255,13 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage) { if (!((end_addr <= texbuf->addr) || (addr >= texbuf->end_addr))) //intersected, remove { - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxTextureBufferExt(texbuf->tmu, texbuf->tex_addr, texbuf->info.smallLodLog2, texbuf->info.largeLodLog2, texbuf->info.aspectRatioLog2, texbuf->info.format, GR_MIPMAPLEVELMASK_BOTH); gfxDepthMask(FXFALSE); grBufferClear(0, 0, 0xFFFF); gfxDepthMask(FXTRUE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); rdp.texbufs[i].count--; if (j < rdp.texbufs[i].count) memmove(&(rdp.texbufs[i].images[j]), &(rdp.texbufs[i].images[j + 1]), sizeof(TBUFF_COLOR_IMAGE)*(rdp.texbufs[i].count - j)); @@ -293,7 +293,7 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage) rdp.acc_tex_buf = rdp.cur_tex_buf; rdp.cur_image = texbuf; - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxTextureBufferExt(rdp.cur_image->tmu, rdp.cur_image->tex_addr, rdp.cur_image->info.smallLodLog2, rdp.cur_image->info.largeLodLog2, rdp.cur_image->info.aspectRatioLog2, rdp.cur_image->info.format, GR_MIPMAPLEVELMASK_BOTH); @@ -395,7 +395,7 @@ int CloseTextureBuffer(int draw) WriteTrace(TraceRDP, TraceDebug, "CloseTextureBuffer KO"); return FALSE; } - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); rdp.offset_x = rdp.offset_x_bak; rdp.offset_y = rdp.offset_y_bak; rdp.offset_x_bak = rdp.offset_y_bak = 0; @@ -484,7 +484,7 @@ int CopyTextureBuffer(COLOR_IMAGE & fb_from, COLOR_IMAGE & fb_to) grTexSource(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]); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); rdp.offset_x = rdp.offset_x_bak; rdp.offset_y = rdp.offset_y_bak; rdp.offset_x_bak = rdp.offset_y_bak = 0; @@ -539,12 +539,12 @@ int CopyDepthBuffer() gfxAuxBufferExt(GR_BUFFER_AUXBUFFER); grTexSource(rdp.texbufs[0].tmu, rdp.texbufs[0].begin, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info)); - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + 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); gfxDrawTriangle(&v[0], &v[2], &v[1]); gfxDrawTriangle(&v[2], &v[3], &v[1]); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); gfxAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT); rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; @@ -596,7 +596,7 @@ int SwapTextureBuffer() texbuf->tile_uls = rdp.tbuff_tex->tile_uls; texbuf->tile_ult = rdp.tbuff_tex->tile_ult; texbuf->v_shift = rdp.tbuff_tex->v_shift; - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxTextureBufferExt(texbuf->tmu, texbuf->tex_addr, texbuf->info.smallLodLog2, texbuf->info.largeLodLog2, texbuf->info.aspectRatioLog2, texbuf->info.format, GR_MIPMAPLEVELMASK_BOTH); gfxDrawTriangle(&v[0], &v[2], &v[1]); @@ -615,7 +615,7 @@ int SwapTextureBuffer() } else { - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); rdp.offset_x = rdp.offset_x_bak; rdp.offset_y = rdp.offset_y_bak; rdp.offset_x_bak = rdp.offset_y_bak = 0; diff --git a/Source/Project64-video/rdp.cpp b/Source/Project64-video/rdp.cpp index 0c99e0636..4f03235ee 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -2777,7 +2777,7 @@ void rdp_setcolorimage() if (rdp.motionblur) { rdp.cur_image = &(rdp.texbufs[rdp.cur_tex_buf].images[0]); - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxTextureBufferExt(rdp.cur_image->tmu, rdp.cur_image->tex_addr, rdp.cur_image->info.smallLodLog2, rdp.cur_image->info.largeLodLog2, rdp.cur_image->info.aspectRatioLog2, rdp.cur_image->info.format, GR_MIPMAPLEVELMASK_BOTH); } diff --git a/Source/Project64-video/ucode06.cpp b/Source/Project64-video/ucode06.cpp index fe36282b9..a02890fa5 100644 --- a/Source/Project64-video/ucode06.cpp +++ b/Source/Project64-video/ucode06.cpp @@ -195,12 +195,12 @@ void DrawHiresDepthImage(const DRAWIMAGE & d) } gfxTextureBufferExt(rdp.texbufs[0].tmu, rdp.texbufs[0].begin, LOD, LOD, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); - grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); + gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxAuxBufferExt(GR_BUFFER_AUXBUFFER); grBufferClear(0, 0, 0xFFFF); gfxDrawTriangle(&v[0], &v[2], &v[1]); gfxDrawTriangle(&v[2], &v[3], &v[1]); - grRenderBuffer(GR_BUFFER_BACKBUFFER); + gfxRenderBuffer(GR_BUFFER_BACKBUFFER); gfxAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT); gfxDepthMask(FXTRUE); }