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

Add a function concerning RE Textures #30

Open
Olganix opened this issue May 15, 2018 · 2 comments
Open

Add a function concerning RE Textures #30

Olganix opened this issue May 15, 2018 · 2 comments

Comments

@Olganix
Copy link
Contributor

Olganix commented May 15, 2018

There is a second use of "Load textureblock" "sub_42D680(3);"
-the first is on Load Model function, because model and Textures are linked.
-the second is on a function witch
-read 4 bytes for cheaking (xx < 1700), else it's a infinity loop.
-copy 0x1A90u bytes in a global variable.

@JayFoxRox
Copy link
Member

JayFoxRox commented May 15, 2018

Pretty sure you are talking about this (patched US version):

//----- (00447420) --------------------------------------------------------
void sub_447420() {

  // Open textureblock
  sub_42D680(3);

  // Read 4 bytes from the textureblock and swap it; this is the number of textures
  sub_42D640(3, 0, &dword_E9823C, 4u);
  dword_E9823C = swap32(dword_E9823C);

  // Ensure that we have 1700 or less textures, hang otherwise
  if (dword_E9823C > 1700) {
    while(1);
  }

  //FIXME: Unknown
  // Global variable: `int32_t dword_E93860[1700];` - Texture pointers probably?
  memset(dword_E93860, 0, sizeof(dword_E93860));

  // Close the textureblock again
  sub_42D6F0(3);

  return;
}

@JayFoxRox
Copy link
Member

Someone should verify or redo my work and send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants