git-svn-id: https://svn.eduke32.com/eduke32@1171 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-12-01 10:44:18 +00:00
parent f062dafaed
commit 1aed7f53f8
13 changed files with 130 additions and 116 deletions

View file

@ -1925,7 +1925,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
free(picfil); picfil = 0;
if (glinfo.texcompr && glusetexcompr && !(hicr->flags & 1))
intexfmt = (hasalpha == 255) ? GL_COMPRESSED_RGB_ARB : GL_COMPRESSED_RGBA_ARB;
intexfmt = (hasalpha == 255) ? GL_COMPRESSED_RGBA_S3TC_DXT3_EXT : GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
else if (hasalpha == 255) intexfmt = GL_RGB;
if ((doalloc&3)==1) bglGenTextures(1,(GLuint*)&pth->glpic); //# of textures (make OpenGL allocate structure)

View file

@ -923,7 +923,9 @@ int setvideomode(int x, int y, int c, int fs)
{
int regrab = 0;
static int warnonce = 0;
#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3)
static int ovsync = 1;
#endif
if ((fs == fullscreen) && (x == xres) && (y == yres) && (c == bpp) &&
!videomodereset)
@ -1759,7 +1761,7 @@ inline void idle(void)
usleep(1);
}
#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3)
#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2
static int buildkeytranslationtable(void)
{
memset(keytranslation,0,sizeof(keytranslation));

View file

@ -196,7 +196,7 @@ void P_AddWeapon(DukePlayer_t *p,int weapon)
}
}
void P_SelectNextInventoryItem(DukePlayer_t *p)
void P_SelectNextInvItem(DukePlayer_t *p)
{
if (p->firstaid_amount > 0)
p->inven_icon = 1;

View file

@ -7421,6 +7421,7 @@ static void G_CheckCommandLine(int argc, const char **argv)
{
#if defined(POLYMOST) && defined(USE_OPENGL)
extern char TEXCACHEFILE[BMAX_PATH];
Bsprintf(tempbuf,"%s/%s",argv[i+1],TEXCACHEFILE);
Bstrcpy(TEXCACHEFILE,tempbuf);
#endif

View file

@ -426,67 +426,67 @@ extern int fricxv,fricyv;
// of this struct into the same order so we can just memcpy it and get rid of the
// mywhatever type globals
typedef struct {
int zoom, exitx, exity;
int posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
int bobposx, bobposy, oposx, oposy, oposz, pyoff, opyoff;
int posxv, posyv, poszv, last_pissed_time, truefz, truecz;
int player_par, visibility;
int bobcounter, weapon_sway;
int pals_time, randomflamex, crack_time;
unsigned int interface_toggle_flag;
int max_secret_rooms, secret_rooms, max_actors_killed, actors_killed;
int runspeed, movement_lock, team;
int max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS];
int scream_voice;
int loogiex[64], loogiey[64], numloogs, loogcnt;
char *palette;
short sbs, sound_pitch;
short ang, oang, angvel, cursectnum, look_ang, last_extra, subweapon;
short ammo_amount[MAX_WEAPONS], wackedbyactor, frag, fraggedself;
short curr_weapon, last_weapon, tipincs, horizoff, wantweaponfire;
short holoduke_amount, newowner, hurt_delay, hbomb_hold_delay;
short jumping_counter, airleft, knee_incs, access_incs;
short fta, ftq, access_wallnum, access_spritenum;
short kickback_pic, got_access, weapon_ang, firstaid_amount;
short somethingonplayer, on_crane, i, one_parallax_sectnum;
short over_shoulder_on, random_club_frame, fist_incs;
short one_eighty_count, cheat_phase;
short dummyplayersprite, extra_extra8, quick_kick, last_quick_kick;
short heat_amount, actorsqu, timebeforeexit, customexitsound;
short weaprecs[16], weapreccnt;
short orotscrnang, rotscrnang, dead_flag, show_empty_weapon; // JBF 20031220: added orotscrnang
short scuba_amount, jetpack_amount, steroids_amount, shield_amount;
short holoduke_on, pycount, weapon_pos, frag_ps;
short transporter_hold, last_full_weapon, footprintshade, boot_amount;
char aim_mode, auto_aim, weaponswitch;
char gm, on_warping_sector, footprintcount;
char hbomb_on, jumping_toggle, rapid_fire_hold, on_ground;
char inven_icon, buttonpalette;
char jetpack_on, spritebridge, lastrandomspot;
char scuba_on, footprintpal, heat_on;
char holster_weapon, falling_counter;
char gotweapon[MAX_WEAPONS], refresh_inventory;
char toggle_key_flag, knuckle_incs; // , select_dir;
char walking_snd_toggle, palookup, hard_landing;
char /*fire_flag, */pals[3];
char return_to_center, reloading, name[32];
typedef struct {
int zoom, exitx, exity;
int posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
int bobposx, bobposy, oposx, oposy, oposz, pyoff, opyoff;
int posxv, posyv, poszv, last_pissed_time, truefz, truecz;
int player_par, visibility;
int bobcounter, weapon_sway;
int pals_time, randomflamex, crack_time;
unsigned int interface_toggle_flag;
int max_secret_rooms, secret_rooms, max_actors_killed, actors_killed;
int runspeed, movement_lock, team;
int max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS];
int scream_voice;
int loogiex[64], loogiey[64], numloogs, loogcnt;
char *palette;
short sbs, sound_pitch;
short ang, oang, angvel, cursectnum, look_ang, last_extra, subweapon;
short ammo_amount[MAX_WEAPONS], wackedbyactor, frag, fraggedself;
short curr_weapon, last_weapon, tipincs, horizoff, wantweaponfire;
short holoduke_amount, newowner, hurt_delay, hbomb_hold_delay;
short jumping_counter, airleft, knee_incs, access_incs;
short fta, ftq, access_wallnum, access_spritenum;
short kickback_pic, got_access, weapon_ang, firstaid_amount;
short somethingonplayer, on_crane, i, one_parallax_sectnum;
short over_shoulder_on, random_club_frame, fist_incs;
short one_eighty_count, cheat_phase;
short dummyplayersprite, extra_extra8, quick_kick, last_quick_kick;
short heat_amount, actorsqu, timebeforeexit, customexitsound;
short weaprecs[16], weapreccnt;
short orotscrnang, rotscrnang, dead_flag, show_empty_weapon; // JBF 20031220: added orotscrnang
short scuba_amount, jetpack_amount, steroids_amount, shield_amount;
short holoduke_on, pycount, weapon_pos, frag_ps;
short transporter_hold, last_full_weapon, footprintshade, boot_amount;
char aim_mode, auto_aim, weaponswitch;
char gm, on_warping_sector, footprintcount;
char hbomb_on, jumping_toggle, rapid_fire_hold, on_ground;
char inven_icon, buttonpalette;
char jetpack_on, spritebridge, lastrandomspot;
char scuba_on, footprintpal, heat_on;
char holster_weapon, falling_counter;
char gotweapon[MAX_WEAPONS], refresh_inventory;
char toggle_key_flag, knuckle_incs; // , select_dir;
char walking_snd_toggle, palookup, hard_landing;
char /*fire_flag, */pals[3];
char return_to_center, reloading, name[32];
} DukePlayer_t;
extern char tempbuf[2048], packbuf[576], menutextbuf[128];

View file

@ -168,7 +168,7 @@ extern inline int G_CheckForSpaceFloor(int sectnum);
extern void P_AddAmmo(int weapon,DukePlayer_t *p,int amount);
extern void P_AddWeaponNoSwitch(DukePlayer_t *p,int weapon);
extern void P_AddWeapon(DukePlayer_t *p,int weapon);
extern void P_SelectNextInventoryItem(DukePlayer_t *p);
extern void P_SelectNextInvItem(DukePlayer_t *p);
extern void P_CheckWeapon(DukePlayer_t *p);
extern void A_RadiusDamage(int i,int r,int hp1,int hp2,int hp3,int hp4);
extern int A_MoveSprite(int spritenum,int xchange,int ychange,int zchange,unsigned int cliptype);

View file

@ -1065,9 +1065,9 @@ void getpackets(void)
vote_map = packbuf[3];
Bsprintf(tempbuf,"%s^00 HAS CALLED A VOTE TO CHANGE MAP TO %s (E%dL%d)",
g_player[(unsigned char)packbuf[1]].user_name,
MapInfo[(unsigned char)(packbuf[2]*MAXLEVELS + packbuf[3])].name,
packbuf[2]+1,packbuf[3]+1);
g_player[(unsigned char)packbuf[1]].user_name,
MapInfo[(unsigned char)(packbuf[2]*MAXLEVELS + packbuf[3])].name,
packbuf[2]+1,packbuf[3]+1);
G_AddUserQuote(tempbuf);
Bsprintf(tempbuf,"PRESS F1 TO ACCEPT, F2 TO DECLINE");
@ -1581,6 +1581,7 @@ void G_DrawTilePalSmall(int x, int y, int tilenum, int shade, int orientation, i
#define POLYMOSTTRANS (1)
#define POLYMOSTTRANS2 (1|32)
// draws inventory numbers in the HUD for both the full and mini status bars
static void G_DrawInvNum(int x,int y,char num1,char ha,char sbits)
{
char dabuf[80] = {0};
@ -1591,7 +1592,7 @@ static void G_DrawInvNum(int x,int y,char num1,char ha,char sbits)
Bsprintf(dabuf,"%d",num1);
if (num1 > 99)
{
if (shd && getrendermode() >= 3 && althud_shadows)
if (shd && ud.screen_size == 4 && getrendermode() >= 3 && althud_shadows)
{
rotatesprite(sbarx(x-4+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,4,POLYMOSTTRANS|sbits,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,4,POLYMOSTTRANS|sbits,0,0,xdim-1,ydim-1);
@ -1604,7 +1605,7 @@ static void G_DrawInvNum(int x,int y,char num1,char ha,char sbits)
}
if (num1 > 9)
{
if (shd && getrendermode() >= 3 && althud_shadows)
if (shd && ud.screen_size == 4 && getrendermode() >= 3 && althud_shadows)
{
rotatesprite(sbarx(x+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,4,POLYMOSTTRANS|sbits,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+4+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,4,POLYMOSTTRANS|sbits,0,0,xdim-1,ydim-1);
@ -12215,7 +12216,7 @@ static void Net_DoPrediction(void)
if (myz < (fz-(i<<8)) && (G_CheckForSpaceFloor(psect)|G_CheckForSpaceCeiling(psect)) == 0) //falling
{
if (!TEST_SYNC_KEY(sb_snum, SK_JUMP) && !TEST_SYNC_KEY(sb_snum, SK_CROUCH) &&
myonground && (sector[psect].floorstat&2) && myz >= (fz-(i<<8)-(16<<8)))
myonground && (sector[psect].floorstat&2) && myz >= (fz-(i<<8)-(16<<8)))
myz = fz-(i<<8);
else
{

View file

@ -47,6 +47,7 @@ static int C_IncreaseScriptSize(int size);
int g_numQuoteRedefinitions = 0;
// pointers to weapon gamevar data
intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in magazine
intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
intptr_t *aplWeaponFireDelay[MAX_WEAPONS]; // delay to fire

View file

@ -94,7 +94,7 @@ void X_OnEvent(int iEventID, int iActor, int iPlayer, int lDist)
g_killitFlag = 0;
while (1) if (X_DoExecute()) break;
while (!X_DoExecute());
if (g_killitFlag == 1)
{
@ -171,6 +171,9 @@ static char A_Dodge(spritetype *s)
int mxvect = sintable[(s->ang+512)&2047];
int myvect = sintable[s->ang&2047];
if (A_CheckEnemySprite(s) && s->extra <= 0) // hack
return 0;
for (i=headspritestat[STAT_PROJECTILE];i>=0;i=nextspritestat[i]) //weapons list
{
if (OW == i || SECT != s->sectnum)
@ -374,6 +377,9 @@ static void X_AlterAng(int a)
g_sp->xvel += (*moveptr-g_sp->xvel)/5;
if (g_sp->zvel < 648) g_sp->zvel += ((*(moveptr+1)<<4)-g_sp->zvel)/5;
if (A_CheckEnemySprite(g_sp) && g_sp->extra <= 0) // hack
return;
if (a&seekplayer)
{
int aang = g_sp->ang, angdif, goalang;
@ -440,6 +446,17 @@ static void X_Move(void)
g_t[0]++;
if (g_t[1] == 0 || a == 0 || (A_CheckEnemySprite(g_sp) && g_sp->extra <= 0))
{
if ((A_CheckEnemySprite(g_sp) && g_sp->extra <= 0) || (ActorExtra[g_i].bposx != g_sp->x) || (ActorExtra[g_i].bposy != g_sp->y))
{
ActorExtra[g_i].bposx = g_sp->x;
ActorExtra[g_i].bposy = g_sp->y;
setsprite(g_i,g_sp->x,g_sp->y,g_sp->z);
}
return;
}
if (a&face_player)
{
if (g_player[g_p].ps->newowner >= 0)
@ -483,17 +500,6 @@ static void X_Move(void)
g_sp->ang += angdif;
}
if (g_t[1] == 0 || a == 0)
{
if ((A_CheckEnemySprite(g_sp) && g_sp->extra <= 0) || (ActorExtra[g_i].bposx != g_sp->x) || (ActorExtra[g_i].bposy != g_sp->y))
{
ActorExtra[g_i].bposx = g_sp->x;
ActorExtra[g_i].bposy = g_sp->y;
setsprite(g_i,g_sp->x,g_sp->y,g_sp->z);
}
return;
}
moveptr = (intptr_t *)g_t[1];
if (a&geth) g_sp->xvel += (*moveptr-g_sp->xvel)>>1;
@ -836,6 +842,8 @@ static int X_DoExecute(void)
if (g_t[5]) g_t[1] = *(((intptr_t *)g_t[5])+1); // move
g_sp->hitag = *(((intptr_t *)g_t[5])+2); // move flags
g_t[0] = g_t[2] = g_t[3] = 0; // count, actioncount... g_t[3] = ???
if (A_CheckEnemySprite(g_sp) && g_sp->extra <= 0) // hack
break;
if (g_sp->hitag&random_angle)
g_sp->ang = krand()&2047;
break;
@ -1096,8 +1104,8 @@ static int X_DoExecute(void)
// fix for flying/jumping monsters getting stuck in water
if (g_sp->statnum != MAXSTATUS && actorscrptr[g_sp->picnum] &&
(g_sp->hitag & jumptoplayer ||
(moveptr >= g_scriptPtr && moveptr <= (g_scriptPtr+g_scriptSize) && *(moveptr+1)))
)
(moveptr >= g_scriptPtr && moveptr <= (g_scriptPtr+g_scriptSize) && *(moveptr+1)))
)
{
// OSD_Printf("%d\n",*(moveptr+1));
break;
@ -1287,14 +1295,14 @@ static int X_DoExecute(void)
intptr_t *tempscrptr=insptr+2;
insptr = (intptr_t *) *(insptr+1);
while (1) if (X_DoExecute()) break;
while (!X_DoExecute());
insptr = tempscrptr;
}
break;
case CON_LEFTBRACE:
insptr++;
while (1) if (X_DoExecute()) break;
while (!X_DoExecute());
break;
case CON_MOVE:
@ -1302,6 +1310,8 @@ static int X_DoExecute(void)
g_t[0]=0;
g_t[1] = *insptr++;
g_sp->hitag = *insptr++;
if (A_CheckEnemySprite(g_sp) && g_sp->extra <= 0) // hack
break;
if (g_sp->hitag&random_angle)
g_sp->ang = krand()&2047;
break;
@ -1770,11 +1780,7 @@ static int X_DoExecute(void)
insptr=(intptr_t*)(lpCases[lCheckCase*2+1] + &script[0]);
//Bsprintf(g_szBuf,"insptr=%d. ", (int)insptr);
//AddLog(g_szBuf);
while (1)
{
if (X_DoExecute())
break;
}
while (!X_DoExecute());
//AddLog("Done Executing Case");
bMatched=1;
}
@ -1787,7 +1793,7 @@ static int X_DoExecute(void)
{
//AddLog("No Matching Case: Using Default");
insptr=(intptr_t*)(*lpDefault + &script[0]);
while (1) if (X_DoExecute()) break;
while (!X_DoExecute());
}
else
{
@ -3480,7 +3486,7 @@ static int X_DoExecute(void)
if (tw == CON_CHECKAVAILWEAPON)
P_CheckWeapon(g_player[j].ps);
else P_SelectNextInventoryItem(g_player[j].ps);
else P_SelectNextInvItem(g_player[j].ps);
break;
@ -4207,7 +4213,7 @@ void A_LoadActor(int iActor)
return;
}
while (1) if (X_DoExecute()) break;
while (!X_DoExecute());
if (g_killitFlag == 1)
deletesprite(g_i);
@ -4255,7 +4261,7 @@ void A_Execute(int iActor,int iPlayer,int lDist)
g_t[3] = 0;
}
while (1) if (X_DoExecute()) break;
while (!X_DoExecute());
if (g_killitFlag == 1)
{

View file

@ -157,7 +157,7 @@ char szPlayerName[32];
int g_damageCameras,g_freezerSelfDamage=0,g_tripbombLaserMode=0;
int g_networkBroadcastMode = 255, g_movesPerPacket = 1,g_gameQuit = 0,everyothertime;
int g_numFreezeBounces=3,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius,
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
STATUSBARTYPE sbar;
int mymaxlag, otherminlag, bufferjitter = 1;

View file

@ -427,7 +427,7 @@ int A_Shoot(int i,int atwith)
A_AddToDeleteQueue(k);
*/
if (!SpriteFlags[ProjectileData[atwith].decal] & SPRITE_DECAL)
if (!(SpriteFlags[ProjectileData[atwith].decal] & SPRITE_DECAL))
SpriteFlags[ProjectileData[atwith].decal] |= SPRITE_DECAL;
k = A_Spawn(i,ProjectileData[atwith].decal);
@ -3137,7 +3137,7 @@ static int P_DoCounters(DukePlayer_t *p)
{
p->steroids_amount--;
if (p->steroids_amount == 0)
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
if (!(p->steroids_amount&7))
if (snum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND))
A_PlaySound(DUKE_HARTBEAT,p->i);
@ -3149,7 +3149,7 @@ static int P_DoCounters(DukePlayer_t *p)
if (p->heat_amount == 0)
{
p->heat_on = 0;
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
A_PlaySound(NITEVISION_ONOFF,p->i);
P_UpdateScreenPal(p);
}
@ -3162,7 +3162,7 @@ static int P_DoCounters(DukePlayer_t *p)
{
A_PlaySound(TELEPORTER,p->i);
p->holoduke_on = -1;
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
}
}
@ -3172,7 +3172,7 @@ static int P_DoCounters(DukePlayer_t *p)
if (p->jetpack_amount <= 0)
{
p->jetpack_on = 0;
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
A_PlaySound(DUKE_JETPACK_OFF,p->i);
A_StopSound(DUKE_JETPACK_IDLE,p->i);
A_StopSound(DUKE_JETPACK_ON,p->i);
@ -3264,7 +3264,7 @@ static int P_DoCounters(DukePlayer_t *p)
if (p->scuba_amount == 0)
{
p->scuba_on = 0;
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
}
}
@ -4274,7 +4274,7 @@ void P_ProcessInput(int snum)
p->boot_amount--;
p->inven_icon = 7;
if (p->boot_amount <= 0)
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
}
else
{
@ -4355,7 +4355,7 @@ void P_ProcessInput(int snum)
P_DoQuote(75,p);
p->boot_amount -= 2;
if (p->boot_amount <= 0)
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
}
}
@ -4747,7 +4747,7 @@ SHOOTINCODE:
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_GLOWS)
p->random_club_frame += 64; // Glowing
// this is for WEAPON_FIREEVERYOTHER
// this is a hack for WEAPON_FIREEVERYOTHER
if (ActorExtra[p->i].temp_data[7])
{
ActorExtra[p->i].temp_data[7]--;

View file

@ -2437,13 +2437,16 @@ void A_DamageObject(int i,int sn)
if (PN != TANK && PN != BOSS1 && PN != BOSS4 && PN != BOSS2 && PN != BOSS3 && PN != RECON && PN != ROTATEGUN)
{
if ((sprite[i].cstat&48) == 0)
SA = (sprite[sn].ang+1024)&2047;
sprite[i].xvel = -(sprite[sn].extra<<2);
j = SECT;
pushmove(&SX,&SY,&SZ,&j,128L,(4L<<8),(4L<<8),CLIPMASK0);
if (j != SECT && j >= 0 && j < MAXSECTORS)
changespritesect(i,j);
if (sprite[i].extra > 0)
{
if ((sprite[i].cstat&48) == 0)
SA = (sprite[sn].ang+1024)&2047;
sprite[i].xvel = -(sprite[sn].extra<<2);
j = SECT;
pushmove(&SX,&SY,&SZ,&j,128L,(4L<<8),(4L<<8),CLIPMASK0);
if (j != SECT && j >= 0 && j < MAXSECTORS)
changespritesect(i,j);
}
}
if (sprite[i].statnum == 2)
@ -3129,7 +3132,7 @@ CHECKINV1:
{
sprite[p->i].extra += p->firstaid_amount;
p->firstaid_amount = 0;
P_SelectNextInventoryItem(p);
P_SelectNextInvItem(p);
}
A_PlaySound(DUKE_USEMEDKIT,p->i);
}

View file

@ -140,14 +140,14 @@ int G_GetVersionFromWebsite(char *buffer)
initprintf("Connecting to http://%s\n",host);
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
{
// initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno);
// initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno);
return(0);
}
bytes_sent = send(mysock, req, strlen(req), 0);
if (bytes_sent == SOCKET_ERROR)
{
// initprintf("update: send() error in G_GetVersionFromWebsite() (%d)\n",errno);
// initprintf("update: send() error in G_GetVersionFromWebsite() (%d)\n",errno);
return(0);
}