From 894ee02f3f7834022f30c2c572d409ce30201d41 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 13 Nov 2018 17:12:18 -0500 Subject: [PATCH 1/6] Fix x64 build issue --- src/sdl/mixer_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 52a35162..609d7dec 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -550,7 +550,7 @@ boolean I_SongPlaying(void) #ifdef HAVE_LIBGME (I_SongType() == MU_GME && gme) || #endif - (boolean)music + music != NULL ); } From 95ed3fcf7e720824e1867d74e533d0a90547c518 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 13 Nov 2018 17:19:22 -0500 Subject: [PATCH 2/6] Save current renderer to screenshots --- src/m_misc.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 5c4e7f2f..37d734ec 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -58,7 +58,7 @@ typedef off_t off64_t; #if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) #define PRIdS "u" -#elif defined (_WIN32) +#elif defined (_WIN32) #define PRIdS "Iu" #elif defined (_PSP) || defined (_arch_dreamcast) || defined (DJGPP) || defined (_WII) || defined (_NDS) || defined (_PS3) #define PRIdS "u" @@ -646,11 +646,11 @@ static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_byte movie) { #ifdef PNG_TEXT_SUPPORTED -#define SRB2PNGTXT 10 //PNG_KEYWORD_MAX_LENGTH(79) is the max +#define SRB2PNGTXT 11 //PNG_KEYWORD_MAX_LENGTH(79) is the max png_text png_infotext[SRB2PNGTXT]; char keytxt[SRB2PNGTXT][12] = { "Title", "Description", "Playername", "Mapnum", "Mapname", - "Location", "Interface", "Revision", "Build Date", "Build Time"}; + "Location", "Interface", "Render Mode", "Revision", "Build Date", "Build Time"}; char titletxt[] = "Sonic Robo Blast 2 " VERSIONSTRING; png_charp playertxt = cv_playername.zstring; char desctxt[] = "SRB2 Screenshot"; @@ -666,6 +666,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png #else "Unknown"; #endif + char rendermodetxt[9]; char maptext[8]; char lvlttltext[48]; char locationtxt[40]; @@ -673,6 +674,19 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png char ctdate[40]; char cttime[40]; + switch (rendermode) + { + case render_soft: + strcpy(rendermodetxt, "Software"); + break; + case render_opengl: + strcpy(rendermodetxt, "OpenGL"); + break; + default: // Just in case + strcpy(rendermodetxt, "None"); + break; + } + if (gamestate == GS_LEVEL) snprintf(maptext, 8, "%s", G_BuildMapName(gamemap)); else @@ -710,9 +724,10 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png png_infotext[4].text = lvlttltext; png_infotext[5].text = locationtxt; png_infotext[6].text = interfacetxt; - png_infotext[7].text = strncpy(ctrevision, comprevision, sizeof(ctrevision)-1); - png_infotext[8].text = strncpy(ctdate, compdate, sizeof(ctdate)-1); - png_infotext[9].text = strncpy(cttime, comptime, sizeof(cttime)-1); + png_infotext[7].text = rendermodetxt; + png_infotext[8].text = strncpy(ctrevision, comprevision, sizeof(ctrevision)-1); + png_infotext[9].text = strncpy(ctdate, compdate, sizeof(ctdate)-1); + png_infotext[10].text = strncpy(cttime, comptime, sizeof(cttime)-1); png_set_text(png_ptr, png_info_ptr, png_infotext, SRB2PNGTXT); #undef SRB2PNGTXT From 2db2b6e6af3702157f0d9f6d980af23f0cbc8177 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 13 Nov 2018 17:24:19 -0500 Subject: [PATCH 3/6] Win32 boolean fixes --- src/win32/win_snd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index 1e1b062f..f2af7f92 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -492,15 +492,15 @@ musictype_t I_SongType(void) boolean I_SongPlaying(void) { - return (boolean)music_stream; + return (music_stream != NULL); } boolean I_SongPaused(void) { - boolean fmpaused = false; + FMOD_BOOL fmpaused = false; if (music_stream) FMOD_Channel_GetPaused(music_channel, &fmpaused); - return fmpaused; + return (boolean)fmpaused; } /// ------------------------ From 0b97b2a76c87855f883470fdc220e5920933a16e Mon Sep 17 00:00:00 2001 From: Marco Z Date: Tue, 13 Nov 2018 22:50:08 -0500 Subject: [PATCH 4/6] Missed #ifdef HAVE_LIBGME in win_snd --- src/win32/win_snd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index f2af7f92..34a6a929 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -551,7 +551,12 @@ boolean I_LoadSong(char *data, size_t len) FMOD_TAG tag; unsigned int loopstart, loopend; - if (gme || music_stream) + if ( +#ifdef HAVE_LIBGME + gme || +#endif + music_stream + ) I_UnloadSong(); memset(&fmt, 0, sizeof(FMOD_CREATESOUNDEXINFO)); From f3b59c17314299c45a8351432be273617681a457 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 14 Nov 2018 12:11:57 +0000 Subject: [PATCH 5/6] Fix VC project files to include hw_clip.c/h --- src/sdl/Srb2SDL-vc10.vcxproj | 2 ++ src/sdl/Srb2SDL-vc10.vcxproj.filters | 6 ++++++ src/win32/Srb2win-vc10.vcxproj | 2 ++ src/win32/Srb2win-vc10.vcxproj.filters | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index 82019264..467d2829 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -141,6 +141,7 @@ + @@ -282,6 +283,7 @@ + diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index d04007dd..364deb49 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -216,6 +216,9 @@ Hw_Hardware + + Hw_Hardware + Hw_Hardware @@ -603,6 +606,9 @@ Hw_Hardware + + Hw_Hardware + Hw_Hardware diff --git a/src/win32/Srb2win-vc10.vcxproj b/src/win32/Srb2win-vc10.vcxproj index 064f75d7..0722c0b6 100644 --- a/src/win32/Srb2win-vc10.vcxproj +++ b/src/win32/Srb2win-vc10.vcxproj @@ -119,6 +119,7 @@ + @@ -275,6 +276,7 @@ + diff --git a/src/win32/Srb2win-vc10.vcxproj.filters b/src/win32/Srb2win-vc10.vcxproj.filters index b2647ea1..95e79cab 100644 --- a/src/win32/Srb2win-vc10.vcxproj.filters +++ b/src/win32/Srb2win-vc10.vcxproj.filters @@ -93,6 +93,9 @@ Hw_Hardware + + Hw_Hardware + Hw_Hardware @@ -470,6 +473,9 @@ Win32app + + Hw_Hardware + Hw_Hardware From f73ea4f98479b931489fd3ea7c5a3148387dee57 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 14 Nov 2018 10:52:16 -0500 Subject: [PATCH 6/6] Clean up warnings --- src/d_netcmd.h | 2 +- src/hardware/hw_main.c | 2 +- src/i_sound.h | 2 +- src/sdl/mixer_sound.c | 2 +- src/win32/win_dll.c | 2 +- src/win32/win_snd.c | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 899f1c86..d0bac3d5 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -196,4 +196,4 @@ void D_SetPassword(const char *pw); // used for the player setup menu UINT8 CanChangeSkin(INT32 playernum); -#endif \ No newline at end of file +#endif diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d9e65523..64df1a2e 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1069,7 +1069,7 @@ static float HWR_ClipViewSegment(INT32 x, polyvertex_t *v1, polyvertex_t *v2) // // HWR_SplitWall // -static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, FSurfaceInfo* Surf, UINT32 cutflag, ffloor_t *pfloor) +static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor) { /* SoM: split up and light walls according to the lightlist. This may also include leaving out parts diff --git a/src/i_sound.h b/src/i_sound.h index 2f73017d..bc9829fd 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -265,4 +265,4 @@ void I_PlayCD(UINT8 track, UINT8 looping); */ boolean I_SetVolumeCD(INT32 volume); -#endif \ No newline at end of file +#endif diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 609d7dec..a3c42199 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -860,4 +860,4 @@ boolean I_SetSongTrack(int track) return false; } -#endif \ No newline at end of file +#endif diff --git a/src/win32/win_dll.c b/src/win32/win_dll.c index c9b3fba4..71eda043 100644 --- a/src/win32/win_dll.c +++ b/src/win32/win_dll.c @@ -148,7 +148,7 @@ static loadfunc_t hwdFuncTable[] = { #ifdef SHUFFLE {"PostImgRedraw", &hwdriver.pfnPostImgRedraw}, #endif - {"FlushScreenTextures"},&hwdriver.pfnFlushScreenTextures}, + {"FlushScreenTextures", &hwdriver.pfnFlushScreenTextures}, {"StartScreenWipe", &hwdriver.pfnStartScreenWipe}, {"EndScreenWipe", &hwdriver.pfnEndScreenWipe}, {"DoScreenWipe", &hwdriver.pfnDoScreenWipe}, diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index 34a6a929..454c53e3 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -457,6 +457,8 @@ void I_ShutdownMusic(void) musictype_t I_SongType(void) { + FMOD_SOUND_TYPE type; + #ifdef HAVE_LIBGME if (gme) return MU_GME; @@ -465,7 +467,6 @@ musictype_t I_SongType(void) if (!music_stream) return MU_NONE; - FMOD_SOUND_TYPE type; if (FMOD_Sound_GetFormat(music_stream, &type, NULL, NULL, NULL) == FMOD_OK) { switch(type)