Skip to content

Universal way of calling daedalus functions from C++.

License

Notifications You must be signed in to change notification settings

bogu9821/DaedalusCall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DaedalusCall

Templated, compile time specialized universal way of calling daedalus functions from C++ with error checking. Requires C++23 and is designed to work with Gothic API.

Example

bool IsPlayerFakeBandit() noexcept(false)
{
  const auto playerIsFakeBanditCall = DaedalusCall<int>(parser, DCFunction("C_PLAYERISFAKEBANDIT"), {}/*eClearStack::CLEAR*/, GetFocus(), player);
  if (!playerIsFakeBanditCall.has_value())
  {
    throw std::runtime_error(std::format("CallFuncError: {}", std::to_underlying(f.error())));
  }

  return *playerIsFakeBanditCall;
}

void CallPrintFunction(const DaedalusFunction t_functionIndex, const zSTRING& t_string)
{
  (void)DaedalusCall(parser, t_functionIndex, eClearStack::NO, t_string);
}

CallPrintFunction(DaedalusFunction{parser->GetIndex("MyPrint")}, zSTRING{"Hello world!"});

About

Universal way of calling daedalus functions from C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages