OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
Gothic Class Referencefinal

#include <gothic.h>

Classes

struct  Options
 

Public Types

enum class  LoadState : int {
  Idle = 0 , Loading = 1 , Saving = 2 , Finalize = 3 ,
  FailedLoad = 4 , FailedSave = 5
}
 

Public Member Functions

 Gothic ()
 
 ~Gothic ()
 
auto version () const -> const VersionInfo &
 
bool isInGame () const
 
bool isInGameAndAlive () const
 
std::string_view defaultWorld () const
 
std::string_view defaultPlayer () const
 
std::string_view defaultSave () const
 
std::string_view defaultGameDatFile () const
 
std::string_view defaultOutputUnits () const
 
std::string_view menuMain () const
 
void setGame (std::unique_ptr< GameSession > &&w)
 
auto clearGame () -> std::unique_ptr< GameSession >
 
auto gameSession () const -> const GameSession *
 
auto gameSession () -> GameSession *
 
const Worldworld () const
 
Worldworld ()
 
WorldViewworldView () const
 
Npcplayer ()
 
Cameracamera ()
 
auto questLog () const -> const QuestLog *
 
void setupGlobalScripts ()
 
auto loadingBanner () const -> const Tempest::Texture2d *
 
int loadingProgress () const
 
void setLoadingProgress (int v)
 
SoundFxloadSoundFx (std::string_view name)
 
SoundFxloadSoundWavFx (std::string_view name)
 
auto loadParticleFx (std::string_view name, bool relaxed=false) -> const ParticleFx *
 
auto loadParticleFx (const ParticleFx *base, const VisualFx::Key *key) -> const ParticleFx *
 
auto loadVisualFx (std::string_view name) -> const VisualFx *
 
void emitGlobalSound (std::string_view sfx)
 
void emitGlobalSound (const SoundFx *sfx)
 
void emitGlobalSound (const Tempest::Sound &sfx)
 
void emitGlobalSoundWav (std::string_view wav)
 
void pushPause ()
 
void popPause ()
 
bool isPause () const
 
bool isMarvinEnabled () const
 
void setMarvinEnabled (bool m)
 
bool isGodMode () const
 
void setGodMode (bool g)
 
void toggleDesktop ()
 
bool isDesktop ()
 
bool doFrate () const
 
void setFRate (bool f)
 
bool doClock () const
 
void setClock (bool t)
 
bool isBenchmarkMode () const
 
bool isBenchmarkModeCi () const
 
void setBenchmarkMode (Benchmark b)
 
LoadState checkLoading () const
 
bool finishLoading ()
 
void startLoad (std::string_view banner, const std::function< std::unique_ptr< GameSession >(std::unique_ptr< GameSession > &&)> f)
 
void startSave (Tempest::Texture2d &&tex, const std::function< std::unique_ptr< GameSession >(std::unique_ptr< GameSession > &&)> f)
 
void cancelLoading ()
 
void tick (uint64_t dt)
 
void updateAnimation (uint64_t dt)
 
void quickSave ()
 
void quickLoad ()
 
void save (std::string_view slot, std::string_view usrName)
 
void load (std::string_view slot)
 
auto updateDialog (const GameScript::DlgChoice &dlg, Npc &player, Npc &npc) -> std::vector< GameScript::DlgChoice >
 
void dialogExec (const GameScript::DlgChoice &dlg, Npc &player, Npc &npc)
 
void openDialogPipe (Npc &player, Npc &npc, AiOuputPipe *&pipe)
 
bool isNpcInDialog (const Npc &npc) const
 
bool isInDialog () const
 
std::string_view messageFromSvm (std::string_view id, int voice) const
 
std::string_view messageByName (std::string_view id) const
 
uint32_t messageTime (std::string_view id) const
 
std::unique_ptr< zenkit::DaedalusVm > createPhoenixVm (std::string_view datFile, const ScriptLang lang=ScriptLang::NONE)
 
zenkit::DaedalusScript loadScript (std::string_view datFile, const ScriptLang lang)
 
void setupCommonScriptClasses (zenkit::DaedalusScript &sc)
 
void setupVmCommonApi (zenkit::DaedalusVm &vm)
 

Static Public Member Functions

static Gothicinst ()
 
static auto invCatOrder () -> const std::vector< ItmFlags > &
 
static auto options () -> const Options &
 
static float interfaceScale (const Tempest::Widget *w)
 
static std::u16string nestedPath (const std::initializer_list< const char16_t * > &name, Tempest::Dir::FileType type)
 
static const FightAifai ()
 
