Skip to content

Commit

Permalink
Move GameFormspec::init to cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Jan 7, 2025
1 parent b1aba81 commit 6f6a10b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/client/game_formspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ class PlayerInventoryFormSource: public IFormSource

//// GameFormSpec

void GameFormSpec::init(Client *client, RenderingEngine *rendering_engine, InputHandler *input)
{
m_client = client;
m_rendering_engine = rendering_engine;
m_input = input;
m_pause_script = std::make_unique<PauseMenuScripting>(client);
m_pause_script->loadBuiltin();
}

void GameFormSpec::deleteFormspec()
{
if (m_formspec) {
Expand Down
9 changes: 1 addition & 8 deletions src/client/game_formspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ It includes:
*/
struct GameFormSpec
{
void init(Client *client, RenderingEngine *rendering_engine, InputHandler *input)
{
m_client = client;
m_rendering_engine = rendering_engine;
m_input = input;
m_pause_script = std::make_unique<PauseMenuScripting>(client);
m_pause_script->loadBuiltin();
}
void init(Client *client, RenderingEngine *rendering_engine, InputHandler *input);

~GameFormSpec();

Expand Down

0 comments on commit 6f6a10b

Please sign in to comment.