git-svn-id: https://svn.eduke32.com/eduke32@581 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2007-10-24 06:48:13 +00:00
parent 2376ac3806
commit 5dbcf7cdbc
18 changed files with 51 additions and 86 deletions

View file

@ -61,7 +61,7 @@ void printmessage256(char name[82]);
void printmessage16(char name[82]);
void getpoint(long searchxe, long searchye, long *x, long *y);
short getpointhighlight(long xplc, long yplc);
long getpointhighlight(long xplc, long yplc);
#ifdef __cplusplus
}

View file

@ -181,7 +181,7 @@ void showwalldata(short wallnum);
void showspritedata(short spritenum);
long drawtilescreen(long pictopleft, long picbox);
void overheadeditor(void);
short getlinehighlight(long xplc, long yplc);
long getlinehighlight(long xplc, long yplc);
void fixspritesectors(void);
long movewalls(long start, long offs);
long loadnames(void);
@ -5941,7 +5941,7 @@ void getpoint(long searchxe, long searchye, long *x, long *y)
if (*y >= editorgridextent) *y = editorgridextent;
}
short getlinehighlight(long xplc, long yplc)
long getlinehighlight(long xplc, long yplc)
{
long i, dst, dist, closest, x1, y1, x2, y2, nx, ny;
@ -5973,7 +5973,7 @@ short getlinehighlight(long xplc, long yplc)
return(closest);
}
short getpointhighlight(long xplc, long yplc)
long getpointhighlight(long xplc, long yplc)
{
long i, dst, dist = 512, closest = -1;

View file

@ -10842,7 +10842,7 @@ void draw2dscreen(long posxe, long posye, short ange, long zoome, short gride)
char pointsize;
col = 6;
pointsize=2;
if (i == pointhighlight || ((pointhighlight < MAXWALLS) && (wall[i].x == wall[pointhighlight].x) && (wall[i].y == wall[pointhighlight].y)))
if (i == pointhighlight || ((pointhighlight < MAXWALLS) && (pointhighlight >= 0) && (wall[i].x == wall[pointhighlight].x) && (wall[i].y == wall[pointhighlight].y)))
{
if (totalclock & 16)
{
@ -10887,7 +10887,7 @@ void draw2dscreen(long posxe, long posye, short ange, long zoome, short gride)
}
if (editstatus == 1)
{
if (j+16384 == pointhighlight || ((pointhighlight-16384 < MAXSPRITES) && (sprite[j].x == sprite[pointhighlight-16384].x) && (sprite[j].y == sprite[pointhighlight-16384].y))) {
if ((pointhighlight-16384) > 0 && (j+16384 == pointhighlight || ((sprite[j].x == sprite[pointhighlight-16384].x) && (sprite[j].y == sprite[pointhighlight-16384].y)))) {
if (totalclock & 32) col += (2<<2);
}
else if ((highlightcnt > 0) && (editstatus == 1))
@ -11149,8 +11149,6 @@ void printext16(long xpos, long ypos, short col, short backcol, char *name, char
long stx, i, x, y, charxsiz;
char *fontptr, *letptr, *ptr;
if (!frameplace) return;
stx = xpos;
if (fontsize) { fontptr = smalltextfont; charxsiz = 4; }

View file

@ -12,7 +12,6 @@ LINKED_GTK = 0
# Debugging options
RELEASE?=1
JFAUD?=0
NOSOUND?=0
# build locations
@ -38,13 +37,9 @@ CXX=g++
OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration -Wno-unused \
-fno-pic -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -DNOCOPYPROTECT \
-I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(SRC)/jaudiolib -I../jfaud/inc
-I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(SRC)/jaudiolib
OURCXXFLAGS=-fno-exceptions -fno-rtti
LIBS=-lm
ifneq (0,$(JFAUD))
JFAUDLIBS=../jfaud/libjfaud.a ../jfaud/mpadec/libmpadec.a
OURCFLAGS+=-DJFAUD
endif
NASMFLAGS=-s #-g
EXESUFFIX=
@ -86,8 +81,6 @@ AUDIOLIB_FX_SDL=$(OBJ)/mv_mix.$o \
$(OBJ)/multivoc.$o
AUDIOLIB_MUSIC_SDL=$(OBJ)/sdlmusic.$o
AUDIOLIB_JFAUD=$(OBJ)/jfaud_sounds.$o
AUDIOLIB_FX=$(OBJ)/mv_mix.$o \
$(OBJ)/mv_mix16.$o \
$(OBJ)/mvreverb.$o \
@ -134,16 +127,12 @@ endif
ifeq ($(RENDERTYPE),SDL)
OURCFLAGS+= $(subst -Dmain=SDL_main,,$(shell sdl-config --cflags))
ifneq (0,$(JFAUD))
AUDIOLIBOBJ=$(AUDIOLIB_JFAUD)
else
ifneq ($(PLATFORM),WINDOWS)
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC_SDL) $(AUDIOLIB_FX_SDL) $(OBJ)/sounds.$o
LIBS+= -lSDL_mixer
else
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC_STUB) $(AUDIOLIB_FX_STUB) $(OBJ)/sounds.$o
endif
endif
ifeq (1,$(HAVE_GTK2))
OURCFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
@ -156,11 +145,7 @@ ifeq ($(RENDERTYPE),SDL)
endif
ifeq ($(RENDERTYPE),WIN)
ifneq (0,$(JFAUD))
AUDIOLIBOBJ=$(AUDIOLIB_JFAUD)
else
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX) $(OBJ)/sounds.$o
endif
endif
ifeq ($(NOSOUND),1)
@ -194,7 +179,7 @@ all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
endif
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB)
$(CC) -o $@ $^ $(JFAUDLIBS) $(LIBS) $(STDCPPLIB) # -Wl,-Map=$@.map
$(CC) -o $@ $^ $(LIBS) $(STDCPPLIB) # -Wl,-Map=$@.map
-rm -f eduke32.sym$(EXESUFFIX)
cp eduke32$(EXESUFFIX) eduke32.sym$(EXESUFFIX)
strip eduke32$(EXESUFFIX)
@ -237,13 +222,8 @@ $(OBJ)/%.$o: $(SRC)/jmact/%.c
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ 2>&1
ifeq (1,$(JFAUD))
$(OBJ)/%.$o: $(SRC)/misc/%.rc
windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) -DJFAUD
else
$(OBJ)/%.$o: $(SRC)/misc/%.rc
windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC)
endif
$(OBJ)/%.$o: $(SRC)/util/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ 2>&1

