From 166019082f4b30f679cf99dfcc296c1a582fa17b Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 1 Sep 2008 21:59:53 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1046 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/mdsprite.c | 1 + polymer/build/src/polymost.c | 4 +- polymer/eduke32/source/actors.c | 128 ++++++++---------------------- polymer/eduke32/source/astub.c | 3 +- polymer/eduke32/source/duke3d.h | 2 +- polymer/eduke32/source/gamedef.c | 41 +++++----- polymer/eduke32/source/gameexec.c | 39 ++++----- polymer/eduke32/source/player.c | 2 +- 8 files changed, 77 insertions(+), 143 deletions(-) diff --git a/polymer/build/src/mdsprite.c b/polymer/build/src/mdsprite.c index c9982ce88..e25024209 100644 --- a/polymer/build/src/mdsprite.c +++ b/polymer/build/src/mdsprite.c @@ -846,6 +846,7 @@ int mdloadskin(md2model *m, int number, int pal, int surf) bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + if (glinfo.texcompr && glusetexcompr && glusetexcache) if (cachefil < 0) { // save off the compressed version diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index e75ae5700..c3f2a174f 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -1268,7 +1268,7 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea unsigned int padx=0, pady=0; GLuint gi; - if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) {OSD_Printf("\n");return;} + if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) return; if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB) { // lacking the necessary extensions to do this @@ -1700,7 +1700,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet pth->skyface = facen; pth->hicr = hicr; - if (glinfo.texcompr && glusetexcompr && !(hicr->flags & 1)) + if (glinfo.texcompr && glusetexcompr && glusetexcache && !(hicr->flags & 1)) if (cachefil < 0) { // save off the compressed version diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 462038084..fc4c86775 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -502,10 +502,10 @@ int movesprite(int spritenum, int xchange, int ychange, int zchange, unsigned in { sprite[spritenum].x = oldx; sprite[spritenum].y = oldy; -/* if (dasectnum >= 0 && sector[dasectnum].lotag == 1 && sprite[spritenum].picnum == LIZMAN) - sprite[spritenum].ang = (TRAND&2047); - else if ((hittype[spritenum].temp_data[0]&3) == 1 && sprite[spritenum].picnum != COMMANDER) - sprite[spritenum].ang = (TRAND&2047); */ + /* if (dasectnum >= 0 && sector[dasectnum].lotag == 1 && sprite[spritenum].picnum == LIZMAN) + sprite[spritenum].ang = (TRAND&2047); + else if ((hittype[spritenum].temp_data[0]&3) == 1 && sprite[spritenum].picnum != COMMANDER) + sprite[spritenum].ang = (TRAND&2047); */ setsprite(spritenum,oldx,oldy,sprite[spritenum].z); if (dasectnum < 0) dasectnum = 0; return (16384+dasectnum); @@ -2409,7 +2409,8 @@ static void moveweapons(void) break; } - if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0 && sprite[s->yvel].sectnum < MAXSECTORS) + if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && + s->yvel >= 0 && sprite[s->yvel].sectnum < MAXSECTORS) if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256) j = 49152|s->yvel; @@ -2438,8 +2439,10 @@ static void moveweapons(void) sprite[k].y = day; sprite[k].z = daz; - if (hittype[i].projectile.sxrepeat > 4) sprite[k].xrepeat=hittype[i].projectile.sxrepeat; - if (hittype[i].projectile.syrepeat > 4) sprite[k].yrepeat=hittype[i].projectile.syrepeat; + if (hittype[i].projectile.sxrepeat > 4) + sprite[k].xrepeat=hittype[i].projectile.sxrepeat; + if (hittype[i].projectile.syrepeat > 4) + sprite[k].yrepeat=hittype[i].projectile.syrepeat; } if (hittype[i].projectile.isound > -1) spritesound(hittype[i].projectile.isound,i); @@ -2470,8 +2473,10 @@ static void moveweapons(void) sprite[k].y = day; sprite[k].z = daz; - if (hittype[i].projectile.sxrepeat > 4) sprite[k].xrepeat=hittype[i].projectile.sxrepeat; - if (hittype[i].projectile.syrepeat > 4) sprite[k].yrepeat=hittype[i].projectile.syrepeat; + if (hittype[i].projectile.sxrepeat > 4) + sprite[k].xrepeat=hittype[i].projectile.sxrepeat; + if (hittype[i].projectile.syrepeat > 4) + sprite[k].yrepeat=hittype[i].projectile.syrepeat; } if (hittype[i].projectile.isound > -1) spritesound(hittype[i].projectile.isound,i); @@ -2507,33 +2512,14 @@ static void moveweapons(void) } } - /* if(hittype[i].projectile.workslike & 8192) - { - for(k=-3;k<2;k++) - { - - x = EGS(s->sectnum, - s->x+((k*sintable[(s->ang+512)&2047])>>9), - s->y+((k*sintable[s->ang&2047])>>9), - s->z+((k*ksgn(s->zvel))*klabs(s->zvel/24)),s->picnum,-40+(k<<2), // FIRELASER - s->xrepeat,s->yrepeat,0,0,0,s->owner,5); - - sprite[x].cstat = 128; - sprite[x].pal = s->pal; - - } - } - else */ - - if (hittype[i].projectile.workslike & PROJECTILE_FLAG_WATERBUBBLES && sector[s->sectnum].lotag == 2 && rnd(140)) + if (hittype[i].projectile.workslike & PROJECTILE_FLAG_WATERBUBBLES && + sector[s->sectnum].lotag == 2 && rnd(140)) spawn(i,WATERBUBBLE); if (j != 0) { if (hittype[i].projectile.workslike & PROJECTILE_FLAG_COOLEXPLOSION1) { - /* if( (j&49152) == 49152 && sprite[j&(MAXSPRITES-1)].picnum != APLAYER) - goto BOLT; */ s->xvel = 0; s->zvel = 0; } @@ -2542,17 +2528,6 @@ static void moveweapons(void) { j &= (MAXSPRITES-1); - /* if(hittype[i].projectile.workslike & PROJECTILE_FLAG_FREEZEBLAST && sprite[j].pal == 1 ) - if( badguy(&sprite[j]) || sprite[j].picnum == APLAYER ) - { - j = spawn(i,TRANSPORTERSTAR); - sprite[j].pal = 1; - sprite[j].xrepeat = 32; - sprite[j].yrepeat = 32; - - KILLIT(i); - }*/ - if (hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFSPRITES) { s->yvel--; @@ -2614,8 +2589,10 @@ static void moveweapons(void) sprite[k].y = day; sprite[k].z = daz; - if (hittype[i].projectile.sxrepeat > 4) sprite[k].xrepeat=hittype[i].projectile.sxrepeat; - if (hittype[i].projectile.syrepeat > 4) sprite[k].yrepeat=hittype[i].projectile.syrepeat; + if (hittype[i].projectile.sxrepeat > 4) + sprite[k].xrepeat=hittype[i].projectile.sxrepeat; + if (hittype[i].projectile.syrepeat > 4) + sprite[k].yrepeat=hittype[i].projectile.syrepeat; } if (hittype[i].projectile.isound > -1) @@ -2631,7 +2608,8 @@ static void moveweapons(void) { j &= (MAXWALLS-1); - if (hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFMIRRORS && (wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR)) + if (hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFMIRRORS && + (wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR)) { k = getangle( wall[wall[j].point2].x-wall[j].x, @@ -2674,9 +2652,8 @@ static void moveweapons(void) if (s->zvel < 0) { - if (sector[s->sectnum].ceilingstat&1) - if (sector[s->sectnum].ceilingpal == 0) - KILLIT(i); + if (sector[s->sectnum].ceilingstat&1 && sector[s->sectnum].ceilingpal == 0) + KILLIT(i); checkhitceiling(s->sectnum); } @@ -2686,10 +2663,6 @@ static void moveweapons(void) bounce(i); ssp(i,qq); - /* if(s->xrepeat > 8) - s->xrepeat -= 2; - if(s->yrepeat > 8) - s->yrepeat -= 2;*/ s->yvel--; if (hittype[i].projectile.bsound > -1) @@ -2705,34 +2678,17 @@ static void moveweapons(void) } } - if (hittype[i].projectile.workslike & PROJECTILE_FLAG_RPG) + if (hittype[i].projectile.workslike & PROJECTILE_FLAG_RPG && hittype[i].projectile.spawns > 0) { - if (hittype[i].projectile.spawns > 0) - { - k = spawn(i,hittype[i].projectile.spawns); - sprite[k].x = dax; - sprite[k].y = day; - sprite[k].z = daz; + k = spawn(i,hittype[i].projectile.spawns); + sprite[k].x = dax; + sprite[k].y = day; + sprite[k].z = daz; - if (hittype[i].projectile.sxrepeat > 4) sprite[k].xrepeat=hittype[i].projectile.sxrepeat; - if (hittype[i].projectile.syrepeat > 4) sprite[k].yrepeat=hittype[i].projectile.syrepeat; - } - /* if(s->xrepeat < 10) - { - sprite[k].xrepeat = 6; - sprite[k].yrepeat = 6; - }*/ - /* else if( (j&49152) == 16384) - { - if( s->zvel > 0) - spawn(i,EXPLOSION2BOT); - else - { - sprite[k].cstat |= 8; - sprite[k].z += (48<<8); - } - } - */ + if (hittype[i].projectile.sxrepeat > 4) + sprite[k].xrepeat=hittype[i].projectile.sxrepeat; + if (hittype[i].projectile.syrepeat > 4) + sprite[k].yrepeat=hittype[i].projectile.syrepeat; } @@ -2752,33 +2708,19 @@ static void moveweapons(void) if (hittype[i].projectile.isound > -1) spritesound(hittype[i].projectile.isound,i); - /* if(s->xrepeat >= 10) - {*/ s->extra=hittype[i].projectile.extra; if (hittype[i].projectile.extra_rand > 0) s->extra += (TRAND&hittype[i].projectile.extra_rand); - x = s->extra; - hitradius(i,hittype[i].projectile.hitradius, x>>2,x>>1,x-(x>>2),x); - /* } - else - { - x = s->extra+(global_random&3); - hitradius( i,(hittype[i].projectile.hitradius>>1),x>>2,x>>1,x-(x>>2),x); - }*/ - // if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_COOLEXPLOSION1)) + hitradius(i,hittype[i].projectile.hitradius, + s->extra>>2,s->extra>>1,s->extra-(s->extra>>2),s->extra); KILLIT(i); } } - - goto BOLT; - - } } else - { // here diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 14a09acd2..cdf9f3fdd 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2960,7 +2960,7 @@ static void Keys3d(void) rotatesprite(160<<16,170<<16,65536,(100-horiz+1024)<<3,1153,0,0,2,0,0,0,0); } -*/ + */ if (usedcount && !helpon) { @@ -9463,6 +9463,7 @@ typedef struct short *headspritestat; short *prevspritestat; short *nextspritestat; + int revision; } mapundo_t; mapundo_t undoredo[UNDODEPTH]; diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index a30a32fe7..d511cceea 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- // this is checked against http://eduke32.com/VERSION -#define BUILDDATE " 20080831" +#define BUILDDATE " 20080901" #define APPNAME "EDuke32" #define VERSION " 1.5.0devel" #define HEAD2 APPNAME VERSION BUILDDATE diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 6116e038d..564b0b12c 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1204,7 +1204,8 @@ static int skipcomments(void) else textptr+=2; } else break; - } while ((c = *textptr)); + } + while ((c = *textptr)); if ((unsigned)(scriptptr-script) > (unsigned)(g_ScriptSize-32)) return increasescriptsize(g_ScriptSize<<1); @@ -2155,11 +2156,11 @@ static int parsecommand(void) i = HASH_find(&labelH,label+(labelcnt<<6)); if (i>=0) { -/* if (i >= defaultlabelcnt) - { - warning++; - ReportError(WARNING_DUPLICATEDEFINITION); - } */ + /* if (i >= defaultlabelcnt) + { + warning++; + ReportError(WARNING_DUPLICATEDEFINITION); + } */ } //printf("Translating. '%.20s'\n",textptr); @@ -5675,23 +5676,23 @@ void loadefs(const char *filenam) if (warning|error) initprintf("Found %d warning(s), %d error(s).\n",warning,error); -/* if (error == 0 && warning != 0) - { - if (groupfile != -1 && loadfromgrouponly == 0) + /* if (error == 0 && warning != 0) { - initprintf("Warning(s) found in file `%s'. Do you want to use the INTERNAL DEFAULTS (y/N)?",filenam); - - i=wm_ynbox("CON File Compilation Warning", "Warning(s) found in file `%s'. Do you want to use the " - "INTERNAL DEFAULTS?",filenam); - if (i) i = 'y'; - if (i == 'y' || i == 'Y') + if (groupfile != -1 && loadfromgrouponly == 0) { - loadfromgrouponly = 1; - initprintf(" Yes\n"); - return; + initprintf("Warning(s) found in file `%s'. Do you want to use the INTERNAL DEFAULTS (y/N)?",filenam); + + i=wm_ynbox("CON File Compilation Warning", "Warning(s) found in file `%s'. Do you want to use the " + "INTERNAL DEFAULTS?",filenam); + if (i) i = 'y'; + if (i == 'y' || i == 'Y') + { + loadfromgrouponly = 1; + initprintf(" Yes\n"); + return; + } } - } - } */ + } */ if (error) { diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 108a2966b..2d55de7f1 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5070,8 +5070,8 @@ static int parse(void) { default: // fix for flying/jumping monsters getting stuck in water - if (g_sp->statnum != MAXSTATUS && actorscrptr[g_sp->picnum] && - ((moveptr && *(moveptr+1)) || g_sp->hitag & jumptoplayer)) + if (g_sp->statnum != MAXSTATUS && actorscrptr[g_sp->picnum] && + ((moveptr && *(moveptr+1)) || g_sp->hitag & jumptoplayer)) { // OSD_Printf("%d\n",*(moveptr+1)); break; @@ -5601,37 +5601,26 @@ static int parse(void) break; } if (sprite[i].statnum == j) break; + /* initialize actor pointers when changing to an actor statnum because they usually have garbage left over from being handled as a hard coded object */ + hittype[i].lastvx = 0; + hittype[i].lastvy = 0; + hittype[i].timetosleep = 0; + hittype[i].cgg = 0; + hittype[i].movflag = 0; + hittype[i].tempang = 0; + hittype[i].dispicnum = 0; + T1=T2=T3=T4=T5=T6=T7=T8=T9=0; + hittype[i].flags = 0; + sprite[i].hitag = 0; + if ((j == 1 || j == 2) && actorscrptr[sprite[i].picnum]) { T5 = *(actorscrptr[sprite[i].picnum]+1); T2 = *(actorscrptr[sprite[i].picnum]+2); sprite[i].hitag = *(actorscrptr[sprite[i].picnum]+3); - hittype[i].lastvx = 0; - hittype[i].lastvy = 0; - hittype[i].timetosleep = 0; - hittype[i].cgg = 0; - hittype[i].movflag = 0; - hittype[i].tempang = 0; - hittype[i].dispicnum = 0; - T1=T3=T4=T6=T7=T8=T9=0; - hittype[i].flags = 0; - } - else - { - T2=T5=0; - sprite[i].hitag = 0; - hittype[i].lastvx = 0; - hittype[i].lastvy = 0; - hittype[i].timetosleep = 0; - hittype[i].cgg = 0; - hittype[i].movflag = 0; - hittype[i].tempang = 0; - hittype[i].dispicnum = 0; - T1=T3=T4=T6=T7=T8=T9=0; - hittype[i].flags = 0; } changespritestat(i,j); break; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 22ca85254..4f9fa054d 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -3339,7 +3339,7 @@ void processinput(int snum) /* wtf is this supposed to do? */ if ((lz&49152) == 16384 && psectlotag == 1 && truefdist > PHEIGHT+(16<<8)) psectlotag = 0; - + hittype[pi].floorz = fz; hittype[pi].ceilingz = cz;