Misc shit

git-svn-id: https://svn.eduke32.com/eduke32@1101 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-10-18 12:37:26 +00:00
parent 2a77b42672
commit 6ae2e2d140
16 changed files with 319 additions and 152 deletions

View file

@ -227,25 +227,60 @@ include Makefile.deps
# RULES # RULES
$(OBJ)/%.$o: $(SRC)/%.nasm $(OBJ)/%.$o: $(SRC)/%.nasm
$(AS) $(ASFLAGS) $< -o $@ ${COMPILE_STATUS}
if $(AS) $(ASFLAGS) $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/%.c $(OBJ)/%.$o: $(SRC)/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/%.m $(OBJ)/%.$o: $(SRC)/%.m
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/%.cpp $(OBJ)/%.$o: $(SRC)/%.cpp
$(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/misc/%.rc $(OBJ)/%.$o: $(SRC)/misc/%.rc
$(RC) -i $< -o $@ --include-dir=$(INC) --include-dir=$(SRC) ${COMPILE_STATUS}
if $(RC) -i $< -o $@ --include-dir=$(INC) --include-dir=$(SRC); then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/util/%.c $(OBJ)/%.$o: $(SRC)/util/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(RSRC)/%.c $(OBJ)/%.$o: $(RSRC)/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c $(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@ echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@

View file

@ -176,3 +176,13 @@ ifneq (0,$(POLYMER))
endif endif
endif endif
endif endif
BUILD_STARTED = printf "\033[K\033[1;36mBuild started with $($OURCFLAGS)\033[0m\n"
BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful.\033[0m\n"
COMPILE_STATUS = printf "\033[K\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r"
COMPILE_OK = printf "\033[K\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n"
COMPILE_FAILED = printf "\033[K\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
LINK_STATUS = printf "\033[K\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r"
LINK_OK = printf "\033[K\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n"
LINK_FAILED = printf "\033[K\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1

View file

@ -24,7 +24,7 @@
#define updatecrc16(crc,dat) (crc = (((crc<<8)&65535)^crctable[((((unsigned short)crc)>>8)&65535)^dat])) #define updatecrc16(crc,dat) (crc = (((crc<<8)&65535)^crctable[((((unsigned short)crc)>>8)&65535)^dat]))
static int crctable[256]; static int crctable[256];
static char kensig[32]; static char kensig[64];
extern int ExtInit(void); extern int ExtInit(void);
extern int ExtPreInit(int argc,const char **argv); extern int ExtPreInit(int argc,const char **argv);

View file

@ -228,7 +228,17 @@ int loadsetup(const char *fn)
if (readconfig(fp, "showheightindicators", val, VL) > 0) if (readconfig(fp, "showheightindicators", val, VL) > 0)
showheightindicators = min(max(Batoi(val),0),2); showheightindicators = min(max(Batoi(val),0),2);
for (i=0;i<256;i++)remap[i]=i; #ifdef _WIN32
{
extern char map_dik_code(int);
for (i=0;i<256;i++)
remap[i]=map_dik_code(i);
}
#else
for (i=0;i<256;i++)
remap[i]=i;
#endif
remapinit=1; remapinit=1;
if (readconfig(fp, "remap", val, VL) > 0) if (readconfig(fp, "remap", val, VL) > 0)
{ {
@ -434,8 +444,8 @@ int writesetup(const char *fn)
keys[19] keys[19]
); );
for (i=0;i<256;i++)
for (i=0;i<256;i++)if (remap[i]!=i) if (remap[i]!=i)
{ {
Bfprintf(fp,first?"%02X-%02X":",%02X-%02X",i,remap[i]); Bfprintf(fp,first?"%02X-%02X":",%02X-%02X",i,remap[i]);
first=0; first=0;

View file

@ -20,7 +20,7 @@ int dynamicgtk_init(void)
if (handle) return 1; if (handle) return 1;
handle = dlopen("libgtk-x11-2.0.so", RTLD_NOW|RTLD_GLOBAL); handle = dlopen("libgtk-x11-2.0.so.0", RTLD_NOW|RTLD_GLOBAL);
if (!handle) return -1; if (!handle) return -1;
memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms)); memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms));

View file

@ -1849,15 +1849,21 @@ static symbol_t *findsymbol(const char *name, symbol_t *startingat)
static symbol_t *findexactsymbol(const char *name) static symbol_t *findexactsymbol(const char *name)
{ {
int i; int i;
char *lname = Bstrdup(name);
if (!symbols) return NULL; if (!symbols) return NULL;
i = HASH_findcase(&osdsymbolsH,name); for (i=Bstrlen(lname);i>=0;i--)
lname[i] = Btolower(lname[i]);
i = HASH_findcase(&osdsymbolsH,lname);
if (i > -1) if (i > -1)
{ {
// if ((symbol_t *)osdsymbptrs[i]->func == (void *)OSD_UNALIASED) // if ((symbol_t *)osdsymbptrs[i]->func == (void *)OSD_UNALIASED)
// return NULL; // return NULL;
Bfree(lname);
return osdsymbptrs[i]; return osdsymbptrs[i];
} }
Bfree(lname);
return NULL; return NULL;
} }

View file

@ -1477,14 +1477,14 @@ int handleevents(void)
{ {
SetKey(code, 1); SetKey(code, 1);
if (keypresscallback) if (keypresscallback)
keypresscallback(code, 1); keypresscallback(remap[code], 1);
} }
} }
else else
{ {
SetKey(code, 0); SetKey(code, 0);
if (keypresscallback) if (keypresscallback)
keypresscallback(code, 0); keypresscallback(remap[code], 0);
} }
break; break;
@ -1515,13 +1515,19 @@ int handleevents(void)
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
switch (ev.button.button) switch (ev.button.button)
{ {
// some of these get reordered to match winlayer
case SDL_BUTTON_LEFT: case SDL_BUTTON_LEFT:
j = 0; break; j = 0; break;
case SDL_BUTTON_RIGHT: case SDL_BUTTON_RIGHT:
j = 1; break; j = 1; break;
case SDL_BUTTON_MIDDLE: case SDL_BUTTON_MIDDLE:
j = 2; break; j = 2; break;
default: case SDL_BUTTON_X1:
j = 3; break;
case SDL_BUTTON_X2:
j = 6; break;
case SDL_BUTTON_WHEELUP:
case SDL_BUTTON_WHEELDOWN:
j = ev.button.button; break; j = ev.button.button; break;
} }
if (j<0) break; if (j<0) break;
@ -1540,7 +1546,8 @@ int handleevents(void)
} }
else else
{ {
if (j < 4) mouseb &= ~(1<<j); if (j != SDL_BUTTON_WHEELUP && j != SDL_BUTTON_WHEELDOWN)
mouseb &= ~(1<<j);
} }
if (mousepresscallback) if (mousepresscallback)

