Skip to content

Commit

Permalink
Delete no_single.h and NO_SINGLE macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Nov 11, 2015
1 parent 77ba564 commit 6027cb1
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 72 deletions.
2 changes: 0 additions & 2 deletions src/xrEngine/no_single.h

This file was deleted.

44 changes: 13 additions & 31 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "stdafx.h"
#include "IGame_Level.h"
#include "IGame_Persistent.h"
#include "no_single.h"
#include "xrNetServer/NET_AuthCheck.h"

#include "xr_input.h"
Expand Down Expand Up @@ -1027,36 +1026,19 @@ void CApplication::OnEvent(EVENT E, u64 P1, u64 P2)
Level_Current = u32(-1);
R_ASSERT(0 == g_pGameLevel);
R_ASSERT(0 != g_pGamePersistent);

#ifdef NO_SINGLE
Console->Execute("main_menu on");
if ((op_server == NULL) ||
(!xr_strlen(op_server)) ||
(
(strstr(op_server, "/dm") || strstr(op_server, "/deathmatch") ||
strstr(op_server, "/tdm") || strstr(op_server, "/teamdeathmatch") ||
strstr(op_server, "/ah") || strstr(op_server, "/artefacthunt") ||
strstr(op_server, "/cta") || strstr(op_server, "/capturetheartefact")
) &&
!strstr(op_server, "/alife")
)
)
#endif // #ifdef NO_SINGLE
{
Console->Execute("main_menu off");
Console->Hide();
//! this line is commented by Dima
//! because I don't see any reason to reset device here
//! Device.Reset (false);
//-----------------------------------------------------------
g_pGamePersistent->PreStart(op_server);
//-----------------------------------------------------------
g_pGameLevel = (IGame_Level*)NEW_INSTANCE(CLSID_GAME_LEVEL);
pApp->LoadBegin();
g_pGamePersistent->Start(op_server);
g_pGameLevel->net_Start(op_server, op_client);
pApp->LoadEnd();
}
Console->Execute("main_menu off");
Console->Hide();
//! this line is commented by Dima
//! because I don't see any reason to reset device here
//! Device.Reset (false);
//-----------------------------------------------------------
g_pGamePersistent->PreStart(op_server);
//-----------------------------------------------------------
g_pGameLevel = (IGame_Level*)NEW_INSTANCE(CLSID_GAME_LEVEL);
pApp->LoadBegin();
g_pGamePersistent->Start(op_server);
g_pGameLevel->net_Start(op_server, op_client);
pApp->LoadEnd();
xr_free(op_server);
xr_free(op_client);
}
Expand Down
1 change: 0 additions & 1 deletion src/xrEngine/xrEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@
<ClInclude Include="line_editor.h" />
<ClInclude Include="line_edit_control.h" />
<ClInclude Include="mp_logging.h" />
<ClInclude Include="no_single.h" />
<ClInclude Include="ObjectAnimator.h" />
<ClInclude Include="ObjectDump.h" />
<ClInclude Include="PerformanceAlert.hpp" />
Expand Down
3 changes: 0 additions & 3 deletions src/xrEngine/xrEngine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@
<ClInclude Include="mp_logging.h">
<Filter>General</Filter>
</ClInclude>
<ClInclude Include="no_single.h">
<Filter>General</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>General</Filter>
</ClInclude>
Expand Down
1 change: 0 additions & 1 deletion src/xrGame/UIDialogHolder.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#include "xrEngine/no_single.h"

class CUIDialogWnd;
class CUIWindow;
Expand Down
5 changes: 0 additions & 5 deletions src/xrGame/ai_space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "alife_simulator.h"
#include "moving_objects.h"
#include "doors_manager.h"
#include "xrEngine/no_single.h"

ENGINE_API bool g_dedicated_server;