View file

@ -16,7 +16,6 @@ $(OBJ)/premap.$o: $(SRC)/premap.c $(duke3d_h) $(EINC)/osd.h
$(OBJ)/savegame.$o: $(SRC)/savegame.c $(duke3d_h)
$(OBJ)/sector.$o: $(SRC)/sector.c $(duke3d_h)
$(OBJ)/sounds.$o: $(SRC)/sounds.c $(duke3d_h)
$(OBJ)/jfaud_sounds.$o: $(SRC)/jfaud_sounds.cpp $(duke3d_h) $(EINC)/osd.h
$(OBJ)/rts.$o: $(SRC)/rts.c $(duke3d_h)
$(OBJ)/config.$o: $(SRC)/config.c $(duke3d_h) $(SRC)/jmact/scriplib.h $(INC)/_functio.h
$(OBJ)/testcd.$o: $(SRC)/testcd.c

View file

@ -1,10 +1,10 @@
# EDuke32 Makefile for Microsoft NMake
SRC=source
OBJ=obj
OBJ=obj_win
EROOT=..\build
EINC=$(EROOT)\include
EOBJ=eobj
EOBJ=eobj_win
INC=$(SRC)
RSRC=rsrc
o=obj
@ -34,16 +34,12 @@ AS=ml
LINK=link /opt:nowin98 /nologo /opt:ref
MT=mt
CFLAGS= /MD /J /nologo $(flags_cl) \
/I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I..\jfaud\inc /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \
/I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \
/DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" -W0 $(ENGINEOPTS) \
/I$(DXROOT)\include /DRENDERTYPEWIN=1
LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib wsock32.lib comctl32.lib \
/NODEFAULTLIB:libFLAC.lib glu32.lib
!ifdef JFAUD
LIBS=$(LIBS) ../jfaud/jfaud.lib ../jfaud/mpadec/mpadec.lib
CFLAGS=$(CFLAGS) /DJFAUD
!endif
ASFLAGS=/nologo /coff
ASFLAGS=/nologo /coff
@ -60,7 +56,6 @@ JMACTOBJ=$(OBJ)\util_lib.$o \
AUDIOLIB_FX_STUB=$(OBJ)\jaudiolib_fxstub.$o
AUDIOLIB_MUSIC_STUB=$(OBJ)\jaudiolib_musicstub.$o
#AUDIOLIB_FX=$(OBJ)\jaudiolib_fx_fmod.$o
AUDIOLIB_JFAUD=$(OBJ)\jfaud_sounds.$o
AUDIOLIB_FX=$(OBJ)\mv_mix.$o \
$(OBJ)\mv_mix16.$o \
$(OBJ)\mvreverb.$o \
@ -73,11 +68,7 @@ AUDIOLIB_MUSIC=$(OBJ)\midi.$o \
$(OBJ)\mpu401.$o \
$(OBJ)\music.$o
!ifdef JFAUD
AUDIOLIBOBJ=$(AUDIOLIB_JFAUD)
!else
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX) $(OBJ)\sounds.$o
!endif
GAMEOBJS=$(OBJ)\game.$o \
$(OBJ)\actors.$o \

