mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
graphics: custom full screen resolution (#274)
## Link to GitHub Issue, if one exists
n/a
## Description of change
Adds a new option to forcibly set the full screen resolution.
Same idea as -windowscale.
## Compiling
🔺
## Testing
Seems to be showing similar results as -windowscale:
* Works GREAT for IIDX/SDVX
* popn launches at correct resolution but only draws a small image (at
native res) - can be scaled with F11 menu
* nostalgia is broken in weird ways, image is drawn correctly but bottom
`credits` text draws at wrong offset, game's wintouch logic broken
(perhaps expectedly)
## Other notes
In theory this could enable "play sdvx in landscape mode" option but the
image scaling doesn't quite work with extreme values.
This commit is contained in:
@@ -298,3 +298,16 @@ static inline int get_async_secondary_mouse() {
|
||||
int vk = GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON;
|
||||
return GetAsyncKeyState(vk);
|
||||
}
|
||||
|
||||
static inline bool parse_width_height(const std::string wh, std::pair<uint32_t, uint32_t> &result) {
|
||||
std::string s = wh;
|
||||
uint32_t w, h;
|
||||
const auto remove_spaces = [](const char& c) { return c == ' '; };
|
||||
s.erase(std::remove_if(s.begin(), s.end(), remove_spaces), s.end());
|
||||
if (sscanf(s.c_str(), "%u,%u", &w, &h) == 2) {
|
||||
result = std::pair(w, h);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user