Expand All @@ -45,8 +44,6 @@ void CAI_Space::init ()
{
if (g_dedicated_server)
return;

#ifndef NO_SINGLE
VERIFY (!m_ef_storage);
m_ef_storage = xr_new<CEF_Storage>();

Expand All @@ -61,8 +58,6 @@ void CAI_Space::init ()

VERIFY (!m_moving_objects);
m_moving_objects = xr_new<::moving_objects>();

#endif //#ifndef NO_SINGLE
RegisterScriptClasses();
object_factory().register_script();
LoadCommonScripts();
Expand Down
5 changes: 0 additions & 5 deletions src/xrGame/game_sv_single.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "gamepersistent.h"
#include "xrServer.h"
#include "xrEngine/x_ray.h"
#include "xrEngine/no_single.h"

game_sv_Single::game_sv_Single ()
{
Expand All @@ -25,12 +24,8 @@ game_sv_Single::~game_sv_Single ()
void game_sv_Single::Create (shared_str& options)
{
inherited::Create (options);

#ifndef NO_SINGLE
if (strstr(*options,"/alife"))
m_alife_simulator = xr_new<CALifeSimulator>(&server(),&options);
#endif //#ifndef NO_SINGLE

switch_Phase (GAME_PHASE_INPROGRESS);
}

Expand Down
1 change: 0 additions & 1 deletion src/xrGame/gamespy/GameSpy_Patching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "GameSpy_Base_Defs.h"
#include "MainMenu.h"
#include "xrGameSpy/xrGameSpy_MainDefs.h"
#include "xrEngine/no_single.h"

CGameSpy_Patching::CGameSpy_Patching()
{
Expand Down
25 changes: 2 additions & 23 deletions src/xrServerEntities/object_factory_register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,15 @@ void CObjectFactory::register_classes ()
add<CGamePersistent> (CLSID_GAME_PERSISTANT ,"game");
add<CHUDManager> (CLSID_HUDMANAGER ,"hud_manager");
//Server Game type

#ifndef NO_SINGLE
add<game_sv_Single> (CLSID_SV_GAME_SINGLE ,"game_sv_single");
#endif // #ifndef NO_SINGLE
#ifndef BENCHMARK_BUILD
add<game_sv_Deathmatch> (CLSID_SV_GAME_DEATHMATCH ,"game_sv_deathmatch");
add<game_sv_TeamDeathmatch> (CLSID_SV_GAME_TEAMDEATHMATCH ,"game_sv_team_deathmatch");
add<game_sv_ArtefactHunt> (CLSID_SV_GAME_ARTEFACTHUNT ,"game_sv_artefact_hunt");
add<game_sv_CaptureTheArtefact> (CLSID_SV_GAME_CAPTURETHEARTEFACT ,"game_sv_capture_the_artefact");
#endif // BENCHMARK_BUILD
//Client Game type
#ifndef NO_SINGLE
add<game_cl_Single> (CLSID_CL_GAME_SINGLE ,"game_cl_single");
#endif // #ifndef NO_SINGLE
#ifndef BENCHMARK_BUILD
add<game_cl_Deathmatch> (CLSID_CL_GAME_DEATHMATCH ,"game_cl_deathmatch");
add<game_cl_TeamDeathmatch> (CLSID_CL_GAME_TEAMDEATHMATCH ,"game_cl_team_deathmatch");
Expand All @@ -223,28 +218,18 @@ void CObjectFactory::register_classes ()
add<CUIGameTDM> (CLSID_GAME_UI_TEAMDEATHMATCH ,"game_ui_team_deathmatch");
add<CUIGameAHunt> (CLSID_GAME_UI_ARTEFACTHUNT ,"game_ui_artefact_hunt");
add<CUIGameCTA> (CLSID_GAME_UI_CAPTURETHEARTEFACT ,"game_ui_capture_the_artefact");

# ifndef NO_SINGLE
ADD_MP(CActor,CActorMP,CSE_ALifeCreatureActor,CSE_ActorMP ,CLSID_OBJECT_ACTOR ,"actor");
# else // #ifndef NO_SINGLE
ADD(CActorMP,CSE_ActorMP ,CLSID_OBJECT_ACTOR ,"actor");
# endif // #ifndef NO_SINGLE
ADD_MP(CActor,CActorMP,CSE_ALifeCreatureActor,CSE_ActorMP ,CLSID_OBJECT_ACTOR ,"actor");
#else // NO_XR_GAME
ADD(CActor ,CSE_ALifeCreatureActor ,CLSID_OBJECT_ACTOR ,"actor");
#endif // NO_XR_GAME

// server entities
#ifndef NO_SINGLE
add<CSE_ALifeGroupTemplate<CSE_ALifeMonsterBase> > (CLSID_AI_FLESH_GROUP ,"flesh_group");
// add<CSE_SpawnGroup> (CLSID_AI_SPAWN_GROUP ,"spawn_group");
add<CSE_ALifeGraphPoint> (CLSID_AI_GRAPH ,"graph_point");
add<CSE_ALifeOnlineOfflineGroup> (CLSID_ONLINE_OFFLINE_GROUP ,"online_offline_group");
#endif // #ifndef NO_SINGLE

add<CSE_ALifeOnlineOfflineGroup> (CLSID_ONLINE_OFFLINE_GROUP ,"online_offline_group");
// client and server entities
ADD(CSpectator ,CSE_Spectator ,CLSID_SPECTATOR ,"spectator");

#ifndef NO_SINGLE
ADD(CAI_Flesh ,CSE_ALifeMonsterBase ,CLSID_AI_FLESH ,"flesh");
ADD(CChimera ,CSE_ALifeMonsterBase ,CLSID_AI_CHIMERA ,"chimera");
ADD(CAI_Dog ,CSE_ALifeMonsterBase ,CLSID_AI_DOG_RED ,"dog_red");
Expand Down Expand Up @@ -274,8 +259,6 @@ void CObjectFactory::register_classes ()
ADD(CCar ,CSE_ALifeCar ,CLSID_CAR ,"car");

ADD(CHelicopter ,CSE_ALifeHelicopter ,CLSID_VEHICLE_HELICOPTER ,"helicopter");
#endif // #ifndef NO_SINGLE

// Artefacts
ADD(CMercuryBall ,CSE_ALifeItemArtefact ,CLSID_AF_MERCURY_BALL ,"art_mercury_ball");
ADD(CBlackDrops ,CSE_ALifeItemArtefact ,CLSID_AF_BLACKDROPS ,"art_black_drops");
Expand Down Expand Up @@ -331,9 +314,7 @@ void CObjectFactory::register_classes ()
ADD(CGrenadeLauncher ,CSE_ALifeItem ,CLSID_OBJECT_W_GLAUNCHER ,"wpn_grenade_launcher");

// Inventory
#ifndef NO_SINGLE
ADD(CBolt ,CSE_ALifeItemBolt ,CLSID_IITEM_BOLT ,"obj_bolt");
#endif // #ifndef NO_SINGLE
ADD(CMedkit ,CSE_ALifeItem ,CLSID_IITEM_MEDKIT ,"obj_medkit");
ADD(CMedkit ,CSE_ALifeItem ,CLSID_IITEM_BANDAGE ,"obj_bandage");
ADD(CAntirad ,CSE_ALifeItem ,CLSID_IITEM_ANTIRAD ,"obj_antirad");
Expand Down Expand Up @@ -411,9 +392,7 @@ void CObjectFactory::register_classes ()
ADD(CDestroyablePhysicsObject,CSE_ALifeObjectPhysic ,CLSID_PHYSICS_DESTROYABLE ,"obj_phys_destroyable");

ADD(CInventoryBox ,CSE_ALifeInventoryBox ,CLSID_INVENTORY_BOX ,"inventory_box");
#ifndef NO_SINGLE
ADD(smart_cover::object ,CSE_SmartCover ,TEXT2CLSID("SMRTCOVR") ,"smart_cover");
#endif // #ifndef NO_SINGLE

#ifndef NO_XR_GAME
// hack, for dedicated server only
Expand Down

0 comments on commit 6027cb1

Please sign in to comment.