game/mario/scenes/editor_scenes.hpp

36 lines
1.4 KiB
C++

#ifndef EDITOR_MAIN_HPP
#define EDITOR_MAIN_HPP
#include "../../sdlpp/sdlpp_scene.hpp"
#include "../gui/gui.hpp"
#include <functional>
struct SceneStruct {
std::shared_ptr<SDLPP::Scene> scene;
std::function<void(std::shared_ptr<SDLPP::Scene> &)> doInput;
std::function<void(std::shared_ptr<SDLPP::Scene> &)> additionalRender;
};
extern std::mutex render_mutex;
extern std::vector<SceneStruct> game_scenes;
void saveMapCallback(void *input, Button *caller);
void loadMapDialogCallback(const std::string &level_name);
SceneStruct createEditorScene(std::shared_ptr<SDLPP::Renderer> &renderer);
SceneStruct
createEditorMainMenuScene(std::shared_ptr<SDLPP::Renderer> &renderer);
SceneStruct
createEditorFileChoiceScene(std::shared_ptr<SDLPP::Renderer> &renderer);
// TODO move to a shared header
SceneStruct createYesNoScene(std::shared_ptr<SDLPP::Renderer> renderer,
const std::string &text,
std::function<void(bool)> finalizer);
SceneStruct createOkScene(std::shared_ptr<SDLPP::Renderer> renderer,
const std::string &text,
std::function<void()> finalizer);
SceneStruct createLoadScene(std::shared_ptr<SDLPP::Renderer> renderer,
const std::string &path,
std::function<void(const std::string &)> finalizer);
#endif