diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/dye.h | 2 | ||||
-rw-r--r-- | src/resources/image.cpp | 15 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 4 | ||||
-rw-r--r-- | src/resources/questdb.cpp | 5 | ||||
-rw-r--r-- | src/resources/questdb.h | 1 | ||||
-rw-r--r-- | src/resources/settingsmanager.cpp | 4 | ||||
-rw-r--r-- | src/resources/settingsmanager.h | 4 | ||||
-rw-r--r-- | src/resources/theme.cpp | 18 | ||||
-rw-r--r-- | src/resources/theme.h | 2 | ||||
-rw-r--r-- | src/resources/wallpaper.cpp | 1 |
10 files changed, 28 insertions, 28 deletions
diff --git a/src/resources/dye.h b/src/resources/dye.h index 0fe68f07..1730d2fd 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -35,7 +35,7 @@ class DyePalette * The string is either a file name or a sequence of hexadecimal RGB * values separated by ',' and starting with '#'. */ - DyePalette(const std::string &pallete); + DyePalette(const std::string &description); /** * Gets a pixel color depending on its intensity. First color is diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 11d5c275..6e6f1187 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -32,6 +32,8 @@ #include <SDL_image.h> +#include <algorithm> + #ifdef USE_OPENGL bool Image::mUseOpenGL = false; bool Image::mPowerOfTwoTextures = true; @@ -176,18 +178,7 @@ void Image::setAlpha(float alpha) if (!useOpenGL() && mDisableTransparency) return; - if (mAlpha == alpha) - return; - - if (alpha < 0.0f || alpha > 1.0f) - return; - - mAlpha = alpha; - - if (mTexture) - { - SDL_SetTextureAlphaMod(mTexture, (Uint8) (255 * mAlpha)); - } + mAlpha = std::clamp(alpha, 0.0f, 1.0f); } Image *Image::_SDLload(SDL_Surface *image) diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 1d217fc2..7f4cbdec 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -125,7 +125,7 @@ void ItemDB::loadEmptyItemDefinition() std::string errFile = paths.getStringValue("spriteErrorFile"); mUnknown->setSprite(errFile, Gender::Male, 0); mUnknown->setSprite(errFile, Gender::Female, 0); - mUnknown->setSprite(errFile, Gender::Hidden, 0); + mUnknown->setSprite(errFile, Gender::Neutral, 0); mUnknown->hitEffectId = paths.getIntValue("hitEffectId"); mUnknown->criticalHitEffectId = paths.getIntValue("criticalHitEffectId"); } @@ -184,7 +184,7 @@ void ItemDB::loadSpriteRef(ItemInfo &itemInfo, XML::Node node) if (gender == "female" || gender == "unisex") itemInfo.setSprite(filename, Gender::Female, race); if (gender == "hidden" || gender == "other" || gender == "unisex") - itemInfo.setSprite(filename, Gender::Hidden, race); + itemInfo.setSprite(filename, Gender::Neutral, race); } void ItemDB::loadSoundRef(ItemInfo &itemInfo, XML::Node node) diff --git a/src/resources/questdb.cpp b/src/resources/questdb.cpp index a3dda637..1424c20e 100644 --- a/src/resources/questdb.cpp +++ b/src/resources/questdb.cpp @@ -37,6 +37,11 @@ static bool contains(const Container &container, const Value &value) return std::find(container.begin(), container.end(), value) != container.end(); } +void init() +{ + unload(); +} + void readQuestVarNode(XML::Node node, const std::string &filename) { int varId = 0; diff --git a/src/resources/questdb.h b/src/resources/questdb.h index 5e943e76..43996b0b 100644 --- a/src/resources/questdb.h +++ b/src/resources/questdb.h @@ -123,6 +123,7 @@ enum class QuestChange namespace QuestDB { + void init(); void readQuestVarNode(XML::Node node, const std::string &filename); void unload(); diff --git a/src/resources/settingsmanager.cpp b/src/resources/settingsmanager.cpp index eabd63ae..3dfb5eb4 100644 --- a/src/resources/settingsmanager.cpp +++ b/src/resources/settingsmanager.cpp @@ -39,6 +39,9 @@ #include "log.h" #include "units.h" +#include <string> +#include <set> + namespace SettingsManager { static std::string mSettingsFile; @@ -54,6 +57,7 @@ namespace SettingsManager hairDB.init(); itemDb->init(); MonsterDB::init(); + QuestDB::init(); AbilityDB::init(); NPCDB::init(); EmoteDB::init(); diff --git a/src/resources/settingsmanager.h b/src/resources/settingsmanager.h index 5b70f865..d9a6994c 100644 --- a/src/resources/settingsmanager.h +++ b/src/resources/settingsmanager.h @@ -20,10 +20,6 @@ #pragma once -#include <string> -#include <list> -#include <set> - namespace SettingsManager { void load(); diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp index 2845f91e..ea2cef45 100644 --- a/src/resources/theme.cpp +++ b/src/resources/theme.cpp @@ -25,7 +25,6 @@ #include "configuration.h" #include "log.h" -#include "textrenderer.h" #include "resources/dye.h" #include "resources/image.h" @@ -419,13 +418,12 @@ void Theme::drawProgressBar(Graphics *graphics, const int textX = area.x + area.width / 2; const int textY = area.y + (area.height - font->getHeight()) / 2; - TextRenderer::renderText(graphics, - text, - textX, - textY, - gcn::Graphics::CENTER, - font, - *textFormat); + graphics->drawText(text, + textX, + textY, + gcn::Graphics::CENTER, + font, + *textFormat); } } @@ -531,6 +529,7 @@ static std::optional<SkinType> readSkinType(std::string_view type) if (type == "ToolWindow") return SkinType::ToolWindow; if (type == "Popup") return SkinType::Popup; if (type == "SpeechBubble") return SkinType::SpeechBubble; + if (type == "Desktop") return SkinType::Desktop; if (type == "Button") return SkinType::Button; if (type == "ButtonUp") return SkinType::ButtonUp; if (type == "ButtonDown") return SkinType::ButtonDown; @@ -695,7 +694,7 @@ void Theme::readSkinStateImgNode(XML::Node node, SkinState &state) const border.right = right; border.top = top; border.bottom = bottom; - border.image = image->getSubImage(x, y, width, height); + border.image.reset(image->getSubImage(x, y, width, height)); node.attribute("fill", border.fillMode); } @@ -794,6 +793,7 @@ static int readColorId(const std::string &id) "WHISPER_TAB", "BACKGROUND", "HIGHLIGHT", + "HIGHLIGHT_TEXT", "TAB_FLASH", "SHOP_WARNING", "ITEM_EQUIPPED", diff --git a/src/resources/theme.h b/src/resources/theme.h index 85a720a2..80b78fdd 100644 --- a/src/resources/theme.h +++ b/src/resources/theme.h @@ -71,6 +71,7 @@ enum class SkinType ToolWindow, Popup, SpeechBubble, + Desktop, Button, ButtonUp, ButtonDown, @@ -228,6 +229,7 @@ class Theme : public EventListener WHISPER_TAB, BACKGROUND, HIGHLIGHT, + HIGHLIGHT_TEXT, TAB_FLASH, SHOP_WARNING, ITEM_EQUIPPED, diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 2bdcd656..ece3e950 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -87,6 +87,7 @@ bool wallpaperCompare(const WallpaperData &a, const WallpaperData &b) void Wallpaper::loadWallpapers() { wallpaperData.clear(); + haveBackup = false; initWallpaperPaths(); |