static const SoundDefinitionssfx ()
 
static const MusicDefinitionsmusicDef ()
 
static const CameraDefinitionscameraDef ()
 
static bool settingsHasSection (std::string_view sec)
 
static int settingsGetI (std::string_view sec, std::string_view name)
 
static void settingsSetI (std::string_view sec, std::string_view name, int val)
 
static std::string_view settingsGetS (std::string_view sec, std::string_view name)
 
static void settingsSetS (std::string_view sec, std::string_view name, std::string_view val)
 
static float settingsGetF (std::string_view sec, std::string_view name)
 
static void settingsSetF (std::string_view sec, std::string_view name, float val)
 
static void flushSettings ()
 

Public Attributes

Tempest::Signal< void()> toggleGi
 
Tempest::Signal< void()> toggleVsm
 
Tempest::Signal< void()> toggleRtsm
 
Tempest::Signal< void(std::string_view)> onStartGame
 
Tempest::Signal< void(std::string_view)> onLoadGame
 
Tempest::Signal< void(std::string_view, std::string_view)> onSaveGame
 
Tempest::Signal< void(Npc &, Npc &, AiOuputPipe *&)> onDialogPipe
 
std::function< bool(const Npc *)> isNpcInDialogFn
 
Tempest::Signal< void(std::string_view, int, int, int, const GthFont &)> onPrintScreen
 
Tempest::Signal< void(std::string_view)> onPrint
 
Tempest::Signal< void(std::string_view)> onVideo
 
Tempest::Signal< void(const ChapterScreen::Show &)> onIntroChapter
 
Tempest::Signal< void(const DocumentMenu::Show &)> onShowDocument
 
Tempest::Signal< void()> onWorldLoaded
 
Tempest::Signal< void()> onStartLoading
 
Tempest::Signal< void()> onSessionExit
 
Tempest::Signal< void()> onSettingsChanged
 
Tempest::Signal< void()> onBenchmarkFinished
 

Detailed Description

Definition at line 28 of file gothic.h.

Member Enumeration Documentation

◆ LoadState

enum class Gothic::LoadState : int
strong
Enumerator
Idle 
Loading 
Saving 
Finalize 
FailedLoad 
FailedSave 

Definition at line 35 of file gothic.h.

Constructor & Destructor Documentation

◆ Gothic()

Gothic::Gothic ( )

Definition at line 47 of file gothic.cpp.

◆ ~Gothic()

Gothic::~Gothic ( )

Definition at line 245 of file gothic.cpp.

Member Function Documentation

◆ camera()

Camera * Gothic::camera ( )

Definition at line 319 of file gothic.cpp.

◆ cameraDef()

const CameraDefinitions & Gothic::cameraDef ( )
static

Definition at line 663 of file gothic.cpp.

◆ cancelLoading()

void Gothic::cancelLoading ( )

Definition at line 591 of file gothic.cpp.

◆ checkLoading()

Gothic::LoadState Gothic::checkLoading ( ) const

Definition at line 500 of file gothic.cpp.

◆ clearGame()

std::unique_ptr< GameSession > Gothic::clearGame ( ) -> std::unique_ptr<GameSession>

Definition at line 295 of file gothic.cpp.

◆ createPhoenixVm()

std::unique_ptr< zenkit::DaedalusVm > Gothic::createPhoenixVm ( std::string_view  datFile,
const ScriptLang  lang = ScriptLang::NONE 
)

Definition at line 711 of file gothic.cpp.

◆ defaultGameDatFile()

std::string_view Gothic::defaultGameDatFile ( ) const

Definition at line 697 of file gothic.cpp.

◆ defaultOutputUnits()

std::string_view Gothic::defaultOutputUnits ( ) const

Definition at line 701 of file gothic.cpp.

◆ defaultPlayer()

std::string_view Gothic::defaultPlayer ( ) const

Definition at line 689 of file gothic.cpp.

◆ defaultSave()

std::string_view Gothic::defaultSave ( ) const

Definition at line 693 of file gothic.cpp.

◆ defaultWorld()

std::string_view Gothic::defaultWorld ( ) const

Definition at line 685 of file gothic.cpp.

◆ dialogExec()

void Gothic::dialogExec ( const GameScript::DlgChoice dlg,
Npc player,
Npc npc 
)

Definition at line 635 of file gothic.cpp.

◆ doClock()

bool Gothic::doClock ( ) const
inline

Definition at line 136 of file gothic.h.

◆ doFrate()

bool Gothic::doFrate ( ) const
inline

Definition at line 133 of file gothic.h.