View file

@ -747,6 +747,12 @@ static struct _joydevicedefn *thisjoydef = NULL, joyfeatures[] =
} \ } \
} }
char map_dik_code(int scanCode)
{
// ugly table for remapping out of range DIK_ entries will go here
// if I can't figure out the layout problem
return scanCode;
}
// //
// initinput() -- init input system // initinput() -- init input system
@ -756,13 +762,25 @@ int initinput(void)
int i; int i;
moustat=0; moustat=0;
memset(keystatus, 0, sizeof(keystatus)); memset(keystatus, 0, sizeof(keystatus));
if (!remapinit)for (i=0;i<256;i++)remap[i]=i;remapinit=1; if (!remapinit)
for (i=0;i<256;i++)
remap[i]=map_dik_code(i);
remapinit=1;
keyfifoplc = keyfifoend = 0; keyfifoplc = keyfifoend = 0;
keyasciififoplc = keyasciififoend = 0; keyasciififoplc = keyasciififoend = 0;
inputdevices = 0; inputdevices = 0;
joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0; joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0;
{
TCHAR layoutname[KL_NAMELENGTH];
// GetKeyboardLayoutName(layoutname);
// initprintf(" * Keyboard layout: %s\n",layoutname);
LoadKeyboardLayout("00000409", KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_SUBSTITUTE_OK);
GetKeyboardLayoutName(layoutname);
initprintf("Using keyboard layout %s\n",layoutname);
}
if (InitDirectInput()) if (InitDirectInput())
return -1; return -1;
@ -1165,7 +1183,7 @@ void releaseallbuttons(void)
//if (OSD_HandleKey(i, 0) != 0) { //if (OSD_HandleKey(i, 0) != 0) {
OSD_HandleScanCode(i, 0); OSD_HandleScanCode(i, 0);
SetKey(i, 0); SetKey(i, 0);
if (keypresscallback) keypresscallback(i, 0); if (keypresscallback) keypresscallback(remap[i], 0);
//} //}
} }
lastKeyDown = lastKeyTime = 0; lastKeyDown = lastKeyTime = 0;
@ -1703,7 +1721,7 @@ static void ProcessInputDevices(void)
SetKey(k, (didod[i].dwData & 0x80) == 0x80); SetKey(k, (didod[i].dwData & 0x80) == 0x80);
if (keypresscallback) if (keypresscallback)
keypresscallback(k, (didod[i].dwData & 0x80) == 0x80); keypresscallback(remap[k], (didod[i].dwData & 0x80) == 0x80);
} }
if (((lastKeyDown & 0x7fffffffl) == k) && !(didod[i].dwData & 0x80)) if (((lastKeyDown & 0x7fffffffl) == k) && !(didod[i].dwData & 0x80))
@ -4219,7 +4237,7 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
SetKey(0x59, 1); SetKey(0x59, 1);
if (keypresscallback) if (keypresscallback)
keypresscallback(0x59, 1); keypresscallback(remap[0x59], 1);
} }
break; break;