View file

@ -23,8 +23,8 @@ CC=wcc386
CXX=wpp386
CFLAGS= -zq -5r -s -orb -fp5 -d2 -db &
-i=$(INC) -i=$(EINC) -i=$(SRC)\jmact -i=$(SRC)\jaudiolib -i=$(DXROOT)\include &
-dRENDERTYPEWIN=1 -dNOCOPYPROTECT $(ENGINEOPTS) -i=..\jfaud\inc
LIBS=wsock32.lib dxguid.lib ..\jfaud\jfaud.lib winmm.lib #opengl32.lib
-dRENDERTYPEWIN=1 -dNOCOPYPROTECT $(ENGINEOPTS)
LIBS=wsock32.lib dxguid.lib winmm.lib #opengl32.lib
WASMFLAGS=-d1
EXESUFFIX=.exe
@ -38,7 +38,6 @@ JMACTOBJ=$(OBJ)\util_lib.$o &
JAUDIOLIB_FX_STUB=$(OBJ)\jaudiolib_fxstub.$o
JAUDIOLIB_MUSIC_STUB=$(OBJ)\jaudiolib_musicstub.$o
JAUDIOLIB_JFAUD=$(OBJ)\jfaud_sounds.$o
JAUDIOLIB_FX=$(OBJ)\mv_mix.$o &
$(OBJ)\mv_mix16.$o &
$(OBJ)\mvreverb.$o &
@ -52,7 +51,6 @@ JAUDIOLIB_MUSIC=$(OBJ)\midi.$o &
$(OBJ)\music.$o
#JAUDIOLIBOBJ=$(JAUDIOLIB_MUSIC) $(JAUDIOLIB_FX) $(OBJ)\sounds.$o
#JAUDIOLIBOBJ=$(JAUDIOLIB_MUSIC_STUB) $(JAUDIOLIB_FX_STUB) $(OBJ)\sounds.$o
JAUDIOLIBOBJ=$(JAUDIOLIB_JFAUD)
GAMEOBJS=$(OBJ)\game.$o &
$(OBJ)\actors.$o &

View file