◆ emitGlobalSound() [1/3]

void Gothic::emitGlobalSound ( const SoundFx sfx)

Definition at line 399 of file gothic.cpp.

◆ emitGlobalSound() [2/3]

void Gothic::emitGlobalSound ( const Tempest::Sound &  sfx)

Definition at line 417 of file gothic.cpp.

◆ emitGlobalSound() [3/3]

void Gothic::emitGlobalSound ( std::string_view  sfx)

Definition at line 395 of file gothic.cpp.

◆ emitGlobalSoundWav()

void Gothic::emitGlobalSoundWav ( std::string_view  wav)

Definition at line 432 of file gothic.cpp.

◆ fai()

const FightAi & Gothic::fai ( )
static

Definition at line 651 of file gothic.cpp.

◆ finishLoading()

bool Gothic::finishLoading ( )

Definition at line 504 of file gothic.cpp.

◆ flushSettings()

void Gothic::flushSettings ( )
static

Definition at line 858 of file gothic.cpp.

◆ gameSession() [1/2]

GameSession * Gothic::gameSession ( ) -> GameSession*

Definition at line 303 of file gothic.cpp.

◆ gameSession() [2/2]

const GameSession * Gothic::gameSession ( ) const -> const GameSession*

Definition at line 299 of file gothic.cpp.

◆ inst()

Gothic & Gothic::inst ( )
static

Definition at line 249 of file gothic.cpp.

◆ interfaceScale()

float Gothic::interfaceScale ( const Tempest::Widget *  w)
static

Definition at line 471 of file gothic.cpp.

◆ invCatOrder()

const std::vector< ItmFlags > & Gothic::invCatOrder ( ) -> const std::vector<ItmFlags>&
static

Definition at line 447 of file gothic.cpp.

◆ isBenchmarkMode()

bool Gothic::isBenchmarkMode ( ) const

Definition at line 484 of file gothic.cpp.

◆ isBenchmarkModeCi()

bool Gothic::isBenchmarkModeCi ( ) const

Definition at line 488 of file gothic.cpp.

◆ isDesktop()

bool Gothic::isDesktop ( )
inline

Definition at line 131 of file gothic.h.

◆ isGodMode()

bool Gothic::isGodMode ( ) const
inline

Definition at line 127 of file gothic.h.

◆ isInDialog()

bool Gothic::isInDialog ( ) const

Definition at line 647 of file gothic.cpp.

◆ isInGame()

bool Gothic::isInGame ( ) const

Definition at line 267 of file gothic.cpp.

◆ isInGameAndAlive()

bool Gothic::isInGameAndAlive ( ) const

Definition at line 271 of file gothic.cpp.

◆ isMarvinEnabled()

bool Gothic::isMarvinEnabled ( ) const

Definition at line 463 of file gothic.cpp.

◆ isNpcInDialog()

bool Gothic::isNpcInDialog ( const Npc npc) const

Definition at line 643 of file gothic.cpp.

◆ isPause()

bool Gothic::isPause ( ) const

Definition at line 459 of file gothic.cpp.

◆ load()

void Gothic::load ( std::string_view  slot)

Definition at line 627 of file gothic.cpp.

◆ loadingBanner()

const Tempest::Texture2d * Gothic::loadingBanner ( ) const -> const Tempest::Texture2d*

Definition at line 339 of file gothic.cpp.

◆ loadingProgress()

int Gothic::loadingProgress ( ) const

Definition at line 331 of file gothic.cpp.

◆ loadParticleFx() [1/2]

const ParticleFx * Gothic::loadParticleFx ( const ParticleFx base,
const VisualFx::Key key 
) -> const ParticleFx*

Definition at line 391 of file gothic.cpp.

◆ loadParticleFx() [2/2]

const ParticleFx * Gothic::loadParticleFx ( std::string_view  name,
bool  relaxed = false 
) -> const ParticleFx*

Definition at line 387 of file gothic.cpp.

◆ loadScript()

zenkit::DaedalusScript Gothic::loadScript ( std::string_view  datFile,
const ScriptLang  lang 
)

Definition at line 720 of file gothic.cpp.

◆ loadSoundFx()

SoundFx * Gothic::loadSoundFx ( std::string_view  name)

Definition at line 343 of file gothic.cpp.

◆ loadSoundWavFx()

SoundFx * Gothic::loadSoundWavFx ( std::string_view  name)

Definition at line 364 of file gothic.cpp.

◆ loadVisualFx()

const VisualFx * Gothic::loadVisualFx ( std::string_view  name) -> const VisualFx*

Definition at line 383 of file gothic.cpp.

