From af5128bcddd61de4f57e2fa72e18c52344894e3b Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 5 Jun 2009 20:09:13 +0000 Subject: [PATCH] MSVC fixes + clean out tree git-svn-id: https://svn.eduke32.com/eduke32@1399 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.msvc | 19 +++++----- polymer/eduke32/build/Makefile.msvc | 19 +++++----- polymer/eduke32/build/include/msvc/stdint.h | 9 +++-- polymer/eduke32/build/include/sdlayer.h | 2 +- polymer/eduke32/build/include/winlayer.h | 2 +- polymer/eduke32/build/src/a.masm | 7 ++-- polymer/eduke32/build/src/compat.c | 2 +- polymer/eduke32/build/src/config.c | 2 +- polymer/eduke32/build/src/mdsprite.c | 4 +-- polymer/eduke32/build/src/osd.c | 2 +- polymer/eduke32/eduke32.vcproj | 2 +- polymer/eduke32/source/actors.c | 7 ++++ polymer/eduke32/source/duke3d.h | 4 +++ polymer/eduke32/source/game.c | 6 ++++ polymer/eduke32/source/jaudiolib/_midi.h | 2 +- polymer/eduke32/source/jaudiolib/_multivc.h | 22 ++---------- .../source/jaudiolib/audiolib_fx_fmod.c | 2 +- .../source/jaudiolib/audiolib_fxstub.c | 2 +- polymer/eduke32/source/jaudiolib/dsl.c | 4 +-- polymer/eduke32/source/jaudiolib/dsl.h | 2 +- polymer/eduke32/source/jaudiolib/dsoundout.c | 2 +- polymer/eduke32/source/jaudiolib/fx_man.c | 8 ++--- polymer/eduke32/source/jaudiolib/fx_man.h | 6 ++-- .../eduke32/source/jaudiolib/fx_man_fmod.h | 2 +- polymer/eduke32/source/jaudiolib/midi.c | 4 +-- polymer/eduke32/source/jaudiolib/multivoc.c | 36 +++++++++---------- polymer/eduke32/source/jaudiolib/multivoc.h | 4 +-- polymer/eduke32/source/jaudiolib/openal.c | 3 -- polymer/eduke32/source/jaudiolib/openal.h | 4 +-- polymer/eduke32/source/jmact/keyboard.c | 4 +-- polymer/eduke32/source/menus.c | 2 +- polymer/eduke32/source/startwin.game.c | 4 +++ 32 files changed, 100 insertions(+), 100 deletions(-) diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index 07383aee1..792e7d081 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -14,11 +14,11 @@ EDITORLIB=build.lib !ifdef DEBUG # debugging options -flags_cl= /Ot /Zi +flags_cl= /Od /Zi flags_link=/DEBUG !else # release options -flags_cl=/O2 /Ox #/Ob1gity +flags_cl=/Ox flags_link=/RELEASE !endif @@ -31,14 +31,14 @@ ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DUSE_OPENAL /DRANCID_NETWORKING CC=cl AS=ml -LINK=link /opt:nowin98 /nologo /opt:ref +LINK=link /nologo /opt:ref MT=mt -CFLAGS= /MD /J /nologo $(flags_cl) \ +CFLAGS= /MT /J /nologo $(flags_cl) \ /I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \ /DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" -W2 $(ENGINEOPTS) \ /I$(DXROOT)\include" /DRENDERTYPEWIN=1 LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib wsock32.lib comctl32.lib \ - /NODEFAULTLIB:libFLAC.lib /NODEFAULTLIB:glu32.lib /NODEFAULTLIB:LIBCMT.lib /NODEFAULTLIB:LIBCMTD.lib + /NODEFAULTLIB:glu32.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib LIBS=vorbisfile_static.lib vorbis_static.lib ogg_static.lib $(LIBS) @@ -46,6 +46,9 @@ ASFLAGS=/nologo /coff /c EXESUFFIX=.exe !ifdef DEBUG CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS +LIBS=$(LIBS) /NODEFAULTLIB:libcmt.lib +!else +LIBS=$(LIBS) /NODEFAULTLIB:libcmtd.lib !endif JMACTOBJ=$(OBJ)\util_lib.$o \ @@ -146,15 +149,15 @@ EDITOROBJS=$(OBJ)\astub.$o \ all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) # duke3d_w32$(EXESUFFIX); eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)\$(ENGINELIB) - $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest $(RSRC)\manifest.game.xml -hashupdate -outputresource:$@ -out:$@.manifest mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)\$(ENGINELIB) $(EOBJ)\$(EDITORLIB) - $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest $(RSRC)\manifest.build.xml -hashupdate -outputresource:$@ -out:$@.manifest duke3d_w32$(EXESUFFIX): $(OBJ)/wrapper.$o - $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ !include Makefile.deps diff --git a/polymer/eduke32/build/Makefile.msvc b/polymer/eduke32/build/Makefile.msvc index 15be865ea..9d97a0ac3 100644 --- a/polymer/eduke32/build/Makefile.msvc +++ b/polymer/eduke32/build/Makefile.msvc @@ -32,20 +32,19 @@ TARGETOPTS=/DNOASM !ifdef DEBUG # debugging options -flags_cl=/Ot /Zi +flags_cl=/Od /Zi flags_link=/DEBUG !else # release options -#flags_cl=/Ox -flags_cl= /O2 /Ox +flags_cl=/Ox flags_link=/RELEASE !endif CC=cl AS=ml RC=rc -LINK=link /opt:nowin98 /opt:ref /nologo -CFLAGS=$(CFLAGS) /nologo /MD /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" /I$(DXROOT)\include" # /I$(ENETROOT)\include" +LINK=link /opt:ref /nologo +CFLAGS=$(CFLAGS) /nologo /MT /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" /I$(DXROOT)\include" # /I$(ENETROOT)\include" ASFLAGS=/nologo /coff /c EXESUFFIX=.exe !ifdef DEBUG @@ -127,23 +126,23 @@ $(OBJ)\$(EDITORLIB): $(EDITOROBJS) # the tools kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o - $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o - $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o - $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o - $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o - $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib + $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ # DEPENDENCIES diff --git a/polymer/eduke32/build/include/msvc/stdint.h b/polymer/eduke32/build/include/msvc/stdint.h index e032ff160..5b256462f 100644 --- a/polymer/eduke32/build/include/msvc/stdint.h +++ b/polymer/eduke32/build/include/msvc/stdint.h @@ -62,14 +62,13 @@ # endif #endif - // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types -typedef __int8 int8_t; -typedef __int16 int16_t; -typedef __int32 int32_t; -typedef __int64 int64_t; +typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; +typedef signed __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; diff --git a/polymer/eduke32/build/include/sdlayer.h b/polymer/eduke32/build/include/sdlayer.h index 3afd83567..ab19ff2a3 100644 --- a/polymer/eduke32/build/include/sdlayer.h +++ b/polymer/eduke32/build/include/sdlayer.h @@ -10,7 +10,7 @@ struct sdlappicon { int32_t width,height; uint32_t *pixels; - unsigned char *mask; + uint8_t *mask; }; #else diff --git a/polymer/eduke32/build/include/winlayer.h b/polymer/eduke32/build/include/winlayer.h index aa769c6ff..a93610fff 100644 --- a/polymer/eduke32/build/include/winlayer.h +++ b/polymer/eduke32/build/include/winlayer.h @@ -6,7 +6,7 @@ #define __build_interface_layer__ WIN extern int32_t backgroundidle; // set to 1 to tell winlayer to go to idle priority when inactive -extern unsigned maxrefreshfreq; +extern uint32_t maxrefreshfreq; extern int32_t glusecds; diff --git a/polymer/eduke32/build/src/a.masm b/polymer/eduke32/build/src/a.masm index 11862c381..97daee539 100644 --- a/polymer/eduke32/build/src/a.masm +++ b/polymer/eduke32/build/src/a.masm @@ -111,9 +111,8 @@ CDECLENDSET MACRO numparams:REQ CDECLEND numparams ENDM -CODE SEGMENT PUBLIC USE32 'CODE' +code segment 'CODE' PUBLIC USE32 ASSUME cs:CODE,ds:CODE - PUBLIC _dep_begin _dep_begin: @@ -2665,5 +2664,5 @@ pentiumpro: PUBLIC _dep_end _dep_end: -CODE ENDS -END +code ends +END diff --git a/polymer/eduke32/build/src/compat.c b/polymer/eduke32/build/src/compat.c index 0997f94ec..ce5fb77f9 100644 --- a/polymer/eduke32/build/src/compat.c +++ b/polymer/eduke32/build/src/compat.c @@ -62,7 +62,7 @@ void Bfree(void *ptr) free(ptr); } -int32_t Bopen(const char *pathname, int32_t flags, unsigned mode) +int32_t Bopen(const char *pathname, int32_t flags, uint32_t mode) { int32_t n=0,o=0; diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index 6b608329e..e4c6eadc2 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -16,7 +16,7 @@ static int32_t vesares[13][2] = {{320,200},{360,200},{320,240},{360,240},{320,40 {1024,768},{1280,1024},{1600,1200} }; -static int32_t readconfig(BFILE *fp, const char *key, char *value, unsigned len) +static int32_t readconfig(BFILE *fp, const char *key, char *value, uint32_t len) { char buf[1000], *k, *v, *eq; int32_t x=0; diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 113ccd3ce..eeb76aa4d 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -2136,9 +2136,9 @@ static int32_t mytexo5, *zbit, gmaxx, gmaxy, garea, pow2m1[33]; static voxmodel_t *gvox; //pitch must equal xsiz*4 -unsigned gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, int32_t dapal) +uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, int32_t dapal) { - unsigned rtexid; + uint32_t rtexid; coltype *pic, *pic2; char *cptr; int32_t i; diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index 20ff54183..03ca32189 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -1295,7 +1295,7 @@ void OSD_ShowDisplay(int32_t onf) void OSD_Draw(void) { - unsigned topoffs; + uint32_t topoffs; int32_t row, lines, x, len; if (!osdinited) return; diff --git a/polymer/eduke32/eduke32.vcproj b/polymer/eduke32/eduke32.vcproj index 69b5952ee..2a3d1fd29 100644 --- a/polymer/eduke32/eduke32.vcproj +++ b/polymer/eduke32/eduke32.vcproj @@ -29,7 +29,7 @@ ReBuildCommandLine="nmake /f Makefile.msvc veryclean all DEBUG=1" CleanCommandLine="nmake /f Makefile.msvc veryclean" Output="eduke32.exe" - PreprocessorDefinitions="WIN32;_DEBUG;SUPERBUILD;POLYMOST;USE_OPENGL;NOCOPYPROTECT;RENDERTYPEWIN" + PreprocessorDefinitions="WIN32;_DEBUG;SUPERBUILD;POLYMOST;POLYMER;USE_OPENGL;NOCOPYPROTECT;RENDERTYPEWIN" IncludeSearchPath="" ForcedIncludes="" AssemblySearchPath="" diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index ba85f34a4..b7932dbfc 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -407,6 +407,7 @@ void A_DeleteSprite(int32_t s) OSD_Printf(OSD_ERROR "A_DeleteSprite(): tried to remove sprite %d in EVENT_EGS\n",s); return; } + if (apScriptGameEvent[EVENT_KILLIT]) { int32_t p, pl=A_FindPlayer(&sprite[s],&p); @@ -416,6 +417,12 @@ void A_DeleteSprite(int32_t s) if (aGameVars[g_iReturnVarID].val.lValue) return; } + +#ifdef POLYMER + if (getrendermode() == 4 && ActorExtra[s].lightId != -1) + polymer_deletelight(ActorExtra[s].lightId); +#endif + deletesprite(s); } #define deletesprite A_DeleteSprite diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 33c86d9ce..d2788d60d 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -546,6 +546,10 @@ typedef struct { char cgg; char filler; projectile_t projectile; +#ifdef POLYMER + int16_t lightId; + _prlight *lightptr; +#endif } ActorData_t; extern ActorData_t ActorExtra[MAXSPRITES]; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index c3cd8db9b..9ec8ce40e 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4709,6 +4709,9 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3 ActorExtra[i].tempang = 0; ActorExtra[i].dispicnum = 0; + ActorExtra[i].lightptr = NULL; + ActorExtra[i].lightId = -1; + T1=T3=T4=T6=T7=T8=T9=0; ActorExtra[i].flags = 0; @@ -4793,6 +4796,9 @@ int32_t A_Spawn(int32_t j, int32_t pn) ActorExtra[i].lastvy = 0; ActorExtra[i].actorstayput = -1; + ActorExtra[i].lightptr = NULL; + ActorExtra[i].lightId = -1; + T1 = T2 = T3 = T4 = T5 = T6 = T7 = T8 = T9 = 0; ActorExtra[i].flags = 0; diff --git a/polymer/eduke32/source/jaudiolib/_midi.h b/polymer/eduke32/source/jaudiolib/_midi.h index f2c41ab04..67139080c 100644 --- a/polymer/eduke32/source/jaudiolib/_midi.h +++ b/polymer/eduke32/source/jaudiolib/_midi.h @@ -114,7 +114,7 @@ typedef struct char *loopstart; int16_t loopcount; int16_t RunningStatus; - unsigned time; + uint32_t time; int32_t FPSecondsPerTick; int16_t tick; int16_t beat; diff --git a/polymer/eduke32/source/jaudiolib/_multivc.h b/polymer/eduke32/source/jaudiolib/_multivc.h index 4e9188233..38e51cbfa 100644 --- a/polymer/eduke32/source/jaudiolib/_multivc.h +++ b/polymer/eduke32/source/jaudiolib/_multivc.h @@ -113,7 +113,7 @@ typedef struct VoiceNode char *NextBlock; char *LoopStart; char *LoopEnd; - unsigned LoopCount; + uint32_t LoopCount; uint32_t LoopSize; uint32_t BlockLength; @@ -202,7 +202,7 @@ typedef struct typedef char HARSH_CLIP_TABLE_8[ MV_NumVoices * 256 ]; #if defined(_WIN32) -static uint32_t MV_GetBufferSize(unsigned); +static uint32_t MV_GetBufferSize(uint32_t); #endif static void MV_Mix(VoiceNode *voice, int32_t buffer); static void MV_PlayVoice(VoiceNode *voice); @@ -228,24 +228,6 @@ static void MV_CalcPanTable(void); static void ClearBuffer_DW(void *ptr, int32_t data, int32_t length); -/* -#define ClearBuffer_DW( ptr, data, length ) \ - ({ void *__ptr=(ptr); unsigned __data=(data); int32_t __length=(length); \ - __asm__ __volatile__ ("rep; stosl" \ - : "+c" (__length), "+D" (__ptr) : "a" (__data) : "memory", "cc"); \ - 0; }) -*/ -/* -#pragma aux ClearBuffer_DW = \ - "cld", \ - "push es", \ - "push ds", \ - "pop es", \ - "rep stosd", \ - "pop es", \ -parm [ edi ] [ eax ] [ ecx ] modify exact [ ecx edi ]; -*/ - #if defined(__WATCOMC__) #pragma aux MV_Mix8BitMono parm [eax] [edx] [ebx] [ecx] diff --git a/polymer/eduke32/source/jaudiolib/audiolib_fx_fmod.c b/polymer/eduke32/source/jaudiolib/audiolib_fx_fmod.c index 240ffd4ba..9fa08d915 100644 --- a/polymer/eduke32/source/jaudiolib/audiolib_fx_fmod.c +++ b/polymer/eduke32/source/jaudiolib/audiolib_fx_fmod.c @@ -123,7 +123,7 @@ static char *OutputType(int32_t a) } } -int32_t FX_Init(int32_t SoundCard, int32_t numvoices, int32_t numchannels, int32_t samplebits, unsigned mixrate) +int32_t FX_Init(int32_t SoundCard, int32_t numvoices, int32_t numchannels, int32_t samplebits, uint32_t mixrate) { FSOUND_Close(); diff --git a/polymer/eduke32/source/jaudiolib/audiolib_fxstub.c b/polymer/eduke32/source/jaudiolib/audiolib_fxstub.c index 437c531fd..96b35b90b 100644 --- a/polymer/eduke32/source/jaudiolib/audiolib_fxstub.c +++ b/polymer/eduke32/source/jaudiolib/audiolib_fxstub.c @@ -90,7 +90,7 @@ int32_t FX_Init int32_t numvoices, int32_t numchannels, int32_t samplebits, - unsigned mixrate + uint32_t mixrate ) { diff --git a/polymer/eduke32/source/jaudiolib/dsl.c b/polymer/eduke32/source/jaudiolib/dsl.c index bfd23c738..8ef63f034 100644 --- a/polymer/eduke32/source/jaudiolib/dsl.c +++ b/polymer/eduke32/source/jaudiolib/dsl.c @@ -171,7 +171,7 @@ static void mixer_callback(int32_t chan, void *stream, int32_t len, void *udata) } //int32_t DSL_BeginBufferedPlayback(char *BufferStart, - // int32_t BufferSize, int32_t NumDivisions, unsigned SampleRate, + // int32_t BufferSize, int32_t NumDivisions, uint32_t SampleRate, // int32_t MixMode, void(*CallBackFunc)(void)) int32_t DSL_BeginBufferedPlayback(char *BufferStart, int32_t(*CallBackFunc)(int32_t), int32_t BufferSize, int32_t NumDivisions) { @@ -255,7 +255,7 @@ void DSL_StopPlayback(void) mixer_initialized = 0; } -unsigned DSL_GetPlaybackRate(void) +uint32_t DSL_GetPlaybackRate(void) { return _DSL_SampleRate; } diff --git a/polymer/eduke32/source/jaudiolib/dsl.h b/polymer/eduke32/source/jaudiolib/dsl.h index ec09b43da..64b942137 100644 --- a/polymer/eduke32/source/jaudiolib/dsl.h +++ b/polymer/eduke32/source/jaudiolib/dsl.h @@ -45,7 +45,7 @@ int32_t RestoreInterrupts(int32_t); int32_t DSL_Init(int32_t soundcard, int32_t mixrate, int32_t numchannels, int32_t samplebits, int32_t buffersize); void DSL_StopPlayback( void ); -unsigned DSL_GetPlaybackRate( void ); +uint32_t DSL_GetPlaybackRate( void ); int32_t DSL_BeginBufferedPlayback(char *BufferStart, int32_t (*CallBackFunc)(int32_t), int32_t buffersize, int32_t numdivisions); void DSL_Shutdown( void ); diff --git a/polymer/eduke32/source/jaudiolib/dsoundout.c b/polymer/eduke32/source/jaudiolib/dsoundout.c index 44c7c6d66..5c9f7f500 100644 --- a/polymer/eduke32/source/jaudiolib/dsoundout.c +++ b/polymer/eduke32/source/jaudiolib/dsoundout.c @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //------------------------------------------------------------------------- -#include "dsound.h" +#include #include "dsoundout.h" #define WIN32_LEAN_AND_MEAN diff --git a/polymer/eduke32/source/jaudiolib/fx_man.c b/polymer/eduke32/source/jaudiolib/fx_man.c index 8c4b5ce40..49031f562 100644 --- a/polymer/eduke32/source/jaudiolib/fx_man.c +++ b/polymer/eduke32/source/jaudiolib/fx_man.c @@ -41,7 +41,7 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com) #define FALSE ( !TRUE ) #endif -static unsigned FX_MixRate; +static uint32_t FX_MixRate; static char tempbuf[2048]; extern void initprintf(const char *, ...); @@ -255,7 +255,7 @@ int32_t FX_Init int32_t numvoices, int32_t numchannels, int32_t samplebits, - unsigned mixrate + uint32_t mixrate ) { @@ -895,7 +895,7 @@ int32_t FX_PlayRaw ( char *ptr, uint32_t length, - unsigned rate, + uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, @@ -931,7 +931,7 @@ int32_t FX_PlayLoopedRaw uint32_t length, char *loopstart, char *loopend, - unsigned rate, + uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, diff --git a/polymer/eduke32/source/jaudiolib/fx_man.h b/polymer/eduke32/source/jaudiolib/fx_man.h index d20c16636..e0393a123 100644 --- a/polymer/eduke32/source/jaudiolib/fx_man.h +++ b/polymer/eduke32/source/jaudiolib/fx_man.h @@ -83,7 +83,7 @@ char *FX_ErrorString( int32_t ErrorNumber ); //int32_t FX_SetupCard( int32_t SoundCard, fx_device *device ); //int32_t FX_GetBlasterSettings( fx_blaster_config *blaster ); //int32_t FX_SetupSoundBlaster( fx_blaster_config blaster, int32_t *MaxVoices, int32_t *MaxSampleBits, int32_t *MaxChannels ); -int32_t FX_Init( int32_t SoundCard, int32_t numvoices, int32_t numchannels, int32_t samplebits, unsigned mixrate ); +int32_t FX_Init( int32_t SoundCard, int32_t numvoices, int32_t numchannels, int32_t samplebits, uint32_t mixrate ); int32_t FX_Shutdown( void ); int32_t FX_SetCallBack( void ( *function )( uint32_t ) ); void FX_SetVolume( int32_t volume ); @@ -122,11 +122,11 @@ int32_t FX_PlayVOC3D( char *ptr, int32_t pitchoffset, int32_t angle, int32_t dis int32_t priority, uint32_t callbackval ); int32_t FX_PlayWAV3D( char *ptr, int32_t pitchoffset, int32_t angle, int32_t distance, int32_t priority, uint32_t callbackval ); -int32_t FX_PlayRaw( char *ptr, uint32_t length, unsigned rate, +int32_t FX_PlayRaw( char *ptr, uint32_t length, uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval ); int32_t FX_PlayLoopedRaw( char *ptr, uint32_t length, char *loopstart, - char *loopend, unsigned rate, int32_t pitchoffset, int32_t vol, int32_t left, + char *loopend, uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval ); int32_t FX_Pan3D( int32_t handle, int32_t angle, int32_t distance ); int32_t FX_SoundActive( int32_t handle ); diff --git a/polymer/eduke32/source/jaudiolib/fx_man_fmod.h b/polymer/eduke32/source/jaudiolib/fx_man_fmod.h index 8a44dfbce..0d8ea5449 100644 --- a/polymer/eduke32/source/jaudiolib/fx_man_fmod.h +++ b/polymer/eduke32/source/jaudiolib/fx_man_fmod.h @@ -40,7 +40,7 @@ enum FX_ERRORS char *FX_ErrorString( int32_t ErrorNumber ); -int32_t FX_Init( int32_t SoundCard, int32_t numvoices, int32_t numchannels, int32_t samplebits, unsigned mixrate ); +int32_t FX_Init( int32_t SoundCard, int32_t numvoices, int32_t numchannels, int32_t samplebits, uint32_t mixrate ); int32_t FX_Shutdown( void ); int32_t FX_SetCallBack( void ( *function )( uint32_t ) ); void FX_SetVolume( int32_t volume ); diff --git a/polymer/eduke32/source/jaudiolib/midi.c b/polymer/eduke32/source/jaudiolib/midi.c index 1333f924a..870665a11 100644 --- a/polymer/eduke32/source/jaudiolib/midi.c +++ b/polymer/eduke32/source/jaudiolib/midi.c @@ -71,12 +71,12 @@ static int32_t _MIDI_Division; static int32_t _MIDI_Tick = 0; static int32_t _MIDI_Beat = 1; static int32_t _MIDI_Measure = 1; -static unsigned _MIDI_Time; +static uint32_t _MIDI_Time; static int32_t _MIDI_BeatsPerMeasure; static int32_t _MIDI_TicksPerBeat; static int32_t _MIDI_TimeBase; static int32_t _MIDI_FPSecondsPerTick; -static unsigned _MIDI_TotalTime; +static uint32_t _MIDI_TotalTime; static int32_t _MIDI_TotalTicks; static int32_t _MIDI_TotalBeats; static int32_t _MIDI_TotalMeasures; diff --git a/polymer/eduke32/source/jaudiolib/multivoc.c b/polymer/eduke32/source/jaudiolib/multivoc.c index 267956414..c5ecd90cf 100644 --- a/polymer/eduke32/source/jaudiolib/multivoc.c +++ b/polymer/eduke32/source/jaudiolib/multivoc.c @@ -252,9 +252,9 @@ char *MV_ErrorString(int32_t ErrorNumber) ---------------------------------------------------------------------*/ #if defined(_WIN32) #define BASEBUFSZ (512+128) -static uint32_t MV_GetBufferSize(unsigned samplerate) +static uint32_t MV_GetBufferSize(uint32_t samplerate) { - static unsigned lastsr = 0, lastbufsz = 0; + static uint32_t lastsr = 0, lastbufsz = 0; if (samplerate == lastsr) return lastbufsz; @@ -370,7 +370,7 @@ static void MV_Mix(VoiceNode *voice, int32_t buffer) void MV_PlayVoice(VoiceNode *voice) { - unsigned flags; + uint32_t flags; flags = DisableInterrupts(); LL_SortedInsertion(&VoiceList, voice, prev, next, VoiceNode, priority); @@ -543,9 +543,9 @@ static playbackstatus MV_GetNextVOCBlock(VoiceNode *voice) int32_t packtype; int32_t voicemode; int32_t done; - unsigned BitsPerSample; - unsigned Channels; - unsigned Format; + uint32_t BitsPerSample; + uint32_t Channels; + uint32_t Format; if (voice->BlockLength > 0) { @@ -1007,7 +1007,7 @@ static void MV_ServiceRecord(void) VoiceNode *MV_GetVoice(int32_t handle) { VoiceNode *voice; - unsigned flags; + uint32_t flags; flags = DisableInterrupts(); @@ -1092,7 +1092,7 @@ int32_t MV_KillAllVoices(void) int32_t MV_Kill(int32_t handle) { VoiceNode *voice; - unsigned flags; + uint32_t flags; uint32_t callbackval; if (!MV_Installed) @@ -1136,7 +1136,7 @@ int32_t MV_VoicesPlaying(void) { VoiceNode *voice; int32_t NumVoices = 0; - unsigned flags; + uint32_t flags; if (!MV_Installed) { @@ -1167,7 +1167,7 @@ VoiceNode *MV_AllocVoice(int32_t priority) { VoiceNode *voice; VoiceNode *node; - unsigned flags; + uint32_t flags; //return(NULL); if (MV_Recording) @@ -1235,7 +1235,7 @@ int32_t MV_VoiceAvailable(int32_t priority) { VoiceNode *voice; VoiceNode *node; - unsigned flags; + uint32_t flags; // Check if we have any free voices if (!LL_Empty(&VoicePool, next, prev)) @@ -1370,7 +1370,7 @@ static int16_t *MV_GetVolumeTable(int32_t vol) static void MV_SetVoiceMixMode(VoiceNode *voice) { - unsigned flags; + uint32_t flags; int32_t test; flags = DisableInterrupts(); @@ -1524,7 +1524,7 @@ void MV_SetVoiceVolume(VoiceNode *voice, int32_t vol, int32_t left, int32_t righ int32_t MV_EndLooping(int32_t handle) { VoiceNode *voice; - unsigned flags; + uint32_t flags; if (!MV_Installed) { @@ -1865,7 +1865,7 @@ void MV_StopPlayback(void) { VoiceNode *voice; VoiceNode *next; - unsigned flags; + uint32_t flags; // Stop sound playback #if defined(_WIN32) @@ -2030,7 +2030,7 @@ int32_t MV_StartDemandFeedPlayback(void(*function)(char **ptr, uint32_t *length) priority. ---------------------------------------------------------------------*/ -int32_t MV_PlayRaw(char *ptr, uint32_t length, unsigned rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval) +int32_t MV_PlayRaw(char *ptr, uint32_t length, uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval) { int32_t status; @@ -2047,7 +2047,7 @@ int32_t MV_PlayRaw(char *ptr, uint32_t length, unsigned rate, int32_t pitchoffse priority. ---------------------------------------------------------------------*/ -int32_t MV_PlayLoopedRaw(char *ptr, int32_t length, char *loopstart, char *loopend, unsigned rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval) +int32_t MV_PlayLoopedRaw(char *ptr, int32_t length, char *loopstart, char *loopend, uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval) { VoiceNode *voice; @@ -2732,7 +2732,7 @@ int32_t MV_GetReverseStereo(void) int32_t MV_TestPlayback(void) { - unsigned flags; + uint32_t flags; int32_t time; int32_t start; int32_t status; @@ -2935,7 +2935,7 @@ int32_t MV_Init(int32_t soundcard, int32_t MixRate, int32_t Voices, int32_t numc int32_t MV_Shutdown(void) { int32_t buffer; - unsigned flags; + uint32_t flags; if (!MV_Installed) { diff --git a/polymer/eduke32/source/jaudiolib/multivoc.h b/polymer/eduke32/source/jaudiolib/multivoc.h index 402a994bd..3cf232abd 100644 --- a/polymer/eduke32/source/jaudiolib/multivoc.h +++ b/polymer/eduke32/source/jaudiolib/multivoc.h @@ -91,10 +91,10 @@ int32_t MV_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t * int32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval ); int32_t MV_PlayRaw( char *ptr, uint32_t length, - unsigned rate, int32_t pitchoffset, int32_t vol, int32_t left, + uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval ); int32_t MV_PlayLoopedRaw( char *ptr, int32_t length, - char *loopstart, char *loopend, unsigned rate, int32_t pitchoffset, + char *loopstart, char *loopend, uint32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval ); int32_t MV_PlayWAV( char *ptr, int32_t pitchoffset, int32_t vol, int32_t left, diff --git a/polymer/eduke32/source/jaudiolib/openal.c b/polymer/eduke32/source/jaudiolib/openal.c index dc9df4938..8bc78c9e9 100644 --- a/polymer/eduke32/source/jaudiolib/openal.c +++ b/polymer/eduke32/source/jaudiolib/openal.c @@ -20,9 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //------------------------------------------------------------------------- -#ifdef _WIN32 -#include "dsound.h" -#endif #include "baselayer.h" #include "compat.h" diff --git a/polymer/eduke32/source/jaudiolib/openal.h b/polymer/eduke32/source/jaudiolib/openal.h index b6a558e68..ff96ec21e 100644 --- a/polymer/eduke32/source/jaudiolib/openal.h +++ b/polymer/eduke32/source/jaudiolib/openal.h @@ -42,9 +42,9 @@ int32_t openal_disabled; typedef struct sounddef { - unsigned pos; + uint32_t pos; char *ptrsnd; - unsigned size; + uint32_t size; OggVorbis_File oggStream; } sounddef; #endif diff --git a/polymer/eduke32/source/jmact/keyboard.c b/polymer/eduke32/source/jmact/keyboard.c index 6a2377ebf..1b6083325 100644 --- a/polymer/eduke32/source/jmact/keyboard.c +++ b/polymer/eduke32/source/jmact/keyboard.c @@ -235,7 +235,7 @@ void KB_ClearKeysDown(void) char *KB_ScanCodeToString(kb_scancode scancode) { - unsigned s; + uint32_t s; for (s=0; s < (sizeof(sctokeylut)/sizeof(sctokeylut[0])); s++) if (sctokeylut[s].sc == scancode) return sctokeylut[s].key; @@ -245,7 +245,7 @@ char *KB_ScanCodeToString(kb_scancode scancode) kb_scancode KB_StringToScanCode(char * string) { - unsigned s; + uint32_t s; for (s=0; s < (sizeof(sctokeylut)/sizeof(sctokeylut[0])); s++) if (!Bstrcasecmp(sctokeylut[s].key, string)) return sctokeylut[s].sc; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 4497c18a4..37ea7c15d 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -3718,7 +3718,7 @@ cheat_for_port_credits: mgametextpal(40,118+9+9+9+9,"Advanced mouse setup",MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2+2+2),10); { - int32_t sense = CONTROL_MouseSensitivity * 2; + int32_t sense = (int32_t)(CONTROL_MouseSensitivity * 2.0f); barsm(248,126,&sense,2,x==(MAXMOUSEBUTTONS-2)*2+2,MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2),PHX(-7)); CONTROL_MouseSensitivity = sense / 2.0f; } diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index 53317522b..a6bf67890 100644 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -79,6 +79,10 @@ extern char TEXCACHEFILE[]; extern int32_t g_noSetup; +#ifdef INPUT_MOUSE +#undef INPUT_MOUSE +#endif + #define INPUT_KB 0 #define INPUT_MOUSE 1 #define INPUT_JOYSTICK 2