View file

@ -230,31 +230,55 @@ ifeq ($(USE_OPENAL),1)
OURCFLAGS+= -DUSE_OPENAL OURCFLAGS+= -DUSE_OPENAL
endif endif
.SILENT:
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) .PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB)
# TARGETS # TARGETS
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX) all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX)
else else
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
endif endif
all:
${BUILD_FINISHED}
notice:
${BUILD_STARTED}
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB)
$(CC) -o $@ $^ $(LIBS) $(STDCPPLIB) # -Wl,-Map=$@.map ${LINK_STATUS}
-rm -f eduke32.sym$(EXESUFFIX) if $(CC) -o $@ $^ $(LIBS) $(STDCPPLIB); then \
cp eduke32$(EXESUFFIX) eduke32.sym$(EXESUFFIX) ${LINK_OK}; \
else \
${LINK_FAILED}; \
fi
ifeq (1,$(RELEASE))
strip eduke32$(EXESUFFIX) strip eduke32$(EXESUFFIX)
endif
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB)
$(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) # -Wl,-Map=$@.map ${LINK_STATUS}
-rm -f mapster32.sym$(EXESUFFIX) if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS); then \
cp mapster32$(EXESUFFIX) mapster32.sym$(EXESUFFIX) ${LINK_OK}; \
else \
${LINK_FAILED}; \
fi
ifeq (1,$(RELEASE))
strip mapster32$(EXESUFFIX) strip mapster32$(EXESUFFIX)
endif
duke3d_w32$(EXESUFFIX): $(OBJ)/wrapper.$o duke3d_w32$(EXESUFFIX): $(OBJ)/wrapper.$o
$(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ -Wl ${LINK_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ -Wl; then \
${LINK_OK}; \
else \
${LINK_FAILED}; \
fi
ifeq (1,$(RELEASE))
strip duke3d_w32$(EXESUFFIX) strip duke3d_w32$(EXESUFFIX)
endif
include Makefile.deps include Makefile.deps
@ -271,27 +295,66 @@ $(EOBJ)/$(EDITORLIB): editorlib
# RULES # RULES
$(OBJ)/%.$o: $(SRC)/%.nasm $(OBJ)/%.$o: $(SRC)/%.nasm
${COMPILE_STATUS}
nasm $(NASMFLAGS) $< -o $@ nasm $(NASMFLAGS) $< -o $@
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm $(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm
${COMPILE_STATUS}
nasm $(NASMFLAGS) $< -o $@ nasm $(NASMFLAGS) $< -o $@
$(OBJ)/%.$o: $(SRC)/%.c $(OBJ)/%.$o: $(SRC)/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/%.cpp $(OBJ)/%.$o: $(SRC)/%.cpp
$(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/jmact/%.c $(OBJ)/%.$o: $(SRC)/jmact/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.c $(OBJ)/%.$o: $(SRC)/jaudiolib/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/misc/%.rc $(OBJ)/%.$o: $(SRC)/misc/%.rc
windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) ${COMPILE_STATUS}
if windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC); then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(SRC)/util/%.c $(OBJ)/%.$o: $(SRC)/util/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/%.$o: $(RSRC)/%.c $(OBJ)/%.$o: $(RSRC)/%.c
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@ ${COMPILE_STATUS}
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
${COMPILE_OK}; \
else \
${COMPILE_FAILED}; \
fi
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c $(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c $(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
@ -305,7 +368,7 @@ $(RSRC)/editor_banner.c: $(RSRC)/build.bmp
# PHONIES # PHONIES
clean: clean:
-rm -f $(OBJ)/* eduke32$(EXESUFFIX) eduke32.sym$(EXESUFFIX) mapster32$(EXESUFFIX) mapster32.sym$(EXESUFFIX) core* duke3d_w32$(EXESUFFIX) -rm -f $(OBJ)/* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) core* duke3d_w32$(EXESUFFIX)
veryclean: clean veryclean: clean
-rm -f $(EOBJ)/* -rm -f $(EOBJ)/*

View file

@ -217,7 +217,11 @@ static char * mousedefaults[] =
"Jetpack", "Jetpack",
"", "",
"Previous_Weapon", "Previous_Weapon",
"Next_Weapon" "Next_Weapon",
"",
"",
"",
""
}; };
@ -228,6 +232,10 @@ static char * mouseclickeddefaults[] =
"", "",
"", "",
"", "",
"",
"",
"",
"",
"" ""
}; };

View file

@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shellapi.h> #include <shellapi.h>
#endif #endif
#define BUILDDATE " 20081011" #define BUILDDATE " 20081017"
#define VERSION " 1.2.0devel" #define VERSION " 1.2.0devel"
static int floor_over_floor; static int floor_over_floor;
@ -1942,7 +1942,7 @@ static void PrintStatus(char *string,int num,char x,char y,char color)
static inline void SpriteName(short spritenum, char *lo2) static inline void SpriteName(short spritenum, char *lo2)
{ {
Bsprintf(lo2,names[sprite[spritenum].picnum]); Bstrcpy(lo2,names[sprite[spritenum].picnum]);
}// end SpriteName }// end SpriteName
static void ReadPaletteTable() static void ReadPaletteTable()
@ -7534,7 +7534,7 @@ static void checkcommandline(int argc, const char **argv)
if (j > 0) if (j > 0)
{ {
testplay_addparam[j-1] = 0; testplay_addparam[j-1] = 0;
Brealloc(testplay_addparam, j*sizeof(char)); testplay_addparam = Brealloc(testplay_addparam, j*sizeof(char));
} }
else else
{ {
@ -10430,7 +10430,7 @@ static void FuncMenu(void)
{ {
case 0: case 0:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j = 0; j = 0;
@ -10460,7 +10460,7 @@ static void FuncMenu(void)
break; break;
case 1: case 1:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
Bsprintf(tempbuf,"Delete all sprites of tile #: "); Bsprintf(tempbuf,"Delete all sprites of tile #: ");
@ -10480,7 +10480,7 @@ static void FuncMenu(void)
break; break;
case 2: case 2:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Set map sky shade: ",0,128,1); j=getnumber16("Set map sky shade: ",0,128,1);
@ -10496,7 +10496,7 @@ static void FuncMenu(void)
break; break;
case 3: case 3:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Set map sky height: ",0,16777216,1); j=getnumber16("Set map sky height: ",0,16777216,1);
@ -10515,7 +10515,7 @@ static void FuncMenu(void)
break; break;
case 4: case 4:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Z offset: ",0,16777216,1); j=getnumber16("Z offset: ",0,16777216,1);
@ -10536,7 +10536,7 @@ static void FuncMenu(void)
break; break;
case 5: case 5:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Percentage of original: ",100,1000,0); j=getnumber16("Percentage of original: ",100,1000,0);
@ -10577,7 +10577,7 @@ static void FuncMenu(void)
break; break;
case 6: case 6:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Shade divisor: ",1,128,1); j=getnumber16("Shade divisor: ",1,128,1);
@ -10600,7 +10600,7 @@ static void FuncMenu(void)
break; break;
case 7: case 7:
{ {
for (i=Bsprintf(disptext,FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"%s",FuncMenuStrings[row]); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Visibility divisor: ",1,128,0); j=getnumber16("Visibility divisor: ",1,128,0);

View file

@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define APPNAME "EDuke32" #define APPNAME "EDuke32"
#define VERSION " 1.5.0devel" #define VERSION " 1.5.0devel"
// this is checked against http://eduke32.com/VERSION // this is checked against http://eduke32.com/VERSION
#define BUILDDATE " 20081011" extern char *s_builddate;
#define HEAD2 APPNAME VERSION BUILDDATE #define HEAD2 APPNAME VERSION
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View file

@ -844,7 +844,7 @@ void getpackets(void)
for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
if (i != other) sendpacket(i,packbuf,packbufleng); if (i != other) sendpacket(i,packbuf,packbufleng);
if (packbuf[2] != (char)atoi(BUILDDATE)) if (packbuf[2] != (char)atoi(s_builddate))
gameexit("\nYou cannot play Duke with different versions."); gameexit("\nYou cannot play Duke with different versions.");
other = packbuf[1]; other = packbuf[1];
@ -2952,7 +2952,8 @@ void gameexit(const char *t)
//printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); //printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
if (!(t[0] == ' ' && t[1] == 0)) if (!(t[0] == ' ' && t[1] == 0))
{ {
wm_msgbox(HEAD2, (char *)t); Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
wm_msgbox(tempbuf, (char *)t);
} }
} }
@ -7600,7 +7601,7 @@ PALONLY:
if (tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0 && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS) if (tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0 && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{ {
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
spriteext[tsprite[j].owner].tspr = NULL; // spriteext[tsprite[j].owner].tspr = NULL;
} }
} }
while (j--); while (j--);
@ -7611,7 +7612,7 @@ PALONLY:
if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS) if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{ {
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
spriteext[tsprite[j].owner].tspr = NULL; // spriteext[tsprite[j].owner].tspr = NULL;
} }
} }
#ifdef _MSC_VER #ifdef _MSC_VER
@ -8842,7 +8843,8 @@ static void comlinehelp(void)
"\n-?, -help, --help\tDisplay this help message and exit" "\n-?, -help, --help\tDisplay this help message and exit"
; ;
#if defined RENDERTYPEWIN #if defined RENDERTYPEWIN
wm_msgbox(HEAD2,s); Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
wm_msgbox(tempbuf,s);
#else #else
initprintf("%s\n",s); initprintf("%s\n",s);
#endif #endif
@ -10534,7 +10536,7 @@ static void sendplayerupdate(void)
buf[0] = 6; buf[0] = 6;
buf[1] = myconnectindex; buf[1] = myconnectindex;
buf[2] = (char)atoi(BUILDDATE); buf[2] = (char)atoi(s_builddate);
l = 3; l = 3;
//null terminated player name to send //null terminated player name to send
@ -10761,7 +10763,8 @@ void app_main(int argc,const char **argv)
(int(*)(void))GetTime, (int(*)(void))GetTime,
GAME_onshowosd GAME_onshowosd
); );
wm_setapptitle(HEAD2); Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
wm_setapptitle(tempbuf);
initprintf("%s\n",apptitle); initprintf("%s\n",apptitle);
// initprintf("Compiled %s\n",datetimestring); // initprintf("Compiled %s\n",datetimestring);
@ -10892,7 +10895,7 @@ void app_main(int argc,const char **argv)
initprintf("Current version is %d",atoi(tempbuf)); initprintf("Current version is %d",atoi(tempbuf));
ud.config.LastUpdateCheck = time(NULL); ud.config.LastUpdateCheck = time(NULL);
if (atoi(tempbuf) > atoi(BUILDDATE)) if (atoi(tempbuf) > atoi(s_builddate))
{ {
if (wm_ynbox("EDuke32","A new version of EDuke32 is available. " if (wm_ynbox("EDuke32","A new version of EDuke32 is available. "
"Browse to http://eduke32.sourceforge.net now?")) "Browse to http://eduke32.sourceforge.net now?"))
@ -11186,9 +11189,26 @@ void app_main(int argc,const char **argv)
initprintf("Initializing OSD...\n"); initprintf("Initializing OSD...\n");
OSD_SetVersionString(HEAD2, 10,0); Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
OSD_SetVersionString(tempbuf, 10,0);
registerosdcommands(); registerosdcommands();
if (CONTROL_Startup(1, &GetTime, TICRATE))
{
uninitengine();
exit(1);
}
SetupGameButtons();
CONFIG_SetupMouse();
CONFIG_SetupJoystick();
CONTROL_JoystickEnabled = (ud.config.UseJoystick && CONTROL_JoyPresent);
CONTROL_MouseEnabled = (ud.config.UseMouse && CONTROL_MousePresent);
// JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too
for (i=0;i<joynumaxes;i++)
setjoydeadzone(i,ud.config.JoystickAnalogueDead[i],ud.config.JoystickAnalogueSaturate[i]);
if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP) < 0) if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP) < 0)
{ {
int i = 0; int i = 0;
@ -11239,22 +11259,6 @@ void app_main(int argc,const char **argv)
gameexit(" The full version of Duke Nukem 3D supports 5 or more players."); gameexit(" The full version of Duke Nukem 3D supports 5 or more players.");
} */ } */
if (CONTROL_Startup(1, &GetTime, TICRATE))
{
uninitengine();
exit(1);
}
SetupGameButtons();
CONFIG_SetupMouse();
CONFIG_SetupJoystick();
CONTROL_JoystickEnabled = (ud.config.UseJoystick && CONTROL_JoyPresent);
CONTROL_MouseEnabled = (ud.config.UseMouse && CONTROL_MousePresent);
// JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too
for (i=0;i<joynumaxes;i++)
setjoydeadzone(i,ud.config.JoystickAnalogueDead[i],ud.config.JoystickAnalogueSaturate[i]);
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0); setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
// if(KB_KeyPressed( sc_Escape ) ) gameexit(" "); // if(KB_KeyPressed( sc_Escape ) ) gameexit(" ");

View file

@ -1592,7 +1592,8 @@ static int parse(void)
Bstrcpy(fta_quotes[i],g_player[g_p].user_name); Bstrcpy(fta_quotes[i],g_player[g_p].user_name);
break; break;
case STR_VERSION: case STR_VERSION:
Bstrcpy(fta_quotes[i],HEAD2); Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
Bstrcpy(fta_quotes[i],tempbuf);
break; break;
case STR_GAMETYPE: case STR_GAMETYPE:
Bstrcpy(fta_quotes[i],gametype_names[ud.coop]); Bstrcpy(fta_quotes[i],gametype_names[ud.coop]);

View file

@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "duke3d.h" #include "duke3d.h"
char *s_builddate = "20081018";
char *MusicPtr = NULL; char *MusicPtr = NULL;
int Musicsize; int Musicsize;

View file

@ -1468,8 +1468,12 @@ int registerosdcommands(void)
for (i=0;i<NUMGAMEFUNCTIONS-1;i++) for (i=0;i<NUMGAMEFUNCTIONS-1;i++)
{ {
char *t; char *t;
int j;
Bsprintf(tempbuf,"gamefunc_%s",gamefunctions[i]); Bsprintf(tempbuf,"gamefunc_%s",gamefunctions[i]);
t = Bstrdup(tempbuf); t = Bstrdup(tempbuf);
for (j=Bstrlen(t);j>=0;j--)
t[j] = Btolower(t[j]);
Bstrcat(tempbuf,": game button"); Bstrcat(tempbuf,": game button");
OSD_RegisterFunction(t,Bstrdup(tempbuf),osdcmd_button); OSD_RegisterFunction(t,Bstrdup(tempbuf),osdcmd_button);
} }