diff options
author | Samuel Villareal | 2010-09-03 04:11:39 +0000 |
---|---|---|
committer | Samuel Villareal | 2010-09-03 04:11:39 +0000 |
commit | d1c8cb2cfed18f5c5c32347011f33a210c96ff38 (patch) | |
tree | 2d0e2e886d0dae84347e8d9a390ea77652bab403 /src/strife/r_main.c | |
parent | 1c756bd681af926fabdb99c57248e68b776e66fd (diff) | |
download | chocolate-doom-d1c8cb2cfed18f5c5c32347011f33a210c96ff38.tar.gz chocolate-doom-d1c8cb2cfed18f5c5c32347011f33a210c96ff38.tar.bz2 chocolate-doom-d1c8cb2cfed18f5c5c32347011f33a210c96ff38.zip |
+ More button flags added to buttoncode_e
+ Looking/jumping implemented
+ Jump/look/center keys supported
+ Strife mouse firing bug implemented
Subversion-branch: /branches/strife-branch
Subversion-revision: 2003
Diffstat (limited to 'src/strife/r_main.c')
-rw-r--r-- | src/strife/r_main.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/strife/r_main.c b/src/strife/r_main.c index 7ea2a329..dea4603b 100644 --- a/src/strife/r_main.c +++ b/src/strife/r_main.c @@ -35,6 +35,7 @@ #include "doomdef.h" +#include "doomstat.h" // villsa [STRIFE] #include "d_net.h" #include "m_bbox.h" @@ -79,6 +80,8 @@ fixed_t viewx; fixed_t viewy; fixed_t viewz; +int viewpitch; // villsa [STRIFE] + angle_t viewangle; fixed_t viewcos; @@ -697,7 +700,10 @@ void R_ExecuteSetViewSize (void) detailshift = setdetail; viewwidth = scaledviewwidth>>detailshift; - centery = viewheight/2; + // villsa [STRIFE] calculate centery from player's pitch + centery = (setblocks*players[consoleplayer].pitch); + centery = (unsigned int)(centery/10)+viewheight/2; + centerx = viewwidth/2; centerxfrac = centerx<<FRACBITS; centeryfrac = centery<<FRACBITS; @@ -823,6 +829,34 @@ R_PointInSubsector return &subsectors[nodenum & ~NF_SUBSECTOR]; } +// +// R_SetupPitch +// villsa [STRIFE] new function +// Calculate centery/centeryfrac for player viewpitch +// + +void R_SetupPitch(player_t* player) +{ + fixed_t pitchfrac; + int i = 0; + + if(viewpitch != player->pitch) + { + viewpitch = player->pitch; + pitchfrac = ((setblocks*player->pitch)/10); + centery = (pitchfrac+viewheight)/2; + centeryfrac = centery<<FRACBITS; + + if(viewheight > 0) + { + for(i = 0; i < viewheight; i++) + { + yslope[i] = FixedDiv(viewwidth/2*FRACUNIT, + abs(((i-centery)<<FRACBITS)+(FRACUNIT/2))); + } + } + } +} // @@ -832,6 +866,8 @@ void R_SetupFrame (player_t* player) { int i; + R_SetupPitch(player); // villsa [STRIFE] + viewplayer = player; viewx = player->mo->x; viewy = player->mo->y; |