diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 9fc51d190..1c6fa8c06 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -2874,15 +2874,13 @@ static void moveweapons(void) p = -1; + k = s->xvel; + ll = s->zvel; + if (s->picnum == RPG && sector[s->sectnum].lotag == 2) { - k = s->xvel>>1; - ll = s->zvel>>1; - } - else - { - k = s->xvel; - ll = s->zvel; + k >>= 1; + ll >>= 1; } dax = s->x; @@ -2903,18 +2901,14 @@ static void moveweapons(void) break; } - j = movesprite(i, - (k*(sintable[(s->ang+512)&2047]))>>14, - (k*(sintable[s->ang&2047]))>>14,ll,qq); + j = movesprite(i,(k*(sintable[(s->ang+512)&2047]))>>14,(k*(sintable[s->ang&2047]))>>14,ll,qq); if (s->picnum == RPG && s->yvel >= 0) if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256) j = 49152|s->yvel; if (s->sectnum < 0) - { KILLIT(i); - } if ((j&49152) != 49152) if (s->picnum != FREEZEBLAST) @@ -3092,6 +3086,18 @@ static void moveweapons(void) } } + spritesound(RPG_EXPLODE,i); + + if (s->xrepeat >= 10) + { + x = s->extra; + hitradius(i,rpgblastradius, x>>2,x>>1,x-(x>>2),x); + } + else + { + x = s->extra+(global_random&3); + hitradius(i,(rpgblastradius>>1),x>>2,x>>1,x-(x>>2),x); + } } else if (s->picnum == SHRINKSPARK) { @@ -3113,21 +3119,6 @@ static void moveweapons(void) } } - if (s->picnum == RPG) - { - spritesound(RPG_EXPLODE,i); - - if (s->xrepeat >= 10) - { - x = s->extra; - hitradius(i,rpgblastradius, x>>2,x>>1,x-(x>>2),x); - } - else - { - x = s->extra+(global_random&3); - hitradius(i,(rpgblastradius>>1),x>>2,x>>1,x-(x>>2),x); - } - } } if (s->picnum != COOLEXPLOSION1) KILLIT(i); } @@ -3141,7 +3132,6 @@ static void moveweapons(void) goto BOLT; - case SHOTSPARK1__STATIC: p = findplayer(s,&x); execute(&i,&p,&x); @@ -3327,11 +3317,8 @@ static void movetransports(void) break; case 1: - if ((sprite[j].picnum == SHARK) - || (sprite[j].picnum == COMMANDER) - || (sprite[j].picnum == OCTABRAIN) - || ((sprite[j].picnum >= GREENSLIME) && (sprite[j].picnum >= GREENSLIME+7)) - ) + if ((sprite[j].picnum == SHARK) || (sprite[j].picnum == COMMANDER) || (sprite[j].picnum == OCTABRAIN) + || ((sprite[j].picnum >= GREENSLIME) && (sprite[j].picnum >= GREENSLIME+7))) { if (sprite[j].extra > 0) goto JBOLT; @@ -4811,7 +4798,12 @@ DETONATEB: s->cstat = (short)32768; goto BOLT; } - else if (actor_tog == 2) s->cstat = 257; + else if (actor_tog == 2) + { + s->cstat = 0; + if (s->extra) + s->cstat = 257; + } } // #endif diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 5d9e0516d..3ad1917b2 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -425,13 +425,13 @@ void CONFIG_SetupMouse(void) Bsprintf(str,"MouseButton%ld",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle,"Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) MouseFunctions[i][0] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"MouseButtonClicked%ld",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle,"Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) MouseFunctions[i][1] = CONFIG_FunctionNameToNum(temp); } @@ -441,19 +441,19 @@ void CONFIG_SetupMouse(void) Bsprintf(str,"MouseAnalogAxes%ld",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle, "Controls", str,temp)) - if (CONFIG_AnalogNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_AnalogNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) MouseAnalogueAxes[i] = CONFIG_AnalogNameToNum(temp); Bsprintf(str,"MouseDigitalAxes%ld_0",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle, "Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) MouseDigitalFunctions[i][0] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"MouseDigitalAxes%ld_1",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle, "Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) MouseDigitalFunctions[i][1] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"MouseAnalogScale%ld",i); @@ -502,13 +502,13 @@ void CONFIG_SetupJoystick(void) Bsprintf(str,"JoystickButton%ld",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle,"Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) JoystickFunctions[i][0] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"JoystickButtonClicked%ld",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle,"Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) JoystickFunctions[i][1] = CONFIG_FunctionNameToNum(temp); } @@ -518,19 +518,19 @@ void CONFIG_SetupJoystick(void) Bsprintf(str,"JoystickAnalogAxes%ld",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle, "Controls", str,temp)) - if (CONFIG_AnalogNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_AnalogNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) JoystickAnalogueAxes[i] = CONFIG_AnalogNameToNum(temp); Bsprintf(str,"JoystickDigitalAxes%ld_0",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle, "Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) JoystickDigitalFunctions[i][0] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"JoystickDigitalAxes%ld_1",i); temp[0] = 0; if (!SCRIPT_GetString(scripthandle, "Controls", str,temp)) - if (CONFIG_FunctionNameToNum(temp) != -1 || temp[0] == 0) + if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1)) JoystickDigitalFunctions[i][1] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"JoystickAnalogScale%ld",i); diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index 1a65f92bb..7defac150 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -124,22 +124,22 @@ extern void loadefs(char *fn); extern short furthestangle(short sActor,short angs); extern void execute(const short *sActor,const short *sPlayer,const long *lDist); extern void overwritesprite(long thex,long they,short tilenum,signed char shade,char stat,char dapalnum); -extern int gametext(int x,int y,char *t,char s,short dabits); -extern int gametextpal(int x,int y,char *t,char s,char p); -extern int minitext(int x,int y,char *t,char p,short sb); +extern inline int gametext(int x,int y,char *t,char s,short dabits); +extern inline int gametextpal(int x,int y,char *t,char s,char p); +extern inline int minitext(int x,int y,char *t,char p,short sb); extern void gamenumber(long x,long y,long n,char s); extern void Shutdown(void); extern void getpackets(void); extern void check_fta_sounds(short i); extern inline short inventory(spritetype *s); -extern short badguy(spritetype *s); -extern short badguypic(short pn); +extern int badguy(spritetype *s); +extern inline int badguypic(short pn); extern void myos(long x,long y,short tilenum,signed char shade,char orientation); extern void myospal(long x,long y,short tilenum,signed char shade,char orientation,char p); extern void displayfragbar(void); extern void FTA(short q,struct player_struct *p); extern void gameexit(char *t); -extern short strget(short x,short y,char *t,short dalen,short c); +extern inline int strget(short x,short y,char *t,short dalen,short c); extern void displayrest(long smoothratio); extern void updatesectorz(long x,long y,long z,short *sectnum); extern void drawbackground(void); @@ -196,13 +196,13 @@ extern void movecyclers(void); extern void movedummyplayers(void); // game.c -extern void setstatusbarscale(long sc); +extern inline void setstatusbarscale(long sc); extern void setgamepalette(struct player_struct *player, char *pal, int set); extern void fadepal(int r, int g, int b, int start, int end, int step); -extern int minitextshade(int x,int y,char *t,char s,char p,short sb); -extern int gametext_(int small, int starttile, int x,int y,char *t,char s,char p,short orientation,long x1, long y1, long x2, long y2); +extern inline int minitextshade(int x,int y,char *t,char s,char p,short sb); +extern inline int gametext_(int small, int starttile, int x,int y,char *t,char s,char p,short orientation,long x1, long y1, long x2, long y2); extern void txdigitalnumber(short starttile, long x,long y,long n,char s,char pal,char cs,long x1, long y1, long x2, long y2); extern void myosx(long x,long y,short tilenum,signed char shade,char orientation); extern void myospalx(long x,long y,short tilenum,signed char shade,char orientation,char p); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index d0046c6ed..c746e5855 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -175,7 +175,7 @@ static int getatoken(scriptfile *sf, tokenlist *tl, int ntokens) return T_ERROR; } -void setstatusbarscale(long sc) +inline void setstatusbarscale(long sc) { ud.statusbarscale = min(100,max(10,sc)); vscrn(); @@ -1447,7 +1447,7 @@ inline int checkspriteflagsp(short sPicnum, int iType) return 0; } -short badguypic(short pn) +int badguypic(short pn) { //this case can't be handled by the dynamictostatic system because it adds //stuff to the value from names.h so handling separately @@ -1501,7 +1501,7 @@ short badguypic(short pn) return 0; } -inline short badguy(spritetype *s) +inline int badguy(spritetype *s) { return(badguypic(s->picnum)); } @@ -2070,6 +2070,12 @@ static void coolgaugetext(short snum) u |= 16384; } + if (sbar.last_extra != p->last_extra) + { + sbar.last_extra = p->last_extra; + u |= 1; + } + { long lAmount=GetGameVar("PLR_MORALE",-1, p->i, snum); if (lAmount == -1) @@ -2620,7 +2626,7 @@ void gameexit(char *t) char inputloc = 0; -short strget_(int small,short x,short y,char *t,short dalen,short c) +static int strget_(int small,short x,short y,char *t,short dalen,short c) { short ch; int i; @@ -2692,17 +2698,17 @@ short strget_(int small,short x,short y,char *t,short dalen,short c) return (0); } -inline short strget(short x,short y,char *t,short dalen,short c) +inline int strget(short x,short y,char *t,short dalen,short c) { return(strget_(0,x,y,t,dalen,c)); } -inline short strgetsm(short x,short y,char *t,short dalen,short c) +inline int strgetsm(short x,short y,char *t,short dalen,short c) { return(strget_(1,x,y,t,dalen,c)); } -inline short mpstrget(short x,short y,char *t,short dalen,short c) +inline int mpstrget(short x,short y,char *t,short dalen,short c) { if (xdim >= 640 && ydim >= 480) return(strgetsm(x,y,t,dalen,c)); @@ -7239,14 +7245,11 @@ FOUNDCHEAT: switch (k) { case CHEAT_WEAPONS: + + j = 0; + if (VOLUMEONE) - { j = 6; - } - else - { - j = 0; - } for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++) { @@ -7364,25 +7367,24 @@ FOUNDCHEAT: sprite[ps[myconnectindex].i].pal = ps[myconnectindex].palookup; Bstrcpy(fta_quotes[122],"Scream for me, Long Beach!"); FTA(122,&ps[myconnectindex]); + CheatGetInventory(); + for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS;weapon++) + ps[myconnectindex].gotweapon[weapon] = 1; + + for (weapon = PISTOL_WEAPON; + weapon < (MAX_WEAPONS); + weapon++) + addammo(weapon, &ps[myconnectindex], max_ammo_amount[weapon]); + ps[myconnectindex].got_access = 7; } else { - ud.god = 0; sprite[ps[myconnectindex].i].extra = max_player_health; hittype[ps[myconnectindex].i].extra = -1; ps[myconnectindex].last_extra = max_player_health; FTA(18,&ps[myconnectindex]); } - CheatGetInventory(); - for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS;weapon++) - ps[myconnectindex].gotweapon[weapon] = 1; - - for (weapon = PISTOL_WEAPON; - weapon < (MAX_WEAPONS); - weapon++) - addammo(weapon, &ps[myconnectindex], max_ammo_amount[weapon]); - ps[myconnectindex].got_access = 7; sprite[ps[myconnectindex].i].extra = max_player_health; hittype[ps[myconnectindex].i].extra = 0; ps[myconnectindex].cheat_phase = 0; @@ -7392,14 +7394,11 @@ FOUNDCHEAT: case CHEAT_STUFF: + j = 0; + if (VOLUMEONE) - { j = 6; - } - else - { - j = 0; - } + for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++) ps[myconnectindex].gotweapon[weapon] = 1; @@ -7440,27 +7439,13 @@ FOUNDCHEAT: volnume--; levnume--; - if (VOLUMEONE && volnume > 0) + if ((VOLUMEONE && volnume > 0) || volnume > num_volumes-1 || + levnume >= MAXLEVELS || level_file_names[volnume*MAXLEVELS+levnume] == NULL) { ps[myconnectindex].cheat_phase = 0; KB_FlushKeyBoardQueue(); return; } - else if (volnume > num_volumes-1) - { - ps[myconnectindex].cheat_phase = 0; - KB_FlushKeyBoardQueue(); - return; - } - else - { - if (levnume >= MAXLEVELS || level_file_names[volnume*MAXLEVELS+levnume] == NULL) - { - ps[myconnectindex].cheat_phase = 0; - KB_FlushKeyBoardQueue(); - return; - } - } ud.m_volume_number = ud.volume_number = volnume; ud.m_level_number = ud.level_number = levnume; @@ -7470,7 +7455,6 @@ FOUNDCHEAT: ud.m_volume_number = ud.volume_number = osdcmd_cheatsinfo_stat.volume; ud.m_level_number = ud.level_number = osdcmd_cheatsinfo_stat.level; } - } else { @@ -7598,7 +7582,7 @@ FOUNDCHEAT: case CHEAT_MONSTERS: { - char *s[] = { "ON", "OFF", "ON (BLOCKING)" }; + char *s[] = { "ON", "OFF", "ON" }; actor_tog++; if (actor_tog == 3) actor_tog = 0; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 584168cea..010892268 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2717,7 +2717,8 @@ cheat_for_port_credits: if (validmode[day].bpp == 8) { vidsets[dax++] = 8|((validmode[day].fs&1)<<16); - vidsets[dax++] = 0x20000|8|((validmode[day].fs&1)<<16); +// 8-bit Polymost can diaf +// vidsets[dax++] = 0x20000|8|((validmode[day].fs&1)<<16); } else vidsets[dax++] = 0x20000|validmode[day].bpp|((validmode[day].fs&1)<<16); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 4a18662e8..62ceabd53 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -35,7 +35,14 @@ static int precachecount; static void tloadtile(short tilenume, char type) { - if ((picanm[tilenume]&63) > 0) + if ((picanm[tilenume]&63) < 1) + { + if (!(gotpic[tilenume>>3] & pow2char[tilenume&7])) precachecount++; + gotpic[tilenume>>3] |= pow2char[tilenume&7]; + precachehightile[(unsigned char)type][tilenume>>3] |= pow2char[tilenume&7]; + return; + } + { int i,j; @@ -56,12 +63,6 @@ static void tloadtile(short tilenume, char type) precachehightile[(unsigned char)type][i>>3] |= pow2char[i&7]; } } - else - { - if (!(gotpic[tilenume>>3] & pow2char[tilenume&7])) precachecount++; - gotpic[tilenume>>3] |= pow2char[tilenume&7]; - precachehightile[(unsigned char)type][tilenume>>3] |= pow2char[tilenume&7]; - } } static void cachespritenum(short i) @@ -488,8 +489,7 @@ void vscrn(void) long i, j, ss, x1, x2, y1, y2; if (ud.screen_size < 0) ud.screen_size = 0; - else if (ud.screen_size > 64) ud.screen_size = 64; - + if (ud.screen_size > 64) ud.screen_size = 64; if (ud.screen_size == 0) flushperms(); ss = max(ud.screen_size-8,0); @@ -511,7 +511,8 @@ void vscrn(void) if (j >= 12) y1 += 8; } - if (ud.screen_size >= 8 && !(ud.screen_size == 8 && ud.statusbarmode && bpp > 8)) y2 -= (ss+scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100)); + if (ud.screen_size >= 8 && !(ud.screen_size == 8 && ud.statusbarmode && bpp > 8)) + y2 -= (ss+scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100)); y1 = scale(y1,ydim,200); y2 = scale(y2,ydim,200); @@ -530,8 +531,10 @@ void pickrandomspot(short snum) p = &ps[snum]; + i = snum; if (ud.multimode > 1 && !(gametype_flags[ud.coop] & GAMETYPE_FLAG_FIXEDRESPAWN)) { + i = TRAND%numplayersprites; if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDMSPAWN) { for (j=0;jbobposx = p->oposx = p->posx = po[i].ox; p->bobposy = p->oposy = p->posy = po[i].oy; @@ -1150,17 +1151,18 @@ void newgame(char vn,char ln,char sk) struct player_struct *p = &ps[0]; short i; + handleevents(); + getpackets(); + if (globalskillsound >= 0 && FXDevice >= 0 && SoundToggle) + { while (issoundplaying(-1,globalskillsound)) { handleevents(); getpackets(); } - else - { - handleevents(); - getpackets(); } + globalskillsound = -1; waitforeverybody(); @@ -1204,32 +1206,31 @@ void newgame(char vn,char ln,char sk) p->zoom = 768; p->gm = 0; + //AddLog("Newgame"); + ResetGameVars(); + + InitGameVarPointers(); + + ResetSystemDefaults(); + + if (ud.m_coop != 1) { - //AddLog("Newgame"); - ResetGameVars(); - - InitGameVarPointers(); - - ResetSystemDefaults(); - - if (ud.m_coop != 1) + for (i=0;icurr_weapon = i; - p->gotweapon[i] = 1; - p->ammo_amount[i] = 48; - } - else if (aplWeaponWorksLike[i][0]==KNEE_WEAPON) - p->gotweapon[i] = 1; - else if (aplWeaponWorksLike[i][0]==HANDREMOTE_WEAPON) - p->gotweapon[i] = 1; + p->curr_weapon = i; + p->gotweapon[i] = 1; + p->ammo_amount[i] = 48; } - p->last_weapon = -1; + else if (aplWeaponWorksLike[i][0]==KNEE_WEAPON) + p->gotweapon[i] = 1; + else if (aplWeaponWorksLike[i][0]==HANDREMOTE_WEAPON) + p->gotweapon[i] = 1; } + p->last_weapon = -1; } + display_mirror = 0; if (ud.multimode > 1) @@ -1648,7 +1649,7 @@ int enterlevel(char g) //gameexit(tempbuf); return 1; } - else + { char *p; strcpy(levname, boardfilename);