From ba2ec6fe5952e250e510fd30eb037b581a3ba28a Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Wed, 3 Jul 2013 18:42:05 +0000 Subject: [PATCH] all: gcc warning clean round 4 * remove unused variable * move static function from h into cpp * Initialized hw_by_page to 0xFFFFFFFF instead of -1 (number must be a positive integer) * Use a s32 fore m_current_lsn instead of u32 (use -1 as error code) Bonus: a couple of fix for clang compiler (doesn't mean that it fully compile with clang) * remove useless __debugbreak on linux * use short for 16bits atomic function git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5695 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Utilities/wxGuiTools.h | 2 +- common/include/intrin_x86.h | 2 + pcsx2/CDVD/IsoFileFormats.h | 2 +- pcsx2/IPU/mpeg2lib/Idct.cpp | 2 +- pcsx2/Memory.cpp | 4 +- plugins/GSdx/GSDeviceOGL.cpp | 2 +- plugins/GSdx/stdafx.h | 4 +- plugins/spu2-x/src/Linux/Config.h | 17 -- plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp | 230 ++++++++++-------- plugins/zzogl-pg/opengl/Linux/Linux.cpp | 10 - plugins/zzogl-pg/opengl/ZZoglCRTC.cpp | 8 +- plugins/zzogl-pg/opengl/ZZoglFlush.cpp | 39 ++- plugins/zzogl-pg/opengl/ZZoglShoots.cpp | 5 +- 13 files changed, 155 insertions(+), 172 deletions(-) diff --git a/common/include/Utilities/wxGuiTools.h b/common/include/Utilities/wxGuiTools.h index 1a07be0ff6..949d123b2e 100644 --- a/common/include/Utilities/wxGuiTools.h +++ b/common/include/Utilities/wxGuiTools.h @@ -272,7 +272,7 @@ void operator+=( wxSizer& target, const pxWindowAndFlags& src ) // ---------------------------------------------------------------------------- // Pointer Versions! (note that C++ requires one of the two operator params be a -// "poper" object type (non-pointer), so that's why some of these are missing. +// "proper" object type (non-pointer), so that's why some of these are missing. template< typename WinType > void operator+=( wxWindow* target, WinType& src ) diff --git a/common/include/intrin_x86.h b/common/include/intrin_x86.h index 13b4be28e7..9f40fc31e1 100644 --- a/common/include/intrin_x86.h +++ b/common/include/intrin_x86.h @@ -852,10 +852,12 @@ static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void /*** Interrupts ***/ +#ifndef __LINUX__ static __inline__ __attribute__((always_inline)) void __debugbreak(void) { __asm__("int $3"); } +#endif static __inline__ __attribute__((always_inline)) void __int2c(void) { diff --git a/pcsx2/CDVD/IsoFileFormats.h b/pcsx2/CDVD/IsoFileFormats.h index dc1bd03ec9..9feea6b47c 100644 --- a/pcsx2/CDVD/IsoFileFormats.h +++ b/pcsx2/CDVD/IsoFileFormats.h @@ -46,7 +46,7 @@ protected: wxString m_filename; AsyncFileReader* m_reader; - uint m_current_lsn; + s32 m_current_lsn; uint m_current_count; isoType m_type; diff --git a/pcsx2/IPU/mpeg2lib/Idct.cpp b/pcsx2/IPU/mpeg2lib/Idct.cpp index 9848f63781..5f6848a2c6 100644 --- a/pcsx2/IPU/mpeg2lib/Idct.cpp +++ b/pcsx2/IPU/mpeg2lib/Idct.cpp @@ -213,7 +213,7 @@ __ri void mpeg2_idct_add (const int last, s16 * block, s16 * dest, const int str } else { - s16 DC = (block[0] + 4) >> 3; + s16 DC = ((int)block[0] + 4) >> 3; s16 dcf[2] = { DC, DC }; block[0] = block[63] = 0; diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index 45580cbbaf..bcae88394c 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -105,7 +105,7 @@ static vtlbHandler vu1_micro_mem, vu1_data_mem, - hw_by_page[0x10] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + hw_by_page[0x10] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}, gs_page_0, gs_page_1, @@ -665,7 +665,7 @@ __pagealigned u8 eeHw[Ps2MemSize::Hardware]; void memBindConditionalHandlers() { - if( hw_by_page[0xf] == -1 ) return; + if( hw_by_page[0xf] == 0xFFFFFFFF ) return; if (EmuConfig.Speedhacks.IntcStat) { diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index f645278df8..ea305f81b1 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -578,7 +578,7 @@ void GSDeviceOGL::DrawIndexedPrimitive() void GSDeviceOGL::DrawIndexedPrimitive(int offset, int count) { - ASSERT(offset + count <= m_index.count); + ASSERT(offset + count <= (int)m_index.count); BeforeDraw(); m_state.vb->DrawIndexedPrimitive(offset, count); diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index 15a8c526e1..c93f322327 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -408,9 +408,9 @@ struct aligned_free_second {template void operator()(T& p) {_aligned_fr return retval; } - __forceinline long _InterlockedExchangeAdd16(volatile short* const Addend, const short Value) + __forceinline short _InterlockedExchangeAdd16(volatile short* const Addend, const short Value) { - long retval = Value; + short retval = Value; __asm__("lock; xaddw %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory"); diff --git a/plugins/spu2-x/src/Linux/Config.h b/plugins/spu2-x/src/Linux/Config.h index ac7b5d71e9..d17980dc2b 100644 --- a/plugins/spu2-x/src/Linux/Config.h +++ b/plugins/spu2-x/src/Linux/Config.h @@ -86,26 +86,9 @@ extern int SynchMode; namespace SoundtouchCfg { - // Timestretch Slider Bounds, Min/Max - static const int SequenceLen_Min = 20; - static const int SequenceLen_Max = 100; - - static const int SeekWindow_Min = 10; - static const int SeekWindow_Max = 30; - - static const int Overlap_Min = 5; - static const int Overlap_Max = 15; - - static int SequenceLenMS = 30; - static int SeekWindowMS = 20; - static int OverlapMS = 10; - void ReadSettings(); void WriteSettings(); void DisplayDialog(); - - - static void ClampValues(); }; void ReadSettings(); diff --git a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp index b56e956862..7364c5904d 100644 --- a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp +++ b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp @@ -26,112 +26,126 @@ namespace SoundtouchCfg { -void ClampValues() -{ - Clampify( SequenceLenMS, SequenceLen_Min, SequenceLen_Max ); - Clampify( SeekWindowMS, SeekWindow_Min, SeekWindow_Max ); - Clampify( OverlapMS, Overlap_Min, Overlap_Max ); -} - -void ApplySettings( soundtouch::SoundTouch& sndtouch ) -{ - sndtouch.setSetting( SETTING_SEQUENCE_MS, SequenceLenMS ); - sndtouch.setSetting( SETTING_SEEKWINDOW_MS, SeekWindowMS ); - sndtouch.setSetting( SETTING_OVERLAP_MS, OverlapMS ); -} - -void ReadSettings() -{ - SequenceLenMS = CfgReadInt( L"SOUNDTOUCH", L"SequenceLengthMS", 30 ); - SeekWindowMS = CfgReadInt( L"SOUNDTOUCH", L"SeekWindowMS", 20 ); - OverlapMS = CfgReadInt( L"SOUNDTOUCH", L"OverlapMS", 10 ); - - ClampValues(); - WriteSettings(); -} - -void WriteSettings() -{ - CfgWriteInt( L"SOUNDTOUCH", L"SequenceLengthMS", SequenceLenMS ); - CfgWriteInt( L"SOUNDTOUCH", L"SeekWindowMS", SeekWindowMS ); - CfgWriteInt( L"SOUNDTOUCH", L"OverlapMS", OverlapMS ); -} - -static GtkWidget *seq_label, *seek_label, *over_label; -static GtkWidget *seq_slide, *seek_slide, *over_slide; - -void restore_defaults() -{ - gtk_range_set_value(GTK_RANGE(seq_slide), 30); - gtk_range_set_value(GTK_RANGE(seek_slide), 20); - gtk_range_set_value(GTK_RANGE(over_slide), 10); -} - -void DisplayDialog() -{ - int return_value; - GtkWidget *dialog, *main_label, *main_frame, *main_box; - GtkWidget *default_button; - - ReadSettings(); - - /* Create the widgets */ - dialog = gtk_dialog_new_with_buttons ( - "Advanced Settings", - NULL, /* parent window*/ - (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), - GTK_STOCK_OK, - GTK_RESPONSE_ACCEPT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_REJECT, - NULL); - - main_label = gtk_label_new ("These are advanced configuration options fine tuning time stretching behavior. Larger values are better for slowdown, while smaller values are better for speedup (more then 60 fps.). All options are in microseconds."); - gtk_label_set_line_wrap (GTK_LABEL(main_label), true); - - default_button = gtk_button_new_with_label("Reset to Defaults"); - - seq_label = gtk_label_new("Sequence Length"); - seq_slide = gtk_hscale_new_with_range(SequenceLen_Min, SequenceLen_Max, 2); - gtk_range_set_value(GTK_RANGE(seq_slide), SequenceLenMS); - - seek_label = gtk_label_new("Seek Window Size"); - seek_slide = gtk_hscale_new_with_range(SeekWindow_Min, SeekWindow_Max, 1); - gtk_range_set_value(GTK_RANGE(seek_slide), SeekWindowMS); - - over_label = gtk_label_new("Overlap"); - over_slide = gtk_hscale_new_with_range(Overlap_Min, Overlap_Max, 1); - gtk_range_set_value(GTK_RANGE(over_slide), OverlapMS); - - main_box = gtk_vbox_new(false, 5); - main_frame = gtk_frame_new ("Spu2-X Config"); - - gtk_container_add(GTK_CONTAINER (main_box), default_button); - gtk_container_add(GTK_CONTAINER (main_box), seq_label); - gtk_container_add(GTK_CONTAINER (main_box), seq_slide); - gtk_container_add(GTK_CONTAINER (main_box), seek_label); - gtk_container_add(GTK_CONTAINER (main_box), seek_slide); - gtk_container_add(GTK_CONTAINER (main_box), over_label); - gtk_container_add(GTK_CONTAINER (main_box), over_slide); - gtk_container_add(GTK_CONTAINER(main_frame), main_box); - - gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_label); - gtk_container_add (GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_frame); - gtk_widget_show_all (dialog); - - g_signal_connect_swapped(GTK_OBJECT (default_button), "clicked", G_CALLBACK(restore_defaults), default_button); - - return_value = gtk_dialog_run (GTK_DIALOG (dialog)); - - if (return_value == GTK_RESPONSE_ACCEPT) - { - SequenceLenMS = gtk_range_get_value(GTK_RANGE(seq_slide));; - SeekWindowMS = gtk_range_get_value(GTK_RANGE(seek_slide));; - OverlapMS = gtk_range_get_value(GTK_RANGE(over_slide));; - } - - gtk_widget_destroy (dialog); - - WriteSettings(); -} + // Timestretch Slider Bounds, Min/Max + static const int SequenceLen_Min = 20; + static const int SequenceLen_Max = 100; + + static const int SeekWindow_Min = 10; + static const int SeekWindow_Max = 30; + + static const int Overlap_Min = 5; + static const int Overlap_Max = 15; + + static int SequenceLenMS = 30; + static int SeekWindowMS = 20; + static int OverlapMS = 10; + + static void ClampValues() + { + Clampify( SequenceLenMS, SequenceLen_Min, SequenceLen_Max ); + Clampify( SeekWindowMS, SeekWindow_Min, SeekWindow_Max ); + Clampify( OverlapMS, Overlap_Min, Overlap_Max ); + } + + void ApplySettings( soundtouch::SoundTouch& sndtouch ) + { + sndtouch.setSetting( SETTING_SEQUENCE_MS, SequenceLenMS ); + sndtouch.setSetting( SETTING_SEEKWINDOW_MS, SeekWindowMS ); + sndtouch.setSetting( SETTING_OVERLAP_MS, OverlapMS ); + } + + void ReadSettings() + { + SequenceLenMS = CfgReadInt( L"SOUNDTOUCH", L"SequenceLengthMS", 30 ); + SeekWindowMS = CfgReadInt( L"SOUNDTOUCH", L"SeekWindowMS", 20 ); + OverlapMS = CfgReadInt( L"SOUNDTOUCH", L"OverlapMS", 10 ); + + ClampValues(); + WriteSettings(); + } + + void WriteSettings() + { + CfgWriteInt( L"SOUNDTOUCH", L"SequenceLengthMS", SequenceLenMS ); + CfgWriteInt( L"SOUNDTOUCH", L"SeekWindowMS", SeekWindowMS ); + CfgWriteInt( L"SOUNDTOUCH", L"OverlapMS", OverlapMS ); + } + + static GtkWidget *seq_label, *seek_label, *over_label; + static GtkWidget *seq_slide, *seek_slide, *over_slide; + + void restore_defaults() + { + gtk_range_set_value(GTK_RANGE(seq_slide), 30); + gtk_range_set_value(GTK_RANGE(seek_slide), 20); + gtk_range_set_value(GTK_RANGE(over_slide), 10); + } + + void DisplayDialog() + { + int return_value; + GtkWidget *dialog, *main_label, *main_frame, *main_box; + GtkWidget *default_button; + + ReadSettings(); + + /* Create the widgets */ + dialog = gtk_dialog_new_with_buttons ( + "Advanced Settings", + NULL, /* parent window*/ + (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_STOCK_OK, + GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_REJECT, + NULL); + + main_label = gtk_label_new ("These are advanced configuration options fine tuning time stretching behavior. Larger values are better for slowdown, while smaller values are better for speedup (more then 60 fps.). All options are in microseconds."); + gtk_label_set_line_wrap (GTK_LABEL(main_label), true); + + default_button = gtk_button_new_with_label("Reset to Defaults"); + + seq_label = gtk_label_new("Sequence Length"); + seq_slide = gtk_hscale_new_with_range(SequenceLen_Min, SequenceLen_Max, 2); + gtk_range_set_value(GTK_RANGE(seq_slide), SequenceLenMS); + + seek_label = gtk_label_new("Seek Window Size"); + seek_slide = gtk_hscale_new_with_range(SeekWindow_Min, SeekWindow_Max, 1); + gtk_range_set_value(GTK_RANGE(seek_slide), SeekWindowMS); + + over_label = gtk_label_new("Overlap"); + over_slide = gtk_hscale_new_with_range(Overlap_Min, Overlap_Max, 1); + gtk_range_set_value(GTK_RANGE(over_slide), OverlapMS); + + main_box = gtk_vbox_new(false, 5); + main_frame = gtk_frame_new ("Spu2-X Config"); + + gtk_container_add(GTK_CONTAINER (main_box), default_button); + gtk_container_add(GTK_CONTAINER (main_box), seq_label); + gtk_container_add(GTK_CONTAINER (main_box), seq_slide); + gtk_container_add(GTK_CONTAINER (main_box), seek_label); + gtk_container_add(GTK_CONTAINER (main_box), seek_slide); + gtk_container_add(GTK_CONTAINER (main_box), over_label); + gtk_container_add(GTK_CONTAINER (main_box), over_slide); + gtk_container_add(GTK_CONTAINER(main_frame), main_box); + + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_label); + gtk_container_add (GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_frame); + gtk_widget_show_all (dialog); + + g_signal_connect_swapped(GTK_OBJECT (default_button), "clicked", G_CALLBACK(restore_defaults), default_button); + + return_value = gtk_dialog_run (GTK_DIALOG (dialog)); + + if (return_value == GTK_RESPONSE_ACCEPT) + { + SequenceLenMS = gtk_range_get_value(GTK_RANGE(seq_slide));; + SeekWindowMS = gtk_range_get_value(GTK_RANGE(seek_slide));; + OverlapMS = gtk_range_get_value(GTK_RANGE(over_slide));; + } + + gtk_widget_destroy (dialog); + + WriteSettings(); + } } diff --git a/plugins/zzogl-pg/opengl/Linux/Linux.cpp b/plugins/zzogl-pg/opengl/Linux/Linux.cpp index 554ddacbc4..92b8e9553a 100644 --- a/plugins/zzogl-pg/opengl/Linux/Linux.cpp +++ b/plugins/zzogl-pg/opengl/Linux/Linux.cpp @@ -37,8 +37,6 @@ static gameHacks tempHacks; EXPORT_C_(void) GSkeyEvent(keyEvent *ev) { - static bool bAlt = false; - switch (ev->evt) { case KEYPRESS: @@ -61,10 +59,6 @@ EXPORT_C_(void) GSkeyEvent(keyEvent *ev) THR_bCtrl = true; break; - case XK_Alt_L: - case XK_Alt_R: - bAlt = true; - break; } break; @@ -81,10 +75,6 @@ EXPORT_C_(void) GSkeyEvent(keyEvent *ev) THR_bCtrl = false; break; - case XK_Alt_L: - case XK_Alt_R: - bAlt = false; - break; } } } diff --git a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp index 1bdcd78c1e..cf876e997a 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp @@ -251,7 +251,7 @@ inline void RenderStartHelper() // on image y coords. So if we write valpha.z * F + valpha.w + 0.5, it would be switching odd // and even strings at each frame. // valpha.x and y are used for image blending. -inline float4 RenderGetForClip(int psm, CRTC_TYPE render_type) +inline void RenderGetForClip(int psm, CRTC_TYPE render_type) { SetShaderCaller("RenderGetForClip"); FRAGMENTSHADER* prog = curr_pps(render_type); @@ -292,8 +292,6 @@ inline float4 RenderGetForClip(int psm, CRTC_TYPE render_type) } ZZshSetParameter4fv(prog->prog, prog->sOneColor, valpha, "g_fOneColor"); - - return valpha; } // Put interlaced texture in use for shader prog. @@ -577,7 +575,7 @@ inline void RenderCheckForTargets(tex0Info& texframe, list& list v = RenderSetTargetBitTrans(ptarg->fbh); v = RenderSetTargetInvTex(texframe.tbw, ptarg->fbh, CRTC_RENDER_TARG); // FIXME. This is no use - float4 valpha = RenderGetForClip(texframe.psm, CRTC_RENDER_TARG); + RenderGetForClip(texframe.psm, CRTC_RENDER_TARG); pps = curr_ppsCRTCTarg(); // inside vb[0]'s target area, so render that region only @@ -654,7 +652,7 @@ inline void RenderCheckForMemory(tex0Info& texframe, list& listT v = RenderSetTargetBitPos(1, 1, 0); v = RenderSetTargetBitTrans(texframe.th); v = RenderSetTargetInvTex(texframe.tw, texframe.th, CRTC_RENDER); - float4 valpha = RenderGetForClip(texframe.psm, CRTC_RENDER); + RenderGetForClip(texframe.psm, CRTC_RENDER); ZZshGLSetTextureParameter(curr_ppsCRTC()->prog, curr_ppsCRTC()->sMemory, vb[0].pmemtarg->ptex->tex, "CRTC memory"); RenderCreateInterlaceTex(texframe.th, CRTC_RENDER); diff --git a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp index 916adccf46..d0568fbb45 100644 --- a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp @@ -664,7 +664,7 @@ inline int FlushGetShaderType(VB& curvb, CRenderTarget* ptextarg, GLuint& ptexcl //Set page offsets depends on shader type. -inline float4 FlushSetPageOffset(FRAGMENTSHADER* pfragment, int shadertype, CRenderTarget* ptextarg) +inline void FlushSetPageOffset(FRAGMENTSHADER* pfragment, int shadertype, CRenderTarget* ptextarg) { SetShaderCaller("FlushSetPageOffset"); @@ -692,12 +692,10 @@ inline float4 FlushSetPageOffset(FRAGMENTSHADER* pfragment, int shadertype, CRen if (PSMT_ISZTEX(ptextarg->psm)) vpageoffset.w = -1.0f; ZZshSetParameter4fv(pfragment->prog, pfragment->fPageOffset, vpageoffset, "g_fPageOffset"); - - return vpageoffset; } //Setting texture offsets depends on shader type. -inline float4 FlushSetTexOffset(FRAGMENTSHADER* pfragment, int shadertype, VB& curvb, CRenderTarget* ptextarg) +inline void FlushSetTexOffset(FRAGMENTSHADER* pfragment, int shadertype, VB& curvb, CRenderTarget* ptextarg) { SetShaderCaller("FlushSetTexOffset"); float4 v; @@ -720,12 +718,10 @@ inline float4 FlushSetTexOffset(FRAGMENTSHADER* pfragment, int shadertype, VB& c v.w = 8.0f / (float)ptextarg->fbh; ZZshSetParameter4fv(pfragment->prog, pfragment->fTexOffset, v, "g_fTexOffset"); } - - return v; } // Set dimension (Real!) of texture. z and w -inline float4 FlushTextureDims(FRAGMENTSHADER* pfragment, int shadertype, VB& curvb, CRenderTarget* ptextarg) +inline void FlushTextureDims(FRAGMENTSHADER* pfragment, int shadertype, VB& curvb, CRenderTarget* ptextarg) { SetShaderCaller("FlushTextureDims"); float4 vTexDims; @@ -753,8 +749,6 @@ inline float4 FlushTextureDims(FRAGMENTSHADER* pfragment, int shadertype, VB& cu vTexDims.z += 8.0f; ZZshSetParameter4fv(pfragment->prog, pfragment->fTexDims, vTexDims, "g_fTexDims"); - - return vTexDims; } // Apply TEX1 mmag and mmin -- filter for expanding/reducing texture @@ -795,11 +789,11 @@ inline FRAGMENTSHADER* FlushUseExistRenderTarget(VB& curvb, CRenderTarget* ptext FRAGMENTSHADER* pfragment = ZZshLoadShadeEffect(shadertype, 0, curvb.curprim.fge, IsAlphaTestExpansion(curvb.tex0), exactcolor, curvb.clamp, context, NULL); - float4 vpageoffset = FlushSetPageOffset(pfragment, shadertype, ptextarg); + FlushSetPageOffset(pfragment, shadertype, ptextarg); - float4 v = FlushSetTexOffset(pfragment, shadertype, curvb, ptextarg); + FlushSetTexOffset(pfragment, shadertype, curvb, ptextarg); - float4 vTexDims = FlushTextureDims(pfragment, shadertype, curvb, ptextarg); + FlushTextureDims(pfragment, shadertype, curvb, ptextarg); if (pfragment->sCLUT != NULL && ptexclut != 0) ZZshGLSetTextureParameter(pfragment->prog, pfragment->sCLUT, ptexclut, "CLUT"); @@ -1683,7 +1677,7 @@ void SetContextTarget(int context) } } - bool bSetTarg = 1; + //bool bSetTarg = 1; if (curvb.pdepth->status & CRenderTarget::TS_NeedUpdate) { @@ -1691,7 +1685,7 @@ void SetContextTarget(int context) // don't update if virtual curvb.pdepth->Update(context, curvb.prndr); - bSetTarg = 0; + //bSetTarg = 0; } GL_REPORT_ERRORD(); @@ -2112,13 +2106,16 @@ void SetTexVariablesInt(int context, int bilinear, const tex0Info& tex0, bool Ch } \ } -//if( a.fix <= 0x80 ) { \ -// dwTemp = (a.fix*2)>255?255:(a.fix*2); \ -// dwTemp = dwTemp|(dwTemp<<8)|(dwTemp<<16)|0x80000000; \ -// ZZLog::Debug_Log("bfactor: %8.8x", dwTemp); \ -// glBlendColorEXT(dwTemp); \ -// } \ -// else { \ +#if 0 +if( a.fix <= 0x80 ) { \ + dwTemp = (a.fix*2)>255?255:(a.fix*2); \ + dwTemp = dwTemp|(dwTemp<<8)|(dwTemp<<16)|0x80000000; \ + ZZLog::Debug_Log("bfactor: %8.8x", dwTemp); \ + glBlendColorEXT(dwTemp); \ + } \ + else { \ + +#endif //void ResetAlphaVariables() { // FUNCLOG diff --git a/plugins/zzogl-pg/opengl/ZZoglShoots.cpp b/plugins/zzogl-pg/opengl/ZZoglShoots.cpp index c3e24b06a8..2fe0d408ce 100644 --- a/plugins/zzogl-pg/opengl/ZZoglShoots.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglShoots.cpp @@ -302,7 +302,6 @@ __attribute__((packed)); // Save image as TGA bool SaveTGA(const char* filename, int width, int height, void* pdata) { - int err = 0; TGA_HEADER hdr; FILE* f = fopen(filename, "wb"); @@ -318,8 +317,8 @@ bool SaveTGA(const char* filename, int width, int height, void* pdata) hdr.height = height; hdr.descriptor |= 8 | (1 << 5); // 8bit alpha, flip vertical - err = fwrite(&hdr, sizeof(hdr), 1, f); - err = fwrite(pdata, width * height * 4, 1, f); + fwrite(&hdr, sizeof(hdr), 1, f); + fwrite(pdata, width * height * 4, 1, f); fclose(f);