From 21192dfb480bf5a20d3d6f5de05ed1aa64a502a2 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 18 May 2010 00:30:30 +0000 Subject: [PATCH] Make nedmalloc a compile time option and add support for loading an external nedmalloc.dll at run time if it isn't compiled in git-svn-id: https://svn.eduke32.com/eduke32@1643 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 1 + polymer/eduke32/Makefile.msvc | 4 +- polymer/eduke32/build/Makefile | 8 +- polymer/eduke32/build/Makefile.msvc | 10 +- polymer/eduke32/build/Makefile.shared | 4 + polymer/eduke32/build/include/baselayer.h | 2 +- polymer/eduke32/build/include/compat.h | 16 +- polymer/eduke32/build/include/nedmalloc.h | 10 + polymer/eduke32/build/src/compat.c | 12 + polymer/eduke32/build/src/config.c | 8 - polymer/eduke32/build/src/engine.c | 2 + polymer/eduke32/build/src/mdsprite.c | 258 ++++----- polymer/eduke32/build/src/nedmalloc.c | 9 - polymer/eduke32/build/src/sdlayer.c | 4 +- polymer/eduke32/build/src/winlayer.c | 604 ++++++++++------------ polymer/eduke32/nedmalloc.dll | Bin 0 -> 39936 bytes polymer/eduke32/source/game.c | 20 +- polymer/eduke32/source/grpscan.c | 2 +- 18 files changed, 479 insertions(+), 495 deletions(-) create mode 100644 polymer/eduke32/nedmalloc.dll diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index c0bac1371..9b9f8e24d 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -18,6 +18,7 @@ USE_OPENGL = 1 NOASM = 0 LINKED_GTK = 0 BUILD32_ON_64 = 0 +NEDMALLOC = 1 # Debugging/Build options RELEASE?=1 diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index 59a089e3b..d23a6dd29 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -31,11 +31,11 @@ flags_link=/RELEASE /LTCG DXROOT="C:\Program Files\Microsoft DirectX SDK (February 2010)" -ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DPOLYMER +ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DPOLYMER # /DNEDMALLOC CC=cl AS=ml -LINK=link /nologo /opt:ref +LINK=link /nologo /opt:ref MT=mt CFLAGS= /MT /J /nologo $(flags_cl) \ /I$(INC) /I$(EINC)\msvc /I$(EINC)\ /I$(SRC)\jmact /I$(JAUDIOLIBDIR)\include /I$(ENETDIR)\include \ diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index fa570f47c..6b17df0d3 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -26,6 +26,7 @@ USE_OPENGL ?= 1 NOASM ?= 0 LINKED_GTK ?= 0 BUILD32_ON_64 ?= 0 +NEDMALLOC ?= 1 ifeq (0,$(USE_OPENGL)) POLYMER = 0 @@ -148,8 +149,7 @@ ENGINEOBJS+= \ $(OBJ)/osd.$o \ $(OBJ)/pragmas.$o \ $(OBJ)/scriptfile.$o \ - $(OBJ)/nedmalloc.$o \ - $(OBJ)/mutex.$o + $(OBJ)/mutex.$o ifeq (1,$(USE_OPENGL)) ENGINEOBJS+= $(OBJ)/mdsprite.$o @@ -160,6 +160,10 @@ ifeq (1,$(POLYMER)) ENGINEOBJS+= $(OBJ)/polymer.$o endif +ifeq (1,$(NEDMALLOC)) + ENGINEOBJS+= $(OBJ)/nedmalloc.$o +endif + EDITOROBJS=$(OBJ)/build.$o \ $(OBJ)/config.$o diff --git a/polymer/eduke32/build/Makefile.msvc b/polymer/eduke32/build/Makefile.msvc index e71260ac5..9c1786389 100644 --- a/polymer/eduke32/build/Makefile.msvc +++ b/polymer/eduke32/build/Makefile.msvc @@ -9,7 +9,7 @@ OBJ=obj.msc !endif INC=include\ # !ifndef CFLAGS -CFLAGS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DKSFORBUILD /DPOLYMER +CFLAGS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DKSFORBUILD /DPOLYMER # /DNEDMALLOC !endif o=obj @@ -76,10 +76,10 @@ ENGINEOBJS= \ $(OBJ)\pragmas.$o \ $(OBJ)\scriptfile.$o \ $(OBJ)\winlayer.$o \ - $(OBJ)\polymer.$o \ - $(OBJ)\nedmalloc.$o \ - $(OBJ)\mutex.$o \ - $(OBJ)\rawinput.$o + $(OBJ)\polymer.$o \ + $(OBJ)\mutex.$o \ + $(OBJ)\rawinput.$o \ +# $(OBJ)\nedmalloc.$o EDITOROBJS=$(OBJ)\build.$o \ $(OBJ)\startwin.editor.$o \ diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index 6e8cf5b18..26025867f 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -187,6 +187,10 @@ ifneq (0,$(POLYMER)) endif endif +ifneq (0,$(NEDMALLOC)) + BUILDCFLAGS+= -DNEDMALLOC +endif + ifeq ($(PRETTY_OUTPUT),1) BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS)\"\033[0m\n" BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n" diff --git a/polymer/eduke32/build/include/baselayer.h b/polymer/eduke32/build/include/baselayer.h index 221ae4c2d..88d80f819 100644 --- a/polymer/eduke32/build/include/baselayer.h +++ b/polymer/eduke32/build/include/baselayer.h @@ -12,7 +12,7 @@ extern "C" { #endif -#define SYSTEM_POOL_SIZE (128 * 1048576) +#define SYSTEM_POOL_SIZE (64 * 1048576) extern int32_t _buildargc; extern const char **_buildargv; diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index 61cdb17f0..9e767ab16 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -35,11 +35,9 @@ #endif #endif -#define USE_ALLOCATOR 1 -#define USE_MAGIC_HEADERS 1 -#define ENABLE_FAST_HEAP_DETECTION 1 - +#ifdef NEDMALLOC #include "nedmalloc.h" +#endif #ifndef TRUE #define TRUE 1 @@ -382,10 +380,19 @@ int32_t Bclosedir(BDIR *dir); #ifdef __compat_h_macrodef__ # define Brand rand # define Balloca alloca +#ifdef NEDMALLOC # define Bmalloc nedmalloc # define Bcalloc nedcalloc # define Brealloc nedrealloc # define Bfree nedfree +# define Bstrdup nedstrdup +#else +# define Bmalloc malloc +# define Bcalloc calloc +# define Brealloc realloc +# define Bfree free +# define Bstrdup strdup +#endif # define Bopen open # define Bclose close # define Bwrite write @@ -408,7 +415,6 @@ int32_t Bclosedir(BDIR *dir); # define Bfread fread # define Bfwrite fwrite # define Bfprintf fprintf -# define Bstrdup nedstrdup # define Bstrcpy strcpy # define Bstrncpy strncpy # define Bstrcmp strcmp diff --git a/polymer/eduke32/build/include/nedmalloc.h b/polymer/eduke32/build/include/nedmalloc.h index 5f1272ae7..4ea9d93ff 100644 --- a/polymer/eduke32/build/include/nedmalloc.h +++ b/polymer/eduke32/build/include/nedmalloc.h @@ -81,6 +81,16 @@ fashion which may not hold true across OS upgrades. #include /* for size_t */ +#define USE_ALLOCATOR 1 +#define USE_MAGIC_HEADERS 1 +#define MAXTHREADSINPOOL 2 +#define FINEGRAINEDBINS 1 +#define ENABLE_LARGE_PAGES 1 +#define ENABLE_FAST_HEAP_DETECTION 1 +#define NDEBUG 1 +#define THREADCACHEMAX 4194304 +#define THREADCACHEMAXBINS ((22-4)*2) + #ifndef NEDMALLOCEXTSPEC #ifdef NEDMALLOC_DLL_EXPORTS #ifdef WIN32 diff --git a/polymer/eduke32/build/src/compat.c b/polymer/eduke32/build/src/compat.c index 3deccdf76..670265379 100644 --- a/polymer/eduke32/build/src/compat.c +++ b/polymer/eduke32/build/src/compat.c @@ -54,12 +54,20 @@ int32_t Brand(void) void *Bmalloc(bsize_t size) { +#ifdef NEDMALLOC return nedmalloc(size); +#else + return malloc(size); +#endif } void Bfree(void *ptr) { +#ifdef NEDMALLOC nedfree(ptr); +#else + free(ptr); +#endif } int32_t Bopen(const char *pathname, int32_t flags, uint32_t mode) @@ -157,7 +165,11 @@ bsize_t Bfwrite(const void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream) char *Bstrdup(const char *s) { +#ifdef NEDMALLOC return nedstrdup(s); +#else + return strdup(s); +#endif } char *Bstrcpy(char *dest, const char *src) diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index fd5e875e9..7767c3aeb 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -247,16 +247,8 @@ int32_t loadsetup(const char *fn) if (readconfig(fp, "parlock", val, VL) > 0) ParentalLock = Batoi(val); -#ifdef _WIN32 - { - extern char map_dik_code(int32_t); - 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) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 059220d4b..4276788d2 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -6672,7 +6672,9 @@ int32_t loadboard(char *filename, char fromwhere, int32_t *daposx, int32_t *dapo clearbufbyte(&sprite, sizeof(sprite), 0); */ +#ifdef NEDMALLOC nedtrimthreadcache(0, 0); +#endif initspritelists(); diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index c8b2c31eb..4daa4664c 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -81,7 +81,7 @@ void freevbos() { // OSD_Printf("freeing model %d vbo\n",i); bglDeleteBuffersARB(m->head.numsurfs, m->vbos); - nedpfree(model_data_pool, m->vbos); + Bfree(m->vbos); m->vbos = NULL; } } @@ -101,7 +101,7 @@ void freeallmodels() if (models) { for (i=0; i= nummodelsalloced) { - ml = (mdmodel_t **)nedprealloc(model_data_pool, models,(nummodelsalloced+MODELALLOCGROUP)*sizeof(void*)); if (!ml) return(-1); + ml = (mdmodel_t **)Brealloc(models,(nummodelsalloced+MODELALLOCGROUP)*sizeof(void*)); if (!ml) return(-1); models = ml; nummodelsalloced += MODELALLOCGROUP; } @@ -310,7 +310,7 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char * ma.fpssc = fpssc; ma.flags = flags; - map = (mdanim_t*)nedpcalloc(model_data_pool, 1,sizeof(mdanim_t)); + map = (mdanim_t*)Bcalloc(1,sizeof(mdanim_t)); if (!map) return(-4); Bmemcpy(map, &ma, sizeof(ma)); @@ -340,13 +340,13 @@ int32_t md_defineskin(int32_t modelid, const char *skinfn, int32_t palnum, int32 if (sk->palette == (uint8_t)palnum && skinnum == sk->skinnum && surfnum == sk->surfnum) break; if (!sk) { - sk = (mdskinmap_t *)nedpcalloc(model_data_pool, 1,sizeof(mdskinmap_t)); + sk = (mdskinmap_t *)Bcalloc(1,sizeof(mdskinmap_t)); if (!sk) return -4; if (!skl) m->skinmap = sk; else skl->next = sk; } - else if (sk->fn) nedpfree(model_data_pool, sk->fn); + else if (sk->fn) Bfree(sk->fn); sk->palette = (uint8_t)palnum; sk->skinnum = skinnum; @@ -354,7 +354,7 @@ int32_t md_defineskin(int32_t modelid, const char *skinfn, int32_t palnum, int32 sk->param = param; sk->specpower = specpower; sk->specfactor = specfactor; - sk->fn = (char *)nedpmalloc(model_data_pool, strlen(skinfn)+1); + sk->fn = (char *)malloc(strlen(skinfn)+1); if (!sk->fn) return(-4); strcpy(sk->fn, skinfn); @@ -418,14 +418,14 @@ static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t int32_t r, g, b; picfillen = kfilelength(filh); - picfil = (char *)nedpmalloc(model_data_pool, picfillen+1); if (!picfil) { return -1; } + picfil = (char *)malloc(picfillen+1); if (!picfil) { return -1; } kread(filh, picfil, picfillen); // tsizx/y = replacement texture's natural size // xsiz/y = 2^x size of replacement kpgetdim(picfil,picfillen,&tsizx,&tsizy); - if (tsizx == 0 || tsizy == 0) { nedpfree(model_data_pool, picfil); return -1; } + if (tsizx == 0 || tsizy == 0) { Bfree(picfil); return -1; } if (!glinfo.texnpot) { @@ -438,13 +438,13 @@ static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t ysiz = tsizy; } *osizx = tsizx; *osizy = tsizy; - pic = (coltype *)nedpmalloc(model_data_pool, xsiz*ysiz*sizeof(coltype)); - if (!pic) { nedpfree(model_data_pool, picfil); return -1; } + pic = (coltype *)malloc(xsiz*ysiz*sizeof(coltype)); + if (!pic) { Bfree(picfil); return -1; } memset(pic,0,xsiz*ysiz*sizeof(coltype)); if (kprender(picfil,picfillen,(intptr_t)pic,xsiz*sizeof(coltype),xsiz,ysiz,0,0)) - { nedpfree(model_data_pool, picfil); nedpfree(model_data_pool, pic); return -1; } - nedpfree(model_data_pool, picfil); + { Bfree(picfil); Bfree(pic); return -1; } + Bfree(picfil); cptr = &britable[gammabrightness ? 0 : curbrightness][0]; r=(glinfo.bgra)?hictinting[pal].b:hictinting[pal].r; @@ -621,14 +621,14 @@ static int32_t mdloadskin_cached(int32_t fil, texcacheheader *head, int32_t *doa if (alloclen < pict.size) { - void *picc = nedprealloc(model_data_pool, pic, pict.size); + void *picc = Brealloc(pic, pict.size); if (!picc) goto failure; else pic = picc; alloclen = pict.size; - picc = nedprealloc(model_data_pool, packbuf, alloclen+16); + picc = Brealloc(packbuf, alloclen+16); if (!picc) goto failure; else packbuf = picc; - picc = nedprealloc(model_data_pool, midbuf, pict.size); + picc = Brealloc(midbuf, pict.size); if (!picc) goto failure; else midbuf = picc; } @@ -639,14 +639,14 @@ static int32_t mdloadskin_cached(int32_t fil, texcacheheader *head, int32_t *doa if (bglGetError() != GL_NO_ERROR) goto failure; } - if (midbuf) nedpfree(model_data_pool, midbuf); - if (pic) nedpfree(model_data_pool, pic); - if (packbuf) nedpfree(model_data_pool, packbuf); + if (midbuf) Bfree(midbuf); + if (pic) Bfree(pic); + if (packbuf) Bfree(packbuf); return 0; failure: - if (midbuf) nedpfree(model_data_pool, midbuf); - if (pic) nedpfree(model_data_pool, pic); - if (packbuf) nedpfree(model_data_pool, packbuf); + if (midbuf) Bfree(midbuf); + if (pic) Bfree(pic); + if (packbuf) Bfree(packbuf); return -1; } // --------------------------------------------------- JONOF'S COMPRESSED TEXTURE CACHE STUFF @@ -770,7 +770,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) else if (!hasalpha) intexfmt = GL_RGB; if (glinfo.bgra) texfmt = GL_BGRA; uploadtexture((doalloc&1), xsiz, ysiz, intexfmt, texfmt, (coltype*)fptr, xsiz, ysiz, 0|8192); - nedpfree(model_data_pool, (void*)fptr); + Bfree((void*)fptr); } if (!m->skinloaded) @@ -965,7 +965,7 @@ static void mdloadvbos(md3model_t *m) { int32_t i; - m->vbos = nedpmalloc(model_data_pool, m->head.numsurfs * sizeof(GLuint)); + m->vbos = malloc(m->head.numsurfs * sizeof(GLuint)); bglGenBuffersARB(m->head.numsurfs, m->vbos); i = 0; @@ -989,7 +989,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) char st[BMAX_PATH]; int32_t i, j, k; - m = (md2model_t *)nedpcalloc(model_data_pool, 1,sizeof(md2model_t)); if (!m) return(0); + m = (md2model_t *)Bcalloc(1,sizeof(md2model_t)); if (!m) return(0); m->mdnum = 2; m->scale = .01f; kread(fil,(char *)&head,sizeof(md2head_t)); @@ -1003,7 +1003,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) head.ofsframes = B_LITTLE32(head.ofsframes); head.ofsglcmds = B_LITTLE32(head.ofsglcmds); head.ofseof = B_LITTLE32(head.ofseof); - if ((head.id != 0x32504449) || (head.vers != 8)) { nedpfree(model_data_pool, m); return(0); } //"IDP2" + if ((head.id != 0x32504449) || (head.vers != 8)) { Bfree(m); return(0); } //"IDP2" m->numskins = head.numskins; m->numframes = head.numframes; @@ -1011,26 +1011,26 @@ static md2model_t *md2load(int32_t fil, const char *filnam) m->numglcmds = head.numglcmds; m->framebytes = head.framebytes; - m->frames = (char *)nedpcalloc(model_data_pool, m->numframes,m->framebytes); if (!m->frames) { nedpfree(model_data_pool, m); return(0); } - m->glcmds = (int32_t *)nedpcalloc(model_data_pool, m->numglcmds,sizeof(int32_t)); if (!m->glcmds) { nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } - m->tris = (md2tri_t *)nedpcalloc(model_data_pool, head.numtris, sizeof(md2tri_t)); if (!m->tris) { nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } - m->uv = (md2uv_t *)nedpcalloc(model_data_pool, head.numuv, sizeof(md2uv_t)); if (!m->uv) { nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + m->frames = (char *)Bcalloc(m->numframes,m->framebytes); if (!m->frames) { Bfree(m); return(0); } + m->glcmds = (int32_t *)Bcalloc(m->numglcmds,sizeof(int32_t)); if (!m->glcmds) { Bfree(m->frames); Bfree(m); return(0); } + m->tris = (md2tri_t *)Bcalloc(head.numtris, sizeof(md2tri_t)); if (!m->tris) { Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + m->uv = (md2uv_t *)Bcalloc(head.numuv, sizeof(md2uv_t)); if (!m->uv) { Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } klseek(fil,head.ofsframes,SEEK_SET); if (kread(fil,(char *)m->frames,m->numframes*m->framebytes) != m->numframes*m->framebytes) - { nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } klseek(fil,head.ofsglcmds,SEEK_SET); if (kread(fil,(char *)m->glcmds,m->numglcmds*sizeof(int32_t)) != (int32_t)(m->numglcmds*sizeof(int32_t))) - { nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } klseek(fil,head.ofstris,SEEK_SET); if (kread(fil,(char *)m->tris,head.numtris*sizeof(md2tri_t)) != (int32_t)(head.numtris*sizeof(md2tri_t))) - { nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } klseek(fil,head.ofsuv,SEEK_SET); if (kread(fil,(char *)m->uv,head.numuv*sizeof(md2uv_t)) != (int32_t)(head.numuv*sizeof(md2uv_t))) - { nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } #if B_BIG_ENDIAN != 0 { @@ -1072,16 +1072,16 @@ static md2model_t *md2load(int32_t fil, const char *filnam) if ((st[i] == '/') || (st[i] == '\\')) { i++; break; } if (i<0) i=0; st[i] = 0; - m->basepath = (char *)nedpmalloc(model_data_pool, i+1); if (!m->basepath) { nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + m->basepath = (char *)malloc(i+1); if (!m->basepath) { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } strcpy(m->basepath, st); - m->skinfn = (char *)nedpcalloc(model_data_pool, m->numskins,64); if (!m->skinfn) { nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + m->skinfn = (char *)Bcalloc(m->numskins,64); if (!m->skinfn) { Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } klseek(fil,head.ofsskins,SEEK_SET); if (kread(fil,m->skinfn,64*m->numskins) != 64*m->numskins) - { nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + { Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } - m->texid = (GLuint *)nedpcalloc(model_data_pool, m->numskins, sizeof(GLuint) * (HICEFFECTMASK+1)); - if (!m->texid) { nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + m->texid = (GLuint *)Bcalloc(m->numskins, sizeof(GLuint) * (HICEFFECTMASK+1)); + if (!m->texid) { Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } maxmodelverts = max(maxmodelverts, m->numverts); maxmodeltris = max(maxmodeltris, head.numtris); @@ -1090,7 +1090,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) // the MD2 is now loaded internally - let's begin the MD3 conversion process //OSD_Printf("Beginning md3 conversion.\n"); - m3 = (md3model_t *)nedpcalloc(model_data_pool, 1, sizeof(md3model_t)); if (!m3) { nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + m3 = (md3model_t *)Bcalloc(1, sizeof(md3model_t)); if (!m3) { Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } m3->mdnum = 3; m3->texid = 0; m3->scale = m->scale; m3->head.id = 0x33504449; m3->head.vers = 15; // this changes the conversion code to do real MD2->MD3 conversion @@ -1104,8 +1104,8 @@ static md2model_t *md2load(int32_t fil, const char *filnam) m3->numskins = m3->head.numskins; m3->numframes = m3->head.numframes; - m3->head.frames = (md3frame_t *)nedpcalloc(model_data_pool, m3->head.numframes, sizeof(md3frame_t)); if (!m3->head.frames) { nedpfree(model_data_pool, m3); nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } - m3->muladdframes = (point3d *)nedpcalloc(model_data_pool, m->numframes * 2, sizeof(point3d)); + m3->head.frames = (md3frame_t *)Bcalloc(m3->head.numframes, sizeof(md3frame_t)); if (!m3->head.frames) { Bfree(m3); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + m3->muladdframes = (point3d *)Bcalloc(m->numframes * 2, sizeof(point3d)); f = (md2frame_t *)(m->frames); @@ -1123,7 +1123,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) m3->head.tags = NULL; - m3->head.surfs = (md3surf_t *)nedpcalloc(model_data_pool, 1, sizeof(md3surf_t)); if (!m3->head.surfs) { nedpfree(model_data_pool, m3->head.frames); nedpfree(model_data_pool, m3); nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + m3->head.surfs = (md3surf_t *)Bcalloc(1, sizeof(md3surf_t)); if (!m3->head.surfs) { Bfree(m3->head.frames); Bfree(m3); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } s = m3->head.surfs; // model converting @@ -1140,9 +1140,9 @@ static md2model_t *md2load(int32_t fil, const char *filnam) s->shaders = NULL; - s->tris = (md3tri_t *)nedpcalloc(model_data_pool, head.numtris, sizeof(md3tri_t)); if (!s->tris) { nedpfree(model_data_pool, s); nedpfree(model_data_pool, m3->head.frames); nedpfree(model_data_pool, m3); nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } - s->uv = (md3uv_t *)nedpcalloc(model_data_pool, s->numverts, sizeof(md3uv_t)); if (!s->uv) { nedpfree(model_data_pool, s->tris); nedpfree(model_data_pool, s); nedpfree(model_data_pool, m3->head.frames); nedpfree(model_data_pool, m3); nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } - s->xyzn = (md3xyzn_t *)nedpcalloc(model_data_pool, s->numverts * m->numframes, sizeof(md3xyzn_t)); if (!s->xyzn) { nedpfree(model_data_pool, s->uv); nedpfree(model_data_pool, s->tris); nedpfree(model_data_pool, s); nedpfree(model_data_pool, m3->head.frames); nedpfree(model_data_pool, m3); nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); return(0); } + s->tris = (md3tri_t *)Bcalloc(head.numtris, sizeof(md3tri_t)); if (!s->tris) { Bfree(s); Bfree(m3->head.frames); Bfree(m3); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + s->uv = (md3uv_t *)Bcalloc(s->numverts, sizeof(md3uv_t)); if (!s->uv) { Bfree(s->tris); Bfree(s); Bfree(m3->head.frames); Bfree(m3); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + s->xyzn = (md3xyzn_t *)Bcalloc(s->numverts * m->numframes, sizeof(md3xyzn_t)); if (!s->xyzn) { Bfree(s->uv); Bfree(s->tris); Bfree(s); Bfree(m3->head.frames); Bfree(m3); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } //memoryusage += (s->numverts * m->numframes * sizeof(md3xyzn_t)); //OSD_Printf("Current model geometry memory usage : %i.\n", memoryusage); @@ -1196,28 +1196,28 @@ static md2model_t *md2load(int32_t fil, const char *filnam) { mdskinmap_t *sk; - sk = (mdskinmap_t *)nedpcalloc(model_data_pool, 1,sizeof(mdskinmap_t)); + sk = (mdskinmap_t *)Bcalloc(1,sizeof(mdskinmap_t)); sk->palette = 0; sk->skinnum = 0; sk->surfnum = 0; if (m->numskins > 0) { - sk->fn = (char *)nedpmalloc(model_data_pool, strlen(m->basepath)+strlen(m->skinfn)+1); + sk->fn = (char *)malloc(strlen(m->basepath)+strlen(m->skinfn)+1); strcpy(sk->fn, m->basepath); strcat(sk->fn, m->skinfn); } m3->skinmap = sk; } - m3->indexes = nedpmalloc(model_data_pool, sizeof(uint16_t) * s->numtris); - m3->vindexes = nedpmalloc(model_data_pool, sizeof(uint16_t) * s->numtris * 3); - m3->maxdepths = nedpmalloc(model_data_pool, sizeof(float) * s->numtris); + m3->indexes = malloc(sizeof(uint16_t) * s->numtris); + m3->vindexes = malloc(sizeof(uint16_t) * s->numtris * 3); + m3->maxdepths = malloc(sizeof(float) * s->numtris); m3->vbos = NULL; // die MD2 ! DIE ! - nedpfree(model_data_pool, m->texid); nedpfree(model_data_pool, m->skinfn); nedpfree(model_data_pool, m->basepath); nedpfree(model_data_pool, m->uv); nedpfree(model_data_pool, m->tris); nedpfree(model_data_pool, m->glcmds); nedpfree(model_data_pool, m->frames); nedpfree(model_data_pool, m); + Bfree(m->texid); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return((md2model_t *)m3); } @@ -1278,7 +1278,7 @@ static md3model_t *md3load(int32_t fil) md3model_t *m; md3surf_t *s; - m = (md3model_t *)nedpcalloc(model_data_pool, 1,sizeof(md3model_t)); if (!m) return(0); + m = (md3model_t *)Bcalloc(1,sizeof(md3model_t)); if (!m) return(0); m->mdnum = 3; m->texid = 0; m->scale = .01f; m->muladdframes = NULL; @@ -1291,7 +1291,7 @@ static md3model_t *md3load(int32_t fil) m->head.ofstags = B_LITTLE32(m->head.ofstags); m->head.ofssurfs = B_LITTLE32(m->head.ofssurfs); m->head.eof = B_LITTLE32(m->head.eof); - if ((m->head.id != 0x33504449) && (m->head.vers != 15)) { nedpfree(model_data_pool, m); return(0); } //"IDP3" + if ((m->head.id != 0x33504449) && (m->head.vers != 15)) { Bfree(m); return(0); } //"IDP3" m->numskins = m->head.numskins; //<- dead code? m->numframes = m->head.numframes; @@ -1299,19 +1299,19 @@ static md3model_t *md3load(int32_t fil) ofsurf = m->head.ofssurfs; klseek(fil,m->head.ofsframes,SEEK_SET); i = m->head.numframes*sizeof(md3frame_t); - m->head.frames = (md3frame_t *)nedpmalloc(model_data_pool, i); if (!m->head.frames) { nedpfree(model_data_pool, m); return(0); } + m->head.frames = (md3frame_t *)malloc(i); if (!m->head.frames) { Bfree(m); return(0); } kread(fil,m->head.frames,i); if (m->head.numtags == 0) m->head.tags = NULL; else { klseek(fil,m->head.ofstags,SEEK_SET); i = m->head.numtags*sizeof(md3tag_t); - m->head.tags = (md3tag_t *)nedpmalloc(model_data_pool, i); if (!m->head.tags) { nedpfree(model_data_pool, m->head.frames); nedpfree(model_data_pool, m); return(0); } + m->head.tags = (md3tag_t *)malloc(i); if (!m->head.tags) { Bfree(m->head.frames); Bfree(m); return(0); } kread(fil,m->head.tags,i); } klseek(fil,m->head.ofssurfs,SEEK_SET); i = m->head.numsurfs*sizeof(md3surf_t); - m->head.surfs = (md3surf_t *)nedpmalloc(model_data_pool, i); if (!m->head.surfs) { if (m->head.tags) nedpfree(model_data_pool, m->head.tags); nedpfree(model_data_pool, m->head.frames); nedpfree(model_data_pool, m); return(0); } + m->head.surfs = (md3surf_t *)malloc(i); if (!m->head.surfs) { if (m->head.tags) Bfree(m->head.tags); Bfree(m->head.frames); Bfree(m); return(0); } #if B_BIG_ENDIAN != 0 { @@ -1355,11 +1355,11 @@ static md3model_t *md3load(int32_t fil) //OSD_Printf("Current model geometry memory usage : %i.\n", memoryusage); - s->tris = (md3tri_t *)nedpmalloc(model_data_pool, leng[0]+leng[1]+leng[2]+leng[3]); + s->tris = (md3tri_t *)malloc(leng[0]+leng[1]+leng[2]+leng[3]); if (!s->tris) { - for (surfi--; surfi>=0; surfi--) nedpfree(model_data_pool, m->head.surfs[surfi].tris); - if (m->head.tags) nedpfree(model_data_pool, m->head.tags); nedpfree(model_data_pool, m->head.frames); nedpfree(model_data_pool, m); return(0); + for (surfi--; surfi>=0; surfi--) Bfree(m->head.surfs[surfi].tris); + if (m->head.tags) Bfree(m->head.tags); Bfree(m->head.frames); Bfree(m); return(0); } s->shaders = (md3shader_t *)(((intptr_t)s->tris)+leng[0]); s->uv = (md3uv_t *)(((intptr_t)s->shaders)+leng[1]); @@ -1428,9 +1428,9 @@ static md3model_t *md3load(int32_t fil) } #endif - m->indexes = nedpmalloc(model_data_pool, sizeof(uint16_t) * maxtrispersurf); - m->vindexes = nedpmalloc(model_data_pool, sizeof(uint16_t) * maxtrispersurf * 3); - m->maxdepths = nedpmalloc(model_data_pool, sizeof(float) * maxtrispersurf); + m->indexes = malloc(sizeof(uint16_t) * maxtrispersurf); + m->vindexes = malloc(sizeof(uint16_t) * maxtrispersurf * 3); + m->maxdepths = malloc(sizeof(float) * maxtrispersurf); m->vbos = NULL; @@ -1580,9 +1580,9 @@ static int md3postload(md3model_t* m) { s = &m->head.surfs[surfi]; - s->geometry = nedpcalloc(model_data_pool, m->head.numframes * s->numverts * sizeof(float), 15); + s->geometry = Bcalloc(m->head.numframes * s->numverts * sizeof(float), 15); - numtris = nedpcalloc(model_data_pool, s->numverts, sizeof(int)); + numtris = Bcalloc(s->numverts, sizeof(int)); verti = 0; while (verti < (m->head.numframes * s->numverts)) @@ -1611,7 +1611,7 @@ static int md3postload(md3model_t* m) s->tris[trii].i[1] >= s->numverts || s->tris[trii].i[1] < 0 || s->tris[trii].i[2] >= s->numverts || s->tris[trii].i[2] < 0) { // corrupt model - nedpfree(model_data_pool, numtris); + Bfree(numtris); OSD_Printf("Triangle index out of bounds!\n"); return 0; } @@ -1693,7 +1693,7 @@ static int md3postload(md3model_t* m) verti++; } - nedpfree(model_data_pool, numtris); + Bfree(numtris); surfi++; } @@ -2232,13 +2232,13 @@ static void md3free(md3model_t *m) for (anim=m->animations; anim; anim=nanim) { nanim = anim->next; - nedpfree(model_data_pool, anim); + Bfree(anim); } for (sk=m->skinmap; sk; sk=nsk) { nsk = sk->next; - nedpfree(model_data_pool, sk->fn); - nedpfree(model_data_pool, sk); + Bfree(sk->fn); + Bfree(sk); } if (m->head.surfs) @@ -2246,35 +2246,35 @@ static void md3free(md3model_t *m) for (surfi=m->head.numsurfs-1; surfi>=0; surfi--) { s = &m->head.surfs[surfi]; - if (s->tris) nedpfree(model_data_pool, s->tris); + if (s->tris) Bfree(s->tris); if (m->head.flags == 1337) { - if (s->shaders) nedpfree(model_data_pool, s->shaders); - if (s->uv) nedpfree(model_data_pool, s->uv); - if (s->xyzn) nedpfree(model_data_pool, s->xyzn); + if (s->shaders) Bfree(s->shaders); + if (s->uv) Bfree(s->uv); + if (s->xyzn) Bfree(s->xyzn); } } - nedpfree(model_data_pool, m->head.surfs); + Bfree(m->head.surfs); } - if (m->head.tags) nedpfree(model_data_pool, m->head.tags); - if (m->head.frames) nedpfree(model_data_pool, m->head.frames); + if (m->head.tags) Bfree(m->head.tags); + if (m->head.frames) Bfree(m->head.frames); - if (m->texid) nedpfree(model_data_pool, m->texid); + if (m->texid) Bfree(m->texid); - if (m->muladdframes) nedpfree(model_data_pool, m->muladdframes); + if (m->muladdframes) Bfree(m->muladdframes); - if (m->indexes) nedpfree(model_data_pool, m->indexes); - if (m->vindexes) nedpfree(model_data_pool, m->vindexes); - if (m->maxdepths) nedpfree(model_data_pool, m->maxdepths); + if (m->indexes) Bfree(m->indexes); + if (m->vindexes) Bfree(m->vindexes); + if (m->maxdepths) Bfree(m->maxdepths); if (m->vbos) { bglDeleteBuffersARB(m->head.numsurfs, m->vbos); - nedpfree(model_data_pool, m->vbos); + Bfree(m->vbos); m->vbos = NULL; } - nedpfree(model_data_pool, m); + Bfree(m); } //---------------------------------------- MD3 LIBRARY ENDS ---------------------------------------- @@ -2301,7 +2301,7 @@ uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, i int32_t i; pic = (coltype *)picbuf; //Correct for GL's RGB order; also apply gamma here.. - pic2 = (coltype *)nedpmalloc(model_data_pool, xsiz*ysiz*sizeof(int32_t)); if (!pic2) return((unsigned)-1); + pic2 = (coltype *)malloc(xsiz*ysiz*sizeof(int32_t)); if (!pic2) return((unsigned)-1); cptr = (char*)&britable[gammabrightness ? 0 : curbrightness][0]; if (!is8bit) { @@ -2330,7 +2330,7 @@ uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, i bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); bglTexImage2D(GL_TEXTURE_2D,0,4,xsiz,ysiz,0,GL_RGBA,GL_UNSIGNED_BYTE,(char *)pic2); - nedpfree(model_data_pool, pic2); + Bfree(pic2); return(rtexid); } @@ -2344,7 +2344,7 @@ static int32_t getvox(int32_t x, int32_t y, int32_t z) static void putvox(int32_t x, int32_t y, int32_t z, int32_t col) { - if (vnum >= vmax) { vmax = max(vmax<<1,4096); vcol = (voxcol_t *)nedprealloc(model_data_pool, vcol,vmax*sizeof(voxcol_t)); } + if (vnum >= vmax) { vmax = max(vmax<<1,4096); vcol = (voxcol_t *)Brealloc(vcol,vmax*sizeof(voxcol_t)); } z += x*yzsiz + y*zsiz; vcol[vnum].p = z; z = ((z*214013)&vcolhashsizm1); @@ -2552,7 +2552,7 @@ static voxmodel_t *vox2poly() int32_t i, j, x, y, z, v, ov, oz = 0, cnt, sc, x0, y0, dx, dy,*bx0, *by0; void (*daquad)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); - gvox = (voxmodel_t *)nedpmalloc(model_data_pool, sizeof(voxmodel_t)); if (!gvox) return(0); + gvox = (voxmodel_t *)malloc(sizeof(voxmodel_t)); if (!gvox) return(0); memset(gvox,0,sizeof(voxmodel_t)); //x is largest dimension, y is 2nd largest dimension @@ -2560,7 +2560,7 @@ static voxmodel_t *vox2poly() if ((x < y) && (x < z)) x = z; else if (y < z) y = z; if (x < y) { z = x; x = y; y = z; } shcntp = x; i = x*y*sizeof(int32_t); - shcntmal = (int32_t *)nedpmalloc(model_data_pool, i); if (!shcntmal) { nedpfree(model_data_pool, gvox); return(0); } + shcntmal = (int32_t *)malloc(i); if (!shcntmal) { Bfree(gvox); return(0); } memset(shcntmal,0,i); shcnt = &shcntmal[-shcntp-1]; gmaxx = gmaxy = garea = 0; @@ -2568,7 +2568,7 @@ static voxmodel_t *vox2poly() for (i=0; i<7; i++) gvox->qfacind[i] = -1; i = ((max(ysiz,zsiz)+1)<<2); - bx0 = (int32_t *)nedpmalloc(model_data_pool, i<<1); if (!bx0) { nedpfree(model_data_pool, gvox); return(0); } + bx0 = (int32_t *)malloc(i<<1); if (!bx0) { Bfree(gvox); return(0); } by0 = (int32_t *)(((intptr_t)bx0)+i); for (cnt=0; cnt<2; cnt++) @@ -2614,8 +2614,8 @@ static voxmodel_t *vox2poly() if (!cnt) { - shp = (spoint2d *)nedpmalloc(model_data_pool, gvox->qcnt*sizeof(spoint2d)); - if (!shp) { nedpfree(model_data_pool, bx0); nedpfree(model_data_pool, gvox); return(0); } + shp = (spoint2d *)malloc(gvox->qcnt*sizeof(spoint2d)); + if (!shp) { Bfree(bx0); Bfree(gvox); return(0); } sc = 0; for (y=gmaxy; y; y--) @@ -2636,7 +2636,7 @@ skindidntfit: mytexo5 = (gvox->mytexx>>5); i = (((gvox->mytexx*gvox->mytexy+31)>>5)<<2); - zbit = (int32_t *)nedpmalloc(model_data_pool, i); if (!zbit) { nedpfree(model_data_pool, bx0); nedpfree(model_data_pool, gvox); nedpfree(model_data_pool, shp); return(0); } + zbit = (int32_t *)malloc(i); if (!zbit) { Bfree(bx0); Bfree(gvox); Bfree(shp); return(0); } memset(zbit,0,i); v = gvox->mytexx*gvox->mytexy; @@ -2655,7 +2655,7 @@ skindidntfit: i--; if (i < 0) //Time-out! Very slow if this happens... but at least it still works :P { - nedpfree(model_data_pool, zbit); + Bfree(zbit); //Re-generate shp[].x/y (box sizes) from shcnt (now head indices) for next pass :/ j = 0; @@ -2678,14 +2678,14 @@ skindidntfit: shp[z].x = x0; shp[z].y = y0; //Overwrite size with top-left location } - gvox->quad = (voxrect_t *)nedpmalloc(model_data_pool, gvox->qcnt*sizeof(voxrect_t)); - if (!gvox->quad) { nedpfree(model_data_pool, zbit); nedpfree(model_data_pool, shp); nedpfree(model_data_pool, bx0); nedpfree(model_data_pool, gvox); return(0); } + gvox->quad = (voxrect_t *)malloc(gvox->qcnt*sizeof(voxrect_t)); + if (!gvox->quad) { Bfree(zbit); Bfree(shp); Bfree(bx0); Bfree(gvox); return(0); } - gvox->mytex = (int32_t *)nedpmalloc(model_data_pool, gvox->mytexx*gvox->mytexy*sizeof(int32_t)); - if (!gvox->mytex) { nedpfree(model_data_pool, gvox->quad); nedpfree(model_data_pool, zbit); nedpfree(model_data_pool, shp); nedpfree(model_data_pool, bx0); nedpfree(model_data_pool, gvox); return(0); } + gvox->mytex = (int32_t *)malloc(gvox->mytexx*gvox->mytexy*sizeof(int32_t)); + if (!gvox->mytex) { Bfree(gvox->quad); Bfree(zbit); Bfree(shp); Bfree(bx0); Bfree(gvox); return(0); } } } - nedpfree(model_data_pool, shp); nedpfree(model_data_pool, zbit); nedpfree(model_data_pool, bx0); + Bfree(shp); Bfree(zbit); Bfree(bx0); return(gvox); } @@ -2708,14 +2708,14 @@ static int32_t loadvox(const char *filnam) pal[255] = -1; vcolhashsizm1 = 8192-1; - vcolhashead = (int32_t *)nedpmalloc(model_data_pool, (vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { kclose(fil); return(-1); } + vcolhashead = (int32_t *)malloc((vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { kclose(fil); return(-1); } memset(vcolhashead,-1,(vcolhashsizm1+1)*sizeof(int32_t)); yzsiz = ysiz*zsiz; i = ((xsiz*yzsiz+31)>>3); - vbit = (int32_t *)nedpmalloc(model_data_pool, i); if (!vbit) { kclose(fil); return(-1); } + vbit = (int32_t *)malloc(i); if (!vbit) { kclose(fil); return(-1); } memset(vbit,0,i); - tbuf = (char *)nedpmalloc(model_data_pool, zsiz*sizeof(uint8_t)); if (!tbuf) { kclose(fil); return(-1); } + tbuf = (char *)malloc(zsiz*sizeof(uint8_t)); if (!tbuf) { kclose(fil); return(-1); } klseek(fil,12,SEEK_SET); for (x=0; x=0; i--) xyoffs[i] = B_LITTLE16(xyoffs[i]); klseek(fil,-768,SEEK_END); @@ -2775,17 +2775,17 @@ static int32_t loadkvx(const char *filnam) { kread(fil,c,3); pal[i] = B_LITTLE32((((int32_t)c[0])<<18)+(((int32_t)c[1])<<10)+(((int32_t)c[2])<<2)+(i<<24)); } yzsiz = ysiz*zsiz; i = ((xsiz*yzsiz+31)>>3); - vbit = (int32_t *)nedpmalloc(model_data_pool, i); if (!vbit) { nedpfree(model_data_pool, xyoffs); kclose(fil); return(-1); } + vbit = (int32_t *)malloc(i); if (!vbit) { Bfree(xyoffs); kclose(fil); return(-1); } memset(vbit,0,i); for (vcolhashsizm1=4096; vcolhashsizm1<(mip1leng>>1); vcolhashsizm1<<=1); vcolhashsizm1--; //approx to numvoxs! - vcolhashead = (int32_t *)nedpmalloc(model_data_pool, (vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { nedpfree(model_data_pool, xyoffs); kclose(fil); return(-1); } + vcolhashead = (int32_t *)malloc((vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { Bfree(xyoffs); kclose(fil); return(-1); } memset(vcolhashead,-1,(vcolhashsizm1+1)*sizeof(int32_t)); klseek(fil,28+((xsiz+1)<<2)+((ysizp1*xsiz)<<1),SEEK_SET); i = kfilelength(fil)-ktell(fil); - tbuf = (char *)nedpmalloc(model_data_pool, i); if (!tbuf) { nedpfree(model_data_pool, xyoffs); kclose(fil); return(-1); } + tbuf = (char *)malloc(i); if (!tbuf) { Bfree(xyoffs); kclose(fil); return(-1); } kread(fil,tbuf,i); kclose(fil); cptr = tbuf; @@ -2804,7 +2804,7 @@ static int32_t loadkvx(const char *filnam) } } - nedpfree(model_data_pool, tbuf); nedpfree(model_data_pool, xyoffs); return(0); + Bfree(tbuf); Bfree(xyoffs); return(0); } static int32_t loadkv6(const char *filnam) @@ -2823,7 +2823,7 @@ static int32_t loadkv6(const char *filnam) kread(fil,&i,4); zpiv = (float)(B_LITTLE32(i)); kread(fil,&numvoxs,4); numvoxs = B_LITTLE32(numvoxs); - ylen = (uint16_t *)nedpmalloc(model_data_pool, xsiz*ysiz*sizeof(int16_t)); + ylen = (uint16_t *)malloc(xsiz*ysiz*sizeof(int16_t)); if (!ylen) { kclose(fil); return(-1); } klseek(fil,32+(numvoxs<<3)+(xsiz<<2),SEEK_SET); @@ -2831,11 +2831,11 @@ static int32_t loadkv6(const char *filnam) klseek(fil,32,SEEK_SET); yzsiz = ysiz*zsiz; i = ((xsiz*yzsiz+31)>>3); - vbit = (int32_t *)nedpmalloc(model_data_pool, i); if (!vbit) { nedpfree(model_data_pool, ylen); kclose(fil); return(-1); } + vbit = (int32_t *)malloc(i); if (!vbit) { Bfree(ylen); kclose(fil); return(-1); } memset(vbit,0,i); for (vcolhashsizm1=4096; vcolhashsizm1>3); - vbit = (int32_t *)nedpmalloc(model_data_pool, i); if (!vbit) { kclose(fil); return(-1); } + vbit = (int32_t *)malloc(i); if (!vbit) { kclose(fil); return(-1); } memset(vbit,-1,i); vcolhashsizm1 = 1048576-1; - vcolhashead = (int32_t *)nedpmalloc(model_data_pool, (vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { kclose(fil); return(-1); } + vcolhashead = (int32_t *)malloc((vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { kclose(fil); return(-1); } memset(vcolhashead,-1,(vcolhashsizm1+1)*sizeof(int32_t)); //Allocate huge buffer and load rest of file into it... i = kfilelength(fil)-ktell(fil); - vbuf = (char *)nedpmalloc(model_data_pool, i); if (!vbuf) { kclose(fil); return(-1); } + vbuf = (char *)malloc(i); if (!vbuf) { kclose(fil); return(-1); } kread(fil,vbuf,i); kclose(fil); @@ -2901,17 +2901,17 @@ static int32_t loadvxl(const char *filnam) } v += ((((int32_t)v[2])-((int32_t)v[1])+2)<<2); } - nedpfree(model_data_pool, vbuf); return(0); + Bfree(vbuf); return(0); } #endif void voxfree(voxmodel_t *m) { if (!m) return; - if (m->mytex) nedpfree(model_data_pool, m->mytex); - if (m->quad) nedpfree(model_data_pool, m->quad); - if (m->texid) nedpfree(model_data_pool, m->texid); - nedpfree(model_data_pool, m); + if (m->mytex) Bfree(m->mytex); + if (m->quad) Bfree(m->quad); + if (m->texid) Bfree(m->texid); + Bfree(m); } voxmodel_t *voxload(const char *filnam) @@ -2934,13 +2934,13 @@ voxmodel_t *voxload(const char *filnam) vm->xpiv = xpiv; vm->ypiv = ypiv; vm->zpiv = zpiv; vm->is8bit = is8bit; - vm->texid = (uint32_t *)nedpcalloc(model_data_pool, MAXPALOOKUPS,sizeof(uint32_t)); + vm->texid = (uint32_t *)Bcalloc(MAXPALOOKUPS,sizeof(uint32_t)); if (!vm->texid) { voxfree(vm); vm = 0; } } - if (shcntmal) { nedpfree(model_data_pool, shcntmal); shcntmal = 0; } - if (vbit) { nedpfree(model_data_pool, vbit); vbit = 0; } - if (vcol) { nedpfree(model_data_pool, vcol); vcol = 0; vnum = 0; vmax = 0; } - if (vcolhashead) { nedpfree(model_data_pool, vcolhashead); vcolhashead = 0; } + if (shcntmal) { Bfree(shcntmal); shcntmal = 0; } + if (vbit) { Bfree(vbit); vbit = 0; } + if (vcol) { Bfree(vcol); vcol = 0; vnum = 0; vmax = 0; } + if (vcolhashead) { Bfree(vcolhashead); vcolhashead = 0; } return(vm); } @@ -3135,8 +3135,8 @@ int32_t mddraw(spritetype *tspr) if (r_vbos && (r_vbocount > allocvbos)) { - indexvbos = nedprealloc(model_data_pool, indexvbos, sizeof(GLuint) * r_vbocount); - vertvbos = nedprealloc(model_data_pool, vertvbos, sizeof(GLuint) * r_vbocount); + indexvbos = Brealloc(indexvbos, sizeof(GLuint) * r_vbocount); + vertvbos = Brealloc(vertvbos, sizeof(GLuint) * r_vbocount); bglGenBuffersARB(r_vbocount - allocvbos, &(indexvbos[allocvbos])); bglGenBuffersARB(r_vbocount - allocvbos, &(vertvbos[allocvbos])); @@ -3159,7 +3159,7 @@ int32_t mddraw(spritetype *tspr) if (maxmodelverts > allocmodelverts) { - point3d *vl = (point3d *)nedprealloc(model_data_pool, vertlist,sizeof(point3d)*maxmodelverts); + point3d *vl = (point3d *)Brealloc(vertlist,sizeof(point3d)*maxmodelverts); if (!vl) { OSD_Printf("ERROR: Not enough memory to allocate %d vertices!\n",maxmodelverts); return 0; } vertlist = vl; allocmodelverts = maxmodelverts; diff --git a/polymer/eduke32/build/src/nedmalloc.c b/polymer/eduke32/build/src/nedmalloc.c index 62284b038..3ab973742 100644 --- a/polymer/eduke32/build/src/nedmalloc.c +++ b/polymer/eduke32/build/src/nedmalloc.c @@ -36,15 +36,6 @@ DEALINGS IN THE SOFTWARE. #pragma warning(disable:4706) /* assignment within conditional expression */ #endif -#define USE_ALLOCATOR 1 -#define USE_MAGIC_HEADERS 1 -#define MAXTHREADSINPOOL 1 -#define FINEGRAINEDBINS 1 -#define ENABLE_LARGE_PAGES 1 -#define ENABLE_FAST_HEAP_DETECTION 1 -#define NDEBUG 1 -#define THREADCACHEMAX 32768 -#define THREADCACHEMAXBINS ((15-4)*2) /*#define ENABLE_TOLERANT_NEDMALLOC 1*/ /*#define ENABLE_FAST_HEAP_DETECTION 1*/ /*#define NEDMALLOC_DEBUG 1*/ diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 3003a63f7..8dc44808a 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -173,8 +173,10 @@ int32_t main(int32_t argc, char *argv[]) char *argp; FILE *fp; +#ifdef NEDMALLOC nedcreatepool(SYSTEM_POOL_SIZE, -1); -// atexit(neddestroysyspool); + // atexit(neddestroysyspool); +#endif buildkeytranslationtable(); diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index b37595629..24ead37f3 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -39,6 +39,7 @@ #include "a.h" #include "osd.h" #include "rawinput.h" +#include "nedmalloc.h" // undefine to restrict windowed resolutions to conventional sizes #define ANY_WINDOWED_SIZE @@ -85,7 +86,7 @@ static void ReleaseDirectDrawSurfaces(void); static BOOL InitDirectInput(void); static void UninitDirectInput(void); static void GetKeyNames(void); -static void AcquireInputDevices(char acquire, int8_t device); +static void AcquireInputDevices(char acquire); static inline void DI_PollJoysticks(void); static int32_t SetupDirectDraw(int32_t width, int32_t height); static void UninitDIB(void); @@ -132,7 +133,11 @@ int32_t remapinit=0; static char key_names[256][24]; static OSVERSIONINFOEX osv; +#ifdef NEDMALLOC extern int32_t largepagesavailable; +#else +static HMODULE nedhandle = NULL; +#endif void (*keypresscallback)(int32_t,int32_t) = 0; void (*mousepresscallback)(int32_t,int32_t) = 0; @@ -286,6 +291,7 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in return -1; } +#ifdef NEDMALLOC /* Attempt to enable SeLockMemoryPrivilege, 2003/Vista/7 only */ if (Bgetenv("BUILD_NOLARGEPAGES") == NULL && (osv.dwMajorVersion >= 6 || (osv.dwMajorVersion == 5 && osv.dwMinorVersion == 2))) @@ -310,8 +316,16 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in } nedcreatepool(SYSTEM_POOL_SIZE, -1); + // atexit(neddestroysyspool); +#else + if ((nedhandle = LoadLibrary("nedmalloc.dll"))) + { + nedpool *(WINAPI *nedcreatepool)(size_t, int); -// atexit(neddestroysyspool); + if ((nedcreatepool = (void *)GetProcAddress(nedhandle, "nedcreatepool"))) + nedcreatepool(SYSTEM_POOL_SIZE, -1); + } +#endif hdc = GetDC(NULL); r = GetDeviceCaps(hdc, BITSPIXEL); @@ -430,7 +444,7 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in MB_OK|MB_ICONINFORMATION); #endif -// atexit(uninitsystem); + // atexit(uninitsystem); instanceflag = CreateSemaphore(NULL, 1,1, WindowClass); @@ -528,12 +542,19 @@ static void printsysversion(void) break; } - initprintf("Running under Windows %s (build %lu.%lu.%lu) %s\n", ver, osv.dwMajorVersion, osv.dwMinorVersion, + initprintf("Running under Windows %s (build %lu.%lu.%lu) %s", ver, osv.dwMajorVersion, osv.dwMinorVersion, osv.dwPlatformId == VER_PLATFORM_WIN32_NT ? osv.dwBuildNumber : osv.dwBuildNumber&0xffff, osv.szCSDVersion); +#ifdef NEDMALLOC + initprintf("\n"); + if (largepagesavailable) initprintf("Large page support available\n"); +#else + if (nedhandle) initprintf("with nedmalloc\n"); +#endif + } @@ -541,7 +562,7 @@ int32_t initsystem(void) { DEVMODE desktopmode; -// initprintf("Initializing Windows DirectX/GDI system interface\n"); + // initprintf("Initializing Windows DirectX/GDI system interface\n"); // get the desktop dimensions before anything changes them ZeroMemory(&desktopmode, sizeof(DEVMODE)); @@ -596,6 +617,10 @@ void uninitsystem(void) #if defined(USE_OPENGL) && defined(POLYMOST) unloadgldriver(); #endif + +#ifndef NEDMALLOC + if (nedhandle) FreeLibrary(nedhandle), nedhandle = NULL; +#endif } @@ -671,18 +696,20 @@ int32_t handleevents(void) while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - if (msg.message == WM_QUIT) - quitevent = 1; - - if (startwin_idle((void*)&msg) > 0) continue; - - if (msg.message == WM_INPUT) + switch (msg.message) { - RI_PollDevices(FALSE); + case WM_QUIT: + quitevent = 1; + continue; + case WM_INPUT: + // this call to RI_PollDevices() probably isn't necessary + // RI_PollDevices(FALSE); RI_ProcessMessage(&msg); continue; } + if (startwin_idle((void*)&msg) > 0) continue; + TranslateMessage(&msg); DispatchMessage(&msg); } @@ -699,31 +726,25 @@ int32_t handleevents(void) //================================================================================================= #define JOYSTICK 0 -#define NUM_INPUTS 1 static HMODULE hDInputDLL = NULL; static LPDIRECTINPUT7A lpDI = NULL; -static LPDIRECTINPUTDEVICE7A lpDID[NUM_INPUTS] = { NULL }; +static LPDIRECTINPUTDEVICE7A lpDID = NULL; #define INPUT_BUFFER_SIZE 32 -static GUID guidDevs[NUM_INPUTS]; +static GUID guidDevs; -static char devacquired[NUM_INPUTS]; -static HANDLE inputevt[NUM_INPUTS]; +static char di_devacquired; +static HANDLE di_inputevt; static int32_t joyblast=0; volatile uint8_t moustat = 0, mousegrab = 0; -static uint32_t idevnums[NUM_INPUTS], numdevs = 0; -static HANDLE waithnds[NUM_INPUTS]; - static struct { char *name; LPDIRECTINPUTDEVICE7A *did; const DIDATAFORMAT *df; -} devicedef[NUM_INPUTS] = -{ - { "joystick", &lpDID[JOYSTICK], &c_dfDIJoystick } -}; +} devicedef = { "joystick", &lpDID, &c_dfDIJoystick }; + static struct _joydef { const char *name; @@ -736,7 +757,7 @@ inline void SetKey(int32_t key, int32_t state) { keystatus[remap[key]] = state; - if (state) + if (state) { keyfifo[keyfifoend] = remap[key]; keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state; @@ -744,42 +765,37 @@ inline void SetKey(int32_t key, int32_t state) } } -char map_dik_code(int32_t 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 // int32_t initinput(void) { int32_t i; + char layoutname[KL_NAMELENGTH]; + moustat=0; memset(keystatus, 0, sizeof(keystatus)); + if (!remapinit) for (i=0; i<256; i++) - remap[i]=map_dik_code(i); + remap[i]=i; + remapinit=1; keyfifoplc = keyfifoend = 0; keyasciififoplc = keyasciififoend = 0; inputdevices = 1|2; - joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0; + joyisgamepad = joynumaxes = joynumbuttons = joynumhats=0; // 00000409 is "American English" + + GetKeyboardLayoutName(layoutname); + if (Bstrcmp(layoutname, "00000409")) { - char layoutname[KL_NAMELENGTH]; + initprintf("Switching kb layout from %s ",layoutname); + LoadKeyboardLayout("00000409", KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_SUBSTITUTE_OK); GetKeyboardLayoutName(layoutname); - if (Bstrcmp(layoutname, "00000409")) - { - initprintf("Switching kb layout from %s ",layoutname); - LoadKeyboardLayout("00000409", KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_SUBSTITUTE_OK); - GetKeyboardLayoutName(layoutname); - initprintf("to %s\n",layoutname); - } + initprintf("to %s\n",layoutname); } GetKeyNames(); @@ -858,7 +874,7 @@ void setjoydeadzone(int32_t axis, uint16_t dead, uint16_t satur) DIPROPDWORD dipdw; HRESULT result; - if (!lpDID[JOYSTICK]) return; + if (!lpDID) return; if (dead > 10000) dead = 10000; if (satur > 10000) satur = 10000; @@ -880,8 +896,8 @@ void setjoydeadzone(int32_t axis, uint16_t dead, uint16_t satur) } dipdw.dwData = dead; - result = IDirectInputDevice7_SetProperty(lpDID[JOYSTICK], DIPROP_DEADZONE, &dipdw.diph); - if FAILED(result) + result = IDirectInputDevice7_SetProperty(lpDID, DIPROP_DEADZONE, &dipdw.diph); + if (FAILED(result)) { //ShowDInputErrorBox("Failed setting joystick dead zone", result); initprintf("Failed setting joystick dead zone: %s\n", GetDInputError(result)); @@ -890,8 +906,8 @@ void setjoydeadzone(int32_t axis, uint16_t dead, uint16_t satur) dipdw.dwData = satur; - result = IDirectInputDevice7_SetProperty(lpDID[JOYSTICK], DIPROP_SATURATION, &dipdw.diph); - if FAILED(result) + result = IDirectInputDevice7_SetProperty(lpDID, DIPROP_SATURATION, &dipdw.diph); + if (FAILED(result)) { //ShowDInputErrorBox("Failed setting joystick saturation point", result); initprintf("Failed setting joystick saturation point: %s\n", GetDInputError(result)); @@ -909,7 +925,7 @@ void getjoydeadzone(int32_t axis, uint16_t *dead, uint16_t *satur) HRESULT result; if (!dead || !satur) return; - if (!lpDID[JOYSTICK]) { *dead = *satur = 0; return; } + if (!lpDID) { *dead = *satur = 0; return; } if (axis >= joynumaxes) { *dead = *satur = 0; return; } memset(&dipdw, 0, sizeof(dipdw)); @@ -926,8 +942,8 @@ void getjoydeadzone(int32_t axis, uint16_t *dead, uint16_t *satur) dipdw.diph.dwHow = DIPH_BYOFFSET; } - result = IDirectInputDevice7_GetProperty(lpDID[JOYSTICK], DIPROP_DEADZONE, &dipdw.diph); - if FAILED(result) + result = IDirectInputDevice7_GetProperty(lpDID, DIPROP_DEADZONE, &dipdw.diph); + if (FAILED(result)) { //ShowDInputErrorBox("Failed getting joystick dead zone", result); initprintf("Failed getting joystick dead zone: %s\n", GetDInputError(result)); @@ -936,8 +952,8 @@ void getjoydeadzone(int32_t axis, uint16_t *dead, uint16_t *satur) *dead = dipdw.dwData; - result = IDirectInputDevice7_GetProperty(lpDID[JOYSTICK], DIPROP_SATURATION, &dipdw.diph); - if FAILED(result) + result = IDirectInputDevice7_GetProperty(lpDID, DIPROP_SATURATION, &dipdw.diph); + if (FAILED(result)) { //ShowDInputErrorBox("Failed getting joystick saturation point", result); initprintf("Failed getting joystick saturation point: %s\n", GetDInputError(result)); @@ -994,21 +1010,13 @@ static BOOL CALLBACK InitDirectInput_enum(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRe UNREFERENCED_PARAMETER(pvRef); -#define COPYGUID(d,s) Bmemcpy(&d,&s,sizeof(GUID)) - - switch (lpddi->dwDevType&0xff) - { - case DIDEVTYPE_JOYSTICK: - { - inputdevices |= (1<<(JOYSTICK+2)); - joyisgamepad = ((lpddi->dwDevType & (DIDEVTYPEJOYSTICK_GAMEPAD<<8)) != 0); - d = joyisgamepad ? "GAMEPAD" : "JOYSTICK"; - COPYGUID(guidDevs[JOYSTICK],lpddi->guidInstance); - } - break; - default: + if ((lpddi->dwDevType&0xff) != DIDEVTYPE_JOYSTICK) return DIENUM_CONTINUE; - } + + inputdevices |= 4; + joyisgamepad = ((lpddi->dwDevType & (DIDEVTYPEJOYSTICK_GAMEPAD<<8)) != 0); + d = joyisgamepad ? "GAMEPAD" : "JOYSTICK"; + Bmemcpy(&guidDevs, &lpddi->guidInstance, sizeof(GUID)); initprintf(" * %s: %s\n", d, lpddi->tszProductName); @@ -1064,16 +1072,13 @@ static BOOL InitDirectInput(void) LPDIRECTINPUTDEVICE7A dev2; DIDEVCAPS didc; - int32_t devn; - if (bDInputInited) return FALSE; initprintf("Initializing DirectInput...\n"); - // load up the DirectInput DLL if (!hDInputDLL) { -// initprintf(" - Loading DINPUT.DLL\n"); + // initprintf(" - Loading DINPUT.DLL\n"); hDInputDLL = LoadLibrary("DINPUT.DLL"); if (!hDInputDLL) { @@ -1082,21 +1087,17 @@ static BOOL InitDirectInput(void) } } - // get the pointer to DirectInputCreate aDirectInputCreateA = (void *)GetProcAddress(hDInputDLL, "DirectInputCreateA"); if (!aDirectInputCreateA) ShowErrorBox("Error fetching DirectInputCreateA()"); - // create a new DirectInput object -// initprintf(" - Creating DirectInput object\n"); result = aDirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &lpDI, NULL); - if FAILED(result) { HorribleDInputDeath("DirectInputCreateA() failed", result); } + if (FAILED(result)) { HorribleDInputDeath("DirectInputCreateA() failed", result); } else if (result != DI_OK) initprintf(" Created DirectInput object with warning: %s\n",GetDInputError(result)); - // enumerate devices to make us look fancy initprintf(" - Enumerating attached game controllers\n"); inputdevices = 1|2; result = IDirectInput7_EnumDevices(lpDI, 0, InitDirectInput_enum, NULL, DIEDFL_ATTACHEDONLY); - if FAILED(result) { HorribleDInputDeath("Failed enumerating attached game controllers", result); } + if (FAILED(result)) { HorribleDInputDeath("Failed enumerating attached game controllers", result); } else if (result != DI_OK) initprintf(" Enumerated game controllers with warning: %s\n",GetDInputError(result)); if (inputdevices == (1|2)) @@ -1107,86 +1108,78 @@ static BOOL InitDirectInput(void) return TRUE; } - // *** - // create the devices - // *** - for (devn = 0; devn < NUM_INPUTS; devn++) + *devicedef.did = NULL; + + // initprintf(" - Creating %s device\n", devicedef.name); + result = IDirectInput7_CreateDeviceEx(lpDI, &guidDevs, &IID_IDirectInputDevice7, (void *)&dev, NULL); + if (FAILED(result)) { HorribleDInputDeath("Failed creating device", result); } + else if (result != DI_OK) initprintf(" Created device with warning: %s\n",GetDInputError(result)); + + result = IDirectInputDevice7_QueryInterface(dev, &IID_IDirectInputDevice7, (LPVOID *)&dev2); + IDirectInputDevice7_Release(dev); + if (FAILED(result)) { HorribleDInputDeath("Failed querying DirectInput7 interface for device", result); } + else if (result != DI_OK) initprintf(" Queried IDirectInputDevice7 interface with warning: %s\n",GetDInputError(result)); + + result = IDirectInputDevice7_SetDataFormat(dev2, devicedef.df); + if (FAILED(result)) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed setting data format", result); } + else if (result != DI_OK) initprintf(" Set data format with warning: %s\n",GetDInputError(result)); + + di_inputevt = CreateEvent(NULL, FALSE, FALSE, NULL); + if (di_inputevt == NULL) { - if ((inputdevices & (1<<(devn+2))) == 0) continue; - *devicedef[devn].did = NULL; - -// initprintf(" - Creating %s device\n", devicedef[devn].name); - result = IDirectInput7_CreateDeviceEx(lpDI, &guidDevs[devn], &IID_IDirectInputDevice7, (void *)&dev, NULL); - if FAILED(result) { HorribleDInputDeath("Failed creating device", result); } - else if (result != DI_OK) initprintf(" Created device with warning: %s\n",GetDInputError(result)); - - result = IDirectInputDevice7_QueryInterface(dev, &IID_IDirectInputDevice7, (LPVOID *)&dev2); - IDirectInputDevice7_Release(dev); - if FAILED(result) { HorribleDInputDeath("Failed querying DirectInput7 interface for device", result); } - else if (result != DI_OK) initprintf(" Queried IDirectInputDevice7 interface with warning: %s\n",GetDInputError(result)); - - result = IDirectInputDevice7_SetDataFormat(dev2, devicedef[devn].df); - if FAILED(result) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed setting data format", result); } - else if (result != DI_OK) initprintf(" Set data format with warning: %s\n",GetDInputError(result)); - - inputevt[devn] = CreateEvent(NULL, FALSE, FALSE, NULL); - if (inputevt[devn] == NULL) - { - IDirectInputDevice7_Release(dev2); - ShowErrorBox("Couldn't create event object"); - UninitDirectInput(); - return TRUE; - } - - result = IDirectInputDevice7_SetEventNotification(dev2, inputevt[devn]); - if FAILED(result) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed setting event object", result); } - else if (result != DI_OK) initprintf(" Set event object with warning: %s\n",GetDInputError(result)); - - IDirectInputDevice7_Unacquire(dev2); - - memset(&dipdw, 0, sizeof(dipdw)); - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = INPUT_BUFFER_SIZE; - - result = IDirectInputDevice7_SetProperty(dev2, DIPROP_BUFFERSIZE, &dipdw.diph); - if FAILED(result) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed setting buffering", result); } - else if (result != DI_OK) initprintf(" Set buffering with warning: %s\n",GetDInputError(result)); - - // set up device - if (devn == JOYSTICK) - { - int32_t typecounts[3] = {0,0,0}; - - memset(&didc, 0, sizeof(didc)); - didc.dwSize = sizeof(didc); - result = IDirectInputDevice7_GetCapabilities(dev2, &didc); - if FAILED(result) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed getting controller capabilities", result); } - else if (result != DI_OK) initprintf(" Fetched controller capabilities with warning: %s\n",GetDInputError(result)); - - joynumaxes = (uint8_t)didc.dwAxes; - joynumbuttons = min(32,(uint8_t)didc.dwButtons); - joynumhats = (uint8_t)didc.dwPOVs; - initprintf("Controller has %d axes, %d buttons, and %d hat(s).\n",joynumaxes,joynumbuttons,joynumhats); - - axisdefs = (struct _joydef *)Bcalloc(didc.dwAxes, sizeof(struct _joydef)); - buttondefs = (struct _joydef *)Bcalloc(didc.dwButtons, sizeof(struct _joydef)); - hatdefs = (struct _joydef *)Bcalloc(didc.dwPOVs, sizeof(struct _joydef)); - - joyaxis = (int32_t *)Bcalloc(didc.dwAxes, sizeof(int32_t)); - joyhat = (int32_t *)Bcalloc(didc.dwPOVs, sizeof(int32_t)); - - result = IDirectInputDevice7_EnumObjects(dev2, InitDirectInput_enumobjects, (LPVOID)typecounts, DIDFT_ALL); - if FAILED(result) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed getting controller features", result); } - else if (result != DI_OK) initprintf(" Fetched controller features with warning: %s\n",GetDInputError(result)); - } - - *devicedef[devn].did = dev2; + IDirectInputDevice7_Release(dev2); + ShowErrorBox("Couldn't create event object"); + UninitDirectInput(); + return TRUE; } - memset(devacquired, 0, sizeof(devacquired)); + result = IDirectInputDevice7_SetEventNotification(dev2, di_inputevt); + if (FAILED(result)) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed setting event object", result); } + else if (result != DI_OK) initprintf(" Set event object with warning: %s\n",GetDInputError(result)); + + IDirectInputDevice7_Unacquire(dev2); + + memset(&dipdw, 0, sizeof(dipdw)); + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = INPUT_BUFFER_SIZE; + + result = IDirectInputDevice7_SetProperty(dev2, DIPROP_BUFFERSIZE, &dipdw.diph); + if (FAILED(result)) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed setting buffering", result); } + else if (result != DI_OK) initprintf(" Set buffering with warning: %s\n",GetDInputError(result)); + + // set up device + { + int32_t typecounts[3] = {0,0,0}; + + memset(&didc, 0, sizeof(didc)); + didc.dwSize = sizeof(didc); + result = IDirectInputDevice7_GetCapabilities(dev2, &didc); + if (FAILED(result)) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed getting controller capabilities", result); } + else if (result != DI_OK) initprintf(" Fetched controller capabilities with warning: %s\n",GetDInputError(result)); + + joynumaxes = (uint8_t)didc.dwAxes; + joynumbuttons = min(32,(uint8_t)didc.dwButtons); + joynumhats = (uint8_t)didc.dwPOVs; + initprintf("Controller has %d axes, %d buttons, and %d hat(s).\n",joynumaxes,joynumbuttons,joynumhats); + + axisdefs = (struct _joydef *)Bcalloc(didc.dwAxes, sizeof(struct _joydef)); + buttondefs = (struct _joydef *)Bcalloc(didc.dwButtons, sizeof(struct _joydef)); + hatdefs = (struct _joydef *)Bcalloc(didc.dwPOVs, sizeof(struct _joydef)); + + joyaxis = (int32_t *)Bcalloc(didc.dwAxes, sizeof(int32_t)); + joyhat = (int32_t *)Bcalloc(didc.dwPOVs, sizeof(int32_t)); + + result = IDirectInputDevice7_EnumObjects(dev2, InitDirectInput_enumobjects, (LPVOID)typecounts, DIDFT_ALL); + if (FAILED(result)) { IDirectInputDevice7_Release(dev2); HorribleDInputDeath("Failed getting controller features", result); } + else if (result != DI_OK) initprintf(" Fetched controller features with warning: %s\n",GetDInputError(result)); + } + + *devicedef.did = dev2; + + di_devacquired = 0; bDInputInited = TRUE; return FALSE; @@ -1198,12 +1191,11 @@ static BOOL InitDirectInput(void) // static void UninitDirectInput(void) { - int32_t devn; int32_t i; if (bDInputInited) initprintf("Uninitializing DirectInput...\n"); - AcquireInputDevices(0,-1); + AcquireInputDevices(0); if (axisdefs) { @@ -1221,20 +1213,15 @@ static void UninitDirectInput(void) Bfree(hatdefs); hatdefs = NULL; } - for (devn = 0; devn < NUM_INPUTS; devn++) + if (*devicedef.did) { - if (*devicedef[devn].did) - { - if (devn != JOYSTICK) IDirectInputDevice7_SetEventNotification(*devicedef[devn].did, NULL); - - IDirectInputDevice7_Release(*devicedef[devn].did); - *devicedef[devn].did = NULL; - } - if (inputevt[devn]) - { - CloseHandle(inputevt[devn]); - inputevt[devn] = NULL; - } + IDirectInputDevice7_Release(*devicedef.did); + *devicedef.did = NULL; + } + if (di_inputevt) + { + CloseHandle(di_inputevt); + di_inputevt = NULL; } if (lpDI) @@ -1294,57 +1281,49 @@ const char *getjoyname(int32_t what, int32_t num) // // AcquireInputDevices() -- (un)acquires the input devices // -static void AcquireInputDevices(char acquire, int8_t device) +static void AcquireInputDevices(char acquire) { DWORD flags; HRESULT result; - int32_t i; if (!bDInputInited) return; if (!hWindow) return; if (acquire) { -// if (!appactive) return; // why acquire when inactive? - for (i=0; i=0; i--) + { + int32_t j; + + // check axes + for (j=0; j (int32_t)(WAIT_OBJECT_0+numdevs)) - return; - - switch (idevnums[ev - WAIT_OBJECT_0]) - { - case JOYSTICK: - if (!lpDID[JOYSTICK]) break; - - result = IDirectInputDevice7_GetDeviceData(lpDID[JOYSTICK], sizeof(DIDEVICEOBJECTDATA), - (LPDIDEVICEOBJECTDATA)&didod, &dwElements, 0); - - if (result != DI_OK || !dwElements) break; - - for (i=dwElements-1; i>=0; i--) - { - int32_t j; - - // check axes - for (j=0; j MAXXDIM) *x = MAXXDIM; if (*y > MAXYDIM) *y = MAXYDIM; -// *x &= 0xfffffff8l; + // *x &= 0xfffffff8l; for (i=0; i= 0) gammabrightness = 1; if (gammabrightness && setgamma() < 0) gammabrightness = 0; } @@ -1813,7 +1773,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) #if defined(USE_OPENGL) && defined(POLYMOST) if (hGLWindow && glinfo.vsync) bwglSwapIntervalEXT(vsync); #endif - for (i=0; i0; i--, start++) { - dapal[0] = curpalette[start].b >> 2; - dapal[1] = curpalette[start].g >> 2; - dapal[2] = curpalette[start].r >> 2; - dapal += 4; - } +for (i=num; i>0; i--, start++) { +dapal[0] = curpalette[start].b >> 2; +dapal[1] = curpalette[start].g >> 2; +dapal[2] = curpalette[start].r >> 2; +dapal += 4; +} - return 0; +return 0; }*/ @@ -2287,7 +2247,7 @@ static int32_t setgammaramp(WORD gt[3][256]) hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, &IID_IDirectDrawGammaControl, (LPVOID)&gam); if (hr != DD_OK) { -// ShowDDrawErrorBox("Error querying gamma control", hr); + // ShowDDrawErrorBox("Error querying gamma control", hr); initprintf("Error querying gamma control: %s\n",GetDDrawError(hr)); return -1; } @@ -2297,7 +2257,7 @@ static int32_t setgammaramp(WORD gt[3][256]) { IDirectDrawGammaControl_Release(gam); initprintf("Error setting gamma ramp: %s\n",GetDDrawError(hr)); -// ShowDDrawErrorBox("Error setting gamma ramp", hr); + // ShowDDrawErrorBox("Error setting gamma ramp", hr); return -1; } @@ -2383,7 +2343,7 @@ static BOOL WINAPI InitDirectDraw_enum(GUID *lpGUID, LPSTR lpDesc, LPSTR lpName, UNREFERENCED_PARAMETER(lpName); UNREFERENCED_PARAMETER(lpContext); UNREFERENCED_PARAMETER(lpDesc); -// initprintf(" * %s\n", lpDesc); + // initprintf(" * %s\n", lpDesc); return 1; } @@ -2401,7 +2361,7 @@ static BOOL InitDirectDraw(void) // load up the DirectDraw DLL if (!hDDrawDLL) { -// initprintf(" - Loading DDRAW.DLL\n"); + // initprintf(" - Loading DDRAW.DLL\n"); hDDrawDLL = LoadLibrary("DDRAW.DLL"); if (!hDDrawDLL) { @@ -2420,7 +2380,7 @@ static BOOL InitDirectDraw(void) } // enumerate the devices to make us look fancy -// initprintf(" - Enumerating display devices\n"); + // initprintf(" - Enumerating display devices\n"); aDirectDrawEnumerate(InitDirectDraw_enum, NULL); // get the pointer to DirectDrawCreate @@ -2433,7 +2393,7 @@ static BOOL InitDirectDraw(void) } // create a new DirectDraw object -// initprintf(" - Creating DirectDraw object\n"); + // initprintf(" - Creating DirectDraw object\n"); result = aDirectDrawCreate(NULL, &lpDD, NULL); if (result != DD_OK) { @@ -2443,7 +2403,7 @@ static BOOL InitDirectDraw(void) } // fetch capabilities -// initprintf(" - Checking capabilities\n"); + // initprintf(" - Checking capabilities\n"); ddcaps.dwSize = sizeof(DDCAPS); result = IDirectDraw_GetCaps(lpDD, &ddcaps, NULL); if (result != DD_OK) @@ -2475,14 +2435,14 @@ static void UninitDirectDraw(void) if (lpDD) { -// initprintf(" - Releasing DirectDraw object\n"); + // initprintf(" - Releasing DirectDraw object\n"); IDirectDraw_Release(lpDD); lpDD = NULL; } if (hDDrawDLL) { -// initprintf(" - Unloading DDRAW.DLL\n"); + // initprintf(" - Unloading DDRAW.DLL\n"); FreeLibrary(hDDrawDLL); hDDrawDLL = NULL; } @@ -2533,28 +2493,28 @@ static void ReleaseDirectDrawSurfaces(void) { if (lpDDPalette) { -// initprintf(" - Releasing palette\n"); + // initprintf(" - Releasing palette\n"); IDirectDrawPalette_Release(lpDDPalette); lpDDPalette = NULL; } if (lpDDSBack) { -// initprintf(" - Releasing back-buffer surface\n"); + // initprintf(" - Releasing back-buffer surface\n"); IDirectDrawSurface_Release(lpDDSBack); lpDDSBack = NULL; } if (lpDDSPrimary) { -// initprintf(" - Releasing primary surface\n"); + // initprintf(" - Releasing primary surface\n"); IDirectDrawSurface_Release(lpDDSPrimary); lpDDSPrimary = NULL; } if (lpOffscreen) { -// initprintf(" - Freeing offscreen buffer\n"); + // initprintf(" - Freeing offscreen buffer\n"); Bfree(lpOffscreen); lpOffscreen = NULL; } @@ -2577,7 +2537,7 @@ static int32_t SetupDirectDraw(int32_t width, int32_t height) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; ddsd.dwBackBufferCount = 2; // triple-buffer -// initprintf(" - Creating primary surface\n"); + // initprintf(" - Creating primary surface\n"); result = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSPrimary, NULL); if (result != DD_OK) { @@ -2590,7 +2550,7 @@ static int32_t SetupDirectDraw(int32_t width, int32_t height) ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; numpages = 1; // KJS 20031225 -// initprintf(" - Getting back buffer\n"); + // initprintf(" - Getting back buffer\n"); result = IDirectDrawSurface_GetAttachedSurface(lpDDSPrimary, &ddsd.ddsCaps, &lpDDSBack); if (result != DD_OK) { @@ -2599,7 +2559,7 @@ static int32_t SetupDirectDraw(int32_t width, int32_t height) return TRUE; } -// initprintf(" - Allocating offscreen buffer\n"); + // initprintf(" - Allocating offscreen buffer\n"); lpOffscreen = (char *)Bmalloc((width|1)*height); if (!lpOffscreen) { @@ -2609,7 +2569,7 @@ static int32_t SetupDirectDraw(int32_t width, int32_t height) } // attach a palette to the primary surface -// initprintf(" - Creating palette\n"); + // initprintf(" - Creating palette\n"); for (i=0; i<256; i++) curpalettefaded[i].f = PC_NOCOLLAPSE; result = IDirectDraw_CreatePalette(lpDD, DDPCAPS_8BIT | DDPCAPS_ALLOW256, (LPPALETTEENTRY)curpalettefaded, &lpDDPalette, NULL); @@ -3635,8 +3595,8 @@ static inline BOOL CheckWinVersion(void) static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { /* RECT rect; - POINT pt; - HRESULT result; */ + POINT pt; + HRESULT result; */ #if defined(POLYMOST) && defined(USE_OPENGL) if (hWnd == hGLWindow) return DefWindowProc(hWnd,uMsg,wParam,lParam); @@ -3700,7 +3660,7 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA } Bmemset(keystatus, 0, sizeof(keystatus)); - AcquireInputDevices(appactive,-1); + AcquireInputDevices(appactive); break; } @@ -3712,13 +3672,13 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA } Bmemset(keystatus, 0, sizeof(keystatus)); - AcquireInputDevices(appactive,-1); + AcquireInputDevices(appactive); break; case WM_SIZE: if (wParam == SIZE_MAXHIDE || wParam == SIZE_MINIMIZED) appactive = 0; else appactive = 1; - AcquireInputDevices(appactive,-1); + AcquireInputDevices(appactive); break; case WM_PALETTECHANGED: @@ -3758,8 +3718,8 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA return TRUE; case WM_MOVE: -// windowx = LOWORD(lParam); -// windowy = HIWORD(lParam); + // windowx = LOWORD(lParam); + // windowy = HIWORD(lParam); return 0; case WM_MOVING: @@ -3776,11 +3736,11 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA case WM_ENTERMENULOOP: case WM_ENTERSIZEMOVE: - AcquireInputDevices(0,-1); + AcquireInputDevices(0); return 0; case WM_EXITMENULOOP: case WM_EXITSIZEMOVE: - AcquireInputDevices(1,-1); + AcquireInputDevices(1); return 0; case WM_DESTROY: @@ -3814,7 +3774,7 @@ static BOOL RegisterWindowClass(void) wcx.cbWndExtra = 0; wcx.hInstance = hInstance; wcx.hIcon = LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON, - GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR); + GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR); wcx.hCursor = LoadCursor(NULL, IDC_ARROW); wcx.hbrBackground = (HBRUSH)COLOR_GRAYTEXT; wcx.lpszMenuName = NULL; diff --git a/polymer/eduke32/nedmalloc.dll b/polymer/eduke32/nedmalloc.dll new file mode 100644 index 0000000000000000000000000000000000000000..3b26a3fbab9691e42bd3d0cc4d29624fc1957989 GIT binary patch literal 39936 zcmeIb3wTpix;MVlq%=SinNfnv;_rffnr-rTa&%Hs34FQ z*t6Wq%*b3kjz@=?GoHEXryfB8TZ*JyhKtO>B91Z+qp4xEC<8@0mv^o8u6Moby{x@kdf!$-D+q!P!S5G@9k|mkmtVj6(ueFDZhhkh;nk6U zxNV1~s# zsSCvnXV%RP!7y?5riNBLPn_M>@G!r>)Ub}N=` z;J%sP%Nv%~6YStf9EE~VqKOpb)8}Ug)6NK!ZyT){B?wJOxl2ub{$bor21jS z8S4?u2(1WVzg#puT`eXQmm}kO1fWl7LkRoj3PQ(pr^~q%Y3f+f!4Y_PGOQ4yxdhKy z*VKZ7zoUHMK+xm|uXH0tVw z1i@0(DEQxP?~v~FN8g3~tjQovX_P0DS3>h@F(Ft?>+bf~bR7=+RkCyLbFmdw)vTYL zZ}*EuY+@V$HO4B1XB}1kXfqz#JH&LGbXKz3B(F4m!`cf(pwd*^+P+nmdLqI`p~`;( zrEX+}ecHbGeyO8ov9;rV_SZ#SHH*U z7_NHOZ{NQ%g7qm?{`Qknlrq!b?h!}$qfMwMrE!pr$w~D=Xb+`rY07?bNTD9W;bHBJcV_FfEqGc_I@KL5g5K@CJ=w^C-e$*zgWx zzW9jT=VB_VtQX}pd6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6tyDa%tfrM#5#M#@d8_SAyZy404`O{veMo=6>!(aleLBu$?_ zBmI}@BWxyHuC2(n*tW^`JM_QDb~F0CE90*jf6vg{lkFvTW2P%}YvzwK$7RjQT9vgq zYg^WytRq<;XBo0%vs1I}+4HiyvyWz<%Kjqza`xRh896^D+IawH*>HP2@wvoN$yv#> zlb0l~1YMp>{siscllDE^FF_BZ?04AH?DOp1_QUpL_CMNt?C;yp*w2F6&)NIz__OBr z0lSc?%hYEYGEJH0%$UsB%sVsfnfGNrl=;2PuFUSt6Pc#0Te51iewy`O)?c&k%wCZF zK=xzVTe5$X{a@K{Wxt($Ec<+RWX`A@Q%-tLR!)9SWzKy$bvX~^NI8$@Y|Qy?&bFLq za()lo@5cp>5Cgg3C} zd`DB9&re_CKN2lTcPH7B@{(qOF4rY(O8QCC_M{h+ew);l zbTp|i>1xtwtI3*b&9OSH_13l4jn*yJ=dHi6zKnVFSdUo$YV}$D)(Oe?B&Q@7C)X#h zNp4GiBKg(iH^C#`PClG`3X~m{Votd$n_8ASKeZ-xdFl#K z_oJ!qRF?XK)PGNXG4;2pucYoy-Jg0q^-rMnFH$e1{sYv0Q<^31J83CtxoJgd3qb2@ z(w<8DW!lSWpQU}7W=_8;y(j%o>7S>MvE63-j_pa?)3#@9&)Z(M?Y14aeP**~> zN{CIEmXMr~n^2N4KVexyYraw)@w5GJyv^GG0BK;-XtF|4sUA7JzTKM+&Ee8G{!NC6p4C?Mz literal 0 HcmV?d00001 diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index f78716754..3b6043f1a 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9492,7 +9492,7 @@ static void G_ShowParameterHelp(void) "-connect [host]\tConnect to a multiplayer game\n" "-c#\t\tUse MP mode #, 1 = Dukematch, 2 = Coop, 3 = Dukematch(no spawn)\n" "-d[file.dmo]\tPlay a demo\n" - "-g[file.grp]\tUse an extra group file\n" + "-g[file.grp]\tUse additional game data\n" "-h[file.def]\tUse an alternate def\n" "-j[dir]\t\tAdds a directory to EDuke32's search list\n" "-l#\t\tWarp to level #, see -v\n" @@ -9595,7 +9595,7 @@ static void G_DoAutoload(const char *fn) while (findfiles) { Bsprintf(tempbuf,"autoload/%s/%s",fn,findfiles->name); - initprintf("Using group file '%s'.\n",tempbuf); + initprintf("Using file '%s' as game data.\n",tempbuf); initgroupfile(tempbuf); findfiles = findfiles->next; } @@ -9716,10 +9716,10 @@ static int32_t parsedefinitions_game(scriptfile *script, const int32_t preload) int32_t j = initgroupfile(fn); if (j == -1) - initprintf("Could not find group file '%s'.\n",fn); + initprintf("Could not find file '%s'.\n",fn); else { - initprintf("Using group file '%s'.\n",fn); + initprintf("Using file '%s' as game data.\n",fn); if (!g_noAutoLoad && !ud.config.NoAutoLoad) G_DoAutoload(fn); } @@ -11470,9 +11470,9 @@ CLEAN_DIRECTORY: i = initgroupfile(g_grpNamePtr); if (i == -1) - initprintf("Warning: could not find main group file '%s'!\n",g_grpNamePtr); + initprintf("Warning: could not find main data file '%s'!\n",g_grpNamePtr); else - initprintf("Using '%s' as main group file.\n", g_grpNamePtr); + initprintf("Using '%s' as main game data file.\n", g_grpNamePtr); if (!g_noAutoLoad && !ud.config.NoAutoLoad) { @@ -11484,7 +11484,7 @@ CLEAN_DIRECTORY: while (findfiles) { Bsprintf(tempbuf,"autoload/%s",findfiles->name); - initprintf("Using group file '%s'.\n",tempbuf); + initprintf("Using file '%s' as game data.\n",tempbuf); initgroupfile(tempbuf); findfiles = findfiles->next; } @@ -11505,7 +11505,7 @@ CLEAN_DIRECTORY: while (findfiles) { Bsprintf(tempbuf,"%s/%s",g_modDir,findfiles->name); - initprintf("Using group file '%s'.\n",tempbuf); + initprintf("Using file '%s' as game data.\n",tempbuf); initgroupfile(tempbuf); findfiles = findfiles->next; } @@ -11524,11 +11524,11 @@ CLEAN_DIRECTORY: { s = CommandGrps->next; j = initgroupfile(CommandGrps->str); - if (j == -1) initprintf("Could not find group file '%s'.\n",CommandGrps->str); + if (j == -1) initprintf("Could not find file '%s'.\n",CommandGrps->str); else { g_groupFileHandle = j; - initprintf("Using group file '%s'.\n",CommandGrps->str); + initprintf("Using file '%s' as game data.\n",CommandGrps->str); if (!g_noAutoLoad && !ud.config.NoAutoLoad) G_DoAutoload(CommandGrps->str); } diff --git a/polymer/eduke32/source/grpscan.c b/polymer/eduke32/source/grpscan.c index c3262d146..221b9547c 100644 --- a/polymer/eduke32/source/grpscan.c +++ b/polymer/eduke32/source/grpscan.c @@ -93,7 +93,7 @@ int32_t ScanGroups(void) return 0; } - initprintf("Scanning for game data...\n"); + initprintf("Searching for game data...\n"); LoadGroupsCache();