Fake multi-mode: better -q* messages, make surplus APLAYER sprites invisible.

Also, change type of g_numPlayerSprites (global and mapstate) from inconsistent
uint8_t/char to int8_t.

git-svn-id: https://svn.eduke32.com/eduke32@2897 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-16 21:48:13 +00:00
parent 2913ee5211
commit c6f30669b1
7 changed files with 31 additions and 19 deletions

View file

@ -8883,11 +8883,22 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
}
else
{
ud.multimode = Batoi(c)%17;
initprintf("Fake multiplayer mode: %d players.\n", ud.multimode);
int32_t numpl = Batoi(c);
g_fakeMultiMode = 1;
if (numpl < 2 || numpl > MAXPLAYERS)
{
initprintf("Fake multiplayer mode: expected 2-%d players, falling back to 1.\n",
MAXPLAYERS);
}
else
{
ud.multimode = numpl;
initprintf("Fake multiplayer mode: %d players.\n", ud.multimode);
g_fakeMultiMode = 1;
}
}
ud.m_coop = ud.coop = 0;
ud.m_marker = ud.marker = 1;
ud.m_respawn_monsters = ud.respawn_monsters = 1;

View file

@ -81,7 +81,8 @@ char g_numVolumes = 3;
int32_t g_timerTicsPerSecond=TICRATE;
char g_numPlayerSprites,g_loadFromGroupOnly=0,g_earthquakeTime;
int8_t g_numPlayerSprites;
char g_loadFromGroupOnly=0, g_earthquakeTime;
int32_t playerswhenstarted;

View file

@ -56,7 +56,7 @@ G_EXTERN char SkillNames[MAXSKILLS][33];
G_EXTERN char g_RTSPlaying;
G_EXTERN int32_t g_musicIndex;
G_EXTERN char g_numGametypes;
G_EXTERN char g_numPlayerSprites,g_loadFromGroupOnly;
G_EXTERN char g_loadFromGroupOnly;
G_EXTERN char g_numVolumes;
G_EXTERN char g_numSkills;
G_EXTERN char myjumpingtoggle,myonground,myhardlanding,myreturntocenter;

View file

@ -112,7 +112,7 @@ typedef struct {
int16_t prevspritestat[MAXSPRITES];
uint8_t g_earthquakeTime;
uint8_t g_numPlayerSprites;
int8_t g_numPlayerSprites;
uint8_t scriptptrs[MAXSPRITES];
netactor_t actor[MAXSPRITES];

View file

@ -227,7 +227,7 @@ typedef struct {
} playerdata_t;
#pragma pack(pop)
extern char g_numPlayerSprites;
extern int8_t g_numPlayerSprites;
extern int32_t fricxv,fricyv;
extern intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in clip

View file

@ -1567,9 +1567,8 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
static void resetpspritevars(char g)
{
int16_t i, j, nexti; //circ;
// int32_t firstx,firsty;
spritetype *s;
int16_t i, j; //circ;
uint8_t aimmode[MAXPLAYERS],autoaim[MAXPLAYERS],weaponswitch[MAXPLAYERS];
DukeStatus_t tsbar[MAXPLAYERS];
@ -1628,17 +1627,17 @@ static void resetpspritevars(char g)
i = headspritestat[STAT_PLAYER];
while (i >= 0)
{
nexti = nextspritestat[i];
s = &sprite[i];
const int32_t nexti = nextspritestat[i];
spritetype *const s = &sprite[i];
if (g_numPlayerSprites == MAXPLAYERS)
G_GameExit("\nToo many player sprites (max 16.)");
g_playerSpawnPoints[(uint8_t)g_numPlayerSprites].ox = s->x;
g_playerSpawnPoints[(uint8_t)g_numPlayerSprites].oy = s->y;
g_playerSpawnPoints[(uint8_t)g_numPlayerSprites].oz = s->z;
g_playerSpawnPoints[(uint8_t)g_numPlayerSprites].oa = s->ang;
g_playerSpawnPoints[(uint8_t)g_numPlayerSprites].os = s->sectnum;
g_playerSpawnPoints[g_numPlayerSprites].ox = s->x;
g_playerSpawnPoints[g_numPlayerSprites].oy = s->y;
g_playerSpawnPoints[g_numPlayerSprites].oz = s->z;
g_playerSpawnPoints[g_numPlayerSprites].oa = s->ang;
g_playerSpawnPoints[g_numPlayerSprites].os = s->sectnum;
g_numPlayerSprites++;
@ -1651,7 +1650,7 @@ static void resetpspritevars(char g)
if (!g_fakeMultiMode)
s->cstat = j < numplayers ? 1+256 : 32768;
else
s->cstat = 1+256;
s->cstat = j < ud.multimode ? 1+256 : 32768;
s->xoffset = 0;
s->clipdist = 64;
@ -1716,6 +1715,7 @@ static void resetpspritevars(char g)
j++;
}
else A_DeleteSprite(i);
i = nexti;
}
}

View file

@ -66,7 +66,7 @@ typedef struct {
int16_t pskyoff[MAXPSKYTILES], pskybits;
uint8_t g_earthquakeTime;
uint8_t g_numPlayerSprites;
int8_t g_numPlayerSprites;
uint8_t show2dsector[(MAXSECTORS+7)>>3];