diff options
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 0c3d78eb..768aeb2b 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -71,7 +71,7 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) setTheme(themeIt != mAvailableThemes.end() ? *themeIt : mAvailableThemes.front()); - logger->log("Initializing GUI..."); + Log::info("Initializing GUI..."); // Set graphics setGraphics(graphics); @@ -106,8 +106,8 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) } catch (gcn::Exception e) { - logger->error(std::string("Unable to load '") + fontFile + - std::string("': ") + e.getMessage()); + Log::critical(std::string("Unable to load '") + fontFile + + "': " + e.getMessage()); } // Set bold font @@ -119,8 +119,8 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) } catch (gcn::Exception e) { - logger->error(std::string("Unable to load '") + fontFile + - std::string("': ") + e.getMessage()); + Log::critical(std::string("Unable to load '") + fontFile + + "': " + e.getMessage()); } // Set mono font @@ -132,8 +132,8 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) } catch (gcn::Exception e) { - logger->error(std::string("Unable to load '") + fontFile + - std::string("': ") + e.getMessage()); + Log::critical(std::string("Unable to load '") + fontFile + + "': " + e.getMessage()); } loadCustomCursors(); @@ -288,32 +288,20 @@ void Gui::loadCustomCursors() SDL_Surface *mouseSurface = loadSurface(cursorPath); if (!mouseSurface) { - logger->log("Warning: Unable to load mouse cursor file (%s): %s", - cursorPath.c_str(), SDL_GetError()); + Log::warn("Unable to load mouse cursor file (%s): %s", + cursorPath.c_str(), SDL_GetError()); return; } SDL_SetSurfaceBlendMode(mouseSurface, SDL_BLENDMODE_NONE); -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - const Uint32 rmask = 0xff000000; - const Uint32 gmask = 0x00ff0000; - const Uint32 bmask = 0x0000ff00; - const Uint32 amask = 0x000000ff; -#else - const Uint32 rmask = 0x000000ff; - const Uint32 gmask = 0x0000ff00; - const Uint32 bmask = 0x00ff0000; - const Uint32 amask = 0xff000000; -#endif - constexpr int cursorSize = 40; const int targetCursorSize = cursorSize * mCustomCursorScale; const int columns = mouseSurface->w / cursorSize; - SDL_Surface *cursorSurface = SDL_CreateRGBSurface( + SDL_Surface *cursorSurface = SDL_CreateRGBSurfaceWithFormat( 0, targetCursorSize, targetCursorSize, 32, - rmask, gmask, bmask, amask); + SDL_PIXELFORMAT_RGBA32); for (int i = 0; i < static_cast<int>(Cursor::Count); ++i) { @@ -329,7 +317,7 @@ void Gui::loadCustomCursors() 17 * mCustomCursorScale); if (!cursor) { - logger->log("Warning: Unable to create cursor: %s", SDL_GetError()); + Log::warn("Unable to create cursor: %s", SDL_GetError()); } mCustomMouseCursors.push_back(cursor); |