@ -106,7 +106,7 @@ extern int g_ScriptVersion, g_Shareware, g_GameType;
// #define GC (TICSPERFRAME*44)
#define NUM_SOUNDS 1536
#define MAXSOUNDS 1536
/*
#pragma aux sgn =\
@ -123,10 +123,6 @@ extern int g_ScriptVersion, g_Shareware, g_GameType;
#define PHEIGHT (38<<8)
// #define P(X) printf("%ld\n",X);
#define WAIT(X) ototalclock=totalclock+(X);while(totalclock<ototalclock)getpackets()
enum gamemodes {
MODE_MENU = 1,
MODE_DEMO = 2,
@ -285,11 +281,6 @@ enum weapons {
#define rnd(X) ((TRAND>>8)>=(255-(X)))
typedef struct {
short i;
int voice;
} SOUNDOWNER;
#define __USRHOOKS_H
enum USRHOOKS_Errors {
@ -309,6 +300,11 @@ extern input recsync[RECSYNCBUFSIZ];
extern long movefifosendplc;
typedef struct {
short i;
int voice;
} SOUNDOWNER;
typedef struct {
char *ptr;
volatile char lock;
@ -320,6 +316,8 @@ typedef struct {
long soundsiz;
} sound_t;
extern sound_t g_sounds[MAXSOUNDS];
typedef struct {
short wallnum;
long tag;
@ -442,7 +440,7 @@ typedef struct {
typedef struct {
long ox,oy,oz;
short oa,os;
} player_spawnpoint;
} playerspawn_t;
extern char numplayersprites;
@ -525,11 +523,6 @@ extern char buf[1024]; //My own generic input buffer
extern char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
extern char ready2send;
//extern fx_device device;
extern sound_t g_sounds[ NUM_SOUNDS ];
// extern char sounds[NUM_SOUNDS][BMAX_PATH];
// JBF 20040531: adding 16 extra to the script so we have some leeway
// to (hopefully) safely abort when hitting the limit
extern long *script,*scriptptr,*insptr,*labelcode,labelcnt,defaultlabelcnt,*labeltype;
@ -986,7 +979,7 @@ typedef struct {
} playerdata_t;
extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
extern player_spawnpoint g_PlayerSpawnPoints[MAXPLAYERS];
extern playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
extern playerdata_t g_player[MAXPLAYERS];
#include "funct.h"

View file

@ -9296,7 +9296,7 @@ static void freeconmem(void)
Bfree(g_player[i].sync);
}
for (i=NUM_SOUNDS-1;i>=0;i--)
for (i=MAXSOUNDS-1;i>=0;i--)
{
if (g_sounds[i].filename != NULL)
Bfree(g_sounds[i].filename);
@ -10546,6 +10546,11 @@ static int opendemoread(int which_demo) // 0 = mine
for (i=0;i<ud.multimode;i++)
{
if (!g_player[i].ps)
g_player[i].ps = (player_struct *) Bcalloc(1,sizeof(player_struct));
if (!g_player[i].sync)
g_player[i].sync = (input *) Bcalloc(1,sizeof(input));
if (kread(recfilep,(char *)g_player[i].user_name,sizeof(g_player[i].user_name)) != sizeof(g_player[i].user_name)) goto corrupt;
OSD_Printf("ud.user_name: %s\n",g_player[i].user_name);
if (kread(recfilep,(int32 *)&g_player[i].ps->aim_mode,sizeof(int32)) != sizeof(int32)) goto corrupt;

View file

@ -4361,9 +4361,9 @@ repeatcase:
scriptptr--;
transnum(LABEL_DEFINE);
k = *(scriptptr-1);
if (k >= NUM_SOUNDS)
if (k >= MAXSOUNDS)
{
initprintf("%s:%ld: error: exceeded sound limit of %ld.\n",compilefile,line_number,NUM_SOUNDS);
initprintf("%s:%ld: error: exceeded sound limit of %ld.\n",compilefile,line_number,MAXSOUNDS);
error++;
}
scriptptr--;

View file

@ -6428,11 +6428,11 @@ static int parse(void)
break;
case CON_IFNOSOUNDS:
for (j=1;j<NUM_SOUNDS;j++)
for (j=1;j<MAXSOUNDS;j++)
if (g_sounds[j].SoundOwner[0].i == g_i)
break;
parseifelse(j == NUM_SOUNDS);
parseifelse(j == MAXSOUNDS);
break;
case CON_SPRITEFLAGS:

View file

@ -343,6 +343,7 @@ int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags)
// if existing is system, they only get to change default value....
aGameVars[i].lValue=lValue;
aGameVars[i].lDefault=lValue;
aGameVars[i].bReset=0;
}
else
{

View file

@ -73,14 +73,14 @@ char num_volumes = 3;
short timer=120;
//fx_device device;
sound_t g_sounds[ NUM_SOUNDS ];
sound_t g_sounds[ MAXSOUNDS ];
char numplayersprites,loadfromgrouponly=0,earthquaketime;
long fricxv,fricyv;
playerdata_t g_player[MAXPLAYERS];
input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
player_spawnpoint g_PlayerSpawnPoints[MAXPLAYERS];
playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
user_defs ud;
char pus, pub;

View file

@ -44,7 +44,7 @@ int FX_ErrorCode = FX_Ok;
#define FX_SetErrorCode( status ) \
FX_ErrorCode = ( status );
FSOUND_SAMPLE * FX_Samples[NUM_SOUNDS + 11]; // 11 remote ridicules
FSOUND_SAMPLE * FX_Samples[MAXSOUNDS + 11]; // 11 remote ridicules
int FX_NumVoices = 0;
static char chtoggle=0;

View file

@ -3,7 +3,7 @@
#include <tchar.H>
LPCSTR MiniDumper::m_szAppName;
// MiniDumper g_dumper("EDuke32");
MiniDumper g_dumper("eduke32");
MiniDumper::MiniDumper( LPCSTR szAppName )
{

View file

@ -275,7 +275,7 @@ static int getsound(unsigned int num)
short fp;
long l;
if (num >= NUM_SOUNDS || ud.config.SoundToggle == 0) return 0;
if (num >= MAXSOUNDS || ud.config.SoundToggle == 0) return 0;
if (ud.config.FXDevice < 0) return 0;
if (!g_sounds[num].filename) return 0;
@ -304,7 +304,7 @@ static void precachenecessarysounds(void)
if (ud.config.FXDevice < 0) return;
j = 0;
for (i=0;i<NUM_SOUNDS;i++)
for (i=0;i<MAXSOUNDS;i++)
if (g_sounds[i].ptr == 0)
{
j++;

View file

@ -51,7 +51,7 @@ int callsound(int sn,int whatsprite)
if (SLT)
{
spritesound(SLT,whatsprite);
if (SHT && SLT != SHT && SHT < NUM_SOUNDS)
if (SHT && SLT != SHT && SHT < MAXSOUNDS)
stopspritesound(SHT,T6);
T6 = whatsprite;
}
@ -60,7 +60,7 @@ int callsound(int sn,int whatsprite)
T1 = 1;
}
}
else if (SHT < NUM_SOUNDS)
else if (SHT < MAXSOUNDS)
{
if (SHT) spritesound(SHT,whatsprite);
if ((g_sounds[SLT].m&1) || (SHT && SHT != SLT))

View file

@ -230,15 +230,15 @@ int loadsound(unsigned int num)
{
long fp, l;
if (num >= NUM_SOUNDS || ud.config.SoundToggle == 0) return 0;
if (num >= MAXSOUNDS || ud.config.SoundToggle == 0) return 0;
if (ud.config.FXDevice < 0) return 0;
fp = kopen4load(g_sounds[num].filename,loadfromgrouponly);
if (fp == -1)
{
// Bsprintf(fta_quotes[113],"Sound %s(#%d) not found.",sounds[num],num);
// Bsprintf(fta_quotes[113],"g_sounds %s(#%d) not found.",sounds[num],num);
// FTA(113,g_player[myconnectindex].ps);
initprintf("Sound %s(#%d) not found.\n",g_sounds[num].filename,num);
OSD_Printf("Sound %s(#%d) not found.\n",g_sounds[num].filename,num);
return 0;
}
@ -261,7 +261,7 @@ int xyzsound(int num,int i,long x,long y,long z)
// if(num != 358) return 0;
if (num >= NUM_SOUNDS ||
if (num >= MAXSOUNDS ||
ud.config.FXDevice < 0 ||
((g_sounds[num].m&8) && ud.lockout) ||
ud.config.SoundToggle == 0 ||
@ -282,7 +282,7 @@ int xyzsound(int num,int i,long x,long y,long z)
return -1;
else if (ud.multimode > 1 && PN == APLAYER && sprite[i].yvel != screenpeek && ud.config.VoiceToggle!=2)
return -1;
for (j=0;j<NUM_SOUNDS;j++)
for (j=0;j<MAXSOUNDS;j++)
for (k=0;k<g_sounds[j].num;k++)
if ((g_sounds[j].num > 0) && (g_sounds[j].m&4))
return -1;
@ -414,7 +414,7 @@ void sound(int num)
if (ud.config.VoiceToggle==0 && (g_sounds[num].m&4)) return;
if ((g_sounds[num].m&8) && ud.lockout) return;
if (FX_VoiceAvailable(g_sounds[num].pr) == 0) return;
if (num > NUM_SOUNDS-1 || !g_sounds[num].filename)
if (num > MAXSOUNDS-1 || !g_sounds[num].filename)
{
OSD_Printf("WARNING: invalid sound #%d\n",num);
return;
@ -472,7 +472,7 @@ void sound(int num)
int spritesound(unsigned int num, int i)
{
if (num >= NUM_SOUNDS) return -1;
if (num >= MAXSOUNDS) return -1;
return xyzsound(num,i,SX,SY,SZ);
}
@ -530,7 +530,7 @@ void pan3dsound(void)
ca = sprite[ud.camerasprite].ang;
}
for (j=0;j<NUM_SOUNDS;j++) for (k=0;k<g_sounds[j].num;k++)
for (j=0;j<MAXSOUNDS;j++) for (k=0;k<g_sounds[j].num;k++)
{
i = g_sounds[j].SoundOwner[k].i;
@ -628,7 +628,7 @@ void clearsoundlocks(void)
{
long i;
for (i=0;i<NUM_SOUNDS;i++)
for (i=0;i<MAXSOUNDS;i++)
if (g_sounds[i].lock >= 200)
g_sounds[i].lock = 199;