diff --git a/CMakeLists.txt b/CMakeLists.txt index ef53aa2862..5b878c5499 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -699,7 +699,7 @@ include(CheckTypeSize) include(CheckFunctionExists) include(CheckSymbolExists) -vendored_guichan() +vendored_guisan() # Windows RC compiler definitions @@ -1114,7 +1114,7 @@ if (ENABLE_STDIO_REDIRECT) else () add_executable(stratagus src/stratagus/main.cpp) endif () -target_link_libraries(stratagus_lib PUBLIC ${stratagus_LIBS} ${CMAKE_DL_LIBS} guichan_lib) +target_link_libraries(stratagus_lib PUBLIC ${stratagus_LIBS} ${CMAKE_DL_LIBS} guisan_lib) target_link_libraries(stratagus PUBLIC stratagus_lib) target_include_directories(stratagus_lib SYSTEM PRIVATE third-party/mdns third-party/spiritless_po/include) diff --git a/src/editor/editloop.cpp b/src/editor/editloop.cpp index 99c77fd53c..888e092141 100644 --- a/src/editor/editloop.cpp +++ b/src/editor/editloop.cpp @@ -64,7 +64,7 @@ #include "video.h" #include "widgets.h" -#include +#include extern void DoScrollArea(int state, bool fast, bool isKeyboard); extern void DrawGuichanWidgets(); diff --git a/src/include/font.h b/src/include/font.h index d7adc96978..94c027ca71 100644 --- a/src/include/font.h +++ b/src/include/font.h @@ -63,7 +63,7 @@ #include #include -#include +#include #include #include @@ -92,7 +92,7 @@ class CFont : public gcn::Font int getHeight() const override { return Height(); } int getWidth(const std::string &text) const override { return Width(text); } - void drawString(gcn::Graphics *graphics, const std::string &text, int x, int y) override; + void drawString(gcn::Graphics *graphics, const std::string &text, int x, int y, bool enabled) override; int getStringIndexAt(const std::string &text, int x) const override; // Set to false to reverse color when drawing string diff --git a/src/include/movie.h b/src/include/movie.h index 5429daedca..e40b2b4d37 100644 --- a/src/include/movie.h +++ b/src/include/movie.h @@ -33,8 +33,8 @@ //@{ #include -#include -#include +#include +#include #ifdef USE_VORBIS diff --git a/src/include/video.h b/src/include/video.h index 924128a588..9be74a0a41 100644 --- a/src/include/video.h +++ b/src/include/video.h @@ -41,8 +41,8 @@ #include "vec2i.h" #include -#include -#include +#include +#include #include #include #include diff --git a/src/include/widgets.h b/src/include/widgets.h index e0cb929b0a..1a936ceb0f 100644 --- a/src/include/widgets.h +++ b/src/include/widgets.h @@ -34,10 +34,10 @@ #include "luacallback.h" #include -#include -#include -#include -#include +#include +#include +#include +#include extern bool GuichanActive; diff --git a/src/stratagus/mainloop.cpp b/src/stratagus/mainloop.cpp index 6c101156ff..7f2d43e469 100644 --- a/src/stratagus/mainloop.cpp +++ b/src/stratagus/mainloop.cpp @@ -1,4 +1,4 @@ -// _________ __ __ +// _________ __ __ // / _____// |_____________ _/ |______ ____ __ __ ______ // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ | @@ -58,7 +58,6 @@ # include #endif -#include void DrawGuichanWidgets(); diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp index 5daad90ff4..3a0e76ddb6 100644 --- a/src/stratagus/stratagus.cpp +++ b/src/stratagus/stratagus.cpp @@ -211,7 +211,7 @@ extern void beos_init(int argc, char **argv); #include "missile.h" //for FreeBurningBuildingFrames #include -#include +#include #include #ifdef USE_STACKTRACE diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index e24ba09b27..e1e62859bb 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -57,8 +57,8 @@ #include "video.h" #include -#include -#include +#include +#include #include #include diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp index 24c8dcd9b1..8692c9524d 100644 --- a/src/ui/mouse.cpp +++ b/src/ui/mouse.cpp @@ -63,7 +63,7 @@ #include "widgets.h" #include -#include +#include #include /*---------------------------------------------------------------------------- diff --git a/src/ui/widgets.cpp b/src/ui/widgets.cpp index 5408fb06f1..4646eaa5cf 100644 --- a/src/ui/widgets.cpp +++ b/src/ui/widgets.cpp @@ -45,7 +45,7 @@ #include "sound.h" #include "util.h" -#include +#include /*---------------------------------------------------------------------------- -- Variables @@ -171,8 +171,6 @@ static void MenuHandleKeyRepeat(unsigned key, unsigned keychar) HandleKeyModifiersDown(key, keychar); } -sdl2::RendererPtr guichanRenderer; - /** ** Initializes the GUI stuff */ @@ -183,8 +181,7 @@ void initGuichan() // Set the target for the graphics object to be the screen. // In other words, we will draw to the screen. // Note, any surface will do, it doesn't have to be the screen. - guichanRenderer.reset(SDL_CreateSoftwareRenderer(TheScreen)); - graphics->setTarget(guichanRenderer.get(), Video.Width, Video.Height); + graphics->setTarget(TheScreen); Input = std::make_unique(); diff --git a/src/video/font.cpp b/src/video/font.cpp index 6e5eb1b429..eb23ef48b4 100644 --- a/src/video/font.cpp +++ b/src/video/font.cpp @@ -40,7 +40,7 @@ #include "intern_video.h" #include "video.h" -#include +#include #include #include @@ -141,7 +141,7 @@ int CFont::getStringIndexAt(const std::string &text, int x) const /* override */ } void CFont::drawString( - gcn::Graphics *graphics, const std::string &txt, int x, int y) /* override */ + gcn::Graphics *graphics, const std::string &txt, int x, int y, bool /*enabled*/) /* override */ { DynamicLoad(); const gcn::ClipRectangle &r = graphics->getCurrentClipArea(); @@ -515,7 +515,7 @@ int convertSDLKeyCharacterToGuichanKey(int key) event.type = SDL_KEYDOWN; event.key.keysym.sym = (SDL_Keycode) key; auto ret = input.convertSDLEventToGuichanKeyValue(event); - return ret == -1 ? key : ret; + return ret.getValue() == -1 ? key : ret.getValue(); } /** diff --git a/src/video/video.cpp b/src/video/video.cpp index e9ae1ed3f7..468cd0c7fb 100644 --- a/src/video/video.cpp +++ b/src/video/video.cpp @@ -289,9 +289,7 @@ bool CVideo::ResizeScreen(int w, int h) if (Gui) { if (auto graphics = dynamic_cast(Gui->getGraphics())) { - extern sdl2::RendererPtr guichanRenderer; - guichanRenderer.reset(SDL_CreateSoftwareRenderer(TheScreen)); - graphics->setTarget(guichanRenderer.get(), w, h); + graphics->setTarget(TheScreen); } } diff --git a/third-party b/third-party index 5fdc3b546a..21b4553d72 160000 --- a/third-party +++ b/third-party @@ -1 +1 @@ -Subproject commit 5fdc3b546aa32879f90a937492b5654421cae55d +Subproject commit 21b4553d72658c01bf7129bc2b0191739468eb04