Skip to content

Commit

Permalink
Fix msvc build
Browse files Browse the repository at this point in the history
  • Loading branch information
mittorn committed Mar 22, 2017
1 parent 97dee26 commit ed1ac9b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion engine/client/cl_scrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ NetGraph_DrawLine
CL_FillRGBA shortcut
==========
*/
static inline void NetGraph_DrawRect( wrect_t *rect, byte colors[4] )
_inline void NetGraph_DrawRect( wrect_t *rect, byte colors[4] )
{
CL_FillRGBA( rect->left, rect->top, rect->right, rect->bottom, colors[0], colors[1], colors[2], colors[3] );
}
Expand Down
6 changes: 4 additions & 2 deletions engine/common/Sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,16 @@ Sequence_BakeDefaults
*/
void Sequence_BakeDefaults( sequenceCommandLine_s *destination, sequenceCommandLine_s *source )
{
char *saveName, *saveMessage;

if( !destination )
MsgDev( D_ERROR, "Attempt to bake defaults into a non-existant command." );

if( !source )
MsgDev( D_ERROR, "Attempt to bake defaults from a non-existant command." );

char *saveName = destination->clientMessage.pName;
char *saveMessage = destination->clientMessage.pMessage;
saveName= destination->clientMessage.pName;
saveMessage = destination->clientMessage.pMessage;

destination->clientMessage = source->clientMessage;

Expand Down
5 changes: 3 additions & 2 deletions engine/common/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ void Host_Frame( float time );
void Host_RunFrame()
{
static double oldtime, newtime;
if( !oldtime )
oldtime = Sys_DoubleTime();
#ifdef XASH_SDL
SDL_Event event;
#endif
if( !oldtime )
oldtime = Sys_DoubleTime();


#if XASH_INPUT == INPUT_SDL
while( !host.crashed && !host.shutdown_issued && SDL_PollEvent( &event ) )
Expand Down
4 changes: 4 additions & 0 deletions engine/common/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ qboolean Sys_DebuggerPresent( void )
raise( SIGINT )
#endif
#endif

#if defined _WIN32 && !defined __amd64__
#ifdef _MSC_VER


BOOL WINAPI IsDebuggerPresent(void);
#define DEBUG_BREAK if( IsDebuggerPresent() ) \
_asm{ int 3 }
#else
Expand Down
2 changes: 1 addition & 1 deletion game_launch/xash.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GNU General Public License for more details.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if _MSC_VER == 1200
#if _MSC_VER <= 1600
#define true 1
#define false 0
#else
Expand Down
2 changes: 1 addition & 1 deletion msvc6/build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rem msvc writes all objects to CWD, so we need do some renames to resolve conflicts
move common\common.c common\host_common.c
move common\soundlib\libmpg\common.c common\soundlib\libmpg\mpg_common.c
cl -Dvsnprintf=_vsnprintf -o xash_sdl.dll /DEBUG /Zi /DLL /W3 /Gm /GD /G6 /LD /O2 /MD /O2 /D_USRDLL /DXASH_FORCEINLINE /DXASH_FASTSTR /D_WINDLL common\*.c client\*.c server\*.c client\vgui\*.c common\soundlib\*.c common\soundlib\libmpg\*.c common\imagelib\*.c platform\sdl\*.c platform\win32\*.c -I ../msvc6/ -I ../SDL2-2.0.4/include/ -Icommon -I../common -I. -I../pm_shared -Iclient -Iserver -Iclient/vgui -Icommon/sdl -DXASH_VGUI -DXASH_SDL -Dsnprintf=_snprintf -DDBGHELP /link /DLL /LIBPATH:..\msvc6 user32.lib shell32.lib gdi32.lib msvcrt.lib winmm.lib /nodefaultlib:"libc.lib" /subsystem:windows ../SDL2-2.0.4/lib/x86/SDL2.lib kernel32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DEBUG
cl -Dvsnprintf=_vsnprintf -o xash_sdl.dll /DEBUG /Zi /DLL /W3 /Gm /GD /G6 /LD /O2 /MD /O2 /D_USRDLL /DXASH_FORCEINLINE /DXASH_FASTSTR /D_WINDLL common\*.c client\*.c server\*.c client\vgui\*.c common\soundlib\*.c common\soundlib\libmpg\*.c common\imagelib\*.c platform\sdl\*.c platform\win32\*.c -I ../msvc6/ -I ../SDL2-2.0.5/include/ -Icommon -I../common -I. -I../pm_shared -Iclient -Iserver -Iclient/vgui -Icommon/sdl -DXASH_VGUI -DXASH_SDL -Dsnprintf=_snprintf -DDBGHELP /link /DLL /LIBPATH:..\msvc6 user32.lib shell32.lib gdi32.lib msvcrt.lib winmm.lib /nodefaultlib:"libc.lib" /subsystem:windows ../SDL2-2.0.5/lib/x86/SDL2.lib kernel32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DEBUG
move common\host_common.c common\common.c
move common\soundlib\libmpg\mpg_common.c common\soundlib\libmpg\common.c
2 changes: 1 addition & 1 deletion msvc6/build_launch.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rc game.rc
cl /MD /W3 /GX /O2 /D_USRDLL /D_WINDLL xash.c -I ../SDL2-2.0.4/include/ -Icommon -I../common -I. -I../pm_shared -Iclient -Iserver -Iclient/vgui -Icommon/sdl -o xash_vc.exe -DXASH_SDL -DNO_ICO /link game.RES user32.lib shell32.lib gdi32.lib msvcrt.lib winmm.lib /nodefaultlib:"libc.lib" /subsystem:windows ../SDL2-2.0.4/lib/x86/SDL2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
cl /MD /W3 /GX /O2 /D_USRDLL /D_WINDLL xash.c -I ../SDL2-2.0.5/include/ -Icommon -I../common -I. -I../pm_shared -Iclient -Iserver -Iclient/vgui -Icommon/sdl -o xash_vc.exe -DXASH_SDL -DNO_ICO /link game.RES user32.lib shell32.lib gdi32.lib msvcrt.lib winmm.lib /nodefaultlib:"libc.lib" /subsystem:windows ../SDL2-2.0.5/lib/x86/SDL2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

0 comments on commit ed1ac9b

Please sign in to comment.