- Fixed: Pressing a key to advance an intermission screen only worked on

the local computer.



SVN r3328 (trunk)
This commit is contained in:
Randy Heit 2011-12-06 02:51:32 +00:00
parent 2f8d6beb1e
commit 8e8331d44c
5 changed files with 37 additions and 3 deletions

View file

@ -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)
@ -2455,6 +2457,10 @@ void Net_DoCommand (int type, BYTE **stream, int player)
players[player].MaxPitch = ReadByte(stream) * ANGLE_1; // down
break;
case DEM_ADVANCEINTER:
F_AdvanceIntermission();
break;
default:
I_Error ("Unknown net command: %d", type);
break;

View file

@ -160,6 +160,7 @@ enum EDemoCommand
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

View file

@ -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;
}
}

View file

@ -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,

View file

@ -64,7 +64,7 @@
// 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 0x215
#define DEMOGAMEVERSION 0x216
// Minimum demo version we can play.
// Bump it whenever you change or remove existing DEM_ commands.