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

Blank map when using higher resolution than 640x480 #9

Closed
JanSimek opened this issue May 22, 2022 · 2 comments
Closed

Blank map when using higher resolution than 640x480 #9

JanSimek opened this issue May 22, 2022 · 2 comments

Comments

@JanSimek
Copy link
Contributor

It seems to happen only on larger maps such as arcaves.map and broken1.map and not the smaller ones such as artemple.map or desert1.map .

When loading certain maps the tileSetCenter function fails and returns -1 on the following check:

fallout2-ce/src/tile.cc

Lines 508 to 512 in 0c61f74

if (_borderInitialized) {
if (tile_x <= _tile_border || tile_x >= dword_66BBCC || tile_y <= dword_66BBC8 || tile_y >= dword_66BBD0) {
return -1;
}
}

My guess is that the code above checks whether the center tile is outside of the scroll block area.

I suspect that the bug is somewhere in the _tile_set_border function. Specifically, this part looks suspicious as the windowWidth parameter is not used anywhere:

fallout2-ce/src/tile.cc

Lines 402 to 405 in 0c61f74

void _tile_set_border(int windowWidth, int windowHeight, int hexGridWidth, int hexGridHeight)
{
int v1 = tileFromScreenXY(-320, -240, 0);
int v2 = tileFromScreenXY(-320, windowHeight + 240, 0);

alexbatalov added a commit that referenced this issue May 23, 2022
@alexbatalov
Copy link
Owner

Check it on your map. I've seen something you describe in Gecko, but I'm not sure.

@JanSimek
Copy link
Contributor Author

The problem is in the tileFromScreenXY() function which relies on the _tile_offx and _tile_offy variables. These are in turn calculated from gTileWindowWidth (= real window width) and gTileWindowHeight (= real window height).

HRP for reference

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