mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-04 19:20:53 +00:00
* Updated to ZDoom r3328:
- Fixed: Pressing a key to advance an intermission screen only worked on the local computer. - Be less verbose when attempting to play non-ZDoom demos. - Do nothing in D_DoAdvanceDemo if gameaction is not ga_nothing. - Need to bump demo/gameversion due to DEM_SETPITCHLIMIT. MINDEMOVERSION also needs to be touched, since the default limits are now 0. - A_SetPitch now clamps the player's pitch within the valid range. It can be made to clamp other actors' pitches to within the range (-90,+90) degrees with the SPF_FORCECLAMP flag. - Transmit the local viewpitch limits to the other players. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1271 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
5158bd57d2
commit
ddc9ca3f4f
18 changed files with 114 additions and 25 deletions
|
@ -1225,12 +1225,17 @@ void D_DoAdvanceDemo (void)
|
|||
static int pagecount;
|
||||
const char *pagename = NULL;
|
||||
|
||||
advancedemo = false;
|
||||
|
||||
if (gameaction != ga_nothing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
V_SetBlend (0,0,0,0);
|
||||
players[consoleplayer].playerstate = PST_LIVE; // not reborn
|
||||
advancedemo = false;
|
||||
usergame = false; // no save / end game here
|
||||
paused = 0;
|
||||
gameaction = ga_nothing;
|
||||
|
||||
// [RH] If you want something more dynamic for your title, create a map
|
||||
// and name it TITLEMAP. That map will be loaded and used as the title.
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include "m_argv.h"
|
||||
#include "p_lnspec.h"
|
||||
#include "v_video.h"
|
||||
#include "intermission/intermission.h"
|
||||
|
||||
int P_StartScript (AActor *who, line_t *where, int script, char *map, bool backSide,
|
||||
int arg0, int arg1, int arg2, int always, bool wantResultCode, bool net);
|
||||
|
@ -748,6 +749,7 @@ void GetPackets (void)
|
|||
}
|
||||
|
||||
if (netbuffer[0] & NCMD_QUITTERS)
|
||||
|
||||
{
|
||||
numplayers = netbuffer[k++];
|
||||
for (int i = 0; i < numplayers; ++i)
|
||||
|
@ -2450,6 +2452,15 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
}
|
||||
break;
|
||||
|
||||
case DEM_SETPITCHLIMIT:
|
||||
players[player].MinPitch = ReadByte(stream) * -ANGLE_1; // up
|
||||
players[player].MaxPitch = ReadByte(stream) * ANGLE_1; // down
|
||||
break;
|
||||
|
||||
case DEM_ADVANCEINTER:
|
||||
F_AdvanceIntermission();
|
||||
break;
|
||||
|
||||
default:
|
||||
I_Error ("Unknown net command: %d", type);
|
||||
break;
|
||||
|
@ -2570,6 +2581,9 @@ void Net_SkipCommand (int type, BYTE **stream)
|
|||
skip = 2 + ((*stream)[1] >> 7);
|
||||
break;
|
||||
|
||||
case DEM_SETPITCHLIMIT:
|
||||
skip = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
|
|
|
@ -282,6 +282,7 @@ public:
|
|||
|
||||
bool centering;
|
||||
BYTE turnticks;
|
||||
|
||||
bool attackdown;
|
||||
bool usedown;
|
||||
DWORD oldbuttons;
|
||||
|
@ -342,9 +343,9 @@ public:
|
|||
|
||||
|
||||
TObjPtr<AActor> enemy; // The dead meat.
|
||||
TObjPtr<AActor> missile; // A threathing missile that got to be avoided.
|
||||
TObjPtr<AActor> mate; // Friend (used for grouping in templay or coop.
|
||||
TObjPtr<AActor> last_mate; // If bots mate dissapeared (not if died) that mate is
|
||||
TObjPtr<AActor> missile; // A threatening missile that needs to be avoided.
|
||||
TObjPtr<AActor> mate; // Friend (used for grouping in teamplay or coop).
|
||||
TObjPtr<AActor> last_mate; // If bots mate disappeared (not if died) that mate is
|
||||
// pointed to by this. Allows bot to roam to it if
|
||||
// necessary.
|
||||
|
||||
|
@ -380,6 +381,9 @@ public:
|
|||
|
||||
FString LogText; // [RH] Log for Strife
|
||||
|
||||
int MinPitch; // Viewpitch limits (negative is up, positive is down)
|
||||
int MaxPitch;
|
||||
|
||||
SBYTE crouching;
|
||||
SBYTE crouchdir;
|
||||
fixed_t crouchfactor;
|
||||
|
|
|
@ -159,6 +159,8 @@ enum EDemoCommand
|
|||
DEM_CONVCLOSE, // 60
|
||||
DEM_CONVNULL, // 61
|
||||
DEM_RUNSPECIAL, // 62 Byte: Special number, Byte: Arg count, Ints: Args
|
||||
DEM_SETPITCHLIMIT, // 63 Byte: Up limit, Byte: Down limit (in degrees)
|
||||
DEM_ADVANCEINTER, // 64 Advance intermission screen state
|
||||
};
|
||||
|
||||
// The following are implemented by cht_DoCheat in m_cheat.cpp
|
||||
|
|
|
@ -2534,7 +2534,7 @@ void G_DoPlayDemo (void)
|
|||
|
||||
if (ReadLong (&demo_p) != FORM_ID)
|
||||
{
|
||||
const char *eek = "Cannot play non-ZDoom demos.\n(They would go out of sync badly.)\n";
|
||||
const char *eek = "Cannot play non-ZDoom demos.\n";
|
||||
|
||||
C_ForgetCVars();
|
||||
M_Free(demobuffer);
|
||||
|
|
|
@ -1151,8 +1151,8 @@ EXTERN_CVAR(Float, maxviewpitch)
|
|||
|
||||
int FGLInterface::GetMaxViewPitch(bool down)
|
||||
{
|
||||
if (netgame) return down? MAX_DN_ANGLE*ANGLE_1 : -MAX_UP_ANGLE*ANGLE_1;
|
||||
else return (down? maxviewpitch : -maxviewpitch) * ANGLE_1;
|
||||
if (netgame) return down? MAX_DN_ANGLE : -MAX_UP_ANGLE;
|
||||
else return down? maxviewpitch : -maxviewpitch;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "g_level.h"
|
||||
#include "p_conversation.h"
|
||||
#include "menu/menu.h"
|
||||
#include "d_net.h"
|
||||
|
||||
FIntermissionDescriptorList IntermissionDescriptors;
|
||||
|
||||
|
@ -769,7 +770,11 @@ bool DIntermissionController::Responder (event_t *ev)
|
|||
|
||||
if (mScreen->mTicker < 2) return false; // prevent some leftover events from auto-advancing
|
||||
int res = mScreen->Responder(ev);
|
||||
mAdvance = (res == -1);
|
||||
if (res == -1 && !mSentAdvance)
|
||||
{
|
||||
Net_WriteByte(DEM_ADVANCEINTER);
|
||||
mSentAdvance = true;
|
||||
}
|
||||
return !!res;
|
||||
}
|
||||
return false;
|
||||
|
@ -777,6 +782,10 @@ bool DIntermissionController::Responder (event_t *ev)
|
|||
|
||||
void DIntermissionController::Ticker ()
|
||||
{
|
||||
if (mAdvance)
|
||||
{
|
||||
mSentAdvance = false;
|
||||
}
|
||||
if (mScreen != NULL)
|
||||
{
|
||||
mAdvance |= (mScreen->Ticker() == -1);
|
||||
|
@ -926,3 +935,18 @@ void F_EndFinale ()
|
|||
DIntermissionController::CurrentIntermission = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Called by net loop.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void F_AdvanceIntermission()
|
||||
{
|
||||
if (DIntermissionController::CurrentIntermission != NULL)
|
||||
{
|
||||
DIntermissionController::CurrentIntermission->mAdvance = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ class DIntermissionController : public DObject
|
|||
TObjPtr<DIntermissionScreen> mScreen;
|
||||
bool mDeleteDesc;
|
||||
bool mFirst;
|
||||
bool mAdvance;
|
||||
bool mAdvance, mSentAdvance;
|
||||
BYTE mGameState;
|
||||
int mIndex;
|
||||
|
||||
|
@ -302,6 +302,8 @@ public:
|
|||
void Ticker ();
|
||||
void Drawer ();
|
||||
void Destroy();
|
||||
|
||||
friend void F_AdvanceIntermission();
|
||||
};
|
||||
|
||||
|
||||
|
@ -312,6 +314,7 @@ void F_Drawer ();
|
|||
void F_StartIntermission(FIntermissionDescriptor *desc, bool deleteme, BYTE state);
|
||||
void F_StartIntermission(FName desc, BYTE state);
|
||||
void F_EndFinale ();
|
||||
void F_AdvanceIntermission();
|
||||
|
||||
// Create an intermission from old cluster data
|
||||
void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int cdid, const char *flat,
|
||||
|
|
|
@ -2783,6 +2783,7 @@ void AActor::Tick ()
|
|||
static const BYTE HereticScrollDirs[4] = { 6, 9, 1, 4 };
|
||||
static const BYTE HereticSpeedMuls[5] = { 5, 10, 25, 30, 35 };
|
||||
|
||||
|
||||
AActor *onmo;
|
||||
int i;
|
||||
|
||||
|
@ -4027,6 +4028,7 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
|
|||
p->BlendR = p->BlendG = p->BlendB = p->BlendA = 0.f;
|
||||
p->mo->ResetAirSupply(false);
|
||||
p->Uncrouch();
|
||||
p->MinPitch = p->MaxPitch = 0; // will be filled in by PostBeginPlay()/netcode
|
||||
|
||||
p->velx = p->vely = 0; // killough 10/98: initialize bobbing to 0.
|
||||
|
||||
|
|
|
@ -522,6 +522,14 @@ void APlayerPawn::PostBeginPlay()
|
|||
P_FindFloorCeiling(this, true);
|
||||
z = floorz;
|
||||
}
|
||||
else if (player - players == consoleplayer)
|
||||
{
|
||||
// Ask the local player's renderer what pitch restrictions
|
||||
// should be imposed and let everybody know.
|
||||
Net_WriteByte(DEM_SETPITCHLIMIT);
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(false)); // up
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(true)); // down
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -2213,11 +2221,11 @@ void P_PlayerThink (player_t *player)
|
|||
player->mo->pitch -= look;
|
||||
if (look > 0)
|
||||
{ // look up
|
||||
player->mo->pitch = MAX(player->mo->pitch, Renderer->GetMaxViewPitch(false));
|
||||
player->mo->pitch = MAX(player->mo->pitch, player->MinPitch);
|
||||
}
|
||||
else
|
||||
{ // look down
|
||||
player->mo->pitch = MIN(player->mo->pitch, Renderer->GetMaxViewPitch(true));
|
||||
player->mo->pitch = MIN(player->mo->pitch, player->MaxPitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ struct FRenderer
|
|||
virtual void StartSerialize(FArchive &arc) {}
|
||||
virtual void EndSerialize(FArchive &arc) {}
|
||||
|
||||
virtual int GetMaxViewPitch(bool down) = 0;
|
||||
virtual int GetMaxViewPitch(bool down) = 0; // return value is in plain degrees
|
||||
|
||||
virtual void OnModeSet () {}
|
||||
virtual void ErrorCleanup () {}
|
||||
|
|
|
@ -173,7 +173,7 @@ void FSoftwareRenderer::DrawRemainingPlayerSprites()
|
|||
|
||||
int FSoftwareRenderer::GetMaxViewPitch(bool down)
|
||||
{
|
||||
return down? MAX_DN_ANGLE*ANGLE_1 : -MAX_UP_ANGLE*ANGLE_1;
|
||||
return down ? MAX_DN_ANGLE : MAX_UP_ANGLE;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -601,11 +601,11 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
|
|||
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
|
||||
if (viewpitch + delta <= viewpitch)
|
||||
{
|
||||
viewpitch = Renderer->GetMaxViewPitch(true);
|
||||
viewpitch = player->MaxPitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewpitch = MIN(viewpitch + delta, Renderer->GetMaxViewPitch(true));
|
||||
viewpitch = MIN(viewpitch + delta, player->MaxPitch);
|
||||
}
|
||||
}
|
||||
else if (delta < 0)
|
||||
|
@ -613,11 +613,11 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
|
|||
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
|
||||
if (viewpitch + delta >= viewpitch)
|
||||
{
|
||||
viewpitch = Renderer->GetMaxViewPitch(false);
|
||||
viewpitch = player->MinPitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewpitch = MAX(viewpitch + delta, Renderer->GetMaxViewPitch(false));
|
||||
viewpitch = MAX(viewpitch + delta, player->MinPitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
// This file was automatically generated by the
|
||||
// updaterevision tool. Do not edit by hand.
|
||||
|
||||
#define ZD_SVN_REVISION_STRING "3322"
|
||||
#define ZD_SVN_REVISION_NUMBER 3322
|
||||
#define ZD_SVN_REVISION_STRING "3328"
|
||||
#define ZD_SVN_REVISION_NUMBER 3328
|
||||
|
|
|
@ -3416,10 +3416,34 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
enum
|
||||
{
|
||||
SPF_FORCECLAMP = 1, // players always clamp
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_ANGLE(pitch, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
if (self->player != NULL || (flags & SPF_FORCECLAMP))
|
||||
{ // clamp the pitch we set
|
||||
int min, max;
|
||||
|
||||
if (self->player != NULL)
|
||||
{
|
||||
min = self->player->MinPitch;
|
||||
max = self->player->MaxPitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
||||
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
||||
}
|
||||
pitch = clamp<int>(pitch, min, max);
|
||||
}
|
||||
|
||||
self->pitch = pitch;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
// Version identifier for network games.
|
||||
// Bump it every time you do a release unless you're certain you
|
||||
// didn't change anything that will affect sync.
|
||||
#define NETGAMEVERSION 224
|
||||
#define NETGAMEVERSION 225
|
||||
|
||||
// Version stored in the ini's [LastRun] section.
|
||||
// Bump it if you made some configuration change that you want to
|
||||
|
@ -66,11 +66,11 @@
|
|||
// Protocol version used in demos.
|
||||
// Bump it if you change existing DEM_ commands or add new ones.
|
||||
// Otherwise, it should be safe to leave it alone.
|
||||
#define DEMOGAMEVERSION 0x214
|
||||
#define DEMOGAMEVERSION 0x216
|
||||
|
||||
// Minimum demo version we can play.
|
||||
// Bump it whenever you change or remove existing DEM_ commands.
|
||||
#define MINDEMOVERSION 0x213
|
||||
#define MINDEMOVERSION 0x215
|
||||
|
||||
// SAVEVER is the version of the information stored in level snapshots.
|
||||
// Note that SAVEVER is not directly comparable to VERSION.
|
||||
|
|
|
@ -278,7 +278,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_PigPain ();
|
||||
action native A_MonsterRefire(int chance, state label);
|
||||
action native A_SetAngle(float angle = 0);
|
||||
action native A_SetPitch(float pitch);
|
||||
action native A_SetPitch(float pitch, int flags = 0);
|
||||
action native A_ScaleVelocity(float scale);
|
||||
action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0);
|
||||
action native A_SetArg(int pos, int value);
|
||||
|
|
|
@ -257,5 +257,8 @@ Const Int WARPF_STOP = 0x80;
|
|||
Const Int WARPF_TOFLOOR = 0x100;
|
||||
Const Int WARPF_TESTONLY = 0x200;
|
||||
|
||||
// flags for A_SetPitch
|
||||
const int SPF_FORCECLAMP = 1;
|
||||
|
||||
// This is only here to provide one global variable for testing.
|
||||
native int testglobalvar;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue