mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-22 18:51:05 +00:00
Support for D3 demo data files (minimum viable changes)
This commit is contained in:
parent
53e0db9f41
commit
12629e1f66
5 changed files with 25 additions and 7 deletions
|
@ -29,6 +29,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "sys/platform.h"
|
||||
#include "framework/DeclEntityDef.h"
|
||||
#include "framework/DeclSkin.h"
|
||||
#include "framework/Session.h"
|
||||
|
||||
#include "gamesys/SysCvar.h"
|
||||
#include "ai/AI.h"
|
||||
|
@ -465,7 +466,8 @@ void idWeapon::Restore( idRestoreGame *savefile ) {
|
|||
WEAPON_RELOAD.LinkTo( scriptObject, "WEAPON_RELOAD" );
|
||||
WEAPON_NETRELOAD.LinkTo( scriptObject, "WEAPON_NETRELOAD" );
|
||||
WEAPON_NETENDRELOAD.LinkTo( scriptObject, "WEAPON_NETENDRELOAD" );
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
if (!session->demoversion)
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
WEAPON_RAISEWEAPON.LinkTo( scriptObject, "WEAPON_RAISEWEAPON" );
|
||||
WEAPON_LOWERWEAPON.LinkTo( scriptObject, "WEAPON_LOWERWEAPON" );
|
||||
|
||||
|
@ -693,7 +695,8 @@ void idWeapon::Clear( void ) {
|
|||
WEAPON_RELOAD.Unlink();
|
||||
WEAPON_NETRELOAD.Unlink();
|
||||
WEAPON_NETENDRELOAD.Unlink();
|
||||
WEAPON_NETFIRING.Unlink();
|
||||
if (!session->demoversion)
|
||||
WEAPON_NETFIRING.Unlink();
|
||||
WEAPON_RAISEWEAPON.Unlink();
|
||||
WEAPON_LOWERWEAPON.Unlink();
|
||||
|
||||
|
@ -1177,7 +1180,8 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
|
|||
WEAPON_RELOAD.LinkTo( scriptObject, "WEAPON_RELOAD" );
|
||||
WEAPON_NETRELOAD.LinkTo( scriptObject, "WEAPON_NETRELOAD" );
|
||||
WEAPON_NETENDRELOAD.LinkTo( scriptObject, "WEAPON_NETENDRELOAD" );
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
if (!session->demoversion)
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
WEAPON_RAISEWEAPON.LinkTo( scriptObject, "WEAPON_RAISEWEAPON" );
|
||||
WEAPON_LOWERWEAPON.LinkTo( scriptObject, "WEAPON_LOWERWEAPON" );
|
||||
|
||||
|
|
|
@ -374,6 +374,8 @@ idSessionLocal::idSessionLocal() {
|
|||
|
||||
menuSoundWorld = NULL;
|
||||
|
||||
demoversion=false;
|
||||
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
@ -2891,6 +2893,10 @@ void idSessionLocal::Init() {
|
|||
|
||||
// we have a single instance of the main menu
|
||||
guiMainMenu = uiManager->FindGui( "guis/mainmenu.gui", true, false, true );
|
||||
if (!guiMainMenu) {
|
||||
guiMainMenu = uiManager->FindGui( "guis/demo_mainmenu.gui", true, false, true );
|
||||
demoversion = true;
|
||||
}
|
||||
guiMainMenu_MapList = uiManager->AllocListGUI();
|
||||
guiMainMenu_MapList->Config( guiMainMenu, "mapList" );
|
||||
idAsyncNetwork::client.serverList.GUIConfig( guiMainMenu, "serverList" );
|
||||
|
|
|
@ -165,6 +165,9 @@ public:
|
|||
idDemoFile * readDemo;
|
||||
idDemoFile * writeDemo;
|
||||
int renderdemoVersion;
|
||||
|
||||
public:
|
||||
bool demoversion;
|
||||
};
|
||||
|
||||
extern idSession * session;
|
||||
|
|
|
@ -29,6 +29,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "sys/platform.h"
|
||||
#include "framework/DeclEntityDef.h"
|
||||
#include "framework/DeclSkin.h"
|
||||
#include "framework/Session.h"
|
||||
|
||||
#include "gamesys/SysCvar.h"
|
||||
#include "ai/AI.h"
|
||||
|
@ -398,7 +399,8 @@ void idWeapon::Restore( idRestoreGame *savefile ) {
|
|||
WEAPON_RELOAD.LinkTo( scriptObject, "WEAPON_RELOAD" );
|
||||
WEAPON_NETRELOAD.LinkTo( scriptObject, "WEAPON_NETRELOAD" );
|
||||
WEAPON_NETENDRELOAD.LinkTo( scriptObject, "WEAPON_NETENDRELOAD" );
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
if (!session->demoversion)
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
WEAPON_RAISEWEAPON.LinkTo( scriptObject, "WEAPON_RAISEWEAPON" );
|
||||
WEAPON_LOWERWEAPON.LinkTo( scriptObject, "WEAPON_LOWERWEAPON" );
|
||||
|
||||
|
@ -552,7 +554,8 @@ void idWeapon::Clear( void ) {
|
|||
WEAPON_RELOAD.Unlink();
|
||||
WEAPON_NETRELOAD.Unlink();
|
||||
WEAPON_NETENDRELOAD.Unlink();
|
||||
WEAPON_NETFIRING.Unlink();
|
||||
if (!session->demoversion)
|
||||
WEAPON_NETFIRING.Unlink();
|
||||
WEAPON_RAISEWEAPON.Unlink();
|
||||
WEAPON_LOWERWEAPON.Unlink();
|
||||
|
||||
|
@ -995,7 +998,8 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
|
|||
WEAPON_RELOAD.LinkTo( scriptObject, "WEAPON_RELOAD" );
|
||||
WEAPON_NETRELOAD.LinkTo( scriptObject, "WEAPON_NETRELOAD" );
|
||||
WEAPON_NETENDRELOAD.LinkTo( scriptObject, "WEAPON_NETENDRELOAD" );
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
if (!session->demoversion)
|
||||
WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" );
|
||||
WEAPON_RAISEWEAPON.LinkTo( scriptObject, "WEAPON_RAISEWEAPON" );
|
||||
WEAPON_LOWERWEAPON.LinkTo( scriptObject, "WEAPON_LOWERWEAPON" );
|
||||
|
||||
|
|
|
@ -389,7 +389,8 @@ void idChoiceWindow::PostParse() {
|
|||
}
|
||||
}
|
||||
else if( idStr::Cmp(GetName(), "OS2Primary") == 0 && cvarStr == "r_mode"
|
||||
&& idStr::Icmp(GetGui()->GetSourceFile(), "guis/mainmenu.gui") == 0 )
|
||||
&& ( idStr::Icmp(GetGui()->GetSourceFile(), "guis/demo_mainmenu.gui") == 0 ||
|
||||
idStr::Icmp(GetGui()->GetSourceFile(), "guis/mainmenu.gui") == 0 ) )
|
||||
{
|
||||
// always enable this for base/ and d3xp/ mainmenu.gui (like we did before)
|
||||
injectResolutions = true;
|
||||
|
|
Loading…
Reference in a new issue