summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Haley2010-09-02 04:49:09 +0000
committerJames Haley2010-09-02 04:49:09 +0000
commit34aa87405686a3ef556ba0be677bd359e2151477 (patch)
tree0844d04f75316893c45457d5d7e747da4c422174 /src
parent1adc64d1acdab31b610a2482abb983697b20f54e (diff)
downloadchocolate-doom-34aa87405686a3ef556ba0be677bd359e2151477.tar.gz
chocolate-doom-34aa87405686a3ef556ba0be677bd359e2151477.tar.bz2
chocolate-doom-34aa87405686a3ef556ba0be677bd359e2151477.zip
Tweaks to Kaiser's PIT_CheckThing work: moved up thing == tmthing check,
verified clipping and missile stuff, added MF_SPECTRAL check for missiles, and changed missile damage formula to match binary. Major status bar work: STlib rewritten, health and ammo widgets appear on bar. Most DOOM cruft removed. Subversion-branch: /branches/strife-branch Subversion-revision: 1998
Diffstat (limited to 'src')
-rw-r--r--src/strife/p_map.c134
-rw-r--r--src/strife/st_lib.c101
-rw-r--r--src/strife/st_lib.h46
-rw-r--r--src/strife/st_stuff.c466
4 files changed, 290 insertions, 457 deletions
diff --git a/src/strife/p_map.c b/src/strife/p_map.c
index ebc6d78e..cd289c88 100644
--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -293,25 +293,25 @@ boolean PIT_CheckLine (line_t* ld)
//
boolean PIT_CheckThing (mobj_t* thing)
{
- fixed_t blockdist;
- boolean solid;
- int damage;
-
+ fixed_t blockdist;
+ boolean solid;
+ int damage;
+
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_SHOOTABLE) ))
- return true;
-
+ return true;
+
+ // don't clip against self
+ if (thing == tmthing)
+ return true;
+
blockdist = thing->radius + tmthing->radius;
if ( abs(thing->x - tmx) >= blockdist
- || abs(thing->y - tmy) >= blockdist )
+ || abs(thing->y - tmy) >= blockdist )
{
- // didn't hit it
- return true;
+ // didn't hit it
+ return true;
}
-
- // don't clip against self
- if (thing == tmthing)
- return true;
// villsa [STRIFE] see if it went over / under
if(thing->height + thing->z < tmthing->z)
@@ -320,83 +320,81 @@ boolean PIT_CheckThing (mobj_t* thing)
// villsa [STRIFE] see if it went over / under
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
-
+
// villsa [STRIFE] unused
// check for skulls slamming into things
/*if (tmthing->flags & MF_SKULLFLY)
{
- damage = ((P_Random()%8)+1)*tmthing->info->damage;
-
- P_DamageMobj (thing, tmthing, tmthing, damage);
-
- tmthing->flags &= ~MF_SKULLFLY;
- tmthing->momx = tmthing->momy = tmthing->momz = 0;
-
- P_SetMobjState (tmthing, tmthing->info->spawnstate);
-
- return false; // stop moving
+ damage = ((P_Random()%8)+1)*tmthing->info->damage;
+
+ P_DamageMobj (thing, tmthing, tmthing, damage);
+
+ tmthing->flags &= ~MF_SKULLFLY;
+ tmthing->momx = tmthing->momy = tmthing->momz = 0;
+
+ P_SetMobjState (tmthing, tmthing->info->spawnstate);
+
+ return false; // stop moving
}*/
-
// missiles can hit other things
if (tmthing->flags & MF_MISSILE)
{
- // villsa [STRIFE] this code here has been moved at the beginning of this function
- // TODO - verify
- // see if it went over / under
- /*if (tmthing->z > thing->z + thing->height)
- return true; // overhead
- if (tmthing->z+tmthing->height < thing->z)
- return true; // underneath*/
-
- // villsa [STRIFE] TODO - update to strife version
- if (tmthing->target
- && (tmthing->target->type == thing->type /*||
- (tmthing->target->type == MT_KNIGHT && thing->type == MT_BRUISER)||
- (tmthing->target->type == MT_BRUISER && thing->type == MT_KNIGHT)*/ ) )
- {
- // Don't hit same species as originator.
- if (thing == tmthing->target)
- return true;
+ // villsa [STRIFE] code to check over/under clipping moved to the beginning of the
+ // function, so that it applies to everything.
+
+ // villsa [STRIFE] updated to strife version
+ if (tmthing->target && (tmthing->target->type == thing->type))
+ {
+ // Don't hit same species as originator.
+ if (thing == tmthing->target)
+ return true;
// sdh: Add deh_species_infighting here. We can override the
// "monsters of the same species cant hurt each other" behavior
// through dehacked patches
- if (thing->type != MT_PLAYER && !deh_species_infighting)
- {
- // Explode, but do no damage.
- // Let players missile other players.
- return false;
- }
- }
-
- if (! (thing->flags & MF_SHOOTABLE) )
- {
- // didn't do any damage
- return !(thing->flags & MF_SOLID);
- }
-
- // damage / explode
- damage = ((P_Random()%8)+1)*tmthing->info->damage;
- P_DamageMobj (thing, tmthing, tmthing->target, damage);
+ if (thing->type != MT_PLAYER && !deh_species_infighting)
+ {
+ // Explode, but do no damage.
+ // Let players missile other players.
+ return false;
+ }
+ }
+
+ if (!(thing->flags & MF_SHOOTABLE))
+ {
+ // didn't do any damage
+ return !(thing->flags & MF_SOLID);
+ }
+
+ // haleyjd 09/01/10: [STRIFE] Spectral check:
+ // Missiles cannot hit SPECTRAL entities unless the missiles are also
+ // flagged as SPECTRAL.
+ if (thing->flags & MF_SPECTRAL && !(tmthing->flags & MF_SPECTRAL))
+ return true; // keep going
+
+ // damage / explode
+ // haleyjd 09/01/10: [STRIFE] Modified missile damage formula
+ damage = ((P_Random()&3)+1)*tmthing->info->damage;
+ P_DamageMobj (thing, tmthing, tmthing->target, damage);
- // don't traverse any more
- return false;
+ // don't traverse any more
+ return false;
}
// check for special pickup
if (thing->flags & MF_SPECIAL)
{
- solid = thing->flags&MF_SOLID;
+ solid = thing->flags&MF_SOLID;
if (tmthing->player) // villsa [STRIFE] no longer checks MF_PICKUP flag
- {
- // can remove thing
- P_TouchSpecialThing (thing, tmthing);
- }
- return !solid;
+ {
+ // can remove thing
+ P_TouchSpecialThing (thing, tmthing);
+ }
+ return !solid;
}
-
+
return !(thing->flags & MF_SOLID);
}
diff --git a/src/strife/st_lib.c b/src/strife/st_lib.c
index e206b34c..a0fed423 100644
--- a/src/strife/st_lib.c
+++ b/src/strife/st_lib.c
@@ -63,7 +63,11 @@ void STlib_init(void)
}
-// ?
+//
+// STlib_initNum
+//
+// haleyjd 09/01/10: [STRIFE]
+// * Rogue removed the "on" member of st_number_t.
void
STlib_initNum
( st_number_t* n,
@@ -71,87 +75,127 @@ STlib_initNum
int y,
patch_t** pl,
int* num,
- boolean* on,
int width )
{
n->x = x;
n->y = y;
- n->oldnum = 0;
n->width = width;
n->num = num;
- n->on = on;
n->p = pl;
}
//
+// STlib_drawNum
+//
// A fairly efficient way to draw a number
// based on differences from the old number.
// Note: worth the trouble?
//
+// haleyjd 09/01/10: [STRIFE]
+// * Rogue removed the "refresh" parameter and caching code
+//
void
STlib_drawNum
-( st_number_t* n,
- boolean refresh )
+( st_number_t* n)
{
+ int numdigits = n->width;
+ int num = *n->num;
- int numdigits = n->width;
- int num = *n->num;
-
- int w = SHORT(n->p[0]->width);
- int h = SHORT(n->p[0]->height);
- int x = n->x;
-
- int neg;
+ int w = SHORT(n->p[0]->width) + 1; // [STRIFE] +1
+ int x = n->x;
- n->oldnum = *n->num;
+ int neg;
neg = num < 0;
if (neg)
{
- if (numdigits == 2 && num < -9)
- num = -9;
- else if (numdigits == 3 && num < -99)
- num = -99;
-
- num = -num;
+ if (numdigits == 2 && num < -9)
+ num = -9;
+ else if (numdigits == 3 && num < -99)
+ num = -99;
+
+ num = -num;
}
+ /* haleyjd 09/01/10: [STRIFE] Widget caching system removed by Rogue
// clear the area
x = n->x - numdigits*w;
if (n->y - ST_Y < 0)
- I_Error("drawNum: n->y - ST_Y < 0");
+ I_Error("drawNum: n->y - ST_Y < 0");
V_CopyRect(x, n->y - ST_Y, st_backing_screen, w*numdigits, h, x, n->y);
+ */
// if non-number, do not draw it
if (num == 1994)
- return;
+ return;
x = n->x;
// in the special case of 0, you draw 0
if (!num)
- V_DrawPatch(x - w, n->y, n->p[ 0 ]);
+ V_DrawPatch(x - w, n->y, n->p[ 0 ]);
// draw the new number
while (num && numdigits--)
{
- x -= w;
- V_DrawPatch(x, n->y, n->p[ num % 10 ]);
- num /= 10;
+ x -= w;
+ V_DrawPatch(x, n->y, n->p[ num % 10 ]);
+ num /= 10;
}
// draw a minus sign if necessary
if (neg)
- V_DrawPatch(x - 8, n->y, sttminus);
+ V_DrawPatch(x - 8, n->y, sttminus);
}
+//
+// STlib_drawNumPositive
+//
+// haleyjd 09/01/10: [STRIFE] New function.
+// * Mostly the same as STlib_drawNum, except doesn't draw negatives.
//
void
+STlib_drawNumPositive
+( st_number_t* n)
+{
+ int numdigits = n->width;
+ int num = *n->num;
+
+ int w = SHORT(n->p[0]->width) + 1; // [STRIFE] +1
+ int x = n->x;
+
+ // Don't draw negative values.
+ if (num < 0)
+ num = 0;
+
+ // if non-number, do not draw it
+ if (num == 1994)
+ return;
+
+ x = n->x;
+
+ // in the special case of 0, you draw 0
+ if (!num)
+ V_DrawPatch(x - w, n->y, n->p[ 0 ]);
+
+ // draw the new number
+ while (num && numdigits--)
+ {
+ x -= w;
+ V_DrawPatch(x, n->y, n->p[ num % 10 ]);
+ num /= 10;
+ }
+}
+
+
+// haleyjd 09/01/10: [STRIFE] All other functions were removed.
+/*
+void
STlib_updateNum
( st_number_t* n,
boolean refresh )
@@ -292,4 +336,5 @@ STlib_updateBinIcon
}
}
+*/
diff --git a/src/strife/st_lib.h b/src/strife/st_lib.h
index 344fd952..2576233d 100644
--- a/src/strife/st_lib.h
+++ b/src/strife/st_lib.h
@@ -41,24 +41,23 @@ typedef struct
{
// upper right-hand corner
// of the number (right-justified)
- int x;
- int y;
+ int x;
+ int y;
// max # of digits in number
- int width;
+ int width;
- // last number value
- int oldnum;
+ // haleyjd 09/01/10: [STRIFE] Removed "oldnum" member
+ //int oldnum;
// pointer to current value
- int* num;
+ int* num;
- // pointer to boolean stating
- // whether to update number
- boolean* on;
+ // haleyjd 09/01/10: [STRIFE] Removed "on" member
+ // boolean* on;
// list of patches for 0-9
- patch_t** p;
+ patch_t** p;
// user data
int data;
@@ -148,16 +147,28 @@ void STlib_init(void);
// Number widget routines
+
+// haleyjd 09/01/10: [STRIFE] Removed "on" parameter.
void
STlib_initNum
-( st_number_t* n,
- int x,
- int y,
- patch_t** pl,
- int* num,
- boolean* on,
- int width );
+( st_number_t* n,
+ int x,
+ int y,
+ patch_t** pl,
+ int* num,
+ int width );
+
+// haleyjd 09/01/10: [STRIFE] Made globally visible.
+void
+STlib_drawNum
+( st_number_t* n);
+
+// haleyjd 09/01/10: [STRIFE] New function
+void
+STlib_drawNumPositive
+( st_number_t* n);
+/* haleyjd 09/01/10: [STRIFE] All the below were removed
void
STlib_updateNum
( st_number_t* n,
@@ -213,5 +224,6 @@ void
STlib_updateBinIcon
( st_binicon_t* bi,
boolean refresh );
+*/
#endif
diff --git a/src/strife/st_stuff.c b/src/strife/st_stuff.c
index e5c9cc37..3b4ff0fb 100644
--- a/src/strife/st_stuff.c
+++ b/src/strife/st_stuff.c
@@ -93,20 +93,22 @@
// or into the frame buffer?
// AMMO number pos.
-#define ST_AMMOWIDTH 3
-#define ST_AMMOX 44
-#define ST_AMMOY 171
+// haleyjd 09/01/10: [STRIFE] Adjusted.
+#define ST_AMMOWIDTH 3
+#define ST_AMMOX 311
+#define ST_AMMOY 162
// HEALTH number pos.
-#define ST_HEALTHWIDTH 3
-#define ST_HEALTHX 90
-#define ST_HEALTHY 171
+// haleyjd 09/01/10: [STRIFE] Adjusted.
+#define ST_HEALTHWIDTH 3
+#define ST_HEALTHX 79
+#define ST_HEALTHY 162
// Weapon pos.
-#define ST_ARMSX 111
-#define ST_ARMSY 172
-#define ST_ARMSBGX 104
-#define ST_ARMSBGY 168
+#define ST_ARMSX 111
+#define ST_ARMSY 172
+#define ST_ARMSBGX 104
+#define ST_ARMSBGY 168
#define ST_ARMSXSPACE 12
#define ST_ARMSYSPACE 10
@@ -198,6 +200,15 @@
// Dimensions given in characters.
#define ST_MSGWIDTH 52
+// haleyjd 08/31/10: [STRIFE]
+// * Removed faces.
+// haleyjd 09/01/10:
+// * Removed DOOM pre-beta cruft.
+// * Removed deathmatch frags/arms-related stuff.
+// * Removed arms panel stuff.
+// * Removed unused widgets.
+// * Removed more faces, keyboxes, st_randomnumber
+
// graphics are drawn to a backing screen and blitted to the real screen
byte *st_backing_screen;
@@ -210,39 +221,12 @@ static boolean st_firsttime;
// lump number for PLAYPAL
static int lu_palette;
-// used for timing
-static unsigned int st_clock;
-
-// used for making messages go away
-static int st_msgcounter=0;
-
-// used when in chat
-static st_chatstateenum_t st_chatstate;
-
// whether in automap or first-person
static st_stateenum_t st_gamestate;
// whether left-side main status bar is active
static boolean st_statusbaron;
-// whether status bar chat is active
-static boolean st_chat;
-
-// value of st_chat before message popped up
-static boolean st_oldchat;
-
-// whether chat window has the cursor on
-static boolean st_cursoron;
-
-// !deathmatch
-static boolean st_notdeathmatch;
-
-// !deathmatch && st_statusbaron
-static boolean st_armson;
-
-// !deathmatch
-static boolean st_fragson;
-
// haleyjd 09/01/10: [STRIFE]
// Whether or not a popup is currently displayed
static boolean st_displaypopup;
@@ -256,84 +240,32 @@ static patch_t* invpop2; // plain popup frame
static patch_t* invpbak; // popup background w/details
static patch_t* invpbak2; // plain popup background
-// 0-9, tall numbers
-static patch_t* tallnum[10];
-
-// tall % sign
-static patch_t* tallpercent;
-
-// 0-9, short, yellow (,different!) numbers
-static patch_t* shortnum[10];
-
-// 3 key-cards, 3 skulls
-static patch_t* keys[NUMCARDS];
-
-// face status patches
-// haleyjd 08/31/10: [STRIFE] Removed faces
-//static patch_t* faces[ST_NUMFACES];
-
-// face background
-static patch_t* faceback;
+// haleyjd 09/01/10: [STRIFE] Replaced tallnum, shortnum w/inv fonts
+// 0-9, green numbers
+static patch_t* invfontg[10];
- // main bar right
-static patch_t* armsbg;
+// 0-9, yellow numbers
+static patch_t* invfonty[10];
-// weapon ownership patches
-static patch_t* arms[6][2];
+// 3 key-cards, 3 skulls -- STRIFE-TODO: This is handled differently
+static patch_t* keys[NUMCARDS];
// ready-weapon widget
-static st_number_t w_ready;
-
- // in deathmatch only, summary of frags stats
-static st_number_t w_frags;
+static st_number_t w_ready; // haleyjd [STRIFE]: This is still used.
+// haleyjd: [STRIFE] This is still used but was changed to a st_number_t.
// health widget
-static st_percent_t w_health;
-
-// arms background
-static st_binicon_t w_armsbg;
-
-
-// weapon ownership widgets
-static st_multicon_t w_arms[6];
-
-// face status widget
-static st_multicon_t w_faces;
-
-// keycard widgets
-static st_multicon_t w_keyboxes[3];
-
-// armor widget
-static st_percent_t w_armor;
+static st_number_t w_health;
// ammo widgets
-static st_number_t w_ammo[4];
+static st_number_t w_ammo[NUMAMMO]; // haleyjd [STRIFE]: Still used.
// max ammo widgets
-static st_number_t w_maxammo[4];
-
-
-
- // number of frags so far in deathmatch
-static int st_fragscount;
-
-// used to use appopriately pained face
-static int st_oldhealth = -1;
-
-// used for evil grin
-static boolean oldweaponsowned[NUMWEAPONS];
-
-// count until face changes
-//static int st_facecount = 0;
-
-// current face index, used by w_faces
-static int st_faceindex = 0;
+static st_number_t w_maxammo[NUMAMMO]; // haleyjd [STRIFE]: Still used.
-// holds key-type for each key box on bar
-static int keyboxes[3];
+// number of frags so far in deathmatch
+static int st_fragscount;
-// a random number per tick
-static int st_randomnumber;
cheatseq_t cheat_mus = CHEAT("idmus", 2);
cheatseq_t cheat_god = CHEAT("iddqd", 0);
@@ -565,12 +497,7 @@ ST_Responder (event_t* ev)
map = buf[1] - '0';
}
- // Chex.exe always warps to episode 1.
-
- if (gameversion == exe_chex)
- {
- epsd = 1;
- }
+ // haleyjd 09/01/10: Removed Chex Quest stuff.
// Catch invalid maps.
if (epsd < 1)
@@ -625,80 +552,63 @@ void ST_updateFaceWidget(void)
}
*/
+/*
void ST_updateWidgets(void)
{
- static int largeammo = 1994; // means "n/a"
- int i;
+ // haleyjd 09/01/10: [STRIFE] Rogue merged this into ST_Ticker below.
+}
+*/
+
+//
+// ST_Ticker
+//
+// haleyjd 09/01/10: [STRIFE]
+// * Removed st_clock and st_randomnumber.
+// * Merged ST_updateWidgets here. Wasn't inlined, as doesn't exist separately
+// in the binary as inlined functions normally do.
+//
+void ST_Ticker (void)
+{
+ static int largeammo = 1994; // means "n/a"
+ int i;
// must redirect the pointer if the ready weapon has changed.
- // if (w_ready.data != plyr->readyweapon)
- // {
if (weaponinfo[plyr->readyweapon].ammo == am_noammo)
- w_ready.num = &largeammo;
+ w_ready.num = &largeammo;
else
- w_ready.num = &plyr->ammo[weaponinfo[plyr->readyweapon].ammo];
- //{
- // static int tic=0;
- // static int dir=-1;
- // if (!(tic&15))
- // plyr->ammo[weaponinfo[plyr->readyweapon].ammo]+=dir;
- // if (plyr->ammo[weaponinfo[plyr->readyweapon].ammo] == -100)
- // dir = 1;
- // tic++;
- // }
- w_ready.data = plyr->readyweapon;
+ w_ready.num = &plyr->ammo[weaponinfo[plyr->readyweapon].ammo];
- // if (*w_ready.on)
- // STlib_updateNum(&w_ready, true);
- // refresh weapon change
- // }
+ w_ready.data = plyr->readyweapon;
- // update keycard multiple widgets
- for (i=0;i<3;i++)
+ // STRIFE-TODO: Gobbledeegunk.
+ /*
+ v2 = dword_88490-- == 1; // no clue yet...
+ if(v2)
+ dword_DC7F4 = dword_DC7F0;
+ v1 = st_popupdisplaytics;
+ if(st_popupdisplaytics)
{
- keyboxes[i] = plyr->cards[i] ? i : -1;
-
- if (plyr->cards[i+3])
- keyboxes[i] = i+3;
+ --st_popupdisplaytics;
+ if(v1 == 1)
+ {
+ st_displaypopup = false;
+ st_showkeys = false;
+ dword_88484 = -1; // unknown var
+ if(st_dosizedisplay)
+ M_SizeDisplay(); // mondo hack?
+ st_dosizedisplay = false;
+ }
}
+ */
- // refresh everything if this is him coming back to life
-
+ // haleyjd 09/01/10: [STRIFE] Keys are handled on a popup
// haleyjd 08/31/10: [STRIFE] No face widget
- //ST_updateFaceWidget();
-
- // used by the w_armsbg widget
- st_notdeathmatch = !deathmatch;
-
- // used by w_arms[] widgets
- st_armson = st_statusbaron && !deathmatch;
-
- // used by w_frags widget
- st_fragson = deathmatch && st_statusbaron;
- st_fragscount = 0;
-
- for (i=0 ; i<MAXPLAYERS ; i++)
- {
- if (i != consoleplayer)
- st_fragscount += plyr->frags[i];
- else
- st_fragscount -= plyr->frags[i];
- }
+ // haleyjd 09/01/10: [STRIFE] Armor, weapons, frags, etc. handled elsewhere
+ // haleyjd: This is from the PRE-BETA! Left here because it amuses me ;)
// get rid of chat window if up because of message
- if (!--st_msgcounter)
- st_chat = st_oldchat;
-
-}
-
-void ST_Ticker (void)
-{
-
- st_clock++;
- st_randomnumber = M_Random();
- ST_updateWidgets();
- st_oldhealth = plyr->health;
-
+ //if (!--st_msgcounter)
+ // st_chat = st_oldchat;
}
static int st_palette = 0;
@@ -768,40 +678,12 @@ void ST_doPaletteStuff(void)
}
+/*
void ST_drawWidgets(boolean refresh)
{
- int i;
-
- // used by w_arms[] widgets
- st_armson = st_statusbaron && !deathmatch;
-
- // used by w_frags widget
- st_fragson = deathmatch && st_statusbaron;
-
- STlib_updateNum(&w_ready, refresh);
-
- for (i=0;i<4;i++)
- {
- STlib_updateNum(&w_ammo[i], refresh);
- STlib_updateNum(&w_maxammo[i], refresh);
- }
-
- STlib_updatePercent(&w_health, refresh);
- STlib_updatePercent(&w_armor, refresh);
-
- STlib_updateBinIcon(&w_armsbg, refresh);
-
- for (i=0;i<6;i++)
- STlib_updateMultIcon(&w_arms[i], refresh);
-
- STlib_updateMultIcon(&w_faces, refresh);
-
- for (i=0;i<3;i++)
- STlib_updateMultIcon(&w_keyboxes[i], refresh);
-
- STlib_updateNum(&w_frags, refresh);
-
+ haleyjd 09/01/10: [STRIFE] Removed
}
+*/
void ST_doRefresh(void)
{
@@ -809,17 +691,11 @@ void ST_doRefresh(void)
// draw status bar background to off-screen buff
ST_refreshBackground();
-
- // haleyjd 09/01/10: STRIFE-TODO: widgets!
- // and refresh all widgets
- //ST_drawWidgets(true);
}
void ST_diffDraw(void)
{
- // haleyjd 09/01/10: STRIFE-TODO: widgets!
- // update all widgets
- //ST_drawWidgets(false);
+ // haleyjd: STRIFE-TODO: Needed?
}
void ST_Drawer (boolean fullscreen, boolean refresh)
@@ -849,9 +725,8 @@ boolean ST_DrawExternal(void)
if (st_statusbaron)
{
V_DrawPatchDirect(0, 160, invtop);
- // STRIFE-TODO:
- // STlib_drawNum2(&stru_DC750); // still unknown!
- // STlib_drawNum2(&w_ready);
+ STlib_drawNumPositive(&w_health);
+ STlib_drawNumPositive(&w_ready);
}
else
{
@@ -888,51 +763,23 @@ static void ST_loadUnloadGraphics(load_callback_t callback)
char namebuf[9];
- // haleyjd 08/31/10: STRIFE-TODO: Disabled statbar resource loading
- /*
- // Load the numbers, tall and short
+ // haleyjd 09/01/10: [STRIFE]
+ // Load the numbers, green and yellow
for (i=0;i<10;i++)
{
- sprintf(namebuf, DEH_String("STTNUM%d"), i);
- callback(namebuf, &tallnum[i]);
-
- sprintf(namebuf, DEH_String("STYSNUM%d"), i);
- callback(namebuf, &shortnum[i]);
- }
+ sprintf(namebuf, DEH_String("INVFONG%d"), i);
+ callback(namebuf, &invfontg[i]);
- // Load percent key.
- //Note: why not load STMINUS here, too?
-
- callback(DEH_String("STTPRCNT"), &tallpercent);
-
- // key cards
- for (i=0;i<NUMCARDS;i++)
- {
- sprintf(namebuf, DEH_String("STKEYS%d"), i);
- callback(namebuf, &keys[i]);
+ sprintf(namebuf, DEH_String("INVFONY%d"), i);
+ callback(namebuf, &invfonty[i]);
}
- // arms background
- callback(DEH_String("STARMS"), &armsbg);
+ // haleyjd 08/31/10: [STRIFE]
+ // * No face - STRIFE-TODO: but there are similar color patches, which appear behind the armor in deathmatch...
+ // 09/01/10:
+ // * Removed all unused DOOM stuff (arms, numbers, %, etc).
- // arms ownership widgets
- for (i=0; i<6; i++)
- {
- sprintf(namebuf, DEH_String("STGNUM%d"), i+2);
-
- // gray #
- callback(namebuf, &arms[i][0]);
-
- // yellow #
- arms[i][1] = shortnum[i+2];
- }
-
- // face backgrounds for different color players
- // haleyjd 08/31/10: [STRIFE] No face - STRIFE-TODO: but there are similar
- // color patches, which appear behind the armor in deathmatch...
-
- */
- // haleyjd 09/01/10: [STRIFE] sbar -> invback
+ // haleyjd 09/01/10: [STRIFE]: stbar -> invback, added new patches
// status bar background bits
callback(DEH_String("INVBACK"), &invback);
callback(DEH_String("INVTOP"), &invtop);
@@ -940,8 +787,6 @@ static void ST_loadUnloadGraphics(load_callback_t callback)
callback(DEH_String("INVPOP2"), &invpop2);
callback(DEH_String("INVPBAK"), &invpbak);
callback(DEH_String("INVPBAK2"), &invpbak2);
-
- // haleyjd 08/31/10: [STRIFE] No face.
}
static void ST_loadCallback(char *lumpname, patch_t **variable)
@@ -976,125 +821,58 @@ void ST_unloadData(void)
ST_unloadGraphics();
}
+//
+// ST_initData
+//
+// haleyjd 09/01/10: [STRIFE]
+// * Removed prebeta cruft, face stuff, keyboxes, and oldwe
+//
void ST_initData(void)
{
-
- int i;
-
st_firsttime = true;
plyr = &players[consoleplayer];
- st_clock = 0;
- st_chatstate = StartChatState;
st_gamestate = FirstPersonState;
st_statusbaron = true;
- st_oldchat = st_chat = false;
- st_cursoron = false;
- st_faceindex = 0;
st_palette = -1;
- st_oldhealth = -1;
-
- for (i=0;i<NUMWEAPONS;i++)
- oldweaponsowned[i] = plyr->weaponowned[i];
-
- for (i=0;i<3;i++)
- keyboxes[i] = -1;
-
STlib_init();
-
}
void ST_createWidgets(void)
{
-
int i;
// ready weapon ammo
STlib_initNum(&w_ready,
- ST_AMMOX,
- ST_AMMOY,
- tallnum,
- &plyr->ammo[weaponinfo[plyr->readyweapon].ammo],
- &st_statusbaron,
- ST_AMMOWIDTH );
+ ST_AMMOX,
+ ST_AMMOY,
+ invfontg,
+ &plyr->ammo[weaponinfo[plyr->readyweapon].ammo],
+ ST_AMMOWIDTH);
// the last weapon type
w_ready.data = plyr->readyweapon;
// health percentage
- STlib_initPercent(&w_health,
- ST_HEALTHX,
- ST_HEALTHY,
- tallnum,
- &plyr->health,
- &st_statusbaron,
- tallpercent);
-
- // arms background
- STlib_initBinIcon(&w_armsbg,
- ST_ARMSBGX,
- ST_ARMSBGY,
- armsbg,
- &st_notdeathmatch,
- &st_statusbaron);
-
- // weapons owned
- for(i=0;i<6;i++)
- {
- STlib_initMultIcon(&w_arms[i],
- ST_ARMSX+(i%3)*ST_ARMSXSPACE,
- ST_ARMSY+(i/3)*ST_ARMSYSPACE,
- arms[i], (int *) &plyr->weaponowned[i+1],
- &st_armson);
- }
-
- // frags sum
- STlib_initNum(&w_frags,
- ST_FRAGSX,
- ST_FRAGSY,
- tallnum,
- &st_fragscount,
- &st_fragson,
- ST_FRAGSWIDTH);
-
- // faces
- // haleyjd 08/31/10: [STRIFE] No face.
-
- // armor percentage - should be colored later
- STlib_initPercent(&w_armor,
- ST_ARMORX,
- ST_ARMORY,
- tallnum,
- &plyr->armorpoints,
- &st_statusbaron, tallpercent);
-
- // keyboxes 0-2
- STlib_initMultIcon(&w_keyboxes[0],
- ST_KEY0X,
- ST_KEY0Y,
- keys,
- &keyboxes[0],
- &st_statusbaron);
-
- STlib_initMultIcon(&w_keyboxes[1],
- ST_KEY1X,
- ST_KEY1Y,
- keys,
- &keyboxes[1],
- &st_statusbaron);
-
- STlib_initMultIcon(&w_keyboxes[2],
- ST_KEY2X,
- ST_KEY2Y,
- keys,
- &keyboxes[2],
- &st_statusbaron);
-
+ STlib_initNum(&w_health,
+ ST_HEALTHX,
+ ST_HEALTHY,
+ invfontg,
+ &plyr->health,
+ ST_HEALTHWIDTH);
+
+ // haleyjd 08/31/10: [STRIFE]
+ // * No face.
+ // 09/01/10:
+ // * No arms, weaponsowned, frags, armor, keyboxes
+
+ // haleyjd 09/01/10: STRIFE-TODO: Ammo Widgets!!!
+ /*
// ammo count (all four kinds)
STlib_initNum(&w_ammo[0],
ST_AMMO0X,
@@ -1160,7 +938,7 @@ void ST_createWidgets(void)
&plyr->maxammo[3],
&st_statusbaron,
ST_MAXAMMO3WIDTH);
-
+ */
}
static boolean st_stopped = true;