Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "TextureBlockSize" value of embedded textures is not dynamically calculated #1042

Closed
Dobby233Liu opened this issue Jul 9, 2022 · 0 comments · Fixed by #1048
Closed
Labels
bug Something isn't working

Comments

@Dobby233Liu
Copy link
Contributor

Dobby233Liu commented Jul 9, 2022

Describe the bug

A extra value was introduced in GM 2022.3 to texture pages in the TXTR chuck, which is the size of the texture data that the texture page contains.
For what the value is supposed to be, and since you can replace the texture data to anything through the ModLib interface, I suppose the value should be dynamically calculated during the serialization of texture pages. However, it's just read into the TextureBlockSize variable when texture pages are deserialized, which is simply written into the data file intact when texture pages are serialized. It's never recalculated in any way when the texture data is replaced, and for new, programmatically created UndertaleEmbeddedTexture instances, it's just set to 0.

The obvious effect of this is when new texture pages are added to data file, and are used in any way, graphics created from the page items in the texture page will not show up when the data file is ran. This visibly affects the NewTexturePacker script, which recreates texture pages anew; when it is ran on a GM 2022.3 game that uses the QOI image format, and the game is ran, no sprites or fonts will show up at all.

Reproducing steps

  1. Open a data file made in GM 2022.3
  2. Add a new texture page to the file programmatically, and add data to it
  3. Save the file
  4. Reopen the newly saved file
  5. Poke the new texture page and find it's TextureBlockSize is zero

or:

  1. Open a 2022.3 game that uses the QOI image format such as HoloCure
  2. Run NewTexturePacker.csx
  3. Save game and run
  4. Observe that no sprites and fonts show up

Setup Details

  1. UndertaleModTool version: commit b8a11a2
  2. Operating system: Windows 11
  3. Game: HoloCure
@Dobby233Liu Dobby233Liu added the bug Something isn't working label Jul 9, 2022
@Dobby233Liu Dobby233Liu changed the title TextureBlockSize for embedded textures is not dynamically updated TextureBlockSize for embedded textures is not dynamically calculated Jul 9, 2022
@Dobby233Liu Dobby233Liu changed the title TextureBlockSize for embedded textures is not dynamically calculated The "TextureBlockSize" value for embedded textures is not dynamically calculated Jul 9, 2022
@Dobby233Liu Dobby233Liu changed the title The "TextureBlockSize" value for embedded textures is not dynamically calculated The "TextureBlockSize" value of embedded textures is not dynamically calculated Jul 9, 2022
Dobby233Liu added a commit to Dobby233Liu/UndertaleModTool that referenced this issue Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant