mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Change mainmenu texture handling + small misc changes
Texture names must now be escaped in formspec elements image[], background[], image_button[], image_button_exit[]. Instead of special-case handling of texture loading (and unloading which was missing) in guiFormSpecMenu.cpp, use the newly created ISimpleTextureSource interface which is a minimal subset of ITextureSource. There is an implementation of this interface used by GUIEngine (MenuTextureSource). Fix an off-by-one bug in unescape_string; it caused requests for a texture called "\0".
This commit is contained in:
parent
da9fe64851
commit
3c4734d69a
11 changed files with 150 additions and 90 deletions
|
@ -307,7 +307,7 @@ inline std::string unescape_string(std::string &s)
|
|||
{
|
||||
std::string res;
|
||||
|
||||
for (size_t i = 0; i <= s.length(); i++) {
|
||||
for (size_t i = 0; i < s.length(); i++) {
|
||||
if (s[i] == '\\')
|
||||
i++;
|
||||
res += s[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue