mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Emit RPG_EXPLODE, PIPEBOMB_EXPODE and LASERTRIP_EXPLODE from the actual EXPLOSION2 sprite instead of whatever spawned EXPLOSION2, to prevent the sound from being owned by whatever sprite happens to spawn with the ID the RPG/pipebomb/whatever had before it was removed
Add brightness/gamma/contrast cvars to Mapster32 Fix bug with WEAPON_SEMIAUTO flag for custom weapons Fix VM error with starttrack when specifying an invalid music track Fix detection of 0x1a EOF characters in CON files Fix a couple of additional sound issues Fix crash in pushmove() Fix Mapster32 textured 2D mode display being a few pixels off from the actual lines drawn Fix crash when clicking "cancel" in Mapster32 startup window Add Makefile detection to build with -march=pentium3 -mtune=generic on i686 git-svn-id: https://svn.eduke32.com/eduke32@1665 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a346acfccb
commit
013ac85e2d
21 changed files with 221 additions and 335 deletions
|
@ -44,14 +44,16 @@ o=o
|
|||
|
||||
ifneq (0,$(RELEASE))
|
||||
# Debugging disabled
|
||||
debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL)
|
||||
debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL) -fno-stack-protector
|
||||
LIBS=-lm
|
||||
else
|
||||
# Debugging enabled
|
||||
debug=-ggdb -O0 -DDEBUGGINGAIDS
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
debug+=-fno-inline -fno-inline-functions -fno-inline-functions-called-once
|
||||
debug+=-DKRANDDEBUG=1
|
||||
endif
|
||||
debug=-ggdb -O0 -DDEBUGGINGAIDS -fstack-protector-all
|
||||
LIBS=-lm -lssp -Wl,--enable-auto-import
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
debug+=-fno-inline -fno-inline-functions -fno-inline-functions-called-once
|
||||
debug+=-DKRANDDEBUG=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (0,$(DEBUGANYWAY))
|
||||
|
@ -70,30 +72,12 @@ AS=nasm
|
|||
RC=windres
|
||||
STRIP=strip
|
||||
|
||||
GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1)
|
||||
GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2)
|
||||
|
||||
ifeq (4,$(GCC_MAJOR))
|
||||
ifneq (0,$(GCC_MINOR))
|
||||
# debug += -ftree-vectorize
|
||||
ifneq (1,$(GCC_MINOR))
|
||||
ifneq (2,$(GCC_MINOR))
|
||||
# debug += -finline-small-functions -fpredictive-commoning
|
||||
endif
|
||||
endif
|
||||
ifeq (5,$(GCC_MINOR))
|
||||
# debug += -flto
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
|
||||
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS \
|
||||
-I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(JAUDIOLIBDIR)/include -I$(ENETDIR)/include -D_FORTIFY_SOURCE=2 \
|
||||
-fjump-tables -fno-stack-protector
|
||||
# -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse
|
||||
-fjump-tables $(ARCH)
|
||||
|
||||
OURCXXFLAGS=-fno-exceptions -fno-rtti
|
||||
LIBS=-lm
|
||||
|
||||
NASMFLAGS = -s
|
||||
EXESUFFIX=
|
||||
|
@ -244,7 +228,7 @@ endif
|
|||
|
||||
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB)
|
||||
$(LINK_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STDCPPLIB) $(MISCLINKOPTS); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
ifeq (1,$(RELEASE))
|
||||
ifeq (0,$(DEBUGANYWAY))
|
||||
$(STRIP) mapster32$(EXESUFFIX)
|
||||
|
|
|
@ -70,14 +70,16 @@ asm=nasm
|
|||
# Debugging and release
|
||||
#
|
||||
ifneq ($(RELEASE),0)
|
||||
# Debugging disabled
|
||||
debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL)
|
||||
# Debugging disabled
|
||||
debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL) -fno-stack-protector
|
||||
LIBS=-lm
|
||||
else
|
||||
# Debugging enabled
|
||||
debug=-ggdb -O0 -DDEBUGGINGAIDS -DNOSDLPARACHUTE
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
debug+=-DKRANDDEBUG=1
|
||||
endif
|
||||
# Debugging enabled
|
||||
debug=-ggdb -O0 -DDEBUGGINGAIDS -DNOSDLPARACHUTE -fstack-protector-all
|
||||
LIBS=-lm -lssp -Wl,--enable-auto-import
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
debug+=-DKRANDDEBUG=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (0,$(DEBUGANYWAY))
|
||||
|
@ -91,31 +93,11 @@ RC=windres
|
|||
AR=ar
|
||||
RANLIB=ranlib
|
||||
|
||||
GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1)
|
||||
GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2)
|
||||
|
||||
ifeq (4,$(GCC_MAJOR))
|
||||
# debug += -ftree-vectorize
|
||||
ifneq (0,$(GCC_MINOR))
|
||||
ifneq (1,$(GCC_MINOR))
|
||||
ifneq (2,$(GCC_MINOR))
|
||||
# this should only enable for 4.3.0 and later
|
||||
# debug += -finline-small-functions -fpredictive-commoning
|
||||
endif
|
||||
endif
|
||||
ifeq (5,$(GCC_MINOR))
|
||||
# debug += -flto
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
|
||||
-Wno-char-subscripts -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS \
|
||||
-DKSFORBUILD -I$(INC) -D_FORTIFY_SOURCE=2 \
|
||||
-fjump-tables -fno-stack-protector
|
||||
# -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse
|
||||
-fjump-tables $(ARCH)
|
||||
OURCXXFLAGS=-fno-exceptions -fno-rtti
|
||||
LIBS=
|
||||
ASFLAGS=-s #-g
|
||||
EXESUFFIX=
|
||||
|
||||
|
@ -171,7 +153,6 @@ EDITOROBJS=$(OBJ)/build.$o \
|
|||
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
ASFLAGS+= -f elf
|
||||
LIBS+= -lm
|
||||
endif
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o \
|
||||
|
@ -183,20 +164,16 @@ endif
|
|||
ifeq ($(PLATFORM),BSD)
|
||||
ASFLAGS+= -f elf
|
||||
OURCFLAGS+= -I/usr/X11R6/include
|
||||
LIBS+= -lm
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OURCFLAGS+= -DUNDERSCORES -I$(DXROOT)/include -I$(FMODROOTWIN)/inc # -I$(ENETROOT)/include
|
||||
LIBS+= -lm -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT)
|
||||
LIBS+= -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT)
|
||||
ASFLAGS+= -DUNDERSCORES -f win32
|
||||
endif
|
||||
ifeq ($(PLATFORM),BEOS)
|
||||
ASFLAGS+= -f elf
|
||||
TARGETOPTS+= -DNOASM
|
||||
endif
|
||||
ifeq ($(PLATFORM),SUNOS)
|
||||
LIBS+= -lm
|
||||
endif
|
||||
ifeq ($(PLATFORM),SYLLABLE)
|
||||
ASFLAGS+= -f elf
|
||||
endif
|
||||
|
|
|
@ -16,9 +16,16 @@ SDL_FRAMEWORK = 0
|
|||
|
||||
# Overridden for OSes that don't have the cutdown stdc++ that is supc++
|
||||
STDCPPLIB=-lsupc++
|
||||
|
||||
BUILDCFLAGS=
|
||||
|
||||
ifndef ARCH
|
||||
ifeq ($(findstring i686, $(shell uname -m)), i686)
|
||||
ARCH=-march=pentium3 -mtune=generic -mmmx # -msse2 -mfpmath=sse,387 -malign-double -mstackrealign
|
||||
else
|
||||
ARCH=
|
||||
endif
|
||||
endif
|
||||
|
||||
# Detect the platform if it wasn't explicitly given to us from
|
||||
# the outside world. This allows cross-compilation by overriding
|
||||
# CC and giving us PLATFORM specifically.
|
||||
|
|
|
@ -149,12 +149,14 @@ void showframe(int32_t);
|
|||
int32_t setpalette(int32_t start, int32_t num);
|
||||
//int32_t getpalette(int32_t start, int32_t num, char *dapal);
|
||||
int32_t setgamma(void);
|
||||
double vid_gamma, vid_contrast, vid_brightness;
|
||||
extern double vid_gamma, vid_contrast, vid_brightness;
|
||||
|
||||
#define DEFAULT_GAMMA 1.0
|
||||
#define DEFAULT_CONTRAST 1.0
|
||||
#define DEFAULT_BRIGHTNESS 0.0
|
||||
|
||||
#define GAMMA_CALC (int32_t)(min(max((float)((vid_gamma-1.0)*10.0),0),15))
|
||||
|
||||
int32_t switchrendermethod(int32_t,int32_t); // 0 = software, 1 = opengl | bool = reinit
|
||||
|
||||
int32_t wm_msgbox(char *name, char *fmt, ...);
|
||||
|
|
|
@ -25,6 +25,8 @@ void(*keypresscallback)(int32_t,int32_t) = 0;
|
|||
void(*mousepresscallback)(int32_t,int32_t) = 0;
|
||||
void(*joypresscallback)(int32_t,int32_t) = 0;
|
||||
|
||||
extern int16_t brightness;
|
||||
|
||||
//
|
||||
// set{key|mouse|joy}presscallback() -- sets a callback which gets notified when keys are pressed
|
||||
//
|
||||
|
@ -270,25 +272,37 @@ int32_t osdcmd_glinfo(const osdfuncparm_t *parm)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static int32_t osdcmd_vars(const osdfuncparm_t *parm)
|
||||
static int32_t osdcmd_cvar_set_baselayer(const osdfuncparm_t *parm)
|
||||
{
|
||||
int32_t showval = (parm->numparms < 1);
|
||||
int32_t r = osdcmd_cvar_set(parm);
|
||||
|
||||
if (!Bstrcasecmp(parm->name, "r_scrcaptureformat"))
|
||||
{
|
||||
const char *fmts[] = {"TGA", "PCX"};
|
||||
if (showval) { OSD_Printf("r_scrcaptureformat is %s\n", fmts[captureformat]); }
|
||||
else
|
||||
if (r != OSDCMD_OK) return r;
|
||||
|
||||
/*
|
||||
if (!Bstrcasecmp(parm->name, "r_scrcaptureformat"))
|
||||
{
|
||||
int32_t j;
|
||||
for (j=0; j<2; j++)
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (j == 2) return OSDCMD_SHOWHELP;
|
||||
captureformat = j;
|
||||
const char *fmts[] = {"TGA", "PCX"};
|
||||
if (showval) { OSD_Printf("r_scrcaptureformat is %s\n", fmts[captureformat]); }
|
||||
else
|
||||
{
|
||||
int32_t j;
|
||||
for (j=0; j<2; j++)
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (j == 2) return OSDCMD_SHOWHELP;
|
||||
captureformat = j;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
else */
|
||||
|
||||
if (!Bstrcasecmp(parm->name, "vid_gamma") || !Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast"))
|
||||
{
|
||||
setbrightness(GAMMA_CALC,palette,0);
|
||||
|
||||
return r;
|
||||
}
|
||||
return OSDCMD_SHOWHELP;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int32_t baselayer_init(void)
|
||||
|
@ -300,7 +314,10 @@ int32_t baselayer_init(void)
|
|||
#ifdef SUPERBUILD
|
||||
{ "r_novoxmips","r_novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",(void *)&novoxmips, CVAR_BOOL, 0, 1 },
|
||||
{ "r_voxels","r_voxels: enable/disable automatic sprite->voxel rendering",(void *)&usevoxels, CVAR_BOOL, 0, 1 },
|
||||
{ "r_scrcaptureformat","r_scrcaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars, CVAR_FUNCPTR, 0, 0 },
|
||||
/* { "r_scrcaptureformat","r_scrcaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars, CVAR_FUNCPTR, 0, 0 },*/
|
||||
{ "vid_gamma","vid_gamma <gamma>: adjusts gamma ramp",(void *)&vid_gamma, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_contrast","vid_contrast <gamma>: adjusts gamma ramp",(void *)&vid_contrast, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_brightness","vid_brightness <gamma>: adjusts gamma ramp",(void *)&vid_brightness, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -310,7 +327,7 @@ int32_t baselayer_init(void)
|
|||
continue;
|
||||
|
||||
OSD_RegisterFunction(cvars_engine[i].name, cvars_engine[i].helpstr,
|
||||
cvars_engine[i].type == CVAR_FUNCPTR ? cvars_engine[i].var : osdcmd_cvar_set);
|
||||
(cvars_engine[i].type & CVAR_FUNCPTR) ? osdcmd_cvar_set_baselayer : osdcmd_cvar_set);
|
||||
}
|
||||
|
||||
#ifdef POLYMOST
|
||||
|
|
|
@ -93,7 +93,6 @@ int32_t forcesetup = 1;
|
|||
extern int32_t cachesize, artsize;
|
||||
|
||||
static int16_t oldmousebstatus = 0;
|
||||
int16_t brightness = 0;
|
||||
char game_executable[BMAX_PATH] = DEFAULT_GAME_LOCAL_EXEC;
|
||||
int32_t zlock = 0x7fffffff, zmode = 0, whitecol, kensplayerheight = 32;
|
||||
int16_t defaultspritecstat = 0;
|
||||
|
@ -287,7 +286,7 @@ static int32_t osdcmd_vidmode(const osdfuncparm_t *parm)
|
|||
|
||||
begindrawing(); //{{{
|
||||
|
||||
CLEARLINES2D(0, ydim16+STATUS2DSIZ, 0);
|
||||
CLEARLINES2D(0, ydim16, 0);
|
||||
|
||||
ydim16 = ydim;
|
||||
// drawline16(0,ydim-STATUS2DSIZ,xdim-1,ydim-STATUS2DSIZ,editorcolors[1]);
|
||||
|
@ -418,7 +417,11 @@ int32_t app_main(int32_t argc, const char **argv)
|
|||
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
|
||||
if (i || forcesetup || cmdsetup)
|
||||
{
|
||||
if (quitevent || !startwin_run()) return -1;
|
||||
if (quitevent || !startwin_run())
|
||||
{
|
||||
uninitengine();
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -483,8 +486,10 @@ int32_t app_main(int32_t argc, const char **argv)
|
|||
|
||||
if (cursectnum == -1)
|
||||
{
|
||||
double gamma = vid_gamma;
|
||||
vid_gamma = 1.0;
|
||||
double gamma = vid_gamma, brightness = vid_brightness, contrast = vid_contrast;
|
||||
vid_gamma = vid_contrast = 1.0;
|
||||
vid_brightness = 0.0;
|
||||
|
||||
setbrightness(0,palette,0);
|
||||
if (setgamemode(fullscreen, xdim2d, ydim2d, 8) < 0)
|
||||
{
|
||||
|
@ -496,7 +501,10 @@ int32_t app_main(int32_t argc, const char **argv)
|
|||
overheadeditor();
|
||||
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
||||
vid_gamma = gamma;
|
||||
setbrightness(brightness,palette,0);
|
||||
vid_contrast = contrast;
|
||||
vid_brightness = brightness;
|
||||
|
||||
setbrightness(GAMMA_CALC,palette,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -507,7 +515,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
|||
Bprintf("%d * %d not supported in this graphics mode\n",xdim,ydim);
|
||||
exit(0);
|
||||
}
|
||||
setbrightness(brightness,palette,0);
|
||||
setbrightness(GAMMA_CALC,palette,0);
|
||||
}
|
||||
CANCEL:
|
||||
quitflag = 0;
|
||||
|
@ -1174,16 +1182,23 @@ void editinput(void)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if (keystatus[buildkeys[BK_MODE2D_3D]]) // Enter
|
||||
{
|
||||
double gamma = vid_gamma;
|
||||
vid_gamma = 1.0;
|
||||
|
||||
double gamma = vid_gamma, contrast = vid_contrast, brightness = vid_brightness;
|
||||
vid_gamma = vid_contrast = 1.0;
|
||||
vid_brightness = 0.0;
|
||||
|
||||
setbrightness(0,palette,0);
|
||||
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
||||
overheadeditor();
|
||||
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
||||
vid_gamma = gamma;
|
||||
setbrightness(brightness,palette,0);
|
||||
vid_contrast = contrast;
|
||||
vid_brightness = brightness;
|
||||
|
||||
setbrightness(GAMMA_CALC,palette,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1432,7 +1447,8 @@ void overheadeditor(void)
|
|||
wall[newnumwalls].y = day;
|
||||
}
|
||||
|
||||
ydim16 = ydim - STATUS2DSIZ2;
|
||||
ydim16 = ydim;// - STATUS2DSIZ2;
|
||||
midydim16 = ydim>>1;
|
||||
|
||||
tempint = numwalls;
|
||||
numwalls = newnumwalls;
|
||||
|
@ -1447,19 +1463,13 @@ void overheadeditor(void)
|
|||
|
||||
if (graphicsmode)
|
||||
{
|
||||
int32_t ii = xyaspect;
|
||||
|
||||
i = yxaspect;
|
||||
Bmemset(show2dsector, 255, sizeof(show2dsector));
|
||||
setview(0, 0, xdim-1, ydim16-1);
|
||||
yxaspect = xyaspect = 65536;
|
||||
|
||||
if (graphicsmode == 2)
|
||||
totalclocklock = totalclock;
|
||||
|
||||
drawmapview(pos.x, pos.y + scale((65536/zoom), ydim, 240), zoom, 1536);
|
||||
yxaspect = i;
|
||||
xyaspect = ii;
|
||||
drawmapview(pos.x, pos.y, zoom, 1536);
|
||||
}
|
||||
|
||||
draw2dgrid(pos.x,pos.y,ang,zoom,grid);
|
||||
|
@ -4604,7 +4614,7 @@ CANCEL:
|
|||
exit(0);
|
||||
}
|
||||
|
||||
setbrightness(brightness,palette,0);
|
||||
setbrightness(GAMMA_CALC,palette,0);
|
||||
|
||||
pos.z = oposz;
|
||||
searchx = scale(searchx,xdimgame,xdim2d);
|
||||
|
@ -5356,7 +5366,7 @@ static int32_t menuselect_pk(int32_t direction) // 20080104: jump to next (direc
|
|||
|
||||
static int32_t menuselect(void)
|
||||
{
|
||||
int32_t listsize = (ydim16-32)/9;
|
||||
int32_t listsize;
|
||||
int32_t i;
|
||||
char ch, buffer[96], /*PK*/ *chptr;
|
||||
static char oldpath[BMAX_PATH];
|
||||
|
@ -5387,6 +5397,7 @@ static int32_t menuselect(void)
|
|||
enddrawing();
|
||||
|
||||
ydim16 = ydim-STATUS2DSIZ2;
|
||||
listsize = (ydim16-32)/9;
|
||||
|
||||
do
|
||||
{
|
||||
|
|
|
@ -150,12 +150,9 @@ int32_t loadsetup(const char *fn)
|
|||
#ifdef POLYMER
|
||||
if (readconfig(fp, "rendmode", val, VL) > 0) { i = Batoi(val); glrendmode = i; }
|
||||
#endif
|
||||
if (readconfig(fp, "brightness", val, VL) > 0)
|
||||
{
|
||||
brightness = min(max(Batoi(val),0),15);
|
||||
vid_gamma = 1.0 + ((float)brightness / 10.0);
|
||||
}
|
||||
|
||||
if (readconfig(fp, "vid_gamma", val, VL) > 0) vid_gamma = Bstrtod(val, NULL);
|
||||
if (readconfig(fp, "vid_brightness", val, VL) > 0) vid_brightness = Bstrtod(val, NULL);
|
||||
if (readconfig(fp, "vid_contrast", val, VL) > 0) vid_contrast = Bstrtod(val, NULL);
|
||||
#ifdef RENDERTYPEWIN
|
||||
if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = Batoi(val);
|
||||
#endif
|
||||
|
@ -355,9 +352,9 @@ int32_t writesetup(const char *fn)
|
|||
"\n"
|
||||
#endif
|
||||
"; 3D mode brightness setting\n"
|
||||
"; 0 - lowest\n"
|
||||
"; 15 - highest\n"
|
||||
"brightness = %d\n"
|
||||
"vid_gamma = %f\n"
|
||||
"vid_brightness = %f\n"
|
||||
"vid_contrast = %f\n"
|
||||
"\n"
|
||||
"; Game executable used for map testing\n"
|
||||
"gameexecutable = %s\n"
|
||||
|
@ -493,7 +490,7 @@ int32_t writesetup(const char *fn)
|
|||
#ifdef RENDERTYPEWIN
|
||||
maxrefreshfreq, windowpos, windowx, windowy,
|
||||
#endif
|
||||
brightness, game_executable,
|
||||
vid_gamma, vid_brightness, vid_contrast, game_executable,
|
||||
#if 0
|
||||
option[7]>>4, option[2],
|
||||
#endif
|
||||
|
|
|
@ -9329,6 +9329,7 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum,
|
|||
bad = -1;
|
||||
k--; if (k <= 0) return(bad);
|
||||
updatesector(vect->x,vect->y,sectnum);
|
||||
if (*sectnum < 0) return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -165,7 +165,7 @@ int32_t OSD_RegisterCvar(const cvar_t *cvar)
|
|||
|
||||
cvars = (osdcvar_t *)Brealloc(cvars, (osdnumcvars + 1) * sizeof(osdcvar_t));
|
||||
|
||||
hash_add(&h_cvars, cvar->name, osdnumcvars);
|
||||
hash_replace(&h_cvars, cvar->name, osdnumcvars);
|
||||
|
||||
switch (cvar->type & (CVAR_BOOL|CVAR_INT|CVAR_UINT|CVAR_FLOAT|CVAR_DOUBLE))
|
||||
{
|
||||
|
@ -1841,11 +1841,13 @@ int32_t OSD_RegisterFunction(const char *name, const char *help, int32_t (*func)
|
|||
|
||||
if (symb) // allow this now for reusing an alias name
|
||||
{
|
||||
/*
|
||||
if (symb->func != OSD_ALIAS && symb->func != OSD_UNALIASED)
|
||||
{
|
||||
OSD_Printf("OSD_RegisterFunction(): \"%s\" is already defined\n", name);
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
Bfree((char *)symb->help);
|
||||
symb->help = help;
|
||||
symb->func = func;
|
||||
|
@ -1918,9 +1920,9 @@ static symbol_t *addnewsymbol(const char *name)
|
|||
newsymb->next = t;
|
||||
}
|
||||
}
|
||||
hash_add(&h_osd, name, osdnumsymbols);
|
||||
hash_replace(&h_osd, name, osdnumsymbols);
|
||||
name = Bstrtolower(Bstrdup(name));
|
||||
hash_add(&h_osd, name, osdnumsymbols);
|
||||
hash_replace(&h_osd, name, osdnumsymbols);
|
||||
Bfree((void *)name);
|
||||
osdsymbptrs[osdnumsymbols++] = newsymb;
|
||||
return newsymb;
|
||||
|
|
|
@ -4537,14 +4537,12 @@ static int32_t polymer_planeinlight(_prplane* plane, _prlight* light)
|
|||
|
||||
static void polymer_invalidateplanelights(_prplane* plane)
|
||||
{
|
||||
int32_t i = 0;
|
||||
int32_t i = -1;
|
||||
|
||||
while (i < plane->lightcount)
|
||||
while (++i < plane->lightcount)
|
||||
{
|
||||
if (plane && (plane->lights[i] != -1) && (prlights[plane->lights[i]].flags.active))
|
||||
prlights[plane->lights[i]].flags.invalidate = 1;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4561,21 +4559,15 @@ static void polymer_invalidatesectorlights(int16_t sectnum)
|
|||
polymer_invalidateplanelights(&s->floor);
|
||||
polymer_invalidateplanelights(&s->ceil);
|
||||
|
||||
i = 0;
|
||||
while (i < sec->wallnum)
|
||||
{
|
||||
w = prwalls[sec->wallptr + i];
|
||||
i = sec->wallnum;
|
||||
|
||||
if (!w) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
while (i--)
|
||||
{
|
||||
if (!(w = prwalls[sec->wallptr + i])) continue;
|
||||
|
||||
polymer_invalidateplanelights(&w->wall);
|
||||
polymer_invalidateplanelights(&w->over);
|
||||
polymer_invalidateplanelights(&w->mask);
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1663,12 +1663,12 @@ ACTOR_STATIC void G_MoveStandables(void)
|
|||
|
||||
if (T3 == 8)
|
||||
{
|
||||
A_PlaySound(LASERTRIP_EXPLODE,i);
|
||||
for (j=0; j<5; j++) RANDOMSCRAP;
|
||||
x = s->extra;
|
||||
A_RadiusDamage(i, g_tripbombBlastRadius, x>>2,x>>1,x-(x>>2),x);
|
||||
|
||||
j = A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(LASERTRIP_EXPLODE,j);
|
||||
sprite[j].ang = s->ang;
|
||||
sprite[j].xvel = 348;
|
||||
A_SetSprite(j,CLIPMASK0);
|
||||
|
@ -1838,9 +1838,9 @@ ACTOR_STATIC void G_MoveStandables(void)
|
|||
sprite[j].pal = 2;
|
||||
}
|
||||
|
||||
A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,i);
|
||||
A_PlaySound(GLASS_HEAVYBREAK,i);
|
||||
j = A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,j);
|
||||
A_PlaySound(GLASS_HEAVYBREAK,j);
|
||||
|
||||
if (s->hitag > 0)
|
||||
{
|
||||
|
@ -1854,9 +1854,9 @@ ACTOR_STATIC void G_MoveStandables(void)
|
|||
}
|
||||
|
||||
x = s->extra;
|
||||
A_Spawn(i,EXPLOSION2);
|
||||
A_RadiusDamage(i, g_pipebombBlastRadius,x>>2, x-(x>>1),x-(x>>2), x);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,i);
|
||||
j = A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,j);
|
||||
|
||||
goto DETONATE;
|
||||
}
|
||||
|
@ -1958,17 +1958,17 @@ DETONATE:
|
|||
|
||||
s->z -= (32<<8);
|
||||
|
||||
if ((t[3] == 1 && s->xrepeat) || s->lotag == -99)
|
||||
{
|
||||
x = s->extra;
|
||||
A_Spawn(i,EXPLOSION2);
|
||||
A_RadiusDamage(i,g_seenineBlastRadius,x>>2, x-(x>>1),x-(x>>2), x);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,i);
|
||||
}
|
||||
|
||||
if (s->xrepeat)
|
||||
for (x=0; x<8; x++) RANDOMSCRAP;
|
||||
|
||||
if ((t[3] == 1 && s->xrepeat) || s->lotag == -99)
|
||||
{
|
||||
int32_t j = A_Spawn(i,EXPLOSION2);
|
||||
x = s->extra;
|
||||
A_RadiusDamage(i,g_seenineBlastRadius,x>>2, x-(x>>1),x-(x>>2), x);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,j);
|
||||
}
|
||||
|
||||
KILLIT(i);
|
||||
}
|
||||
}
|
||||
|
@ -3027,6 +3027,7 @@ ACTOR_STATIC void G_MoveWeapons(void)
|
|||
if (s->picnum == RPG)
|
||||
{
|
||||
k = A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(RPG_EXPLODE,k);
|
||||
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
||||
|
||||
if (s->xrepeat < 10)
|
||||
|
@ -3045,7 +3046,6 @@ ACTOR_STATIC void G_MoveWeapons(void)
|
|||
}
|
||||
|
||||
}
|
||||
A_PlaySound(RPG_EXPLODE,i);
|
||||
|
||||
if (s->xrepeat >= 10)
|
||||
{
|
||||
|
@ -3788,7 +3788,8 @@ ACTOR_STATIC void G_MoveActors(void)
|
|||
{
|
||||
for (l=0; l<16; l++)
|
||||
RANDOMSCRAP;
|
||||
A_PlaySound(LASERTRIP_EXPLODE,i);
|
||||
j = A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(LASERTRIP_EXPLODE,j);
|
||||
A_Spawn(i,PIGCOP);
|
||||
g_player[myconnectindex].ps->actors_killed++;
|
||||
KILLIT(i);
|
||||
|
@ -4503,6 +4504,8 @@ DETONATEB:
|
|||
|
||||
if (t[2] == 2)
|
||||
{
|
||||
int32_t j;
|
||||
|
||||
x = s->extra;
|
||||
m = 0;
|
||||
switch (DynamicTileMap[s->picnum])
|
||||
|
@ -4519,10 +4522,10 @@ DETONATEB:
|
|||
}
|
||||
|
||||
A_RadiusDamage(i, m,x>>2,x>>1,x-(x>>2),x);
|
||||
A_Spawn(i,EXPLOSION2);
|
||||
j = A_Spawn(i,EXPLOSION2);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,j);
|
||||
if (s->zvel == 0)
|
||||
A_Spawn(i,EXPLOSION2BOT);
|
||||
A_PlaySound(PIPEBOMB_EXPLODE,i);
|
||||
for (x=0; x<8; x++)
|
||||
RANDOMSCRAP;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ sound_t g_sounds[MAXSOUNDS];
|
|||
static int16_t g_definedsndnum[MAXSOUNDS]; // maps parse order index to g_sounds index
|
||||
static int16_t g_sndnum[MAXSOUNDS]; // maps current order index to g_sounds index
|
||||
int32_t g_numsounds = 0;
|
||||
|
||||
static int32_t lastupdate, mousecol, mouseadd = 1, bstatus;
|
||||
|
||||
#if !defined(_WIN32)
|
||||
static int32_t usecwd = 0;
|
||||
|
@ -2536,10 +2536,6 @@ static void ReadGamePalette()
|
|||
ReadPaletteTable();
|
||||
}
|
||||
|
||||
static char lockbyte4094;
|
||||
|
||||
static int32_t lastupdate, mousecol, mouseadd = 1, bstatus;
|
||||
|
||||
static void m32_showmouse(void)
|
||||
{
|
||||
int32_t i, col;
|
||||
|
@ -3923,7 +3919,7 @@ ERROR_NOMEMORY:
|
|||
|
||||
static void Keys3d(void)
|
||||
{
|
||||
int32_t i,changedir,tsign; // ,count,nexti
|
||||
int32_t i = 0,changedir,tsign; // ,count,nexti
|
||||
int32_t j, k, tempint = 0, hiz, loz;
|
||||
int32_t hihit, lohit;
|
||||
char smooshyalign=0, repeatpanalign=0; //, buffer[80];
|
||||
|
@ -3932,23 +3928,6 @@ static void Keys3d(void)
|
|||
|
||||
/* start Mapster32 */
|
||||
|
||||
/*
|
||||
if (sidemode != 0)
|
||||
{
|
||||
setviewback();
|
||||
rotatesprite(320<<15,200<<15,65536,(horiz-100)<<2,4094,0,0,2+4,0,0,0,0);
|
||||
lockbyte4094 = 0;
|
||||
searchx = ydim-1-searchx;
|
||||
searchx ^= searchy;
|
||||
searchy ^= searchx;
|
||||
searchx ^= searchy;
|
||||
|
||||
// overwritesprite(160L,170L,1153,0,1+2,0);
|
||||
rotatesprite(160<<16,170<<16,65536,(100-horiz+1024)<<3,1153,0,0,2,0,0,0,0);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
if (g_numsounds > 0 && AmbienceToggle)
|
||||
{
|
||||
M32_MoveFX();
|
||||
|
@ -5847,7 +5826,7 @@ static void Keys3d(void)
|
|||
|
||||
if (PRESSED_KEYSC(F11)) //F11 - brightness
|
||||
{
|
||||
extern int16_t brightness;
|
||||
static int16_t brightness;
|
||||
|
||||
brightness = brightness + (1-2*eitherSHIFT);
|
||||
brightness &= 15;
|
||||
|
@ -7291,21 +7270,6 @@ static int32_t osdcmd_sensitivity(const osdfuncparm_t *parm)
|
|||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
static int32_t osdcmd_gamma(const osdfuncparm_t *parm)
|
||||
{
|
||||
extern int16_t brightness;
|
||||
|
||||
if (parm->numparms != 1)
|
||||
{
|
||||
OSD_Printf("\"gamma\" \"%d\"\n",brightness);
|
||||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
brightness = atoi(parm->parms[0]);
|
||||
setbrightness(brightness,palette,0);
|
||||
OSD_Printf("gamma %d\n",brightness);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
static int32_t osdcmd_noclip(const osdfuncparm_t *parm)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(parm);
|
||||
|
@ -7645,8 +7609,6 @@ static int32_t registerosdcommands(void)
|
|||
|
||||
OSD_RegisterFunction("editorgridextent","editorgridextent: sets the size of the 2D mode editing grid",osdcmd_editorgridextent);
|
||||
|
||||
OSD_RegisterFunction("gamma","gamma <value>: changes brightness", osdcmd_gamma);
|
||||
|
||||
OSD_RegisterFunction("initgroupfile","initgroupfile <path>: adds a grp file into the game filesystem", osdcmd_initgroupfile);
|
||||
|
||||
OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip);
|
||||
|
@ -8919,20 +8881,8 @@ void ExtPreCheckKeys(void) // just before drawrooms
|
|||
}
|
||||
|
||||
if (floor_over_floor) SE40Code(pos.x,pos.y,pos.z,ang,horiz);
|
||||
|
||||
if (purpleon) clearview(255);
|
||||
|
||||
if (sidemode)
|
||||
{
|
||||
lockbyte4094 = 1;
|
||||
if (waloff[4094] == 0)
|
||||
allocache(&waloff[4094],320L*200L,&lockbyte4094);
|
||||
setviewtotile(4094,320L,200L);
|
||||
searchx ^= searchy;
|
||||
searchy ^= searchx;
|
||||
searchx ^= searchy;
|
||||
searchx = ydim-1-searchx;
|
||||
}
|
||||
return;
|
||||
}
|
||||
begindrawing();
|
||||
|
@ -9475,12 +9425,9 @@ void ExtCheckKeys(void)
|
|||
if (qsetmode == 200) //In 3D mode
|
||||
{
|
||||
Keys3d();
|
||||
if (sidemode != 1)
|
||||
{
|
||||
editinput();
|
||||
if (infobox&2)
|
||||
m32_showmouse();
|
||||
}
|
||||
editinput();
|
||||
if (infobox&2)
|
||||
m32_showmouse();
|
||||
}
|
||||
else Keys2d();
|
||||
|
||||
|
@ -9524,7 +9471,7 @@ void faketimerhandler(void)
|
|||
// if (counter>=5) counter=0;
|
||||
|
||||
sampletimer();
|
||||
if (totalclock < ototalclock+TICSPERFRAME || qsetmode != 200 || sidemode != 1)
|
||||
if (totalclock < ototalclock+TICSPERFRAME || qsetmode != 200)
|
||||
return;
|
||||
ototalclock = totalclock;
|
||||
|
||||
|
@ -9588,34 +9535,32 @@ void faketimerhandler(void)
|
|||
if (horiz > 100) horiz--;
|
||||
}
|
||||
|
||||
extern int16_t brightness;
|
||||
|
||||
void SetBOSS1Palette(void)
|
||||
{
|
||||
if (acurpalette==3) return;
|
||||
acurpalette=3;
|
||||
setbrightness(brightness,BOSS1palette,0);
|
||||
setbrightness(GAMMA_CALC,BOSS1palette,0);
|
||||
}
|
||||
|
||||
void SetSLIMEPalette(void)
|
||||
{
|
||||
if (acurpalette==2) return;
|
||||
acurpalette=2;
|
||||
setbrightness(brightness,SLIMEpalette,0);
|
||||
setbrightness(GAMMA_CALC,SLIMEpalette,0);
|
||||
}
|
||||
|
||||
void SetWATERPalette(void)
|
||||
{
|
||||
if (acurpalette==1) return;
|
||||
acurpalette=1;
|
||||
setbrightness(brightness,WATERpalette,0);
|
||||
setbrightness(GAMMA_CALC,WATERpalette,0);
|
||||
}
|
||||
|
||||
void SetGAMEPalette(void)
|
||||
{
|
||||
if (acurpalette==0) return;
|
||||
acurpalette=0;
|
||||
setbrightness(brightness,GAMEpalette,0);
|
||||
setbrightness(GAMMA_CALC,GAMEpalette,0);
|
||||
}
|
||||
|
||||
static void SearchSectors(int32_t dir) // <0: backwards, >=0: forwards
|
||||
|
|
|
@ -37,8 +37,8 @@ extern int32_t S_LoadSound(uint32_t num);
|
|||
extern int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos);
|
||||
extern int32_t S_PlaySound(int32_t num);
|
||||
extern int32_t A_PlaySound(uint32_t num,int32_t i);
|
||||
extern void S_StopSound(int32_t num);
|
||||
extern void S_StopEnvSound(int32_t num,int32_t i);
|
||||
#define S_StopSound(num) S_StopEnvSound(num, -1)
|
||||
extern void S_Update(void);
|
||||
extern void S_Cleanup(void);
|
||||
extern void S_Callback(uint32_t num);
|
||||
|
|
|
@ -1191,6 +1191,7 @@ static int32_t C_SkipComments(void)
|
|||
case ' ':
|
||||
case '\t':
|
||||
case '\r':
|
||||
case 0x1a:
|
||||
textptr++;
|
||||
break;
|
||||
case '/':
|
||||
|
@ -1200,7 +1201,7 @@ static int32_t C_SkipComments(void)
|
|||
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug > 1)
|
||||
initprintf("%s:%d: debug: got comment.\n",g_szScriptFileName,g_lineNumber);
|
||||
C_NextLine();
|
||||
break;
|
||||
continue;
|
||||
case '*': // beginning of a C style comment
|
||||
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug > 1)
|
||||
initprintf("%s:%d: debug: got start of comment block.\n",g_szScriptFileName,g_lineNumber);
|
||||
|
@ -1220,22 +1221,22 @@ static int32_t C_SkipComments(void)
|
|||
initprintf("%s:%d: error: found `/*' with no `*/'.\n",g_szScriptFileName,g_lineNumber);
|
||||
g_parsingActorPtr = 0;g_processingState = g_numBraces = 0;
|
||||
g_numCompilerErrors++;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug > 1)
|
||||
initprintf("%s:%d: debug: got end of comment block.\n",g_szScriptFileName,g_lineNumber);
|
||||
|
||||
textptr+=2;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
continue;
|
||||
|
||||
default:
|
||||
if (ispecial(*textptr))
|
||||
{
|
||||
textptr++;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
case 0: // EOF
|
||||
return ((g_scriptPtr-script) > (g_scriptSize-32)) ? C_SetScriptSize(g_scriptSize<<1) : 0;
|
||||
|
|
|
@ -4199,7 +4199,6 @@ nullquote:
|
|||
if (MapInfo[(uint8_t)g_musicIndex].musicfn == NULL)
|
||||
{
|
||||
OSD_Printf(CON_ERROR "null music for map %d\n",g_errorLineNum,keyw[g_tw],g_musicIndex);
|
||||
insptr++;
|
||||
continue;
|
||||
}
|
||||
S_PlayMusic(&MapInfo[(uint8_t)g_musicIndex].musicfn[0],g_musicIndex);
|
||||
|
|
|
@ -380,8 +380,10 @@ void Gv_ResetVars(void) /* this is called during a new game and nowhere else */
|
|||
|
||||
for (i=0; i<MAXGAMEVARS; i++)
|
||||
{
|
||||
if (aGameVars[i].szLabel != NULL && aGameVars[i].dwFlags & GAMEVAR_RESET)
|
||||
Gv_NewVar(aGameVars[i].szLabel,aGameVars[i].lDefault,aGameVars[i].dwFlags);
|
||||
if (aGameVars[i].szLabel != NULL)
|
||||
Gv_NewVar(aGameVars[i].szLabel,
|
||||
aGameVars[i].dwFlags & GAMEVAR_NODEFAULT ? aGameVars[i].val.lValue : aGameVars[i].lDefault,
|
||||
aGameVars[i].dwFlags);
|
||||
}
|
||||
|
||||
for (i=0; i<MAXGAMEARRAYS; i++)
|
||||
|
|
|
@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "duke3d.h"
|
||||
|
||||
const char *s_buildDate = "20100617";
|
||||
const char *s_buildDate = "20100703";
|
||||
char *MusicPtr = NULL;
|
||||
int32_t g_musicSize;
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ int32_t mousxplc, mousyplc;
|
|||
static int32_t ppointhighlight;
|
||||
//static int32_t counter=0;
|
||||
static uint8_t nosprites=0,purpleon=0,skill=4;
|
||||
static uint8_t framerateon=1,shadepreview=0,sidemode=0;
|
||||
static uint8_t framerateon=1,shadepreview=0;
|
||||
static int32_t xvel, yvel, timoff;
|
||||
|
||||
int32_t autosave=180;
|
||||
|
|
|
@ -1308,7 +1308,7 @@ static int32_t osdcmd_cvar_set_game(const osdfuncparm_t *parm)
|
|||
}
|
||||
else if (!Bstrcasecmp(parm->name, "vid_gamma"))
|
||||
{
|
||||
ud.brightness = (int32_t)(min(max((float)((vid_gamma-1.0)*10.0),0),15));
|
||||
ud.brightness = GAMMA_CALC;
|
||||
ud.brightness <<= 2;
|
||||
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
|
||||
|
||||
|
|
|
@ -3193,9 +3193,6 @@ void getinput(int32_t snum)
|
|||
if (BUTTON(gamefunc_Jump) && p->on_ground)
|
||||
jump_timer = 4;
|
||||
|
||||
if (aplWeaponFlags[g_player[snum].ps->curr_weapon][snum] & WEAPON_SEMIAUTO && BUTTON(gamefunc_Fire))
|
||||
CONTROL_ClearButton(gamefunc_Fire);
|
||||
|
||||
loc.bits = (jump_timer > 0 || BUTTON(gamefunc_Jump))<<SK_JUMP;
|
||||
|
||||
if (jump_timer > 0)
|
||||
|
@ -3236,6 +3233,9 @@ void getinput(int32_t snum)
|
|||
if (BUTTON(gamefunc_Dpad_Aiming))
|
||||
vel = 0;
|
||||
|
||||
if (aplWeaponFlags[g_player[snum].ps->curr_weapon][snum] & WEAPON_SEMIAUTO && BUTTON(gamefunc_Fire))
|
||||
CONTROL_ClearButton(gamefunc_Fire);
|
||||
|
||||
loc.extbits = 0;
|
||||
// if (apScriptGameEvent[EVENT_PROCESSINPUT] || apScriptGameEvent[EVENT_MOVEFORWARD])
|
||||
loc.extbits |= BUTTON(gamefunc_Move_Forward) || (vel > 0);
|
||||
|
|
|
@ -338,23 +338,24 @@ void S_Cleanup(void)
|
|||
|
||||
{
|
||||
int32_t j = num & (MAXSOUNDINSTANCES-1);
|
||||
int32_t i;
|
||||
|
||||
num = (num - j) / MAXSOUNDINSTANCES;
|
||||
|
||||
i = g_sounds[num].SoundOwner[j].i;
|
||||
|
||||
if (g_sounds[num].num > MAXSOUNDINSTANCES)
|
||||
OSD_Printf(OSD_ERROR "S_Cleanup(): num exceeds MAXSOUNDINSTANCES! g_sounds[%d].num %d wtf?\n", num, g_sounds[num].num);
|
||||
|
||||
if (g_sounds[num].num > 0)
|
||||
{
|
||||
int32_t i = g_sounds[num].SoundOwner[j].i;
|
||||
|
||||
// MUSICANDSFX uses t_data[0] to control restarting the sound
|
||||
if (i != -1 && sprite[i].picnum == MUSICANDSFX && sector[sprite[i].sectnum].lotag < 3 && sprite[i].lotag < 999)
|
||||
actor[i].t_data[0] = 0;
|
||||
|
||||
g_sounds[num].SoundOwner[j].i = -1;
|
||||
g_sounds[num].SoundOwner[j].voice = 0;
|
||||
g_sounds[num].num--;
|
||||
}
|
||||
|
||||
// MUSICANDSFX uses t_data[0] to control restarting the sound
|
||||
if (i != -1 && sprite[i].picnum == MUSICANDSFX && sector[sprite[i].sectnum].lotag < 3 && sprite[i].lotag < 999)
|
||||
actor[i].t_data[0] = 0;
|
||||
|
||||
g_sounds[num].SoundOwner[j].i = -1;
|
||||
g_sounds[num].SoundOwner[j].voice = 0;
|
||||
}
|
||||
g_soundlocks[num]--;
|
||||
}
|
||||
|
@ -547,22 +548,22 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
|
|||
(num * MAXSOUNDINSTANCES) + j);
|
||||
}
|
||||
|
||||
if (voice > FX_Ok)
|
||||
if (voice <= FX_Ok)
|
||||
{
|
||||
g_sounds[num].SoundOwner[j].i = i;
|
||||
g_sounds[num].num++;
|
||||
g_sounds[num].SoundOwner[j].voice = voice;
|
||||
return voice;
|
||||
g_soundlocks[num]--;
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_soundlocks[num]--;
|
||||
return -1;
|
||||
g_sounds[num].num++;
|
||||
g_sounds[num].SoundOwner[j].i = i;
|
||||
g_sounds[num].SoundOwner[j].voice = voice;
|
||||
return voice;
|
||||
}
|
||||
|
||||
int32_t S_PlaySound(int32_t num)
|
||||
{
|
||||
int32_t pitch,cx;
|
||||
int32_t voice;
|
||||
int32_t pitch, cx;
|
||||
int32_t voice, j;
|
||||
|
||||
if (ud.config.FXDevice < 0) return -1;
|
||||
if (ud.config.SoundToggle==0) return -1;
|
||||
|
@ -591,6 +592,17 @@ int32_t S_PlaySound(int32_t num)
|
|||
else g_soundlocks[num]++;
|
||||
}
|
||||
|
||||
j = 0;
|
||||
|
||||
while (j < MAXSOUNDINSTANCES && g_sounds[num].SoundOwner[j].voice > 0)
|
||||
j++;
|
||||
|
||||
if (j >= MAXSOUNDINSTANCES)
|
||||
{
|
||||
g_soundlocks[num]--;
|
||||
return -1;
|
||||
}
|
||||
|
||||
voice = (g_sounds[num].m&1) ?
|
||||
FX_PlayLoopedAuto(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
||||
pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,g_sounds[num].soundsiz, 65536 + num) :
|
||||
|
@ -602,6 +614,9 @@ int32_t S_PlaySound(int32_t num)
|
|||
return -1;
|
||||
}
|
||||
|
||||
g_sounds[num].num++;
|
||||
g_sounds[num].SoundOwner[j].i = -1;
|
||||
g_sounds[num].SoundOwner[j].voice = voice;
|
||||
return voice;
|
||||
}
|
||||
|
||||
|
@ -611,115 +626,46 @@ int32_t A_PlaySound(uint32_t num, int32_t i)
|
|||
return i < 0 ? S_PlaySound(num) : S_PlaySound3D(num, i, (vec3_t *)&sprite[i]);
|
||||
}
|
||||
|
||||
void S_StopSound(int32_t num)
|
||||
void S_StopEnvSound(int32_t num, int32_t i)
|
||||
{
|
||||
int32_t iter = 0;
|
||||
int32_t j, iter = 0;
|
||||
|
||||
if (num < 0 || num > g_maxSoundPos || g_sounds[num].num <= 0)
|
||||
return;
|
||||
|
||||
retry:
|
||||
|
||||
if (iter > MAXSOUNDINSTANCES)
|
||||
do
|
||||
{
|
||||
int32_t j=MAXSOUNDINSTANCES-1;
|
||||
|
||||
initprintf(OSD_ERROR "S_StopSound(): too many iterations! The following IDs are still active for sound %d:\n", num);
|
||||
for (; j>=0; j--)
|
||||
if (g_sounds[num].SoundOwner[j].voice)
|
||||
initprintf("slot %d, voice %d, sprite %d\n", j, g_sounds[num].SoundOwner[j].voice, g_sounds[num].SoundOwner[j].i);
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
int32_t j=MAXSOUNDINSTANCES-1;
|
||||
|
||||
iter++;
|
||||
|
||||
for (; j>=0; j--)
|
||||
if (iter++ > MAXSOUNDINSTANCES<<1)
|
||||
{
|
||||
if (g_sounds[num].SoundOwner[j].voice)
|
||||
{
|
||||
if (g_sounds[num].SoundOwner[j].voice <= FX_Ok || g_sounds[num].SoundOwner[j].voice > ud.config.NumVoices)
|
||||
{
|
||||
initprintf(OSD_ERROR "S_StopSound(): bad voice %d for sound ID %d index %d!\n", g_sounds[num].SoundOwner[j].voice, num, j);
|
||||
mutex_lock(&s_mutex);
|
||||
dq[dnum++] = (num * MAXSOUNDINSTANCES) + j;
|
||||
mutex_unlock(&s_mutex);
|
||||
S_Cleanup();
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (FX_SoundActive(g_sounds[num].SoundOwner[j].voice))
|
||||
FX_StopSound(g_sounds[num].SoundOwner[j].voice);
|
||||
else
|
||||
{
|
||||
mutex_lock(&s_mutex);
|
||||
dq[dnum++] = (num * MAXSOUNDINSTANCES) + j;
|
||||
mutex_unlock(&s_mutex);
|
||||
}
|
||||
S_Cleanup();
|
||||
goto retry;
|
||||
}
|
||||
initprintf(OSD_ERROR "S_StopEnvSound(): too many iterations! The following IDs are still active for sound %d:\n", num);
|
||||
for (j=MAXSOUNDINSTANCES-1; j>=0; j--)
|
||||
if (g_sounds[num].SoundOwner[j].i == i)
|
||||
initprintf(OSD_ERROR "slot %d, voice %d, sprite %d\n", j, g_sounds[num].SoundOwner[j].voice, g_sounds[num].SoundOwner[j].i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void S_StopEnvSound(int32_t num,int32_t i)
|
||||
{
|
||||
int32_t iter = 0;
|
||||
|
||||
if (num < 0 || num > g_maxSoundPos || g_sounds[num].num <= 0)
|
||||
return;
|
||||
|
||||
retry:
|
||||
if (iter > MAXSOUNDINSTANCES)
|
||||
{
|
||||
int32_t j=MAXSOUNDINSTANCES-1;
|
||||
|
||||
initprintf(OSD_ERROR "S_StopEnvSound(): too many iterations! The following IDs are still active for sound %d:\n", num);
|
||||
for (; j>=0; j--)
|
||||
if (g_sounds[num].SoundOwner[j].i == i)
|
||||
initprintf("slot %d, voice %d, sprite %d\n", j, g_sounds[num].SoundOwner[j].voice, g_sounds[num].SoundOwner[j].i);
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
int32_t j=MAXSOUNDINSTANCES-1;
|
||||
|
||||
iter++;
|
||||
|
||||
for (; j>=0; j--)
|
||||
for (j=MAXSOUNDINSTANCES-1; j>=0; j--)
|
||||
{
|
||||
if (g_sounds[num].SoundOwner[j].i == i)
|
||||
if (i == -1 || g_sounds[num].SoundOwner[j].i == i)
|
||||
{
|
||||
if (g_sounds[num].SoundOwner[j].voice <= FX_Ok || g_sounds[num].SoundOwner[j].voice > ud.config.NumVoices)
|
||||
{
|
||||
initprintf(OSD_ERROR "S_StopEnvSound(): bad voice %d for sound ID %d index %d!\n", g_sounds[num].SoundOwner[j].voice, num, j);
|
||||
mutex_lock(&s_mutex);
|
||||
dq[dnum++] = (num * MAXSOUNDINSTANCES) + j;
|
||||
mutex_unlock(&s_mutex);
|
||||
S_Cleanup();
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (FX_SoundActive(g_sounds[num].SoundOwner[j].voice))
|
||||
else if (FX_SoundActive(g_sounds[num].SoundOwner[j].voice))
|
||||
FX_StopSound(g_sounds[num].SoundOwner[j].voice);
|
||||
else
|
||||
{
|
||||
// FX_SoundActive returning false could mean one of two things: we asked to stop the sound
|
||||
// right when it was done playing, or we lost track of a voice somewhere (didn't get the callback)
|
||||
// the first scenario resolves itself, and this addresses the second
|
||||
|
||||
mutex_lock(&s_mutex);
|
||||
dq[dnum++] = (num * MAXSOUNDINSTANCES) + j;
|
||||
mutex_unlock(&s_mutex);
|
||||
}
|
||||
// FX_SoundActive returning false could mean one of two things: we asked to stop the sound
|
||||
// right when it was done playing, or we lost track of a voice somewhere (didn't get the callback)
|
||||
// the first scenario resolves itself, and this addresses the second
|
||||
|
||||
mutex_lock(&s_mutex);
|
||||
dq[dnum++] = (num * MAXSOUNDINSTANCES) + j;
|
||||
mutex_unlock(&s_mutex);
|
||||
S_Cleanup();
|
||||
goto retry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (j >= 0);
|
||||
}
|
||||
|
||||
void S_Update(void)
|
||||
|
|
Loading…
Reference in a new issue