Move screen stuff into screen.cpp.

This commit is contained in:
StackZ
2021-01-15 15:46:28 +01:00
parent 98ab68f00d
commit 3fa981f04b
4 changed files with 73 additions and 43 deletions
-24
View File
@@ -84,30 +84,6 @@ namespace Graphics {
* @param layer The layer to draw to
*/
void drawRectangle(int x, int y, int w, int h, u8 color1, u8 color2, bool top, bool layer);
/**
* @brief Draws the setted screen
*/
void drawScreen();
/**
* @brief The current screen logic
* @param hDown The keysDown variable
* @param hHeld The keysHeld variable
* @param touch The TouchPosition variable
*/
void screenLogic(u32 hDown, u32 hHeld, touchPosition touch);
/**
* @brief Set a specific Screen with the Screen class
* @param screen The screen which to set
*/
void setScreen(std::unique_ptr<Screen> screen);
/**
* @brief Goes a screen back
*/
void screenBack();
}
#endif
+27
View File
@@ -29,12 +29,39 @@
#include <memory>
#include <nds.h>
#include <stack>
class Screen {
public:
static std::stack<std::unique_ptr<Screen>> screens;
virtual ~Screen() {}
virtual void Logic(u32 hDown, u32 hHeld, touchPosition touch) = 0;
virtual void Draw() const = 0;
/**
* @brief Draws the setted screen
*/
static void doDraw();
/**
* @brief The current screen logic
* @param hDown The keysDown variable
* @param hHeld The keysHeld variable
* @param touch The TouchPosition variable
*/
static void doLogic(u32 hDown, u32 hHeld, touchPosition touch);
/**
* @brief Set a specific Screen with the Screen class
* @param screen The screen which to set
*/
static void set(std::unique_ptr<Screen> screen);
/**
* @brief Goes a screen back
*/
static void back();
};
#endif