-
Notifications
You must be signed in to change notification settings - Fork 32
Support for 64 tile textures (.w3e) #74
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
Conversation
New map options (.w3i): - Disable deny icon - Force default camera zoom - Force max camera zoom
…ro/War3Net into patch-2.0.3-environment
|
I understand the conditional code for the textureAndFlags union will be ugly either way, but here's how I solved it. Seems less clunky. Although it is only for deserialization: https://github.com/Luashine/wc3-packhelper-library/blob/e44513d50b4a44d2bb0549d892a0e00092a42fdd/example/w3e.lua#L64-L98 High-level explanation: texture doesn't need shifting and is saved in a separate variable immediately upon parsing. The flags are:
|
| private ushort _heightData; | ||
| private ushort _waterDataAndEdgeFlag; | ||
| private byte _textureDataAndFlags; | ||
| private ushort _textureDataAndFlags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to turn this into two separate bytes, one for texture (6 bits), and one for the flags (4 bits, this could even be a Flags enum). Even though it doesn't match the binary data, it would be a cleaner solution because you don't need to store the _formatVersion for every tile, and it'll keep the property getters/setters simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is basically what @Luashine suggested as well. Makes me wonder why Blizzard didn't just increase the limit to 256, they got 6 bits to spare anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retera went off talking about his renderer being limited to 16 tiles/textures etc. It's possible there's truth to that point and the WC3 render is the limiting factor in the end.
|
Could you also include an example .w3x or .w3e file to the test data? |
|
I have these test maps as folders, would you like me to upload them? old retail vs ptr and then the topic I was testing
|
|
@Luashine Just one v12 .w3e file is fine, it's mainly for test coverage. |
|
Fixed in #82 |
On the PTR for build 2.0.3.23052 Blizzard added support for 64 tile textures, up from 16.
Textures for each tile now use 6 bits instead of 4 and the rest of the flags have been shiftet to the left by 2.
Since there's no extra space otherwise, they've added 1 additional byte to all terrain tiles.