raze/source/sw/src/player.h
Mitchell Richters 83936bf5eb Revert "SW: Improve main game loop."
This reverts commit e878c5bab8.

Revert "SW: Use Q16.16 for horiz."

This reverts commit f07a0ae01e.

Revert "SW: Use Q16.16 for angle."

This reverts commit 1ecc74c2ec.

Revert "SW: Minor repairs for Q16.16 implementation."

This reverts commit d78d046bad.

Revert "SW: Process input at frame rate."

This reverts commit c162014dab.

Revert "SW: Amendments to accommodate changes in master."

This reverts commit eaa51138ad.

Revert "SW: Fix incorrectly declared function input type."

This reverts commit 1cdd5b08d8.

Revert "SW: Amend scaleAdjustmentToInterval() with correct value for SW."

This reverts commit d4dd737cd5.

Revert "SW: Refinements to new input code."

This reverts commit 5ebc65a1fb.

Revert "SW: Adjust look and snap up/down keys and slightly tune PLAYER_TURN_AMOUNT."

This reverts commit 2852536dbf.

Revert "SW: Get PLAYER_TURN_SCALE to be just right."

This reverts commit 4630c8a0b7.

Revert "SW: Make map follow mode work better."

This reverts commit 8e94c48eff.

Revert "SW: Remove line accidentally left from 'MoveScrollMode2D()'."

This reverts commit 5db8047b41.

Revert "Fix multiplayer desync after the change to q16 angle and horiz."

This reverts commit 3bc46078b8.

Revert "SW: Revert commented out horiz->q16horiz renames in DSPRINTF strings"

This reverts commit 537313f620.

Revert "sw/src/draw.cpp:drawscreen: We can set the pp->si* fields just once,"

This reverts commit d2e9595980.

Revert "sw/src/game.cpp:LoadLevel: Rename q16ang -> ang"

This reverts commit a178961a3e.

Revert "SW: Minor tweaks."

This reverts commit 377ba68344.

Revert "SW: Further refine turning and optimise horizon adjustment."

This reverts commit 039022d9ac.

Revert "SW: Don't process input at frame rate if ScrollMode2D is true."

This reverts commit 1aa1e62c4d.

Revert "SW: Use a bit more Q16.16 in places."

This reverts commit 40ca656f38.

Revert "SW: Use the old interpolation path in drawscreen if player is dead"

This reverts commit 2d73466425.

Revert "SW: Smooth out 180 degree turn landing and replace some fix16_min/max with fix16_clamp."

This reverts commit 0996e87f79.

Revert "Change Next/Previous Weapon button handling for Shadow Warrior."

This reverts commit f6b8ca6a22.

Revert "SW: Make "Center_View" key return smoothly."

This reverts commit 23c401fbc2.

Revert "SW: Use the old interpolation path in drawscreen if player is dead"

This reverts commit 43ec16eb55.

Revert "Interpolation fixes for SW:"

This reverts commit ac8a7ecfbd.

Revert "SW: Reset the number of interpolations on level load"

This reverts commit 04bf8499e7.

Revert "Another change modifying saved game format in SW:"

This reverts commit e80888523e.

Revert "SW: Interpolate sector objects in non-demo, single player games."

This reverts commit 996ab77cf4.

Revert "- fixed merge errors in SW."

This reverts commit b8cfa94568.

Revert "- fix interpolation stutters when opening console for SW."

This reverts commit 99fdbfb6cb.

Revert "- reset buttonMap button states after returning from pause for SW (stops keys acting stuck down if down prior to pausing)."

This reverts commit 693b6955da.

Revert "SW: fix stupid input scaling bug"

This reverts commit 1c79e6e17c.

Revert "SW: Make vehicle input better."

This reverts commit 670a53c402.

Revert "SW: Change fix16_from_float() to fix16_from_int() that was changed in 4630c8a0b7 but should have been reverted in 377ba68344e34495638c6fa7685ff78c9a0ed6f8."

This reverts commit 423c9da071.

Revert "SW: Remove ScrollMode2D extern boolean and move into PLAYERp struct."

This reverts commit 31eb55c1fa.
2020-05-20 14:43:03 +02:00

149 lines
4.8 KiB
C

