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

Fix #7672: more than 32 resolutions may be available #7677

Merged
merged 1 commit into from
Aug 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/strings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c
}

/* resolution size? */
if (IsInsideMM(ind, (SPECSTR_RESOLUTION_START - 0x70E4), (SPECSTR_RESOLUTION_END - 0x70E4) + 1)) {
if (IsInsideBS(ind, (SPECSTR_RESOLUTION_START - 0x70E4), _resolutions.size())) {
int i = ind - (SPECSTR_RESOLUTION_START - 0x70E4);
buff += seprintf(
buff, last, "%ux%u", _resolutions[i].width, _resolutions[i].height
Expand Down
3 changes: 1 addition & 2 deletions src/strings_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ enum SpecialStrings {
SPECSTR_LANGUAGE_START = 0x7100,
SPECSTR_LANGUAGE_END = SPECSTR_LANGUAGE_START + MAX_LANG - 1,

/* reserve 32 strings for various screen resolutions */
/* reserve strings for various screen resolutions MUST BE THE LAST VALUE IN THIS ENUM */
SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1,
SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F,
};

#endif /* STRINGS_TYPE_H */