git repos / blockattack-game

commit d7f4a888

sago007 · 2020-06-28 09:22
d7f4a888ee5225a6fc509a03e049382628df4b2d patch · browse files
parent 46404443dc8ac6503b11340cb399bfcab2493e99

Add include goard to HelpCommon.hpp.
Add define to DialogBox.hpp so ShowFileState and HelpAboutState does not need an external declaration.

Changed files

M source/code/DialogBox.hpp before
M source/code/HelpAboutState.cpp before
M source/code/HelpCommon.hpp before
M source/code/ShowFileState.cpp before
diff --git a/source/code/DialogBox.hpp b/source/code/DialogBox.hpp index 5024eb4..d8d4272 100644 --- a/source/code/DialogBox.hpp +++ b/source/code/DialogBox.hpp
@@ -77,5 +77,7 @@ private:
int oldmousey = 0;
};
+void DrawRectYellow(SDL_Renderer* target, int topx, int topy, int height, int width);
+
#endif /* DIALOGBOX_HPP */
diff --git a/source/code/HelpAboutState.cpp b/source/code/HelpAboutState.cpp index eef7557..fdbd027 100644 --- a/source/code/HelpAboutState.cpp +++ b/source/code/HelpAboutState.cpp
@@ -21,6 +21,7 @@ https://blockattack.net
===========================================================================
*/
+#include "DialogBox.hpp"
#include "HelpCommon.hpp"
#include "HelpAboutState.hpp"
#include "global.hpp"
@@ -94,8 +95,6 @@ void HelpAboutState::ProcessInput(const SDL_Event& event, bool& processed) {
}
}
-extern void DrawRectYellow(SDL_Renderer* target, int topx, int topy, int height, int width);
-
void HelpAboutState::Draw(SDL_Renderer* target) {
DrawBackground(target);
titleField.Draw(target, 50, 50);
diff --git a/source/code/HelpCommon.hpp b/source/code/HelpCommon.hpp index 5746155..1f2be04 100644 --- a/source/code/HelpCommon.hpp +++ b/source/code/HelpCommon.hpp
@@ -21,6 +21,10 @@ https://blockattack.net
===========================================================================
*/
+
+#ifndef _HELP_COMMON_HPP
+#define _HELP_COMMON_HPP
+
#include "sago/SagoTextBox.hpp"
#include "sago/SagoTextField.hpp"
@@ -29,3 +33,5 @@ void setHelp30Font(const sago::SagoDataHolder* holder, sago::SagoTextField& fiel
void setHelp30Font(const sago::SagoDataHolder* holder, sago::SagoTextBox& field, const char* text);
void setHelpBoxFont(const sago::SagoDataHolder* holder, sago::SagoTextBox& field, const char* text);
+
+#endif //_HELP_COMMON_HPP
diff --git a/source/code/ShowFileState.cpp b/source/code/ShowFileState.cpp index e80e446..dfd574f 100644 --- a/source/code/ShowFileState.cpp +++ b/source/code/ShowFileState.cpp
@@ -17,6 +17,7 @@ https://blockattack.net
===========================================================================
*/
+#include "DialogBox.hpp"
#include "HelpCommon.hpp"
#include "ShowFileState.hpp"
#include "global.hpp"
@@ -58,8 +59,6 @@ void ShowFileState::ProcessInput(const SDL_Event& event, bool& processed) {
}
}
-extern void DrawRectYellow(SDL_Renderer* target, int topx, int topy, int height, int width);
-
void ShowFileState::Draw(SDL_Renderer* target) {
DrawBackground(target);
titleField.Draw(target, 50, 50);