OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Game.cpp File Reference
#include "C4Include.h"
#include "C4ForbidLibraryCompilation.h"
#include "game/C4Game.h"
#include "script/C4AulDebug.h"
#include "object/C4Def.h"
#include "object/C4DefList.h"
#include "script/C4Effect.h"
#include "platform/C4FileMonitor.h"
#include "control/C4GameSave.h"
#include "control/C4Record.h"
#include "game/C4Application.h"
#include "object/C4Object.h"
#include "object/C4ObjectInfo.h"
#include "lib/C4Random.h"
#include "object/C4ObjectCom.h"
#include "game/C4FullScreen.h"
#include "gui/C4Startup.h"
#include "game/C4Viewport.h"
#include "object/C4Command.h"
#include "lib/C4Stat.h"
#include "network/C4League.h"
#include "control/C4PlayerInfo.h"
#include "gui/C4LoaderScreen.h"
#include "network/C4Network2Dialogs.h"
#include "editor/C4Console.h"
#include "network/C4Network2Stats.h"
#include "lib/C4Log.h"
#include "player/C4Player.h"
#include "gui/C4GameOverDlg.h"
#include "control/C4GameParameters.h"
#include "object/C4ObjectMenu.h"
#include "gui/C4GameLobby.h"
#include "gui/C4ChatDlg.h"
#include "control/C4PlayerControl.h"
#include "gui/C4MouseControl.h"
#include "landscape/C4PXS.h"
#include "gui/C4MessageInput.h"
#include "landscape/C4MassMover.h"
#include "player/C4RankSystem.h"
#include "control/C4RoundResults.h"
#include "gui/C4GameMessage.h"
#include "gui/C4ScriptGuiWindow.h"
#include "landscape/C4Material.h"
#include "network/C4Network2Reference.h"
#include "landscape/C4Weather.h"
#include "graphics/C4GraphicsResource.h"
#include "game/C4GraphicsSystem.h"
#include "landscape/C4Texture.h"
#include "landscape/C4Landscape.h"
#include "landscape/C4Sky.h"
#include "player/C4PlayerList.h"
#include "object/C4GameObjects.h"
#include "control/C4GameControl.h"
#include "C4Version.h"
#include "script/C4AulExec.h"
#include "platform/StdFile.h"
#include "landscape/C4MapScript.h"
#include "landscape/C4SolidMask.h"
#include "landscape/fow/C4FoW.h"
#include "landscape/C4Particles.h"
#include "lib/StdMesh.h"
#include <unordered_map>
Include dependency graph for C4Game.cpp:

Go to the source code of this file.

Classes

class  C4GameSec1Timer
 

Macros

#define EXEC_S(Expressions, Stat)   { C4ST_START(Stat) Expressions C4ST_STOP(Stat) }
 
#define EXEC_S_DR(Expressions, Stat, DebugRecName)   { if (Config.General.DebugRec) AddDbgRec(RCT_Block, DebugRecName, 6); EXEC_S(Expressions, Stat) }
 
#define EXEC_DR(Expressions, DebugRecName)   { if (Config.General.DebugRec) AddDbgRec(RCT_Block, DebugRecName, 6); Expressions }
 

Functions

C4ID DefFileGetID (const char *szFilename)
 
bool LandscapeFree (int32_t x, int32_t y)
 
int32_t ListExpandValids (C4IDList &rlist, C4ID *idlist, int32_t maxidlist)
 
bool GetTextSpecFacet (const char *szSpec, C4Facet &fct)
 

Macro Definition Documentation

#define EXEC_DR (   Expressions,
  DebugRecName 
)    { if (Config.General.DebugRec) AddDbgRec(RCT_Block, DebugRecName, 6); Expressions }

Definition at line 711 of file C4Game.cpp.

Referenced by C4Game::Execute().

#define EXEC_S (   Expressions,
  Stat 
)    { C4ST_START(Stat) Expressions C4ST_STOP(Stat) }

Definition at line 707 of file C4Game.cpp.

Referenced by C4Game::Execute().

#define EXEC_S_DR (   Expressions,
  Stat,
  DebugRecName 
)    { if (Config.General.DebugRec) AddDbgRec(RCT_Block, DebugRecName, 6); EXEC_S(Expressions, Stat) }

Definition at line 710 of file C4Game.cpp.

Referenced by C4Game::Execute().

Function Documentation

C4ID DefFileGetID ( const char *  szFilename)

Definition at line 1367 of file C4Game.cpp.

References C4Group::Close(), C4Def::id, C4Def::LoadDefCore(), C4ID::None, and C4Group::Open().

Referenced by C4Game::DropFile().

1368 {
1369  C4Group hDef;
1370  C4Def DefCore;
1371  if (!hDef.Open(szFilename)) return C4ID::None;
1372  if (!DefCore.LoadDefCore(hDef)) { hDef.Close(); return C4ID::None; }
1373  hDef.Close();
1374  return DefCore.id;
1375 }
C4ID id
Definition: C4Def.h:103
bool LoadDefCore(C4Group &hGroup)
Definition: C4Def.cpp:144
bool Open(const char *szGroupName, bool fCreate=false)
Definition: C4Group.cpp:514
static const C4ID None
Definition: C4Id.h:42
Definition: C4Def.h:100
bool Close()
Definition: C4Group.cpp:755

Here is the call graph for this function:

Here is the caller graph for this function:

bool GetTextSpecFacet ( const char *  szSpec,
C4Facet fct 
)

Definition at line 3721 of file C4Game.cpp.

References C4GUI::Icon::GetIconFacet(), and SEqual2().

Referenced by C4Game::DrawTextSpecImage(), and C4Game::GetTextSpecImageAspect().

3722 {
3723  // safety
3724  assert(szSpec && *szSpec);
3725  if (!szSpec) return false;
3726  // Special icon?
3727  if (SEqual2(szSpec, "@Ico:"))
3728  {
3729  szSpec += 5;
3730  auto it = str_to_icon.find(szSpec);
3731  if (it != str_to_icon.end())
3732  {
3733  fct = C4GUI::Icon::GetIconFacet(it->second);
3734  return true;
3735  }
3736  }
3737 
3738  return false;
3739 }
bool SEqual2(const char *szStr1, const char *szStr2)
Definition: Standard.cpp:175
static C4Facet GetIconFacet(Icons icoIconIndex)

Here is the call graph for this function:

Here is the caller graph for this function:

bool LandscapeFree ( int32_t  x,
int32_t  y 
)

Definition at line 1991 of file C4Game.cpp.

References DensitySolid(), GBackDensity(), C4Landscape::GetHeight(), C4Landscape::GetWidth(), and Landscape.

Referenced by C4Game::InitGame().

1992 {
1993  if (!Inside<int32_t>(x,0,::Landscape.GetWidth()-1) || !Inside<int32_t>(y,0,::Landscape.GetHeight()-1)) return false;
1994  return !DensitySolid(GBackDensity(x,y));
1995 }
C4Landscape Landscape
int32_t GetHeight() const
int32_t GBackDensity(int32_t x, int32_t y)
Definition: C4Landscape.h:227
bool DensitySolid(int32_t dens)
Definition: C4Landscape.h:199
int32_t GetWidth() const

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t ListExpandValids ( C4IDList rlist,
C4ID idlist,
int32_t  maxidlist 
)

Definition at line 2594 of file C4Game.cpp.

References C4Id2Def(), and C4IDList::GetID().

Referenced by C4Game::InitInEarth(), and C4Game::InitVegetation().

2596 {
2597  int32_t cnt,cnt2,ccount,cpos;
2598  for (cpos=0,cnt=0; rlist.GetID(cnt); cnt++)
2599  if (C4Id2Def(rlist.GetID(cnt,&ccount)))
2600  for (cnt2=0; cnt2<ccount; cnt2++)
2601  if (cpos<maxidlist)
2602  { idlist[cpos]=rlist.GetID(cnt); cpos++; }
2603  return cpos;
2604 }
C4Def * C4Id2Def(C4ID id)
Definition: C4DefList.h:80
C4ID GetID(size_t index, int32_t *ipCount=nullptr) const
Definition: C4IDList.cpp:99

Here is the call graph for this function:

Here is the caller graph for this function: