From 80e2ec8edf63711371f7206d2fac4033a66f589f Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 14 Apr 2009 22:55:32 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1325 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 4 +- polymer/eduke32/build/src/defs.c | 20 +++++++-- polymer/eduke32/build/src/hightile.c | 2 + polymer/eduke32/build/src/mdsprite.c | 20 ++++++--- polymer/eduke32/build/src/polymost.c | 62 ++++++++++---------------- polymer/eduke32/source/actors.c | 26 +++++------ polymer/eduke32/source/config.c | 11 +++-- polymer/eduke32/source/duke3d.h | 3 +- polymer/eduke32/source/game.c | 6 +-- polymer/eduke32/source/misc/gameres.rc | 13 +++--- polymer/eduke32/source/player.c | 6 +-- polymer/eduke32/source/startwin.game.c | 40 ++++++++++++----- polymer/eduke32/source/startwin.game.h | 6 ++- 13 files changed, 128 insertions(+), 91 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 2774418ee..b4756684f 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -40,15 +40,17 @@ extern "C" { #define MAXSPRITESONSCREEN 4096 #define MAXUNIQHUDID 256 //Extra slots so HUD models can store animation state without messing game sprites -#define RESERVEDPALS 8 // don't forget to increment this when adding reserved pals +#define RESERVEDPALS 2 // don't forget to increment this when adding reserved pals #define DETAILPAL (MAXPALOOKUPS - 1) #define GLOWPAL (MAXPALOOKUPS - 2) +/* #define REDPAL (MAXPALOOKUPS - 3) #define BLUEPAL (MAXPALOOKUPS - 4) #define BROWNPAL (MAXPALOOKUPS - 5) #define GREYPAL (MAXPALOOKUPS - 6) #define GREENPAL (MAXPALOOKUPS - 7) #define SPECPAL (MAXPALOOKUPS - 8) +*/ #define TSPR_TEMP 99 #define TSPR_MIRROR 100 diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index d5c9b1b5d..4429be960 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -21,7 +21,7 @@ enum T_DEFINETEXTURE, T_DEFINESKYBOX, T_DEFINETINT, - T_DEFINECONV, + /*T_DEFINECONV,*/ T_DEFINEMODEL, T_DEFINEMODELFRAME, T_DEFINEMODELANIM, @@ -74,7 +74,7 @@ enum T_CACHESIZE, T_IMPORTTILE, T_MUSIC,T_ID,T_SOUND, - T_REDPAL,T_BLUEPAL,T_BROWNPAL,T_GREYPAL,T_GREENPAL,T_SPECPAL, +/* T_REDPAL,T_BLUEPAL,T_BROWNPAL,T_GREYPAL,T_GREENPAL,T_SPECPAL,*/ T_TILEFROMTEXTURE, T_XOFFSET, T_YOFFSET }; @@ -90,7 +90,7 @@ static tokenlist basetokens[] = { "definetexture", T_DEFINETEXTURE }, { "defineskybox", T_DEFINESKYBOX }, { "definetint", T_DEFINETINT }, - { "defineconv", T_DEFINECONV }, +/* { "defineconv", T_DEFINECONV },*/ { "definemodel", T_DEFINEMODEL }, { "definemodelframe",T_DEFINEMODELFRAME }, { "definemodelanim", T_DEFINEMODELANIM }, @@ -142,12 +142,14 @@ static tokenlist modeltokens[] = { "skin", T_SKIN }, { "glow", T_GLOW }, { "detail", T_DETAIL }, +/* { "redmap", T_REDPAL }, { "bluepal", T_BLUEPAL }, { "brownpal",T_BROWNPAL}, { "greypal", T_GREYPAL }, { "greenpal",T_GREENPAL}, { "specpal", T_SPECPAL }, +*/ { "hud", T_HUD }, { "flags", T_FLAGS }, }; @@ -233,12 +235,14 @@ static tokenlist texturetokens[] = { "pal", T_PAL }, { "detail", T_DETAIL }, { "glow", T_GLOW }, +/* { "redmap", T_REDPAL }, { "bluepal", T_BLUEPAL }, { "brownpal",T_BROWNPAL}, { "greypal", T_GREYPAL }, { "greenpal",T_GREENPAL}, { "specpal", T_SPECPAL }, +*/ }; static tokenlist texturetokens_pal[] = @@ -436,6 +440,7 @@ static int32_t defsparser(scriptfile *script) hicsetpalettetint(pal,r,g,b,f); } break; +/* case T_DEFINECONV: { int32_t pal, pal1, pal2; @@ -448,6 +453,7 @@ static int32_t defsparser(scriptfile *script) #endif } break; +*/ case T_ALPHAHACK: { int32_t tile; @@ -1206,7 +1212,9 @@ static int32_t defsparser(scriptfile *script) } break; case T_SKIN: case T_DETAIL: case T_GLOW: +/* case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL: +*/ { char *skintokptr = script->ltextptr; char *skinend, *skinfn = 0; @@ -1244,12 +1252,14 @@ static int32_t defsparser(scriptfile *script) switch (token) { +/* case T_REDPAL: palnum = REDPAL; break; case T_BLUEPAL: palnum = BLUEPAL; break; case T_BROWNPAL:palnum = BROWNPAL; break; case T_GREYPAL: palnum = GREYPAL; break; case T_GREENPAL:palnum = GREENPAL; break; case T_SPECPAL: palnum = SPECPAL; break; +*/ case T_DETAIL: palnum = DETAILPAL; @@ -1608,7 +1618,7 @@ static int32_t defsparser(scriptfile *script) } break; case T_DETAIL: case T_GLOW: - case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL: +/* case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL:*/ { char *detailtokptr = script->ltextptr, *detailend; int32_t pal = 0, i; @@ -1664,12 +1674,14 @@ static int32_t defsparser(scriptfile *script) switch (token) { +/* case T_REDPAL: pal = REDPAL; palmapbits|=32; break; case T_BLUEPAL: pal = BLUEPAL; palmapbits|=16; break; case T_BROWNPAL:pal = BROWNPAL; palmapbits|= 8; break; case T_GREYPAL: pal = GREYPAL; palmapbits|= 4; break; case T_GREENPAL:pal = GREENPAL; palmapbits|= 2; break; case T_SPECPAL: pal = SPECPAL; palmapbits|= 1; break; +*/ case T_DETAIL: pal = DETAILPAL; diff --git a/polymer/eduke32/build/src/hightile.c b/polymer/eduke32/build/src/hightile.c index 5965635dd..fdb1cd717 100644 --- a/polymer/eduke32/build/src/hightile.c +++ b/polymer/eduke32/build/src/hightile.c @@ -62,9 +62,11 @@ void hicinit(void) int32_t i,j; hicreplctyp *hr, *next; +/* #if defined(USE_OPENGL) clearconv(); #endif +*/ for (i=0; ifn = (char *)malloc(strlen(skinfn)+1); if (!sk->fn) return(-4); strcpy(sk->fn, skinfn); - sk->palmap=0; +/* sk->palmap=0;*/ return 0; } @@ -410,6 +410,7 @@ int32_t md_undefinemodel(int32_t modelid) md2model_t *modelhead; mdskinmap_t *skhead; +/* typedef struct { int32_t pal,pal1,pal2; @@ -476,11 +477,11 @@ void applypalmap(char *pic, char *palmap, int32_t size, int32_t pal) pic[g]=((pic[g]*(255-a)+hictinting[pal].g*a)*palmap[g])/255/255; pic[b]=((pic[b]*(255-a)+hictinting[pal].b*a)*palmap[b])/255/255; - /* + / * pic[r]=((255*(255-a)+hictinting[pal].r*a)*palmap[r])/255/255; pic[g]=((255*(255-a)+hictinting[pal].g*a)*palmap[g])/255/255; pic[b]=((255*(255-a)+hictinting[pal].b*a)*palmap[b])/255/255; - */ + * / if (glinfo.bgra)swapchar(&pic[r], &pic[b]); r+=4; g+=4; b+=4; } @@ -506,8 +507,9 @@ static void applypalmapSkin(char *pic, int32_t sizx, int32_t sizy, md2model_t *m applypalmap(pic,sk->palmap,sk->size,pal2); } } +*/ -static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t *sizx, int32_t *sizy, int32_t *osizx, int32_t *osizy, char *hasalpha, int32_t pal, char effect, md2model_t *m, int32_t number, int32_t surf) +static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t *sizx, int32_t *sizy, int32_t *osizx, int32_t *osizy, char *hasalpha, int32_t pal, char effect) { int32_t picfillen, j,y,x; char *picfil,*cptr,al=255; @@ -544,7 +546,7 @@ static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t { free(picfil); free(pic); return -1; } free(picfil); - applypalmapSkin((char *)pic,tsizx,tsizy,m,number,pal,surf); + /*applypalmapSkin((char *)pic,tsizx,tsizy,m,number,pal,surf);*/ cptr = &britable[gammabrightness ? 0 : curbrightness][0]; r=(glinfo.bgra)?hictinting[pal].b:hictinting[pal].r; g=hictinting[pal].g; @@ -850,7 +852,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) cachefil = -1; // the compressed version will be saved to disk if ((filh = kopen4load(fn, 0)) < 0) return -1; - if (daskinloader(filh,&fptr,&bpl,&xsiz,&ysiz,&osizx,&osizy,&hasalpha,pal,(globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK),m,number,surf)) + if (daskinloader(filh,&fptr,&bpl,&xsiz,&ysiz,&osizx,&osizy,&hasalpha,pal,(globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK))) { kclose(filh); OSD_Printf("Failed loading skin file \"%s\"\n", fn); @@ -859,6 +861,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) } else kclose(filh); if (pal < (MAXPALOOKUPS - RESERVEDPALS))m->usesalpha = hasalpha; +/* if (pal>=SPECPAL&&pal<=REDPAL) { //_initprintf("%cLoaded palmap %d(%dx%d)",sk->palmap?'+':'-',pal,xsiz,ysiz); @@ -871,6 +874,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) cachefil=0; //_initprintf("#%d\n",sk->palmap); } +*/ if ((doalloc&3)==1) bglGenTextures(1,(GLuint*)texidx); bglBindTexture(GL_TEXTURE_2D,*texidx); @@ -1300,11 +1304,13 @@ static md2model_t *md2load(int32_t fil, const char *filnam) if (m->numskins > 0) { sk->fn = (char *)malloc(strlen(m->basepath)+strlen(m->skinfn)+1); +/* if (sk->palmap) { //_initprintf("Delete %s",m->skinfn); sk->palmap=0; sk->size=0; } +*/ strcpy(sk->fn, m->basepath); strcat(sk->fn, m->skinfn); } @@ -2198,11 +2204,13 @@ static void md3free(md3model_t *m) { nsk = sk->next; free(sk->fn); +/* if (sk->palmap) { //_initprintf("Kill %d\n",sk->palette); free(sk->palmap); sk->palmap=0; } +*/ free(sk); } diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 6303bc1a8..4dc3ea4a5 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -680,11 +680,13 @@ void polymost_glreset() free(pth->ofb); } bglDeleteTextures(1,&pth->glpic); +/* if (pth->palmap) { //_initprintf("Kill #%d\n",pth->palmap); free(pth->palmap); pth->palmap=0; } +*/ free(pth); pth = next; } @@ -1476,8 +1478,7 @@ int32_t trytexcache(char *fn, int32_t len, int32_t dameth, char effect, texcache offset = t->offset; // initprintf("got a match for %s offset %d\n",cachefn,offset); } - - if (i < 0) return -1; // didn't find it + else return -1; // didn't find it if (Blseek(cachefilehandle, offset, BSEEK_SET) == -1) { @@ -1521,7 +1522,7 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea GLint gi; int32_t offset = 0; - if (!glinfo.texcompr || !glusetexcompr || !glusetexcache || !cacheindexptr || cachefilehandle < 0) return; + if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) return; if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB) { // lacking the necessary extensions to do this @@ -1529,40 +1530,19 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea glusetexcache = 0; return; } - /* - { - struct stat st; - if (stat(TEXCACHEFILE, &st) < 0) - { - if (errno == ENOENT) // path doesn't exist - { - // try to create the cache directory - if (Bmkdir(TEXCACHEFILE, S_IRWXU) < 0) - { - OSD_Printf("Failed to create texture cache directory %s\n", TEXCACHEFILE); - glusetexcache = 0; - return; - } - else OSD_Printf("Created texture cache directory %s\n", TEXCACHEFILE); - } - else - { - // another type of failure - glusetexcache = 0; - return; - } - } - else if ((st.st_mode & S_IFDIR) != S_IFDIR) - { - // cache directory isn't a directory - glusetexcache = 0; - return; - } - } - */ + if (!cacheindexptr || cachefilehandle < 0) + { + OSD_Printf("Warning: no active cache!\n"); + return; + } + gi = GL_FALSE; bglGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_ARB, (GLint *)&gi); - if (gi != GL_TRUE) return; + if (gi != GL_TRUE) + { + OSD_Printf("Error: glGetTexLevelParameteriv returned GL_FALSE!\n"); + return; + } md4once((uint8_t *)fn, strlen(fn), mdsum); @@ -1573,7 +1553,7 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea Blseek(cachefilehandle, 0, BSEEK_END); offset = Blseek(cachefilehandle, 0, BSEEK_CUR); - OSD_Printf("Writing cached tex %s, offset 0x%x\n", cachefn, offset); + OSD_Printf("Caching %s, offset 0x%x\n", cachefn, offset); Bmemcpy(head->magic, "PMST", 4); // sizes are set by caller @@ -1646,6 +1626,7 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea fseek(cacheindexptr, 0, BSEEK_END); Bfprintf(cacheindexptr, "%s %d %d\n", t->name, t->offset, t->len); } + else OSD_Printf("wtf?\n"); } else { @@ -1659,6 +1640,7 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea fseek(cacheindexptr, 0, BSEEK_END); Bfprintf(cacheindexptr, "%s %d %d\n", curcacheindex->name, curcacheindex->offset, curcacheindex->len); } + else OSD_Printf("wtf?\n"); hash_add(&cacheH, Bstrdup(cachefn), numcacheentries); cacheptrs[numcacheentries++] = curcacheindex; @@ -1669,7 +1651,7 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea goto success; failure: - initprintf("failure!\n"); + initprintf("ERROR: cache failure!\n"); curcacheindex->offset = 0; Bmemset(curcacheindex->name,0,sizeof(curcacheindex->name)); @@ -1759,6 +1741,7 @@ failure: return -1; } // --------------------------------------------------- JONOF'S COMPRESSED TEXTURE CACHE STUFF +/* static void applypalmapsT(char *pic, int32_t sizx, int32_t sizy, int32_t dapic,int32_t dapalnum, int32_t dameth) { //_initprintf("%d\n",pal); @@ -1782,6 +1765,7 @@ static void applypalmapsT(char *pic, int32_t sizx, int32_t sizy, int32_t dapic,i applypalmap(pic,pth->palmap,pth->size,pal2); } } +*/ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp *hicr, int32_t dameth, pthtyp *pth, int32_t doalloc, char effect) { @@ -1860,7 +1844,7 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp pic = (coltype *)calloc(xsiz,ysiz*sizeof(coltype)); if (!pic) { free(picfil); return 1; } if (kprender(picfil,picfillen,(intptr_t)pic,xsiz*sizeof(coltype),xsiz,ysiz,0,0)) { free(picfil); free(pic); return -2; } - applypalmapsT((char *)pic,tsizx,tsizy,dapic,dapalnum,dameth); +/* applypalmapsT((char *)pic,tsizx,tsizy,dapic,dapalnum,dameth);*/ r=(glinfo.bgra)?hictinting[dapalnum].r:hictinting[dapalnum].b; g=hictinting[dapalnum].g; @@ -1933,6 +1917,7 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp if ((doalloc&3)==1) bglGenTextures(1,(GLuint*)&pth->glpic); //# of textures (make OpenGL allocate structure) bglBindTexture(GL_TEXTURE_2D,pth->glpic); +/* if (dapalnum>=SPECPAL&&dapalnum<=REDPAL) { //_initprintf("%cLoaded palamp %d(%dx%d)",pth->palmap?'+':'-',dapalnum,xsiz,ysiz); @@ -1944,6 +1929,7 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp } cachefil=0; } +*/ fixtransparency(pic,tsizx,tsizy,xsiz,ysiz,dameth); uploadtexture(doalloc,xsiz,ysiz,intexfmt,texfmt,pic,-1,tsizy,dameth|8192|(hicr->flags & 16?4096:0)); } diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 159dcaaf5..3e7421d08 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -600,7 +600,7 @@ static void G_MoveZombieActors(void) G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(80<<8),0); break; case ATOMICHEALTH__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),1); break; case FIRE__STATIC: @@ -621,15 +621,15 @@ static void G_MoveZombieActors(void) break; case EXPLOSION2__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(80<<8),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(80<<8),1); break; case FORCERIPPLE__STATIC: // case TRANSPORTERSTAR__STATIC: case TRANSPORTERBEAM__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 80+(80<<8)+(255<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 80+(80<<8)+(255<<16),2); break; case SHRINKEREXPLOSION__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),1); break; } @@ -2280,7 +2280,7 @@ static void G_MoveWeapons(void) // A_PlaySound(WIERDSHOT_FLY,i); if (ActorExtra[i].projectile.flashcolor) - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, ActorExtra[i].projectile.flashcolor,0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, ActorExtra[i].projectile.flashcolor,2); if (ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFWALLS) { @@ -2727,20 +2727,20 @@ static void G_MoveWeapons(void) switch (DynamicTileMap[s->picnum]) { case FREEZEBLAST__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),1); break; case COOLEXPLOSION1__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 3072, 128+(0<<8)+(255<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 3072, 128+(0<<8)+(255<<16),1); break; case SHRINKSPARK__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),1); break; case RPG__STATIC: case FIRELASER__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 32 * s->yrepeat, 255+(80<<8),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 32 * s->yrepeat, 255+(80<<8),2); if (DynamicTileMap[s->picnum] == RPG__STATIC && ActorExtra[i].picnum != BOSS2 && s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) @@ -3386,7 +3386,7 @@ static void G_MoveActors(void) switch (DynamicTileMap[switchpicnum]) { case ATOMICHEALTH__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),1); break; case FIRE__STATIC: @@ -5152,15 +5152,15 @@ static void G_MoveMisc(void) // STATNUM 5 break; case EXPLOSION2__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), (512 * s->yrepeat) / (ActorExtra[i].temp_data[2]+1), 255+(80<<8),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), (512 * s->yrepeat) / (ActorExtra[i].temp_data[2]+1), 255+(80<<8),1); break; case FORCERIPPLE__STATIC: // case TRANSPORTERSTAR__STATIC: case TRANSPORTERBEAM__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 80+(80<<8)+(255<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 80+(80<<8)+(255<<16),2); break; case SHRINKEREXPLOSION__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),0); + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),1); break; } if (!actorscrptr[sprite[i].picnum]) diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 856679090..e64a81ae6 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -196,6 +196,7 @@ void CONFIG_SetDefaults(void) #endif ud.config.useprecache = 1; ud.config.ForceSetup = 1; + ud.config.NoAutoLoad = 0; ud.config.AmbienceToggle = 1; ud.config.AutoAim = 1; ud.config.FXDevice = 0; @@ -667,6 +668,7 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Setup","ConfigVersion",&ud.configversion); SCRIPT_GetNumber(ud.config.scripthandle, "Setup","ForceSetup",&ud.config.ForceSetup); + SCRIPT_GetNumber(ud.config.scripthandle, "Setup","NoAutoLoad",&ud.config.NoAutoLoad); #ifdef _WIN32 if (g_noSetup == 0 && mod_dir[0] == '/') @@ -784,9 +786,9 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning", &r_parallaxskypanning); /*SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount);*/ SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks); - SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLRenderMode", &glrendmode); - if (glrendmode > 4) glrendmode = 4; - if (glrendmode < 3) glrendmode = 3; + SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &dummy); + if (dummy > 0) glrendmode = 4; + else glrendmode = 3; SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", &r_downsize); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache); @@ -1070,6 +1072,7 @@ void CONFIG_WriteSetup(void) SCRIPT_PutNumber(ud.config.scripthandle, "Setup","ConfigVersion",BYTEVERSION_JF,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,false,false); + SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "NoAutoLoad",ud.config.NoAutoLoad,false,false); { Bsprintf(tempbuf,"%.2f",r_ambientlight); @@ -1089,7 +1092,7 @@ void CONFIG_WriteSetup(void) SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false); /*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);*/ SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,false,false); - SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLRenderMode",glrendmode,false,false); + SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false); diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index fd994d9b9..7ce22a7af 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -79,7 +79,7 @@ extern int32_t g_scriptVersion, g_Shareware, g_gameType; #define BYTEVERSION_14 116 #define BYTEVERSION_15 117 -#define BYTEVERSION_JF 192 // increase by 3, because atomic GRP adds 1, and Shareware adds 2 +#define BYTEVERSION_JF 195 // increase by 3, because atomic GRP adds 1, and Shareware adds 2 #define BYTEVERSION (BYTEVERSION_JF+(PLUTOPAK?1:(VOLUMEONE<<1))) // JBF 20040116: different data files give different versions @@ -359,6 +359,7 @@ typedef struct { int32_t ScreenBPP; int32_t ForceSetup; + int32_t NoAutoLoad; int32_t scripthandle; int32_t setupread; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 246b6c028..81e956a5d 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9261,7 +9261,7 @@ static int32_t parsedefinitions_game(scriptfile *script, const int32_t preload) else { initprintf("Using group file '%s'.\n",fn); - if (!g_noAutoLoad) + if (!g_noAutoLoad && !ud.config.NoAutoLoad) G_DoAutoload(fn); } @@ -11230,7 +11230,7 @@ CLEAN_DIRECTORY: else initprintf("Using group file '%s' as main group file.\n", duke3dgrp); - if (!g_noAutoLoad) + if (!g_noAutoLoad && !ud.config.NoAutoLoad) { int32_t ii; @@ -11283,7 +11283,7 @@ CLEAN_DIRECTORY: { g_groupFileHandle = j; initprintf("Using group file '%s'.\n",CommandGrps->str); - if (!g_noAutoLoad) + if (!g_noAutoLoad && !ud.config.NoAutoLoad) G_DoAutoload(CommandGrps->str); } diff --git a/polymer/eduke32/source/misc/gameres.rc b/polymer/eduke32/source/misc/gameres.rc index 2f8195825..538d3ff3e 100644 --- a/polymer/eduke32/source/misc/gameres.rc +++ b/polymer/eduke32/source/misc/gameres.rc @@ -24,7 +24,8 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "&Video mode:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 8, 50, 8 CONTROL "", IDCVMODE, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 6, 80, 56 - CONTROL "&Fullscreen", IDCFULLSCREEN, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 148, 8, 49, 10 + CONTROL "&Fullscreen", IDCFULLSCREEN, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 148, 8, 46, 10 + CONTROL "&Polymer", IDCPOLYMER, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 197, 8, 40, 10 CONTROL "Input devices:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 22, 50, 8 CONTROL "Mo&use", IDCINPUTMOUSE, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 60, 22, 49, 8 @@ -35,14 +36,14 @@ BEGIN CONTROL "Custom game content &directory:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 90, 160, 8 CONTROL "", IDCGAMEDIR, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 10, 99, 226, 156 - + CONTROL "&Enable ""autoload"" folder", IDCAUTOLOAD, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 116, 100, 8 CONTROL "&Always show this window at startup", IDCALWAYSSHOW, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 118, 116, 140, 8 END -#define FILEVER 1,4,9,9 -#define PRODUCTVER 1,4,9,9 -#define STRFILEVER "1.5.0devel\0" -#define STRPRODUCTVER "1.5.0devel\0" +#define FILEVER 1,9,9,9 +#define PRODUCTVER 1,9,9,9 +#define STRFILEVER "2.0.0devel\0" +#define STRPRODUCTVER "2.0.0devel\0" VS_VERSION_INFO VERSIONINFO FILEVERSION FILEVER diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 3f82ca7d2..51e0471d8 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -354,7 +354,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith) case RPG__STATIC: case MORTER__STATIC: G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7), - s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, 255+(80<<8),0); + s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, 255+(80<<8),1); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>4); @@ -387,7 +387,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith) if (ProjectileData[atwith].flashcolor) { G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7), - s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, ProjectileData[atwith].flashcolor,0); + s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, ProjectileData[atwith].flashcolor,1); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>4); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(s->ang)&2047])>>4); @@ -2177,7 +2177,7 @@ void P_FireWeapon(DukePlayer_t *p) p->visibility = 0; G_AddGameLight(0, s->sectnum, s->x+((sintable[(p->ang+512)&2047])>>7), s->y+((sintable[(p->ang)&2047])>>7), - s->z-PHEIGHT, 4096, aplWeaponFlashColor[p->curr_weapon][snum],0); + s->z-PHEIGHT, 4096, aplWeaponFlashColor[p->curr_weapon][snum],1); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(p->ang+512)&2047])>>4); diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index 941c49dcc..8b2a97e79 100644 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -30,7 +30,7 @@ static struct audioenumdrv *wavedevs = NULL; static struct { - int32_t fullscreen; + int32_t flags; // bitfield int32_t xdim, ydim, bpp; int32_t forcesetup; int32_t usemouse, usejoy; @@ -91,8 +91,8 @@ static void PopulateForm(int32_t pgs) hwnd = GetDlgItem(pages[TAB_CONFIG], IDCVMODE); - mode = checkvideomode(&settings.xdim, &settings.ydim, settings.bpp, settings.fullscreen, 1); - if (mode < 0) + mode = checkvideomode(&settings.xdim, &settings.ydim, settings.bpp, settings.flags&1, 1); + if (mode < 0 || (settings.bpp < 15 && (settings.flags & 2))) { int32_t cd[] = { 32, 24, 16, 15, 8, 0 }; for (i=0; cd[i];) @@ -102,18 +102,20 @@ static void PopulateForm(int32_t pgs) } for (; cd[i]; i++) { - mode = checkvideomode(&settings.xdim, &settings.ydim, cd[i], settings.fullscreen, 1); + mode = checkvideomode(&settings.xdim, &settings.ydim, cd[i], settings.flags&1, 1); if (mode < 0) continue; settings.bpp = cd[i]; break; } } - Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), (settings.fullscreen ? BST_CHECKED : BST_UNCHECKED)); + Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), ((settings.flags&1) ? BST_CHECKED : BST_UNCHECKED)); + Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCPOLYMER), ((settings.flags&2) ? BST_CHECKED : BST_UNCHECKED)); (void)ComboBox_ResetContent(hwnd); for (i=0; i