◆ menuMain()

std::string_view Gothic::menuMain ( ) const

Definition at line 705 of file gothic.cpp.

◆ messageByName()

std::string_view Gothic::messageByName ( std::string_view  id) const

Definition at line 673 of file gothic.cpp.

◆ messageFromSvm()

std::string_view Gothic::messageFromSvm ( std::string_view  id,
int  voice 
) const

Definition at line 667 of file gothic.cpp.

◆ messageTime()

uint32_t Gothic::messageTime ( std::string_view  id) const

Definition at line 679 of file gothic.cpp.

◆ musicDef()

const MusicDefinitions & Gothic::musicDef ( )
static

Definition at line 659 of file gothic.cpp.

◆ nestedPath()

std::u16string Gothic::nestedPath ( const std::initializer_list< const char16_t * > &  name,
Tempest::Dir::FileType  type 
)
static

Definition at line 949 of file gothic.cpp.

◆ openDialogPipe()

void Gothic::openDialogPipe ( Npc player,
Npc npc,
AiOuputPipe *&  pipe 
)

Definition at line 639 of file gothic.cpp.

◆ options()

const Gothic::Options & Gothic::options ( ) -> const Options&
static

Definition at line 496 of file gothic.cpp.

◆ player()

Npc * Gothic::player ( )

Definition at line 313 of file gothic.cpp.

◆ popPause()

void Gothic::popPause ( )

Definition at line 455 of file gothic.cpp.

◆ pushPause()

void Gothic::pushPause ( )

Definition at line 451 of file gothic.cpp.

◆ questLog()

const QuestLog * Gothic::questLog ( ) const -> const QuestLog*

Definition at line 325 of file gothic.cpp.

◆ quickLoad()

void Gothic::quickLoad ( )

Definition at line 619 of file gothic.cpp.

◆ quickSave()

void Gothic::quickSave ( )

Definition at line 615 of file gothic.cpp.

◆ save()

void Gothic::save ( std::string_view  slot,
std::string_view  usrName 
)

Definition at line 623 of file gothic.cpp.

◆ setBenchmarkMode()

void Gothic::setBenchmarkMode ( Benchmark  b)

Definition at line 492 of file gothic.cpp.

◆ setClock()

void Gothic::setClock ( bool  t)
inline

Definition at line 137 of file gothic.h.

◆ setFRate()

void Gothic::setFRate ( bool  f)
inline

Definition at line 134 of file gothic.h.

◆ setGame()

void Gothic::setGame ( std::unique_ptr< GameSession > &&  w)

Definition at line 290 of file gothic.cpp.

◆ setGodMode()

void Gothic::setGodMode ( bool  g)
inline

Definition at line 128 of file gothic.h.

◆ setLoadingProgress()

void Gothic::setLoadingProgress ( int  v)

Definition at line 335 of file gothic.cpp.

◆ setMarvinEnabled()

void Gothic::setMarvinEnabled ( bool  m)

Definition at line 467 of file gothic.cpp.

◆ settingsGetF()

float Gothic::settingsGetF ( std::string_view  sec,
std::string_view  name 
)
static

Definition at line 841 of file gothic.cpp.

◆ settingsGetI()

int Gothic::settingsGetI ( std::string_view  sec,
std::string_view  name 
)
static

Definition at line 807 of file gothic.cpp.

◆ settingsGetS()

std::string_view Gothic::settingsGetS ( std::string_view  sec,
std::string_view  name 
)
static

Definition at line 824 of file gothic.cpp.

◆ settingsHasSection()

bool Gothic::settingsHasSection ( std::string_view  sec)
static

Definition at line 798 of file gothic.cpp.

◆ settingsSetF()

void Gothic::settingsSetF ( std::string_view  sec,
std::string_view  name,
float  val 
)
static

Definition at line 853 of file gothic.cpp.

◆ settingsSetI()

void Gothic::settingsSetI ( std::string_view  sec,
std::string_view  name,
int  val 
)
static

Definition at line 819 of file gothic.cpp.

◆ settingsSetS()

void Gothic::settingsSetS ( std::string_view  sec,
std::string_view  name,
std::string_view  val 
)
static

Definition at line 836 of file gothic.cpp.

◆ setupCommonScriptClasses()

void Gothic::setupCommonScriptClasses ( zenkit::DaedalusScript &  sc)

Definition at line 761 of file gothic.cpp.

◆ setupGlobalScripts()

void Gothic::setupGlobalScripts ( )

Definition at line 254 of file gothic.cpp.

◆ setupVmCommonApi()

