mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Misc shit
git-svn-id: https://svn.eduke32.com/eduke32@1101 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2a77b42672
commit
6ae2e2d140
16 changed files with 319 additions and 152 deletions
|
@ -227,25 +227,60 @@ include Makefile.deps
|
|||
|
||||
# RULES
|
||||
$(OBJ)/%.$o: $(SRC)/%.nasm
|
||||
$(AS) $(ASFLAGS) $< -o $@
|
||||
${COMPILE_STATUS}
|
||||
if $(AS) $(ASFLAGS) $< -o $@; then \
|
||||
${COMPILE_OK}; \
|
||||
else \
|
||||
${COMPILE_FAILED}; \
|
||||
fi
|
||||
|
||||
$(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
|
||||
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@
|
||||
${COMPILE_STATUS}
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
|
||||
${COMPILE_OK}; \
|
||||
else \
|
||||
${COMPILE_FAILED}; \
|
||||
fi
|
||||
|
||||
$(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
|
||||
$(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
|
||||
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@
|
||||
${COMPILE_STATUS}
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
|
||||
${COMPILE_OK}; \
|
||||
else \
|
||||
${COMPILE_FAILED}; \
|
||||
fi
|
||||
|
||||
$(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
|
||||
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
||||
|
|
|
@ -176,3 +176,13 @@ ifneq (0,$(POLYMER))
|
|||
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
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#define updatecrc16(crc,dat) (crc = (((crc<<8)&65535)^crctable[((((unsigned short)crc)>>8)&65535)^dat]))
|
||||
static int crctable[256];
|
||||
static char kensig[32];
|
||||
static char kensig[64];
|
||||
|
||||
extern int ExtInit(void);
|
||||
extern int ExtPreInit(int argc,const char **argv);
|
||||
|
|
|
@ -228,7 +228,17 @@ int loadsetup(const char *fn)
|
|||
if (readconfig(fp, "showheightindicators", val, VL) > 0)
|
||||
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;
|
||||
if (readconfig(fp, "remap", val, VL) > 0)
|
||||
{
|
||||
|
@ -434,8 +444,8 @@ int writesetup(const char *fn)
|
|||
keys[19]
|
||||
);
|
||||
|
||||
|
||||
for (i=0;i<256;i++)if (remap[i]!=i)
|
||||
for (i=0;i<256;i++)
|
||||
if (remap[i]!=i)
|
||||
{
|
||||
Bfprintf(fp,first?"%02X-%02X":",%02X-%02X",i,remap[i]);
|
||||
first=0;
|
||||
|
|
|
@ -20,7 +20,7 @@ int dynamicgtk_init(void)
|
|||
|
||||
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;
|
||||
|
||||
memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms));
|
||||
|
|
|
@ -1849,15 +1849,21 @@ static symbol_t *findsymbol(const char *name, symbol_t *startingat)
|
|||
static symbol_t *findexactsymbol(const char *name)
|
||||
{
|
||||
int i;
|
||||
char *lname = Bstrdup(name);
|
||||
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 ((symbol_t *)osdsymbptrs[i]->func == (void *)OSD_UNALIASED)
|
||||
// return NULL;
|
||||
Bfree(lname);
|
||||
return osdsymbptrs[i];
|
||||
}
|
||||
Bfree(lname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1477,14 +1477,14 @@ int handleevents(void)
|
|||
{
|
||||
SetKey(code, 1);
|
||||
if (keypresscallback)
|
||||
keypresscallback(code, 1);
|
||||
keypresscallback(remap[code], 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetKey(code, 0);
|
||||
if (keypresscallback)
|
||||
keypresscallback(code, 0);
|
||||
keypresscallback(remap[code], 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1515,13 +1515,19 @@ int handleevents(void)
|
|||
case SDL_MOUSEBUTTONUP:
|
||||
switch (ev.button.button)
|
||||
{
|
||||
// some of these get reordered to match winlayer
|
||||
case SDL_BUTTON_LEFT:
|
||||
j = 0; break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
j = 1; break;
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
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;
|
||||
}
|
||||
if (j<0) break;
|
||||
|
@ -1540,7 +1546,8 @@ int handleevents(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (j < 4) mouseb &= ~(1<<j);
|
||||
if (j != SDL_BUTTON_WHEELUP && j != SDL_BUTTON_WHEELDOWN)
|
||||
mouseb &= ~(1<<j);
|
||||
}
|
||||
|
||||
if (mousepresscallback)
|
||||
|
|
|
@ -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
|
||||
|
@ -756,13 +762,25 @@ int initinput(void)
|
|||
int i;
|
||||
moustat=0;
|
||||
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;
|
||||
keyasciififoplc = keyasciififoend = 0;
|
||||
|
||||
inputdevices = 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())
|
||||
return -1;
|
||||
|
||||
|
@ -1165,7 +1183,7 @@ void releaseallbuttons(void)
|
|||
//if (OSD_HandleKey(i, 0) != 0) {
|
||||
OSD_HandleScanCode(i, 0);
|
||||
SetKey(i, 0);
|
||||
if (keypresscallback) keypresscallback(i, 0);
|
||||
if (keypresscallback) keypresscallback(remap[i], 0);
|
||||
//}
|
||||
}
|
||||
lastKeyDown = lastKeyTime = 0;
|
||||
|
@ -1703,7 +1721,7 @@ static void ProcessInputDevices(void)
|
|||
SetKey(k, (didod[i].dwData & 0x80) == 0x80);
|
||||
|
||||
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))
|
||||
|
@ -4219,7 +4237,7 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
|
|||
SetKey(0x59, 1);
|
||||
|
||||
if (keypresscallback)
|
||||
keypresscallback(0x59, 1);
|
||||
keypresscallback(remap[0x59], 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -230,31 +230,55 @@ ifeq ($(USE_OPENAL),1)
|
|||
OURCFLAGS+= -DUSE_OPENAL
|
||||
endif
|
||||
|
||||
.SILENT:
|
||||
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB)
|
||||
|
||||
# TARGETS
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX)
|
||||
all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX)
|
||||
else
|
||||
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
|
||||
all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
|
||||
endif
|
||||
|
||||
all:
|
||||
${BUILD_FINISHED}
|
||||
|
||||
notice:
|
||||
${BUILD_STARTED}
|
||||
|
||||
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB)
|
||||
$(CC) -o $@ $^ $(LIBS) $(STDCPPLIB) # -Wl,-Map=$@.map
|
||||
-rm -f eduke32.sym$(EXESUFFIX)
|
||||
cp eduke32$(EXESUFFIX) eduke32.sym$(EXESUFFIX)
|
||||
${LINK_STATUS}
|
||||
if $(CC) -o $@ $^ $(LIBS) $(STDCPPLIB); then \
|
||||
${LINK_OK}; \
|
||||
else \
|
||||
${LINK_FAILED}; \
|
||||
fi
|
||||
ifeq (1,$(RELEASE))
|
||||
strip eduke32$(EXESUFFIX)
|
||||
endif
|
||||
|
||||
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB)
|
||||
$(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) # -Wl,-Map=$@.map
|
||||
-rm -f mapster32.sym$(EXESUFFIX)
|
||||
cp mapster32$(EXESUFFIX) mapster32.sym$(EXESUFFIX)
|
||||
${LINK_STATUS}
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS); then \
|
||||
${LINK_OK}; \
|
||||
else \
|
||||
${LINK_FAILED}; \
|
||||
fi
|
||||
ifeq (1,$(RELEASE))
|
||||
strip mapster32$(EXESUFFIX)
|
||||
endif
|
||||
|
||||
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)
|
||||
endif
|
||||
|
||||
include Makefile.deps
|
||||
|
||||
|
@ -271,27 +295,66 @@ $(EOBJ)/$(EDITORLIB): editorlib
|
|||
|
||||
# RULES
|
||||
$(OBJ)/%.$o: $(SRC)/%.nasm
|
||||
${COMPILE_STATUS}
|
||||
nasm $(NASMFLAGS) $< -o $@
|
||||
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm
|
||||
${COMPILE_STATUS}
|
||||
nasm $(NASMFLAGS) $< -o $@
|
||||
|
||||
$(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
|
||||
$(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
|
||||
$(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
|
||||
$(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
|
||||
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
|
||||
$(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@
|
||||
${COMPILE_STATUS}
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \
|
||||
${COMPILE_OK}; \
|
||||
else \
|
||||
${COMPILE_FAILED}; \
|
||||
fi
|
||||
|
||||
$(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)/editor_banner.$o: $(RSRC)/editor_banner.c
|
||||
|
@ -305,7 +368,7 @@ $(RSRC)/editor_banner.c: $(RSRC)/build.bmp
|
|||
# PHONIES
|
||||
|
||||
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
|
||||
-rm -f $(EOBJ)/*
|
||||
|
|
|
@ -217,7 +217,11 @@ static char * mousedefaults[] =
|
|||
"Jetpack",
|
||||
"",
|
||||
"Previous_Weapon",
|
||||
"Next_Weapon"
|
||||
"Next_Weapon",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
|
||||
|
@ -228,6 +232,10 @@ static char * mouseclickeddefaults[] =
|
|||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#define BUILDDATE " 20081011"
|
||||
#define BUILDDATE " 20081017"
|
||||
#define VERSION " 1.2.0devel"
|
||||
|
||||
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)
|
||||
{
|
||||
Bsprintf(lo2,names[sprite[spritenum].picnum]);
|
||||
Bstrcpy(lo2,names[sprite[spritenum].picnum]);
|
||||
}// end SpriteName
|
||||
|
||||
static void ReadPaletteTable()
|
||||
|
@ -7534,7 +7534,7 @@ static void checkcommandline(int argc, const char **argv)
|
|||
if (j > 0)
|
||||
{
|
||||
testplay_addparam[j-1] = 0;
|
||||
Brealloc(testplay_addparam, j*sizeof(char));
|
||||
testplay_addparam = Brealloc(testplay_addparam, j*sizeof(char));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8955,95 +8955,95 @@ static void Keys2d3d(void)
|
|||
|
||||
if ((!eitherALT && cursectnum >= 0) || (eitherALT && startsectnum >= 0))
|
||||
{
|
||||
char *param = " -map autosave.map -noinstancechecking";
|
||||
char *fullparam;
|
||||
char current_cwd[BMAX_PATH];
|
||||
int slen = 0;
|
||||
BFILE *fp;
|
||||
char *param = " -map autosave.map -noinstancechecking";
|
||||
char *fullparam;
|
||||
char current_cwd[BMAX_PATH];
|
||||
int slen = 0;
|
||||
BFILE *fp;
|
||||
|
||||
if ((program_origcwd[0] == '\0') || !getcwd(current_cwd, BMAX_PATH))
|
||||
current_cwd[0] = '\0';
|
||||
else // Before we check if file exists, for the case there's no absolute path.
|
||||
chdir(program_origcwd);
|
||||
if ((program_origcwd[0] == '\0') || !getcwd(current_cwd, BMAX_PATH))
|
||||
current_cwd[0] = '\0';
|
||||
else // Before we check if file exists, for the case there's no absolute path.
|
||||
chdir(program_origcwd);
|
||||
|
||||
fp = fopen(game_executable, "rb"); // File exists?
|
||||
if (fp != NULL)
|
||||
fclose(fp);
|
||||
else
|
||||
{
|
||||
fp = fopen(game_executable, "rb"); // File exists?
|
||||
if (fp != NULL)
|
||||
fclose(fp);
|
||||
else
|
||||
{
|
||||
#ifdef _WIN32
|
||||
fullparam = Bstrrchr(mapster32_fullpath, '\\');
|
||||
fullparam = Bstrrchr(mapster32_fullpath, '\\');
|
||||
#else
|
||||
fullparam = Bstrrchr(mapster32_fullpath, '/');
|
||||
fullparam = Bstrrchr(mapster32_fullpath, '/');
|
||||
#endif
|
||||
if (fullparam)
|
||||
{
|
||||
slen = fullparam-mapster32_fullpath+1;
|
||||
Bstrncpy(game_executable, mapster32_fullpath, slen);
|
||||
// game_executable is now expected to not be NULL-terminated!
|
||||
Bstrcpy(game_executable+slen, DEFAULT_GAME_EXEC);
|
||||
}
|
||||
else
|
||||
Bstrcpy(game_executable, DEFAULT_GAME_LOCAL_EXEC);
|
||||
}
|
||||
|
||||
if (current_cwd[0] != '\0') // Temporarily changing back,
|
||||
chdir(current_cwd); // after checking if file exists.
|
||||
|
||||
if (testplay_addparam)
|
||||
slen = Bstrlen(testplay_addparam);
|
||||
|
||||
// Considering the NULL character, quatation marks
|
||||
// and a possible extra space not in testplay_addparam,
|
||||
// the length should be Bstrlen(game_executable)+Bstrlen(param)+(slen+1)+2+1.
|
||||
|
||||
fullparam = Bmalloc(Bstrlen(game_executable)+Bstrlen(param)+slen+4);
|
||||
Bsprintf(fullparam,"\"%s\"",game_executable);
|
||||
|
||||
if (testplay_addparam)
|
||||
if (fullparam)
|
||||
{
|
||||
Bstrcat(fullparam, " ");
|
||||
Bstrcat(fullparam, testplay_addparam);
|
||||
slen = fullparam-mapster32_fullpath+1;
|
||||
Bstrncpy(game_executable, mapster32_fullpath, slen);
|
||||
// game_executable is now expected to not be NULL-terminated!
|
||||
Bstrcpy(game_executable+slen, DEFAULT_GAME_EXEC);
|
||||
}
|
||||
Bstrcat(fullparam, param);
|
||||
|
||||
fixspritesectors(); //Do this before saving!
|
||||
ExtPreSaveMap();
|
||||
if (eitherALT)
|
||||
saveboard("autosave.map",&startposx,&startposy,&startposz,&startang,&startsectnum);
|
||||
else
|
||||
saveboard("autosave.map",&posx,&posy,&posz,&ang,&cursectnum);
|
||||
message("Board saved to AUTOSAVE.MAP. Starting the game...");
|
||||
Bstrcpy(game_executable, DEFAULT_GAME_LOCAL_EXEC);
|
||||
}
|
||||
|
||||
uninitmouse();
|
||||
if (current_cwd[0] != '\0') // Temporarily changing back,
|
||||
chdir(current_cwd); // after checking if file exists.
|
||||
|
||||
if (testplay_addparam)
|
||||
slen = Bstrlen(testplay_addparam);
|
||||
|
||||
// Considering the NULL character, quatation marks
|
||||
// and a possible extra space not in testplay_addparam,
|
||||
// the length should be Bstrlen(game_executable)+Bstrlen(param)+(slen+1)+2+1.
|
||||
|
||||
fullparam = Bmalloc(Bstrlen(game_executable)+Bstrlen(param)+slen+4);
|
||||
Bsprintf(fullparam,"\"%s\"",game_executable);
|
||||
|
||||
if (testplay_addparam)
|
||||
{
|
||||
Bstrcat(fullparam, " ");
|
||||
Bstrcat(fullparam, testplay_addparam);
|
||||
}
|
||||
Bstrcat(fullparam, param);
|
||||
|
||||
fixspritesectors(); //Do this before saving!
|
||||
ExtPreSaveMap();
|
||||
if (eitherALT)
|
||||
saveboard("autosave.map",&startposx,&startposy,&startposz,&startang,&startsectnum);
|
||||
else
|
||||
saveboard("autosave.map",&posx,&posy,&posz,&ang,&cursectnum);
|
||||
message("Board saved to AUTOSAVE.MAP. Starting the game...");
|
||||
|
||||
uninitmouse();
|
||||
#ifdef _WIN32
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
ZeroMemory(&si,sizeof(si));
|
||||
ZeroMemory(&pi,sizeof(pi));
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory(&si,sizeof(si));
|
||||
ZeroMemory(&pi,sizeof(pi));
|
||||
si.cb = sizeof(si);
|
||||
|
||||
if (!CreateProcess(NULL,fullparam,NULL,NULL,0,0,NULL,NULL,&si,&pi))
|
||||
message("Error launching the game!");
|
||||
else WaitForSingleObject(pi.hProcess,INFINITE);
|
||||
}
|
||||
if (!CreateProcess(NULL,fullparam,NULL,NULL,0,0,NULL,NULL,&si,&pi))
|
||||
message("Error launching the game!");
|
||||
else WaitForSingleObject(pi.hProcess,INFINITE);
|
||||
}
|
||||
#else
|
||||
if (current_cwd[0] != '\0')
|
||||
{
|
||||
chdir(program_origcwd);
|
||||
system(fullparam);
|
||||
// message("Error launching the game!");
|
||||
chdir(current_cwd);
|
||||
}
|
||||
else system(fullparam);
|
||||
#endif
|
||||
if (current_cwd[0] != '\0')
|
||||
{
|
||||
chdir(program_origcwd);
|
||||
system(fullparam);
|
||||
// message("Error launching the game!");
|
||||
message("Game process exited");
|
||||
initmouse();
|
||||
chdir(current_cwd);
|
||||
}
|
||||
else system(fullparam);
|
||||
#endif
|
||||
// message("Error launching the game!");
|
||||
message("Game process exited");
|
||||
initmouse();
|
||||
|
||||
Bfree(fullparam);
|
||||
Bfree(fullparam);
|
||||
}
|
||||
else
|
||||
message("Position must be in valid player space to test map!");
|
||||
|
@ -10430,7 +10430,7 @@ static void FuncMenu(void)
|
|||
{
|
||||
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)
|
||||
{
|
||||
j = 0;
|
||||
|
@ -10460,7 +10460,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
Bsprintf(tempbuf,"Delete all sprites of tile #: ");
|
||||
|
@ -10480,7 +10480,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
j=getnumber16("Set map sky shade: ",0,128,1);
|
||||
|
@ -10496,7 +10496,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
j=getnumber16("Set map sky height: ",0,16777216,1);
|
||||
|
@ -10515,7 +10515,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
j=getnumber16("Z offset: ",0,16777216,1);
|
||||
|
@ -10536,7 +10536,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
j=getnumber16("Percentage of original: ",100,1000,0);
|
||||
|
@ -10577,7 +10577,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
j=getnumber16("Shade divisor: ",1,128,1);
|
||||
|
@ -10600,7 +10600,7 @@ static void FuncMenu(void)
|
|||
break;
|
||||
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)
|
||||
{
|
||||
j=getnumber16("Visibility divisor: ",1,128,0);
|
||||
|
|
|
@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define APPNAME "EDuke32"
|
||||
#define VERSION " 1.5.0devel"
|
||||
// this is checked against http://eduke32.com/VERSION
|
||||
#define BUILDDATE " 20081011"
|
||||
#define HEAD2 APPNAME VERSION BUILDDATE
|
||||
extern char *s_builddate;
|
||||
#define HEAD2 APPNAME VERSION
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -844,7 +844,7 @@ void getpackets(void)
|
|||
for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
|
||||
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.");
|
||||
|
||||
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");
|
||||
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)
|
||||
{
|
||||
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
|
||||
spriteext[tsprite[j].owner].tspr = NULL;
|
||||
// spriteext[tsprite[j].owner].tspr = NULL;
|
||||
}
|
||||
}
|
||||
while (j--);
|
||||
|
@ -7611,7 +7612,7 @@ PALONLY:
|
|||
if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
|
||||
{
|
||||
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
|
||||
spriteext[tsprite[j].owner].tspr = NULL;
|
||||
// spriteext[tsprite[j].owner].tspr = NULL;
|
||||
}
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
|
@ -8842,7 +8843,8 @@ static void comlinehelp(void)
|
|||
"\n-?, -help, --help\tDisplay this help message and exit"
|
||||
;
|
||||
#if defined RENDERTYPEWIN
|
||||
wm_msgbox(HEAD2,s);
|
||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
||||
wm_msgbox(tempbuf,s);
|
||||
#else
|
||||
initprintf("%s\n",s);
|
||||
#endif
|
||||
|
@ -10534,7 +10536,7 @@ static void sendplayerupdate(void)
|
|||
|
||||
buf[0] = 6;
|
||||
buf[1] = myconnectindex;
|
||||
buf[2] = (char)atoi(BUILDDATE);
|
||||
buf[2] = (char)atoi(s_builddate);
|
||||
l = 3;
|
||||
|
||||
//null terminated player name to send
|
||||
|
@ -10761,7 +10763,8 @@ void app_main(int argc,const char **argv)
|
|||
(int(*)(void))GetTime,
|
||||
GAME_onshowosd
|
||||
);
|
||||
wm_setapptitle(HEAD2);
|
||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
||||
wm_setapptitle(tempbuf);
|
||||
|
||||
initprintf("%s\n",apptitle);
|
||||
// initprintf("Compiled %s\n",datetimestring);
|
||||
|
@ -10892,7 +10895,7 @@ void app_main(int argc,const char **argv)
|
|||
initprintf("Current version is %d",atoi(tempbuf));
|
||||
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. "
|
||||
"Browse to http://eduke32.sourceforge.net now?"))
|
||||
|
@ -11186,9 +11189,26 @@ void app_main(int argc,const char **argv)
|
|||
|
||||
initprintf("Initializing OSD...\n");
|
||||
|
||||
OSD_SetVersionString(HEAD2, 10,0);
|
||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
||||
OSD_SetVersionString(tempbuf, 10,0);
|
||||
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)
|
||||
{
|
||||
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.");
|
||||
} */
|
||||
|
||||
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);
|
||||
|
||||
// if(KB_KeyPressed( sc_Escape ) ) gameexit(" ");
|
||||
|
|
|
@ -1592,7 +1592,8 @@ static int parse(void)
|
|||
Bstrcpy(fta_quotes[i],g_player[g_p].user_name);
|
||||
break;
|
||||
case STR_VERSION:
|
||||
Bstrcpy(fta_quotes[i],HEAD2);
|
||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
||||
Bstrcpy(fta_quotes[i],tempbuf);
|
||||
break;
|
||||
case STR_GAMETYPE:
|
||||
Bstrcpy(fta_quotes[i],gametype_names[ud.coop]);
|
||||
|
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//-------------------------------------------------------------------------
|
||||
#include "duke3d.h"
|
||||
|
||||
char *s_builddate = "20081018";
|
||||
char *MusicPtr = NULL;
|
||||
int Musicsize;
|
||||
|
||||
|
|
|
@ -1468,8 +1468,12 @@ int registerosdcommands(void)
|
|||
for (i=0;i<NUMGAMEFUNCTIONS-1;i++)
|
||||
{
|
||||
char *t;
|
||||
int j;
|
||||
|
||||
Bsprintf(tempbuf,"gamefunc_%s",gamefunctions[i]);
|
||||
t = Bstrdup(tempbuf);
|
||||
for (j=Bstrlen(t);j>=0;j--)
|
||||
t[j] = Btolower(t[j]);
|
||||
Bstrcat(tempbuf,": game button");
|
||||
OSD_RegisterFunction(t,Bstrdup(tempbuf),osdcmd_button);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue