Removed orderweaponnum()

git-svn-id: https://svn.eduke32.com/eduke32@425 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-12-18 04:16:41 +00:00
parent aeaa03022d
commit b04bfe58fb
2 changed files with 47 additions and 89 deletions

View file

@ -112,7 +112,7 @@ extern void savetemp(char *fn,long daptr,long dasiz);
// extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr); // extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
extern int loadplayer(signed char spot); extern int loadplayer(signed char spot);
extern int saveplayer(signed char spot); extern int saveplayer(signed char spot);
extern int menutext(int x,int y,short s,short p,char *t); extern inline int menutext(int x,int y,short s,short p,char *t);
extern int getfilenames(char *path, char kind[]); extern int getfilenames(char *path, char kind[]);
extern void menus(void); extern void menus(void);
extern void palto(char r,char g,char b,long e); extern void palto(char r,char g,char b,long e);
@ -132,8 +132,8 @@ extern void Shutdown(void);
extern void getpackets(void); extern void getpackets(void);
extern void check_fta_sounds(short i); extern void check_fta_sounds(short i);
extern inline short inventory(spritetype *s); extern inline short inventory(spritetype *s);
extern int badguy(spritetype *s); extern inline int badguy(spritetype *s);
extern inline int badguypic(short pn); extern int badguypic(short pn);
extern void myos(long x,long y,short tilenum,signed char shade,char orientation); 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 myospal(long x,long y,short tilenum,signed char shade,char orientation,char p);
extern void displayfragbar(void); extern void displayfragbar(void);

View file

@ -1508,48 +1508,40 @@ inline int badguy(spritetype *s)
void myos(long x, long y, short tilenum, signed char shade, char orientation) void myos(long x, long y, short tilenum, signed char shade, char orientation)
{ {
char p; int p = sector[ps[screenpeek].cursectnum].floorpal, a = 0;
short a;
if (orientation&4) if (orientation&4)
a = 1024; a = 1024;
else a = 0;
p = sector[ps[screenpeek].cursectnum].floorpal;
rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
} }
void myospal(long x, long y, short tilenum, signed char shade, char orientation, char p) void myospal(long x, long y, short tilenum, signed char shade, char orientation, char p)
{ {
short a; int a = 0;
if (orientation&4) if (orientation&4)
a = 1024; a = 1024;
else a = 0;
rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
} }
void myosx(long x, long y, short tilenum, signed char shade, char orientation) void myosx(long x, long y, short tilenum, signed char shade, char orientation)
{ {
char p; int p = sector[ps[screenpeek].cursectnum].floorpal, a = 0;
short a;
if (orientation&4) if (orientation&4)
a = 1024; a = 1024;
else a = 0;
p = sector[ps[screenpeek].cursectnum].floorpal;
rotatesprite(x<<16,y<<16,32768L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); rotatesprite(x<<16,y<<16,32768L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
} }
void myospalx(long x, long y, short tilenum, signed char shade, char orientation, char p) void myospalx(long x, long y, short tilenum, signed char shade, char orientation, char p)
{ {
short a; int a = 0;
if (orientation&4) if (orientation&4)
a = 1024; a = 1024;
else a = 0;
rotatesprite(x<<16,y<<16,32768L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); rotatesprite(x<<16,y<<16,32768L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
} }
@ -1563,22 +1555,15 @@ static void invennum(long x,long y,char num1,char ha,char sbits)
rotatesprite(sbarx(x-4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x-4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[2]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[2]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
return;
} }
else if (num1 > 9) if (num1 > 9)
{ {
rotatesprite(sbarx(x),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
return;
} }
else rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
}
static void orderweaponnum(short ind,long x,long y,char ha)
{
rotatesprite(sbarx(x-7),sbary(y),sbarsc(65536L),0,THREEBYFIVE+ind+1,ha-10,7,10,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x-3),sbary(y),sbarsc(65536L),0,THREEBYFIVE+10,ha,0,10,0,0,xdim-1,ydim-1);
minitextshade(x+1,y-4,"ORDER",26,6,2+8+16);
} }
static void weaponnum(short ind,long x,long y,long num1, long num2,char ha) static void weaponnum(short ind,long x,long y,long num1, long num2,char ha)
@ -1587,6 +1572,13 @@ static void weaponnum(short ind,long x,long y,long num1, long num2,char ha)
rotatesprite(sbarx(x-7),sbary(y),sbarsc(65536L),0,THREEBYFIVE+ind+1,ha-10,7,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x-7),sbary(y),sbarsc(65536L),0,THREEBYFIVE+ind+1,ha-10,7,10,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x-3),sbary(y),sbarsc(65536L),0,THREEBYFIVE+10,ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x-3),sbary(y),sbarsc(65536L),0,THREEBYFIVE+10,ha,0,10,0,0,xdim-1,ydim-1);
if (VOLUMEONE && (ind > HANDBOMB_WEAPON || ind < 0))
{
minitextshade(x+1,y-4,"ORDER",20,11,2+8+16);
return;
}
rotatesprite(sbarx(x+9),sbary(y),sbarsc(65536L),0,THREEBYFIVE+11,ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+9),sbary(y),sbarsc(65536L),0,THREEBYFIVE+11,ha,0,10,0,0,xdim-1,ydim-1);
if (num1 > 99) num1 = 99; if (num1 > 99) num1 = 99;
@ -1605,8 +1597,9 @@ static void weaponnum(short ind,long x,long y,long num1, long num2,char ha)
{ {
rotatesprite(sbarx(x+13),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+13),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+17),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+17),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,10,0,0,xdim-1,ydim-1);
return;
} }
else rotatesprite(sbarx(x+13),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+13),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1);
} }
static void weaponnum999(char ind,long x,long y,long num1, long num2,char ha) static void weaponnum999(char ind,long x,long y,long num1, long num2,char ha)
@ -1642,15 +1635,14 @@ static void weaponnum999(char ind,long x,long y,long num1, long num2,char ha)
{ {
rotatesprite(sbarx(x+17),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+17),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1);
rotatesprite(sbarx(x+21),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+21),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,10,0,0,xdim-1,ydim-1);
return;
} }
else rotatesprite(sbarx(x+25),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+25),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,10,0,0,xdim-1,ydim-1);
} }
static void weapon_amounts(struct player_struct *p,long x,long y,long u) static void weapon_amounts(struct player_struct *p,long x,long y,long u)
{ {
int cw; int cw = p->curr_weapon;
cw = p->curr_weapon;
if (u&4) if (u&4)
{ {
@ -1695,78 +1687,44 @@ static void weapon_amounts(struct player_struct *p,long x,long y,long u)
{ {
if (u != -1) patchstatusbar(127,190,127+29,190+6); //original code: (135,190,135+8,190+6); if (u != -1) patchstatusbar(127,190,127+29,190+6); //original code: (135,190,135+8,190+6);
if (VOLUMEONE) if (p->subweapon&(1<<GROW_WEAPON))
{ weaponnum(SHRINKER_WEAPON,x+39,y+12,
orderweaponnum(SHRINKER_WEAPON,x+39,y+12, p->ammo_amount[GROW_WEAPON],max_ammo_amount[GROW_WEAPON],
(!p->gotweapon[SHRINKER_WEAPON]*9)+12-18* (!p->gotweapon[GROW_WEAPON]*9)+12-18*
(cw == SHRINKER_WEAPON)); (cw == GROW_WEAPON));
}
else else
{ weaponnum(SHRINKER_WEAPON,x+39,y+12,
if (p->subweapon&(1<<GROW_WEAPON)) p->ammo_amount[SHRINKER_WEAPON],max_ammo_amount[SHRINKER_WEAPON],
weaponnum(SHRINKER_WEAPON,x+39,y+12, (!p->gotweapon[SHRINKER_WEAPON]*9)+12-18*
p->ammo_amount[GROW_WEAPON],max_ammo_amount[GROW_WEAPON], (cw == SHRINKER_WEAPON));
(!p->gotweapon[GROW_WEAPON]*9)+12-18*
(cw == GROW_WEAPON));
else
weaponnum(SHRINKER_WEAPON,x+39,y+12,
p->ammo_amount[SHRINKER_WEAPON],max_ammo_amount[SHRINKER_WEAPON],
(!p->gotweapon[SHRINKER_WEAPON]*9)+12-18*
(cw == SHRINKER_WEAPON));
}
} }
if (u&256) if (u&256)
{ {
if (u != -1) patchstatusbar(158,178,162+29,178+6); //original code: (166,178,166+8,178+6); if (u != -1) patchstatusbar(158,178,162+29,178+6); //original code: (166,178,166+8,178+6);
if (VOLUMEONE) weaponnum(DEVISTATOR_WEAPON,x+70,y,
{ p->ammo_amount[DEVISTATOR_WEAPON],max_ammo_amount[DEVISTATOR_WEAPON],
orderweaponnum(DEVISTATOR_WEAPON,x+70,y, (!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18*
(!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18* (cw == DEVISTATOR_WEAPON));
(cw == DEVISTATOR_WEAPON));
}
else
{
weaponnum(DEVISTATOR_WEAPON,x+70,y,
p->ammo_amount[DEVISTATOR_WEAPON],max_ammo_amount[DEVISTATOR_WEAPON],
(!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18*
(cw == DEVISTATOR_WEAPON));
}
} }
if (u&512) if (u&512)
{ {
if (u != -1) patchstatusbar(158,184,162+29,184+6); //original code: (166,184,166+8,184+6); if (u != -1) patchstatusbar(158,184,162+29,184+6); //original code: (166,184,166+8,184+6);
if (VOLUMEONE)
{ weaponnum(TRIPBOMB_WEAPON,x+70,y+6,
orderweaponnum(TRIPBOMB_WEAPON,x+70,y+6, p->ammo_amount[TRIPBOMB_WEAPON],max_ammo_amount[TRIPBOMB_WEAPON],
(!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18* (!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18*
(cw == TRIPBOMB_WEAPON)); (cw == TRIPBOMB_WEAPON));
}
else
{
weaponnum(TRIPBOMB_WEAPON,x+70,y+6,
p->ammo_amount[TRIPBOMB_WEAPON],max_ammo_amount[TRIPBOMB_WEAPON],
(!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18*
(cw == TRIPBOMB_WEAPON));
}
} }
if (u&65536L) if (u&65536L)
{ {
if (u != -1) patchstatusbar(158,190,162+29,190+6); //original code: (166,190,166+8,190+6); if (u != -1) patchstatusbar(158,190,162+29,190+6); //original code: (166,190,166+8,190+6);
if (VOLUMEONE)
{ weaponnum(-1,x+70,y+12,
orderweaponnum(-1,x+70,y+12, p->ammo_amount[FREEZE_WEAPON],max_ammo_amount[FREEZE_WEAPON],
(!p->gotweapon[FREEZE_WEAPON]*9)+12-18* (!p->gotweapon[FREEZE_WEAPON]*9)+12-18*
(cw == FREEZE_WEAPON)); (cw == FREEZE_WEAPON));
}
else
{
weaponnum(-1,x+70,y+12,
p->ammo_amount[FREEZE_WEAPON],max_ammo_amount[FREEZE_WEAPON],
(!p->gotweapon[FREEZE_WEAPON]*9)+12-18*
(cw == FREEZE_WEAPON));
}
} }
} }