Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/base/StarAssets.cpp7
-rw-r--r--source/client/StarClientApplication.cpp4
-rw-r--r--source/core/StarImageProcessing.cpp4
3 files changed, 12 insertions, 3 deletions
diff --git a/source/base/StarAssets.cpp b/source/base/StarAssets.cpp
index f1c1009..01a6001 100644
--- a/source/base/StarAssets.cpp
+++ b/source/base/StarAssets.cpp
@@ -103,7 +103,8 @@ Maybe<RectU> FramesSpecification::getRect(String const& frame) const {
}
Assets::Assets(Settings settings, StringList assetSources) {
- const char* const AssetsPatchSuffix = ".patch";
+ const char* AssetsPatchSuffix = ".patch";
+ const char* AssetsLuaPatchSuffix = ".patch.lua";
m_settings = std::move(settings);
m_stopThreads = false;
@@ -190,6 +191,10 @@ Assets::Assets(Settings settings, StringList assetSources) {
auto targetPatchFile = filename.substr(0, filename.size() - strlen(AssetsPatchSuffix));
if (auto p = m_files.ptr(targetPatchFile))
p->patchSources.append({filename, source});
+ } else if (filename.endsWith(AssetsLuaPatchSuffix, String::CaseInsensitive)) {
+ auto targetPatchFile = filename.substr(0, filename.size() - strlen(AssetsLuaPatchSuffix));
+ if (auto p = m_files.ptr(targetPatchFile))
+ p->patchSources.append({filename, source});
} else {
for (int i = 0; i < 10; i++) {
if (filename.endsWith(AssetsPatchSuffix + toString(i), String::CaseInsensitive)) {
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index e97a8b7..bcdc077 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -110,7 +110,7 @@ Json const AdditionalDefaultConfiguration = Json::parseJson(R"JSON(
"ChatBegin" : [ { "type" : "key", "value" : "Return", "mods" : [] } ],
"ChatBeginCommand" : [ { "type" : "key", "value" : "/", "mods" : [] } ],
"ChatStop" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
- "InterfaceHideHud" : [ { "type" : "key", "value" : "Z", "mods" : [ "LAlt" ] } ],
+ "InterfaceHideHud" : [ { "type" : "key", "value" : "F1", "mods" : [] } ],
"InterfaceChangeBarGroup" : [ { "type" : "key", "value" : "X", "mods" : [] } ],
"InterfaceDeselectHands" : [ { "type" : "key", "value" : "Z", "mods" : [] } ],
"InterfaceBar1" : [ { "type" : "key", "value" : "1", "mods" : [] } ],
@@ -129,7 +129,7 @@ Json const AdditionalDefaultConfiguration = Json::parseJson(R"JSON(
"EssentialBar4" : [ { "type" : "key", "value" : "N", "mods" : [] } ],
"InterfaceRepeatCommand" : [ { "type" : "key", "value" : "P", "mods" : [] } ],
"InterfaceToggleFullscreen" : [ { "type" : "key", "value" : "F11", "mods" : [] } ],
- "InterfaceReload" : [ ],
+ "InterfaceReload" : [],
"InterfaceEscapeMenu" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
"InterfaceInventory" : [ { "type" : "key", "value" : "I", "mods" : [] } ],
"InterfaceCodex" : [ { "type" : "key", "value" : "L", "mods" : [] } ],
diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp
index a56cedc..98f65f4 100644
--- a/source/core/StarImageProcessing.cpp
+++ b/source/core/StarImageProcessing.cpp
@@ -446,6 +446,10 @@ StringList imageOperationReferences(List<ImageOperation> const& operations) {
}
void processImageOperation(ImageOperation const& operation, Image& image, ImageReferenceCallback refCallback) {
+ if (image.bytesPerPixel() == 3) {
+ // Convert to an image format that has alpha so certain operations function properly
+ image = image.convert(image.pixelFormat() == PixelFormat::BGR24 ? PixelFormat::BGRA32 : PixelFormat::RGBA32);
+ }
if (auto op = operation.ptr<HueShiftImageOperation>()) {
image.forEachPixel([&op](unsigned, unsigned, Vec4B& pixel) {
if (pixel[3] != 0)