void Gothic::setupVmCommonApi ( zenkit::DaedalusVm &  vm)

Definition at line 953 of file gothic.cpp.

◆ sfx()

const SoundDefinitions & Gothic::sfx ( )
static

Definition at line 655 of file gothic.cpp.

◆ startLoad()

void Gothic::startLoad ( std::string_view  banner,
const std::function< std::unique_ptr< GameSession >(std::unique_ptr< GameSession > &&)>  f 
)

Definition at line 526 of file gothic.cpp.

◆ startSave()

void Gothic::startSave ( Tempest::Texture2d &&  tex,
const std::function< std::unique_ptr< GameSession >(std::unique_ptr< GameSession > &&)>  f 
)

Definition at line 520 of file gothic.cpp.

◆ tick()

void Gothic::tick ( uint64_t  dt)

Definition at line 598 of file gothic.cpp.

◆ toggleDesktop()

void Gothic::toggleDesktop ( )
inline

Definition at line 130 of file gothic.h.

◆ updateAnimation()

void Gothic::updateAnimation ( uint64_t  dt)

Definition at line 610 of file gothic.cpp.

◆ updateDialog()

std::vector< GameScript::DlgChoice > Gothic::updateDialog ( const GameScript::DlgChoice dlg,
Npc player,
Npc npc 
) -> std::vector<GameScript::DlgChoice>

Definition at line 631 of file gothic.cpp.

◆ version()

const VersionInfo & Gothic::version ( ) const -> const VersionInfo&

Definition at line 263 of file gothic.cpp.

◆ world() [1/2]

World * Gothic::world ( )

Definition at line 284 of file gothic.cpp.

◆ world() [2/2]

const World * Gothic::world ( ) const

Definition at line 278 of file gothic.cpp.

◆ worldView()

WorldView * Gothic::worldView ( ) const

Definition at line 307 of file gothic.cpp.

Member Data Documentation

◆ isNpcInDialogFn

std::function<bool(const Npc*)> Gothic::isNpcInDialogFn

Definition at line 171 of file gothic.h.

◆ onBenchmarkFinished

Tempest::Signal<void()> Gothic::onBenchmarkFinished

Definition at line 184 of file gothic.h.

◆ onDialogPipe

Tempest::Signal<void(Npc&,Npc&,AiOuputPipe*&)> Gothic::onDialogPipe

Definition at line 170 of file gothic.h.

◆ onIntroChapter

Tempest::Signal<void(const ChapterScreen::Show&)> Gothic::onIntroChapter

Definition at line 177 of file gothic.h.

◆ onLoadGame

Tempest::Signal<void(std::string_view)> Gothic::onLoadGame

Definition at line 167 of file gothic.h.

◆ onPrint

Tempest::Signal<void(std::string_view)> Gothic::onPrint

Definition at line 174 of file gothic.h.

◆ onPrintScreen

Tempest::Signal<void(std::string_view,int,int,int,const GthFont&)> Gothic::onPrintScreen

Definition at line 173 of file gothic.h.

◆ onSaveGame

Tempest::Signal<void(std::string_view,std::string_view)> Gothic::onSaveGame

Definition at line 168 of file gothic.h.

◆ onSessionExit

Tempest::Signal<void()> Gothic::onSessionExit

Definition at line 181 of file gothic.h.

◆ onSettingsChanged

Tempest::Signal<void()> Gothic::onSettingsChanged

Definition at line 182 of file gothic.h.

◆ onShowDocument

Tempest::Signal<void(const DocumentMenu::Show&)> Gothic::onShowDocument

Definition at line 178 of file gothic.h.

◆ onStartGame

Tempest::Signal<void(std::string_view)> Gothic::onStartGame

Definition at line 166 of file gothic.h.

◆ onStartLoading

Tempest::Signal<void()> Gothic::onStartLoading

Definition at line 180 of file gothic.h.

◆ onVideo

Tempest::Signal<void(std::string_view)> Gothic::onVideo

Definition at line 175 of file gothic.h.

◆ onWorldLoaded

Tempest::Signal<void()> Gothic::onWorldLoaded

Definition at line 179 of file gothic.h.

◆ toggleGi

Tempest::Signal<void()> Gothic::toggleGi

Definition at line 143 of file gothic.h.

◆ toggleRtsm

Tempest::Signal<void()> Gothic::toggleRtsm

Definition at line 143 of file gothic.h.

◆ toggleVsm

Tempest::Signal<void()> Gothic::toggleVsm

Definition at line 143 of file gothic.h.


The documentation for this class was generated from the following files: