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 "C4Version.h"
#include "control/C4GameControl.h"
#include "control/C4GameParameters.h"
#include "control/C4GameSave.h"
#include "control/C4PlayerControl.h"
#include "control/C4PlayerInfo.h"
#include "control/C4Record.h"
#include "control/C4RoundResults.h"
#include "editor/C4Console.h"
#include "game/C4Application.h"
#include "game/C4FullScreen.h"
#include "game/C4GraphicsSystem.h"
#include "game/C4Viewport.h"
#include "graphics/C4GraphicsResource.h"
#include "gui/C4ChatDlg.h"
#include "gui/C4GameLobby.h"
#include "gui/C4GameMessage.h"
#include "gui/C4GameOverDlg.h"
#include "gui/C4LoaderScreen.h"
#include "gui/C4MessageInput.h"
#include "gui/C4MouseControl.h"
#include "gui/C4ScriptGuiWindow.h"
#include "gui/C4Startup.h"
#include "landscape/C4Landscape.h"
#include "landscape/C4MapScript.h"
#include "landscape/C4MassMover.h"
#include "landscape/C4Material.h"
#include "landscape/C4PXS.h"
#include "landscape/C4Particles.h"
#include "landscape/C4Sky.h"
#include "landscape/C4SolidMask.h"
#include "landscape/C4Texture.h"
#include "landscape/C4Weather.h"
#include "landscape/fow/C4FoW.h"
#include "lib/C4Random.h"
#include "lib/C4Stat.h"
#include "lib/StdMesh.h"
#include "network/C4League.h"
#include "network/C4Network2Dialogs.h"
#include "network/C4Network2Reference.h"
#include "network/C4Network2Stats.h"
#include "object/C4Command.h"
#include "object/C4Def.h"
#include "object/C4DefList.h"
#include "object/C4GameObjects.h"
#include "object/C4Object.h"
#include "object/C4ObjectCom.h"
#include "object/C4ObjectInfo.h"
#include "object/C4ObjectMenu.h"
#include "platform/C4FileMonitor.h"
#include "player/C4Player.h"
#include "player/C4PlayerList.h"
#include "player/C4RankSystem.h"
#include "script/C4AulDebug.h"
#include "script/C4AulExec.h"
#include "script/C4Effect.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 707 of file C4Game.cpp.

Referenced by C4Game::Execute().

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

Definition at line 703 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 706 of file C4Game.cpp.

Referenced by C4Game::Execute().

Function Documentation

C4ID DefFileGetID ( const char *  szFilename)

Definition at line 1363 of file C4Game.cpp.

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

Referenced by C4Game::DropFile().

1364 {
1365  C4Group hDef;
1366  C4Def DefCore;
1367  if (!hDef.Open(szFilename)) return C4ID::None;
1368  if (!DefCore.LoadDefCore(hDef)) { hDef.Close(); return C4ID::None; }
1369  hDef.Close();
1370  return DefCore.id;
1371 }
C4ID id
Definition: C4Def.h:101
bool LoadDefCore(C4Group &hGroup)
Definition: C4Def.cpp:141
bool Open(const char *szGroupName, bool fCreate=false)
Definition: C4Group.cpp:514
static const C4ID None
Definition: C4Id.h:39
Definition: C4Def.h:98
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 3717 of file C4Game.cpp.

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

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

3718 {
3719  // safety
3720  assert(szSpec && *szSpec);
3721  if (!szSpec) return false;
3722  // Special icon?
3723  if (SEqual2(szSpec, "@Ico:"))
3724  {
3725  szSpec += 5;
3726  auto it = str_to_icon.find(szSpec);
3727  if (it != str_to_icon.end())
3728  {
3729  fct = C4GUI::Icon::GetIconFacet(it->second);
3730  return true;
3731  }
3732  }
3733 
3734  return false;
3735 }
bool SEqual2(const char *szStr1, const char *szStr2)
Definition: Standard.cpp:198
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 1987 of file C4Game.cpp.

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

Referenced by C4Game::InitGame().

1988 {
1989  if (!Inside<int32_t>(x,0,::Landscape.GetWidth()-1) || !Inside<int32_t>(y,0,::Landscape.GetHeight()-1)) return false;
1990  return !DensitySolid(GBackDensity(x,y));
1991 }
C4Landscape Landscape
int32_t GetHeight() const
int32_t GBackDensity(int32_t x, int32_t y)
Definition: C4Landscape.h:226
bool DensitySolid(int32_t dens)
Definition: C4Landscape.h:198
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 2590 of file C4Game.cpp.

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

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

2592 {
2593  int32_t cnt,cnt2,ccount,cpos;
2594  for (cpos=0,cnt=0; rlist.GetID(cnt); cnt++)
2595  if (C4Id2Def(rlist.GetID(cnt,&ccount)))
2596  for (cnt2=0; cnt2<ccount; cnt2++)
2597  if (cpos<maxidlist)
2598  { idlist[cpos]=rlist.GetID(cnt); cpos++; }
2599  return cpos;
2600 }
C4Def * C4Id2Def(C4ID id)
Definition: C4DefList.h:84
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: