From b77780e1e7bdff77a836f50c4e9ac9dde6a8b54c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias <alam@srb2.org> Date: Mon, 29 Jul 2019 19:02:45 -0400 Subject: [PATCH] Fix building with MSVC --- src/p_saveg.c | 2 +- src/p_user.c | 2 +- src/r_things.c | 6 +++++- src/s_sound.c | 4 +++- src/sdl/Srb2SDL-vc10.vcxproj | 2 ++ src/sdl/Srb2SDL-vc10.vcxproj.filters | 7 +++++++ src/win32/Srb2win-vc10.vcxproj | 2 ++ src/win32/Srb2win-vc10.vcxproj.filters | 8 ++++++++ 8 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 2e4ba9228c..09df38eb07 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3408,7 +3408,7 @@ static void P_NetUnArchiveThinkers(void) { for (;;) { - thinker_t* th; + thinker_t* th = NULL; tclass = READUINT8(save_p); if (tclass == tc_end) diff --git a/src/p_user.c b/src/p_user.c index 6761d567d1..b758cebe49 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2049,7 +2049,7 @@ boolean P_PlayerHitFloor(player_t *player) fixed_t mu = FixedMul(player->maxdash, player->mo->scale); fixed_t mu2 = FixedHypot(player->mo->momx, player->mo->momy); fixed_t ev; - mobj_t *missile; + mobj_t *missile = NULL; if (mu2 < mu) mu2 = mu; ev = (50*FRACUNIT - (mu/25))/50; diff --git a/src/r_things.c b/src/r_things.c index 4b1586455e..c791571ac2 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2446,9 +2446,11 @@ static void R_DrawMaskedList (drawnode_t* head) void R_DrawMasked(maskcount_t* masks, UINT8 nummasks) { - drawnode_t heads[nummasks]; /**< Drawnode lists; as many as number of views/portals. */ + drawnode_t *heads; /**< Drawnode lists; as many as number of views/portals. */ SINT8 i; + heads = calloc(nummasks, sizeof(drawnode_t)); + for (i = 0; i < nummasks; i++) { heads[i].next = heads[i].prev = &heads[i]; @@ -2474,6 +2476,8 @@ void R_DrawMasked(maskcount_t* masks, UINT8 nummasks) R_DrawMaskedList(&heads[nummasks - 1]); R_ClearDrawNodes(&heads[nummasks - 1]); } + + free(heads); } // ========================================================================== diff --git a/src/s_sound.c b/src/s_sound.c index 2db8392d74..66b5d4f72a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1988,8 +1988,10 @@ void GameMIDIMusic_OnChange(void) } } +#ifdef HAVE_OPENMPT void ModFilter_OnChange(void) { if (openmpt_mhandle) openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH, cv_modfilter.value); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index d05a0d3241..72c38b3dc0 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -277,6 +277,7 @@ <ClInclude Include="..\r_local.h" /> <ClInclude Include="..\r_main.h" /> <ClInclude Include="..\r_plane.h" /> + <ClInclude Include="..\r_portal.h" /> <ClInclude Include="..\r_segs.h" /> <ClInclude Include="..\r_sky.h" /> <ClInclude Include="..\r_splats.h" /> @@ -430,6 +431,7 @@ </ClCompile> <ClCompile Include="..\r_main.c" /> <ClCompile Include="..\r_plane.c" /> + <ClCompile Include="..\r_portal.c" /> <ClCompile Include="..\r_segs.c" /> <ClCompile Include="..\r_sky.c" /> <ClCompile Include="..\r_splats.c" /> diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index ca6bd38d21..9e442000fd 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -453,6 +453,9 @@ <ClInclude Include="..\hardware\hw_clip.h"> <Filter>Hw_Hardware</Filter> </ClInclude> + <ClInclude Include="..\r_portal.h"> + <Filter>R_Rend</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <CustomBuild Include="..\tmap.nas"> @@ -894,6 +897,10 @@ <ClCompile Include="..\hardware\hw_clip.c"> <Filter>Hw_Hardware</Filter> </ClCompile> + <ClCompile Include="..\apng.c" /> + <ClCompile Include="..\r_portal.c"> + <Filter>R_Rend</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <Image Include="Srb2SDL.ico"> diff --git a/src/win32/Srb2win-vc10.vcxproj b/src/win32/Srb2win-vc10.vcxproj index acab2507a3..c0fe8eda9a 100644 --- a/src/win32/Srb2win-vc10.vcxproj +++ b/src/win32/Srb2win-vc10.vcxproj @@ -293,6 +293,7 @@ </ClCompile> <ClCompile Include="..\r_main.c" /> <ClCompile Include="..\r_plane.c" /> + <ClCompile Include="..\r_portal.c" /> <ClCompile Include="..\r_segs.c" /> <ClCompile Include="..\r_sky.c" /> <ClCompile Include="..\r_splats.c" /> @@ -443,6 +444,7 @@ <ClInclude Include="..\r_local.h" /> <ClInclude Include="..\r_main.h" /> <ClInclude Include="..\r_plane.h" /> + <ClInclude Include="..\r_portal.h" /> <ClInclude Include="..\r_segs.h" /> <ClInclude Include="..\r_sky.h" /> <ClInclude Include="..\r_splats.h" /> diff --git a/src/win32/Srb2win-vc10.vcxproj.filters b/src/win32/Srb2win-vc10.vcxproj.filters index c21cedb8a4..93806e3951 100644 --- a/src/win32/Srb2win-vc10.vcxproj.filters +++ b/src/win32/Srb2win-vc10.vcxproj.filters @@ -456,6 +456,10 @@ <ClCompile Include="..\hardware\hw_clip.c"> <Filter>Hw_Hardware</Filter> </ClCompile> + <ClCompile Include="..\apng.c" /> + <ClCompile Include="..\r_portal.c"> + <Filter>R_Rend</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="afxres.h"> @@ -857,6 +861,10 @@ <ClInclude Include="..\hardware\hw_clip.h"> <Filter>Hw_Hardware</Filter> </ClInclude> + <ClInclude Include="..\apng.h" /> + <ClInclude Include="..\r_portal.h"> + <Filter>R_Rend</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <Image Include="Srb2win.ico"> -- GitLab