From 5de507694b0ca43739033d75cf20fcf7ea31a2dd Mon Sep 17 00:00:00 2001 From: James Haley Date: Sat, 18 Sep 2010 17:35:57 +0000 Subject: Tons of warnings fixed - now only 7 warnings at warning level 3, and most of those are outside of our own code (get on those signed/unsigned mismatches in the midi code, fraggle ;) Subversion-branch: /branches/strife-branch Subversion-revision: 2110 --- src/strife/f_finale.c | 9 +-- src/strife/m_menu.h | 3 + src/strife/p_dialog.c | 8 ++- src/strife/p_dialog.h | 16 +++-- src/strife/p_doors.c | 2 +- src/strife/p_enemy.c | 4 +- src/strife/p_inter.c | 50 ++++++++------ src/strife/p_inter.h | 14 ++-- src/strife/p_local.h | 4 +- src/strife/p_map.c | 50 +++++++------- src/strife/p_mobj.c | 180 +++++++++++++++++++++++++------------------------- src/strife/p_mobj.h | 3 +- src/strife/p_pspr.c | 1 - src/strife/p_pspr.h | 5 ++ src/strife/p_spec.c | 50 +++++++------- src/strife/p_switch.c | 2 + src/strife/p_user.c | 10 ++- src/strife/r_bsp.c | 4 +- src/strife/r_main.c | 2 +- src/strife/r_segs.c | 2 +- src/strife/s_sound.c | 11 ++- src/strife/st_stuff.c | 5 -- 22 files changed, 236 insertions(+), 199 deletions(-) (limited to 'src/strife') diff --git a/src/strife/f_finale.c b/src/strife/f_finale.c index f5ab90ff..f12db08c 100644 --- a/src/strife/f_finale.c +++ b/src/strife/f_finale.c @@ -69,9 +69,9 @@ finalestage_t finalestage; unsigned int finalecount; // haleyjd 09/12/10: [STRIFE] Slideshow variables -char *slideshow_panel; -int slideshow_tics; -int slideshow_state; +char *slideshow_panel; +unsigned int slideshow_tics; +int slideshow_state; // haleyjd 09/13/10: [STRIFE] All this is unused. /* @@ -174,7 +174,6 @@ enum void F_StartFinale (void) { patch_t *panel; - size_t i; gameaction = ga_nothing; gamestate = GS_FINALE; @@ -903,8 +902,6 @@ void F_DrawMap34End (void) int x; patch_t* p1; patch_t* p2; - char name[10]; - int stage; static int laststage; p1 = W_CacheLumpName (DEH_String("credit"), PU_LEVEL); diff --git a/src/strife/m_menu.h b/src/strife/m_menu.h index bbd2d9bc..6aa9858e 100644 --- a/src/strife/m_menu.h +++ b/src/strife/m_menu.h @@ -99,6 +99,9 @@ int M_WriteText(int x, int y, const char *string); // haleyjd 09/04/10: [STRIFE] New function. void M_DialogDimMsg(int x, int y, char *str, boolean useyfont); +// haleyjd [STRIFE] Externalized +void M_ClearMenus (int choice); + extern int detailLevel; extern int screenblocks; diff --git a/src/strife/p_dialog.c b/src/strife/p_dialog.c index da46f4c2..98f308fc 100644 --- a/src/strife/p_dialog.c +++ b/src/strife/p_dialog.c @@ -28,6 +28,8 @@ // //----------------------------------------------------------------------------- +#include + #include "z_zone.h" #include "w_wad.h" #include "deh_str.h" @@ -41,6 +43,9 @@ #include "p_local.h" #include "sounds.h" #include "p_dialog.h" +#include "s_sound.h" +#include "p_local.h" +#include "p_inter.h" // // Defines and Macros @@ -1221,7 +1226,7 @@ void P_DialogDoChoice(int choice) dialogtalker->angle = dialogtalkerangle; dialogplayer->st_update = true; - M_ClearMenus(); + M_ClearMenus(0); if(nextdialog >= 0 || gameaction == ga_victory) // Macil hack menuindialog = false; @@ -1251,7 +1256,6 @@ void P_DialogStart(player_t *player) int j = 0; int pic; int rnd = 0; - mapdialog_t* dialog; char* byetext; int jumptoconv; diff --git a/src/strife/p_dialog.h b/src/strife/p_dialog.h index cabf0935..f2cea435 100644 --- a/src/strife/p_dialog.h +++ b/src/strife/p_dialog.h @@ -89,13 +89,15 @@ typedef struct mapdialog_s mapdlgchoice_t choices[MDLG_MAXCHOICES]; } mapdialog_t; -void P_DialogLoad(void); -void P_DialogStart(player_t *player); -void P_DialogDoChoice(int choice); -boolean P_GiveItemToPlayer(player_t *player, int sprnum, mobjtype_t type); -void P_DialogStartP1(void); -mapdialog_t* P_DialogFind(mobjtype_t type, int jumptoconv); -int P_PlayerHasItem(player_t *player, mobjtype_t type); +void P_DialogLoad(void); +void P_DialogStart(player_t *player); +void P_DialogDoChoice(int choice); +boolean P_GiveItemToPlayer(player_t *player, int sprnum, mobjtype_t type); +boolean P_GiveInventoryItem(player_t *player, int sprnum, mobjtype_t type); +boolean P_UseInventoryItem(player_t* player, int item); +void P_DialogStartP1(void); +mapdialog_t* P_DialogFind(mobjtype_t type, int jumptoconv); +int P_PlayerHasItem(player_t *player, mobjtype_t type); #endif diff --git a/src/strife/p_doors.c b/src/strife/p_doors.c index b9696a53..19055475 100644 --- a/src/strife/p_doors.c +++ b/src/strife/p_doors.c @@ -43,6 +43,7 @@ // [STRIFE] #include "p_dialog.h" +#include "i_system.h" // @@ -1236,7 +1237,6 @@ int EV_RemoteSlidingDoor(line_t* line, mobj_t* thing) { int secnum; sector_t* sec; - slidedoor_t* door; int i; int rtn; line_t* secline; diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c index 20233ab5..2176726b 100644 --- a/src/strife/p_enemy.c +++ b/src/strife/p_enemy.c @@ -47,6 +47,9 @@ // [STRIFE] Dialog / Inventory #include "p_dialog.h" #include "deh_str.h" +#include "w_wad.h" +#include "f_finale.h" +#include "p_inter.h" // Forward Declarations: void A_RandomWalk(mobj_t *); @@ -2531,7 +2534,6 @@ void A_EntityDeath(mobj_t* actor) mobj_t *subentity; angle_t an; fixed_t dist; - fixed_t momx, momy; dist = 2 * mobjinfo[MT_SUBENTITY].radius; diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c index 29772668..f6677496 100644 --- a/src/strife/p_inter.c +++ b/src/strife/p_inter.c @@ -41,9 +41,16 @@ #include "p_dialog.h" // villsa [STRIFE] #include "s_sound.h" #include "p_inter.h" + #include "hu_stuff.h" // villsa [STRIFE] #include "z_zone.h" // villsa [STRIFE] +// haleyjd [STRIFE] +#include "w_wad.h" +#include "p_pspr.h" +#include "p_dialog.h" +#include "f_finale.h" + #define BONUSADD 6 @@ -112,31 +119,34 @@ boolean P_GiveAmmo(player_t* player, ammotype_t ammo, int num) // villsa [STRIFE] ammo update // where's the check for grenades? - haleyjd: verified no switch to grenades - switch(ammo && !player->readyweapon) + if(!player->readyweapon) { - case am_bullets: - if(player->weaponowned[wp_rifle]) - player->pendingweapon = wp_rifle; - break; + switch(ammo) + { + case am_bullets: + if(player->weaponowned[wp_rifle]) + player->pendingweapon = wp_rifle; + break; - case am_elecbolts: - case am_poisonbolts: - if(player->weaponowned[wp_elecbow]) - player->pendingweapon = wp_elecbow; - break; + case am_elecbolts: + case am_poisonbolts: + if(player->weaponowned[wp_elecbow]) + player->pendingweapon = wp_elecbow; + break; - case am_cell: - if(player->weaponowned[wp_mauler]) - player->pendingweapon = wp_mauler; - break; + case am_cell: + if(player->weaponowned[wp_mauler]) + player->pendingweapon = wp_mauler; + break; - case am_missiles: - if(player->weaponowned[wp_missile]) - player->pendingweapon = wp_missile; - break; + case am_missiles: + if(player->weaponowned[wp_missile]) + player->pendingweapon = wp_missile; + break; - default: - break; + default: + break; + } } return true; diff --git a/src/strife/p_inter.h b/src/strife/p_inter.h index 4de4360a..1ddf4498 100644 --- a/src/strife/p_inter.h +++ b/src/strife/p_inter.h @@ -28,11 +28,13 @@ #ifndef __P_INTER__ #define __P_INTER__ - - - -boolean P_GivePower(player_t*, powertype_t); - - +// haleyjd [STRIFE]: Multiple externals added +boolean P_GiveCard(player_t* player, card_t card); +boolean P_GiveBody(player_t* player, int num); +boolean P_GiveArmor(player_t* player, int armortype); +boolean P_GivePower(player_t* player, powertype_t power); +boolean P_GiveAmmo(player_t* player, ammotype_t ammo, int num); +boolean P_GiveWeapon(player_t* player, weapontype_t weapon, boolean dropped); +void P_KillMobj(mobj_t* source, mobj_t* target); #endif diff --git a/src/strife/p_local.h b/src/strife/p_local.h index 304f44c5..b35a0acc 100644 --- a/src/strife/p_local.h +++ b/src/strife/p_local.h @@ -147,7 +147,9 @@ void P_ExplodeMissile (mobj_t* mo); // villsa [STRIFE] // void P_NoiseAlert (mobj_t* target, mobj_t* emmiter); void P_DoPunchAlert(mobj_t *puncher, mobj_t *punchee); // villsa [STRIFE] - +void A_BodyParts(mobj_t *actor); // haleyjd: [STRIFE] +void A_AlertSpectreC(mobj_t* actor); +void A_FaceTarget (mobj_t* actor); // // P_MAPUTL diff --git a/src/strife/p_map.c b/src/strife/p_map.c index d423c5fc..b0710591 100644 --- a/src/strife/p_map.c +++ b/src/strife/p_map.c @@ -1469,13 +1469,13 @@ boolean nofit; boolean PIT_ChangeSector (mobj_t* thing) { mobj_t* mo; - + if (P_ThingHeightClip (thing)) { - // keep checking - return true; + // keep checking + return true; } - + // crunch bodies to giblets if (thing->health <= 0) @@ -1486,30 +1486,30 @@ boolean PIT_ChangeSector (mobj_t* thing) nofit = true; return false; } - //P_SetMobjState (thing, S_GIBS); // villsa [STRIFE] unused + //P_SetMobjState (thing, S_GIBS); // villsa [STRIFE] unused A_BodyParts(thing); // villsa [STRIFE] spit out meat/junk stuff - thing->flags &= ~MF_SOLID; - thing->height = 0; - thing->radius = 0; + thing->flags &= ~MF_SOLID; + thing->height = 0; + thing->radius = 0; - // keep checking - return true; + // keep checking + return true; } // crunch dropped items if (thing->flags & MF_DROPPED) { - P_RemoveMobj (thing); - - // keep checking - return true; + P_RemoveMobj (thing); + + // keep checking + return true; } if (! (thing->flags & MF_SHOOTABLE) ) { - // assume it is bloody gibs or something - return true; + // assume it is bloody gibs or something + return true; } nofit = true; @@ -1517,19 +1517,19 @@ boolean PIT_ChangeSector (mobj_t* thing) if (crushchange && !(leveltime&3) ) { S_StartSound(thing, sfx_pcrush); // villsa [STRIFE] - P_DamageMobj(thing,NULL,NULL,10); + P_DamageMobj(thing,NULL,NULL,10); - // spray blood in a random direction - mo = P_SpawnMobj (thing->x, - thing->y, - thing->z + thing->height/2, MT_BLOOD_DEATH); - - mo->momx = (P_Random() - P_Random ())<<12; - mo->momy = (P_Random() - P_Random ())<<12; + // spray blood in a random direction + mo = P_SpawnMobj (thing->x, + thing->y, + thing->z + thing->height/2, MT_BLOOD_DEATH); + + mo->momx = (P_Random() - P_Random ())<<12; + mo->momy = (P_Random() - P_Random ())<<12; } // keep checking (crush other things) - return true; + return true; } diff --git a/src/strife/p_mobj.c b/src/strife/p_mobj.c index 2fdd7a51..4e630d91 100644 --- a/src/strife/p_mobj.c +++ b/src/strife/p_mobj.c @@ -264,14 +264,14 @@ void P_ZMovement (mobj_t* mo) { fixed_t dist; fixed_t delta; - + // check for smooth step up if (mo->player && mo->z < mo->floorz) { - mo->player->viewheight -= mo->floorz-mo->z; + mo->player->viewheight -= mo->floorz-mo->z; - mo->player->deltaviewheight - = (VIEWHEIGHT - mo->player->viewheight)>>3; + mo->player->deltaviewheight + = (VIEWHEIGHT - mo->player->viewheight)>>3; } // adjust height @@ -286,44 +286,44 @@ void P_ZMovement (mobj_t* mo) } //mo->z += mo->momz; // villsa [STRIFE] unused - + if ( mo->flags & MF_FLOAT - && mo->target) + && mo->target) { - // float down towards target if too close - if ( /*!(mo->flags & MF_SKULLFLY) // villsa [STRIFE] unused - &&*/ !(mo->flags & MF_INFLOAT) ) - { - dist = P_AproxDistance (mo->x - mo->target->x, - mo->y - mo->target->y); - - delta =(mo->target->z + (mo->height>>1)) - mo->z; - - if (delta<0 && dist < -(delta*3) ) - mo->z -= FLOATSPEED; - else if (delta>0 && dist < (delta*3) ) - mo->z += FLOATSPEED; - } - + // float down towards target if too close + if ( /*!(mo->flags & MF_SKULLFLY) // villsa [STRIFE] unused + &&*/ !(mo->flags & MF_INFLOAT) ) + { + dist = P_AproxDistance (mo->x - mo->target->x, + mo->y - mo->target->y); + + delta =(mo->target->z + (mo->height>>1)) - mo->z; + + if (delta<0 && dist < -(delta*3) ) + mo->z -= FLOATSPEED; + else if (delta>0 && dist < (delta*3) ) + mo->z += FLOATSPEED; + } + } // clip movement if (mo->z <= mo->floorz) { - // hit the floor - - // Note (id): - // somebody left this after the setting momz to 0, - // kinda useless there. - // - // cph - This was the a bug in the linuxdoom-1.10 source which - // caused it not to sync Doom 2 v1.9 demos. Someone - // added the above comment and moved up the following code. So - // demos would desync in close lost soul fights. - // Note that this only applies to original Doom 1 or Doom2 demos - not - // Final Doom and Ultimate Doom. So we test demo_compatibility *and* - // gamemission. (Note we assume that Doom1 is always Ult Doom, which - // seems to hold for most published demos.) + // hit the floor + + // Note (id): + // somebody left this after the setting momz to 0, + // kinda useless there. + // + // cph - This was the a bug in the linuxdoom-1.10 source which + // caused it not to sync Doom 2 v1.9 demos. Someone + // added the above comment and moved up the following code. So + // demos would desync in close lost soul fights. + // Note that this only applies to original Doom 1 or Doom2 demos - not + // Final Doom and Ultimate Doom. So we test demo_compatibility *and* + // gamemission. (Note we assume that Doom1 is always Ult Doom, which + // seems to hold for most published demos.) // // fraggle - cph got the logic here slightly wrong. There are three // versions of Doom 1.9: @@ -334,103 +334,104 @@ void P_ZMovement (mobj_t* mo) // // So we need to check that this is either retail or commercial // (but not doom2) - - //int correct_lost_soul_bounce = gameversion >= exe_ultimate; - if (/*correct_lost_soul_bounce &&*/ mo->flags & MF_BOUNCE) - { - // the skull slammed into something + //int correct_lost_soul_bounce = gameversion >= exe_ultimate; + + if (/*correct_lost_soul_bounce &&*/ mo->flags & MF_BOUNCE) + { + // the skull slammed into something // villsa [STRIFE] affect reactiontime // momz is also shifted by 1 - mo->momz = -mo->momz >> 1; + mo->momz = -mo->momz >> 1; mo->reactiontime >>= 1; // villsa [STRIFE] get terrain type if(P_GetTerrainType(mo) != FLOOR_SOLID) mo->flags &= ~MF_BOUNCE; - } - - if (mo->momz < 0) - { - if (mo->player - && mo->momz < -GRAVITY*8) - { - // Squat down. - // Decrease viewheight for a moment - // after hitting the ground (hard), - // and utter appropriate sound. - mo->player->deltaviewheight = mo->momz>>3; + } + + if (mo->momz < 0) + { + if (mo->player + && mo->momz < -GRAVITY*8) + { + // Squat down. + // Decrease viewheight for a moment + // after hitting the ground (hard), + // and utter appropriate sound. + mo->player->deltaviewheight = mo->momz>>3; // villsa [STRIFE] fall damage - if(mo->momz < -(20*FRACUNIT)) + if(mo->momz < -20*FRACUNIT) { - P_DamageMobj(mo, NULL, mo, (mo->momz >> 32) / -25000); + // haleyjd 09/18/10: Repaired calculation + P_DamageMobj(mo, NULL, mo, mo->momz / -25000); mo->player->centerview = 1; } - S_StartSound (mo, sfx_oof); - } - mo->momz = 0; - } - mo->z = mo->floorz; + S_StartSound (mo, sfx_oof); + } + mo->momz = 0; + } + mo->z = mo->floorz; - // cph 2001/05/26 - - // See lost soul bouncing comment above. We need this here for bug - // compatibility with original Doom2 v1.9 - if a soul is charging and - // hit by a raising floor this incorrectly reverses its Y momentum. - // + // cph 2001/05/26 - + // See lost soul bouncing comment above. We need this here for bug + // compatibility with original Doom2 v1.9 - if a soul is charging and + // hit by a raising floor this incorrectly reverses its Y momentum. + // // villsa [STRIFE] unused /*if (!correct_lost_soul_bounce && mo->flags & MF_SKULLFLY) mo->momz = -mo->momz;*/ // villsa [STRIFE] also check for MF_BOUNCE - if ( (mo->flags & MF_MISSILE) - && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) ) - { + if ( (mo->flags & MF_MISSILE) + && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) ) + { P_ExplodeMissile (mo); - return; - } + return; + } } else if (! (mo->flags & MF_NOGRAVITY) ) { - if (mo->momz == 0) - mo->momz = -GRAVITY*2; - else - mo->momz -= GRAVITY; + if (mo->momz == 0) + mo->momz = -GRAVITY*2; + else + mo->momz -= GRAVITY; } - + if (mo->z + mo->height > mo->ceilingz) { // villsa [STRIFE] replace skullfly flag with MF_BOUNCE if (mo->flags & MF_BOUNCE) { - // villsa [STRIFE] affect reactiontime + // villsa [STRIFE] affect reactiontime // momz is also shifted by 1 - mo->momz = -mo->momz >> 1; + mo->momz = -mo->momz >> 1; mo->reactiontime >>= 1; } - // hit the ceiling - if (mo->momz > 0) - mo->momz = 0; - { - mo->z = mo->ceilingz - mo->height; - } - + // hit the ceiling + if (mo->momz > 0) + mo->momz = 0; + { + mo->z = mo->ceilingz - mo->height; + } + // villsa [STRIFE] also check for MF_BOUNCE - if ( (mo->flags & MF_MISSILE) - && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) ) - { + if ( (mo->flags & MF_MISSILE) + && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) ) + { // villsa [STRIFE] check against skies if(mo->subsector->sector->ceilingpic == skyflatnum) P_RemoveMobj(mo); else P_ExplodeMissile (mo); - return; - } + return; + } } } @@ -756,7 +757,6 @@ void P_SpawnPlayer(mapthing_t* mthing) fixed_t y; fixed_t z; mobj_t* mobj; - int i; if(mthing->type == 0) return; diff --git a/src/strife/p_mobj.h b/src/strife/p_mobj.h index b7865ff0..21c0ae9a 100644 --- a/src/strife/p_mobj.h +++ b/src/strife/p_mobj.h @@ -332,6 +332,7 @@ typedef struct mobj_s } mobj_t; - +// haleyjd [STRIFE] Exported +void P_CheckMissileSpawn (mobj_t* th); #endif diff --git a/src/strife/p_pspr.c b/src/strife/p_pspr.c index a8788354..3dc368f0 100644 --- a/src/strife/p_pspr.c +++ b/src/strife/p_pspr.c @@ -511,7 +511,6 @@ void A_FireFlameThrower(player_t* player, pspdef_t* psp) void A_FireMissile(player_t* player, pspdef_t* psp) { angle_t an; - mobj_t* mo; an = player->mo->angle; player->mo->angle += (P_Random() - P_Random())<<(19 - (player->accuracy * 4 / 100)); diff --git a/src/strife/p_pspr.h b/src/strife/p_pspr.h index 373831a1..64341b15 100644 --- a/src/strife/p_pspr.h +++ b/src/strife/p_pspr.h @@ -79,4 +79,9 @@ typedef struct } pspdef_t; +typedef struct player_s *playerptr; + +// haleyjd [STRIFE] Exported +void P_SetPsprite(playerptr player, int position, statenum_t stnum); + #endif diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c index 467a424c..2111cdc3 100644 --- a/src/strife/p_spec.c +++ b/src/strife/p_spec.c @@ -138,7 +138,7 @@ animdef_t animdefs[] = { false, "F_FAN2", "F_FAN1", 4}, { false, "F_CONVY2", "F_CONVY1", 4}, { false, "F_RDALN4", "F_RDALN1", 4}, - { -1, NULL, NULL, 0}, + { -1, "", "", 0}, }; anim_t anims[MAXANIMS]; @@ -169,35 +169,35 @@ void P_InitPicAnims (void) startname = DEH_String(animdefs[i].startname); endname = DEH_String(animdefs[i].endname); - if (animdefs[i].istexture) - { - // different episode ? - if (R_CheckTextureNumForName(startname) == -1) - continue; + if (animdefs[i].istexture) + { + // different episode ? + if (R_CheckTextureNumForName(startname) == -1) + continue; - lastanim->picnum = R_TextureNumForName(endname); - lastanim->basepic = R_TextureNumForName(startname); - } - else - { - if (W_CheckNumForName(startname) == -1) - continue; + lastanim->picnum = R_TextureNumForName(endname); + lastanim->basepic = R_TextureNumForName(startname); + } + else + { + if (W_CheckNumForName(startname) == -1) + continue; - lastanim->picnum = R_FlatNumForName(endname); - lastanim->basepic = R_FlatNumForName(startname); - } + lastanim->picnum = R_FlatNumForName(endname); + lastanim->basepic = R_FlatNumForName(startname); + } - lastanim->istexture = animdefs[i].istexture; - lastanim->numpics = lastanim->picnum - lastanim->basepic + 1; + lastanim->istexture = animdefs[i].istexture; + lastanim->numpics = lastanim->picnum - lastanim->basepic + 1; - if (lastanim->numpics < 2) - I_Error ("P_InitPicAnims: bad cycle from %s to %s", - startname, endname); - - lastanim->speed = animdefs[i].speed; - lastanim++; + if (lastanim->numpics < 2) + I_Error ("P_InitPicAnims: bad cycle from %s to %s", + startname, endname); + + lastanim->speed = animdefs[i].speed; + lastanim++; } - + } // villsa [STRIFE] terrain type definitions diff --git a/src/strife/p_switch.c b/src/strife/p_switch.c index 0904c035..b9e0fee1 100644 --- a/src/strife/p_switch.c +++ b/src/strife/p_switch.c @@ -35,6 +35,8 @@ #include "g_game.h" #include "d_main.h" // villsa [STRIFE] #include "s_sound.h" +#include "m_random.h" // haleyjd [STRIFE] +#include "p_dialog.h" // Data. #include "sounds.h" diff --git a/src/strife/p_user.c b/src/strife/p_user.c index b8997c6c..0de9699c 100644 --- a/src/strife/p_user.c +++ b/src/strife/p_user.c @@ -26,8 +26,7 @@ // //----------------------------------------------------------------------------- - - +#include #include "doomdef.h" #include "d_event.h" @@ -36,6 +35,13 @@ #include "p_dialog.h" // villsa [STRIFE] #include "d_main.h" // villsa [STRIFE] #include "doomstat.h" +#include "deh_str.h" // haleyjd [STRIFE] +#include "z_zone.h" +#include "w_wad.h" +#include "p_pspr.h" +#include "m_random.h" +#include "s_sound.h" +#include "p_inter.h" diff --git a/src/strife/r_bsp.c b/src/strife/r_bsp.c index 47194d96..ee05156d 100644 --- a/src/strife/r_bsp.c +++ b/src/strife/r_bsp.c @@ -304,7 +304,7 @@ void R_AddLine (seg_t* line) // Totally off the left edge? if (tspan >= span) return; - angle2 = -clipangle; + angle2 = 0 - clipangle; } // The seg is in the view range, @@ -456,7 +456,7 @@ boolean R_CheckBBox (fixed_t* bspcoord) if (tspan >= span) return false; - angle2 = -clipangle; + angle2 = 0 - clipangle; } diff --git a/src/strife/r_main.c b/src/strife/r_main.c index d9f0672a..b9d9f300 100644 --- a/src/strife/r_main.c +++ b/src/strife/r_main.c @@ -320,7 +320,7 @@ R_PointToAngle if (x>y) { // octant 8 - return -tantoangle[SlopeDiv(y,x)]; + return 0 - tantoangle[SlopeDiv(y,x)]; } else { diff --git a/src/strife/r_segs.c b/src/strife/r_segs.c index bd655654..ac7e3743 100644 --- a/src/strife/r_segs.c +++ b/src/strife/r_segs.c @@ -637,7 +637,7 @@ R_StoreWallRange offsetangle = rw_normalangle-rw_angle1; if (offsetangle > ANG180) - offsetangle = -offsetangle; + offsetangle = 0 - offsetangle; if (offsetangle > ANG90) offsetangle = ANG90; diff --git a/src/strife/s_sound.c b/src/strife/s_sound.c index b9357181..47b33089 100644 --- a/src/strife/s_sound.c +++ b/src/strife/s_sound.c @@ -25,6 +25,7 @@ #include #include +#include #include "i_sound.h" #include "i_system.h" @@ -590,6 +591,7 @@ void I_StartVoice(const char *lumpname) { int lumpnum; voiceinfo_t *voice; // choco-specific + char lumpnamedup[9]; // no voices in deathmatch mode. if(netgame) @@ -613,10 +615,15 @@ void I_StartVoice(const char *lumpname) if(lumpname == NULL) return; - if((lumpnum = W_CheckNumForName(lumpname)) != -1) + // Because of constness problems... + strncpy(lumpnamedup, lumpname, 9); + lumpnamedup[8] = '\0'; + + + if((lumpnum = W_CheckNumForName(lumpnamedup)) != -1) { // haleyjd: Choco-specific: get a voice structure - voice = S_getVoice(lumpname, lumpnum); + voice = S_getVoice(lumpnamedup, lumpnum); // get a channel for the voice i_voicehandle = S_GetChannel(NULL, &voice->sfx, true); diff --git a/src/strife/st_stuff.c b/src/strife/st_stuff.c index d5fcf0ff..cacab9ee 100644 --- a/src/strife/st_stuff.c +++ b/src/strife/st_stuff.c @@ -621,7 +621,6 @@ void ST_updateWidgets(void) void ST_Ticker (void) { static int largeammo = 1994; // means "n/a" - int i; // must redirect the pointer if the ready weapon has changed. if (weaponinfo[plyr->readyweapon].ammo == am_noammo) @@ -809,8 +808,6 @@ static void ST_loadUnloadGraphics(load_callback_t callback) { int i; - int j; - int facenum; char namebuf[9]; @@ -896,8 +893,6 @@ void ST_initData(void) void ST_createWidgets(void) { - int i; - // ready weapon ammo STlib_initNum(&w_ready, ST_AMMOX, -- cgit v1.2.3