//-------------------------------------------------------------------------
/*
Copyright (C) 1997, 2005 - 3D Realms Entertainment
This file is part of Shadow Warrior version 1.2
Shadow Warrior is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Original Source: 1997 - Frank Maddin and Jim Norwood
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/
//-------------------------------------------------------------------------
#ifndef PLAYER_H
#define PLAYER_H
#define PLAYER_HORIZ_MAX 299 // !JIM! was 199 and 5
#define PLAYER_HORIZ_MIN -99 // Had to make plax sky pan up/down like in Duke
// But this is MUCH better!
#define MIN_SWIM_DEPTH 15
// Player view height
#define PLAYER_HEIGHT Z(58)
#define PLAYER_CRAWL_HEIGHT Z(36)
#define PLAYER_SWIM_HEIGHT Z(26)
#define PLAYER_DIVE_HEIGHT Z(26)
#define PLAYER_DIE_DOWN_HEIGHT Z(4)
#define PLAYER_DIE_UP_HEIGHT Z(8)
// step heights - effects floor_dist's
#define PLAYER_STEP_HEIGHT Z(30)
//#define PLAYER_STEP_HEIGHT Z(34)
//#define PLAYER_STEP_HEIGHT Z(38)
#define PLAYER_CRAWL_STEP_HEIGHT Z(8)
#define PLAYER_SWIM_STEP_HEIGHT Z(8)
#define PLAYER_DIVE_STEP_HEIGHT Z(8)
//#define PLAYER_JUMP_STEP_HEIGHT Z(16)
//#define PLAYER_FALL_STEP_HEIGHT Z(16)
//#define PLAYER_JUMP_STEP_HEIGHT Z(34)
//#define PLAYER_FALL_STEP_HEIGHT Z(24)
#define PLAYER_JUMP_STEP_HEIGHT Z(48)
#define PLAYER_FALL_STEP_HEIGHT Z(24)
// FLOOR_DIST variables are the difference in the Players view and the sector floor.
// Must be at LEAST this distance or you cannot move onto sector.
#define PLAYER_RUN_FLOOR_DIST (PLAYER_HEIGHT - PLAYER_STEP_HEIGHT)
#define PLAYER_CRAWL_FLOOR_DIST (PLAYER_CRAWL_HEIGHT - PLAYER_CRAWL_STEP_HEIGHT)
#define PLAYER_WADE_FLOOR_DIST (PLAYER_HEIGHT - PLAYER_STEP_HEIGHT)
#define PLAYER_JUMP_FLOOR_DIST (PLAYER_HEIGHT - PLAYER_JUMP_STEP_HEIGHT)
#define PLAYER_FALL_FLOOR_DIST (PLAYER_HEIGHT - PLAYER_FALL_STEP_HEIGHT)
#define PLAYER_SWIM_FLOOR_DIST (PLAYER_SWIM_HEIGHT - PLAYER_SWIM_STEP_HEIGHT)
#define PLAYER_DIVE_FLOOR_DIST (PLAYER_DIVE_HEIGHT - PLAYER_DIVE_STEP_HEIGHT)
// FLOOR_DIST variables are the difference in the Players view and the sector floor.
// Must be at LEAST this distance or you cannot move onto sector.
#define PLAYER_RUN_CEILING_DIST Z(10)
#define PLAYER_SWIM_CEILING_DIST (Z(12))
#define PLAYER_DIVE_CEILING_DIST (Z(22))
#define PLAYER_CRAWL_CEILING_DIST (Z(12))
#define PLAYER_JUMP_CEILING_DIST Z(4)
#define PLAYER_FALL_CEILING_DIST Z(4)
#define PLAYER_WADE_CEILING_DIST Z(4)
//
// DIVE
//
#define PLAYER_DIVE_MAX_SPEED (1700)
#define PLAYER_DIVE_INC (600)
#define PLAYER_DIVE_BOB_AMT (Z(8))
#define PLAYER_DIVE_TIME (12*120) // time before damage is taken
#define PLAYER_DIVE_DAMAGE_AMOUNT (-1) // amount of damage accessed
#define PLAYER_DIVE_DAMAGE_TIME (50) // time between damage accessment
//
// FLY
//
#define PLAYER_FLY_MAX_SPEED (2560)
#define PLAYER_FLY_INC (1000)
#define PLAYER_FLY_BOB_AMT (Z(12))
// Height from which Player will actually call DoPlayerBeginFall()
//#define PLAYER_FALL_HEIGHT Z(16)
#define PLAYER_FALL_HEIGHT Z(28)
#define PLAYER_FALL_DAMAGE_AMOUNT (10)
//
// DEATH
//
// dead head height - used in DeathFall
#define PLAYER_DEATH_HEIGHT (Z(16))
#define PLAYER_DEAD_HEAD_FLOORZ_OFFSET (Z(7))
//#define PLAYER_NINJA_XREPEAT (56)
//#define PLAYER_NINJA_YREPEAT (56)
#define PLAYER_NINJA_XREPEAT (47)
#define PLAYER_NINJA_YREPEAT (33)
BEGIN_SW_NS
int SetVisHigh(void);
int SetVisNorm(void);
void DoWeapon(void);
void HeadBobStateControl(void);
int DoPickTarget(SPRITEp sp, uint32_t max_delta_ang, SWBOOL skip_targets);
void DoPlayer(void);
void domovethings(void);
void InitAllPlayers(void);
void InitMultiPlayerInfo(void);
void MoveScrollMode2D(PLAYERp pp);
void DoPlayerDivePalette(PLAYERp pp);
void DoPlayerNightVisionPalette(PLAYERp pp);
void DoPlayerStopDiveNoWarp(PLAYERp pp);
void DoPlayerResetMovement(PLAYERp pp);
void DoPlayerZrange(PLAYERp pp);
void DoPlayerSpriteThrow(PLAYERp pp);
int DoPlayerWadeSuperJump(PLAYERp pp);
void DoPlayerWarpTeleporter(PLAYERp pp);
void UpdatePlayerSprite(PLAYERp pp);
void PlaySOsound(short sectnum,short sound_num);
void DoSpawnTeleporterEffectPlace(SPRITEp sp);
void FindMainSector(SECTOR_OBJECTp sop);
END_SW_NS
#endif