From bca97d42aaacdbc9c0e059cc2c4b8967bd61cd28 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 11 Oct 2015 21:12:32 +1100 Subject: [PATCH] [Glide64] Remove unused variables https://github.com/mupen64plus/mupen64plus-video-glide64mk2/commit/4fc96fee0842ae91aa99f40550964ce26440e97f --- Source/Glide64/FBtoScreen.cpp | 8 ++------ Source/Glide64/TexMod.h | 6 +----- Source/Glide64/ucode02.h | 3 --- Source/Glide64/ucode06.h | 2 -- Source/GlideHQ/TextureFilters_2xsai.cpp | 1 - Source/Glitch64/OGLcombiner.cpp | 12 ------------ Source/Glitch64/OGLglitchmain.cpp | 4 ++-- 7 files changed, 5 insertions(+), 31 deletions(-) diff --git a/Source/Glide64/FBtoScreen.cpp b/Source/Glide64/FBtoScreen.cpp index b59aa9e5d..0585383e5 100644 --- a/Source/Glide64/FBtoScreen.cpp +++ b/Source/Glide64/FBtoScreen.cpp @@ -317,7 +317,7 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info) FRDP("DrawFrameBufferToScreen. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr); GrTexInfo t_info; wxUint8 * image = gfx.RDRAM+fb_info.addr; - wxUint32 texwidth, texheight; + wxUint32 texwidth; float scale; if (width <= 256) { @@ -335,12 +335,10 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info) if (height <= (texwidth>>1)) { t_info.aspectRatioLog2 = GR_ASPECT_LOG2_2x1; - texheight = texwidth>>1; } else { t_info.aspectRatioLog2 = GR_ASPECT_LOG2_1x1; - texheight = texwidth; } if (fb_info.size == 2) @@ -588,7 +586,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) FRDP("DrawDepthBufferToScreen. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr); GrTexInfo t_info; wxUint8 * image = gfx.RDRAM+fb_info.addr; - wxUint32 texwidth, texheight; + wxUint32 texwidth; float scale; if (width <= 256) { @@ -606,12 +604,10 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) if (height <= (texwidth>>1)) { t_info.aspectRatioLog2 = GR_ASPECT_LOG2_2x1; - texheight = texwidth>>1; } else { t_info.aspectRatioLog2 = GR_ASPECT_LOG2_1x1; - texheight = texwidth; } wxUint16 * tex = (wxUint16*)texture_buffer; diff --git a/Source/Glide64/TexMod.h b/Source/Glide64/TexMod.h index 39563d15b..ffa79c363 100644 --- a/Source/Glide64/TexMod.h +++ b/Source/Glide64/TexMod.h @@ -359,14 +359,13 @@ static void mod_tex_scale_col_add_col (wxUint16 *dst, int size, wxUint32 color0, static void mod_tex_add_col (wxUint16 *dst, int size, wxUint32 color) { - wxUint32 cr, cg, cb, ca; + wxUint32 cr, cg, cb; wxUint16 col; wxUint8 a, r, g, b; cr = (color >> 12) & 0xF; cg = (color >> 8) & 0xF; cb = (color >> 4) & 0xF; - ca = color & 0xF; for (int i=0; i> 12) & 0xF)/16.0f; cg = (float)((color >> 8) & 0xF)/16.0f; @@ -550,8 +548,6 @@ static void mod_tex_mul_col (wxUint16 *dst, int size, wxUint32 color) { col = *dst; a = col & 0xF000; - percent = (a >> 12) / 15.0f; - percent_i = 1.0f - percent; r = (wxUint8)(cr * ((col & 0x0F00) >> 8)); g = (wxUint8)(cg * ((col & 0x00F0) >> 4)); b = (wxUint8)(cb * (col & 0x000F)); diff --git a/Source/Glide64/ucode02.h b/Source/Glide64/ucode02.h index 8bb7af1ad..d23f5aaff 100644 --- a/Source/Glide64/ucode02.h +++ b/Source/Glide64/ucode02.h @@ -593,10 +593,7 @@ static void uc2_moveword () int index_y = index_x >> 2; index_x &= 3; - float fpart = (float)fabs(rdp.combined[index_y][index_x] - (int)rdp.combined[index_y][index_x]); rdp.combined[index_y][index_x] = (short)(rdp.cmd1>>16); - - fpart = (float)fabs(rdp.combined[index_y][index_x+1] - (int)rdp.combined[index_y][index_x+1]); rdp.combined[index_y][index_x+1] = (short)(rdp.cmd1&0xFFFF); } diff --git a/Source/Glide64/ucode06.h b/Source/Glide64/ucode06.h index 29c5b7c3c..621047b59 100644 --- a/Source/Glide64/ucode06.h +++ b/Source/Glide64/ucode06.h @@ -66,11 +66,9 @@ static float set_sprite_combine_mode () float Z = 0.0f; if ((rdp.othermode_l & 0x00000030) && rdp.cycle_mode < 2) { - wxUint16 prim_dz = 0; if (rdp.zsrc == 1) { Z = rdp.prim_depth; - prim_dz = rdp.prim_dz; } FRDP ("prim_depth = %d, prim_dz = %d\n", rdp.prim_depth, rdp.prim_dz); Z = ScaleZ(Z); diff --git a/Source/GlideHQ/TextureFilters_2xsai.cpp b/Source/GlideHQ/TextureFilters_2xsai.cpp index 38226df28..d7e8305ff 100644 --- a/Source/GlideHQ/TextureFilters_2xsai.cpp +++ b/Source/GlideHQ/TextureFilters_2xsai.cpp @@ -37,7 +37,6 @@ void Super2xSaI_8888(uint32 *srcPtr, uint32 *destPtr, uint32 width, uint32 heigh #define SAI_Q_INTERPOLATE SAI_Q_INTERPOLATE_8888 uint32 destWidth = width << 1; - uint32 destHeight = height << 1; uint32 color4, color5, color6; uint32 color1, color2, color3; diff --git a/Source/Glitch64/OGLcombiner.cpp b/Source/Glitch64/OGLcombiner.cpp index b9b2b1401..3fea2b1e6 100644 --- a/Source/Glitch64/OGLcombiner.cpp +++ b/Source/Glitch64/OGLcombiner.cpp @@ -38,11 +38,9 @@ int need_to_compile; static GLhandleARB fragment_shader_object; static GLhandleARB fragment_depth_shader_object; -static GLhandleARB fragment_bw_shader_object; static GLhandleARB vertex_shader_object; static GLhandleARB program_object_default; static GLhandleARB program_object_depth; -static GLhandleARB program_object_bw; static GLhandleARB program_object; static int constant_color_location; static int ccolor0_location; @@ -87,16 +85,6 @@ static const char* fragment_shader_default = " gl_FragColor = texture2D(texture0, vec2(gl_TexCoord[0])); \n" ; -static const char* fragment_shader_depth = -" gl_FragDepth = dot(texture2D(texture0, vec2(gl_TexCoord[0])), vec4(32*64*32/65536.0, 64*32/65536.0, 32/65536.0, 0))*0.5 + 0.5; \n" -; - -static const char* fragment_shader_bw = -" vec4 readtex0 = texture2D(texture0, vec2(gl_TexCoord[0])); \n" -" gl_FragColor = vec4(vec3(readtex0.b), \n" -" readtex0.r + readtex0.g * 8.0 / 256.0); \n" -; - static const char* fragment_shader_readtex0color = " vec4 readtex0 = texture2D(texture0, vec2(gl_TexCoord[0])); \n" ; diff --git a/Source/Glitch64/OGLglitchmain.cpp b/Source/Glitch64/OGLglitchmain.cpp index d45602c01..cbdef0eac 100644 --- a/Source/Glitch64/OGLglitchmain.cpp +++ b/Source/Glitch64/OGLglitchmain.cpp @@ -762,7 +762,7 @@ int isWglExtensionSupported(const char *extension) FX_ENTRY GrContext_t FX_CALL grSstWinOpenExt( - HWND hWnd, + HWND hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, @@ -787,7 +787,7 @@ grSstWinOpenExt( FX_ENTRY GrContext_t FX_CALL grSstWinOpen( - HWND hWnd, + HWND hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format,