Skip to content

Commit 018efdc

Browse files
authored
Merge branch 'development' into dynamic-music-manager
2 parents 9c7515b + bfe4acb commit 018efdc

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3939

4040
</details>
4141

42+
<details><summary><b>Fixed</b></summary>
43+
44+
- Fixed an issue where palette index 255 was incorrectly showing as black.
45+
46+
</details>
47+
4248
## [Release v6.2.2] - 2024/02/24
4349

4450
<details><summary><b>Added</b></summary>

Data/Base.rte/Scripts/Shared/SecretCodeEntry.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ function SecretCodeEntry.Setup(callbackFunction, callbackSelfObject, codeSequenc
5959
secretCodeEntryData.callbackSelfObject = callbackSelfObject;
6060
secretCodeEntryData.codeSequenceOrCodeType = codeSequenceOrCodeType;
6161
secretCodeEntryData.sequenceLength = sequenceLength;
62+
if type(codeSequenceOrCodeType) == "table" then
63+
secretCodeEntryData.codeSequence = codeSequenceOrCodeType;
64+
end
6265
secretCodeEntryData.firstEntrySoundContainer = firstEntrySoundContainer or SecretCodeEntry.defaultFirstEntrySoundContainer;
6366
secretCodeEntryData.correctEntrySoundContainer = correctEntrySoundContainer or SecretCodeEntry.defaultCorrectEntrySoundContainer;
6467
secretCodeEntryData.incorrectEntrySoundContainer = incorrectEntrySoundContainer or SecretCodeEntry.defaultIncorrectEntrySoundContainer;

Source/Managers/LuaMan.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,24 +236,25 @@ void LuaStateWrapper::Initialize() {
236236

237237
luaL_dostring(m_State,
238238
// Add cls() as a shortcut to ConsoleMan:Clear().
239-
"cls = function() ConsoleMan:Clear(); end"
240-
"\n"
239+
"cls = function() ConsoleMan:Clear(); end\n"
241240
// Override "print" in the lua state to output to the console.
242-
"print = function(stringToPrint) ConsoleMan:PrintString(\"PRINT: \" .. tostring(stringToPrint)); end"
243-
"\n"
241+
"print = function(stringToPrint) ConsoleMan:PrintString(\"PRINT: \" .. tostring(stringToPrint)); end\n"
244242
// Override random functions to appear global instead of under LuaMan
245243
"SelectRand = function(lower, upper) return LuaMan:SelectRand(lower, upper); end;\n"
246244
"RangeRand = function(lower, upper) return LuaMan:RangeRand(lower, upper); end;\n"
247245
"PosRand = function() return LuaMan:PosRand(); end;\n"
248246
"NormalRand = function() return LuaMan:NormalRand(); end;\n"
249247
// Override "math.random" in the lua state to use RTETools MT19937 implementation. Preserve return types of original to not break all the things.
250-
"math.random = function(lower, upper) if lower ~= nil and upper ~= nil then return LuaMan:SelectRand(lower, upper); elseif lower ~= nil then return LuaMan:SelectRand(1, lower); else return LuaMan:PosRand(); end end"
251-
"\n"
248+
"math.random = function(lower, upper) if lower ~= nil and upper ~= nil then return LuaMan:SelectRand(lower, upper); elseif lower ~= nil then return LuaMan:SelectRand(1, lower); else return LuaMan:PosRand(); end end\n"
252249
// Override "dofile"/"loadfile" to be able to account for Data/ or Mods/ directory.
253-
"OriginalDoFile = dofile; dofile = function(filePath) filePath = PresetMan:GetFullModulePath(filePath); if filePath ~= '' then return OriginalDoFile(filePath); end end;"
254-
"OriginalLoadFile = loadfile; loadfile = function(filePath) filePath = PresetMan:GetFullModulePath(filePath); if filePath ~= '' then return OriginalLoadFile(filePath); end end;"
250+
"OriginalDoFile = dofile; dofile = function(filePath) filePath = PresetMan:GetFullModulePath(filePath); if filePath ~= '' then return OriginalDoFile(filePath); end end;\n"
251+
"OriginalLoadFile = loadfile; loadfile = function(filePath) filePath = PresetMan:GetFullModulePath(filePath); if filePath ~= '' then return OriginalLoadFile(filePath); end end;\n"
252+
// Override "require" to be able to track loaded packages so we can clear them when scripts are reloaded.
253+
"_RequiredPackages = {};\n"
254+
"OriginalRequire = require; require = function(filePath) _RequiredPackages[filePath] = true; return OriginalRequire(filePath); end;\n"
255+
"_ClearRequiredPackages = function() for k, v in pairs(_RequiredPackages) do package.loaded[k] = nil; end; _RequiredPackages = {}; end;\n"
255256
// Internal helper functions to add callbacks for async pathing requests
256-
"_AsyncPathCallbacks = {};"
257+
"_AsyncPathCallbacks = {};\n"
257258
"_AddAsyncPathCallback = function(id, callback) _AsyncPathCallbacks[id] = callback; end\n"
258259
"_TriggerAsyncPathCallback = function(id, param) if _AsyncPathCallbacks[id] ~= nil then _AsyncPathCallbacks[id](param); _AsyncPathCallbacks[id] = nil; end end\n");
259260
}
@@ -417,7 +418,7 @@ void LuaMan::Destroy() {
417418
}
418419

419420
void LuaStateWrapper::ClearUserModuleCache() {
420-
luaL_dostring(m_State, "for m, n in pairs(package.loaded) do if type(n) == \"boolean\" then package.loaded[m] = nil; end; end;");
421+
luaL_dostring(m_State, "_ClearRequiredPackages();");
421422
}
422423

423424
void LuaStateWrapper::ClearLuaScriptCache() {

Source/Managers/PostProcessMan.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ void PostProcessMan::CreateGLBackBuffers() {
125125
GL_CHECK(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, c_PaletteEntriesNumber, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0));
126126
GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
127127
GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
128+
GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
129+
GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
128130
UpdatePalette();
129131
GL_CHECK(glActiveTexture(GL_TEXTURE0));
130132
m_ProjectionMatrix = std::make_unique<glm::mat4>(glm::ortho(0.0F, static_cast<float>(g_WindowMan.GetResX()), 0.0F, static_cast<float>(g_WindowMan.GetResY()), -1.0F, 1.0F));

0 commit comments

Comments
 (0)