mirror of
https://github.com/KranX/Vangers.git
synced 2025-12-01 07:25:28 +07:00
Fix segfaults when screenSizeY less then 600
This commit is contained in:
@@ -154,17 +154,18 @@ int XGR_Screen::init(int flags_in)
|
|||||||
int maxWidth = displayMode.w;
|
int maxWidth = displayMode.w;
|
||||||
int maxHeight = displayMode.h;
|
int maxHeight = displayMode.h;
|
||||||
|
|
||||||
|
const float maxAspect = 1280.0f / 600;
|
||||||
float aspect = (float) maxWidth / (float) maxHeight;
|
float aspect = (float) maxWidth / (float) maxHeight;
|
||||||
if (aspect < 4/3.f) {
|
if (aspect < 4/3.f) {
|
||||||
aspect = 4/3.f;
|
aspect = 4/3.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aspect > 13/6.f /* iPhone */) {
|
if (aspect > maxAspect) {
|
||||||
aspect = 13/6.f;
|
aspect = maxAspect;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->hdWidth = 1280;
|
this->hdWidth = 1280;
|
||||||
this->hdHeight = 1280 / aspect;
|
this->hdHeight = round(1280 / aspect);
|
||||||
|
|
||||||
std::cout<<"SDL_CreateWindowAndRenderer"<<std::endl;
|
std::cout<<"SDL_CreateWindowAndRenderer"<<std::endl;
|
||||||
if (XGR_FULL_SCREEN) {
|
if (XGR_FULL_SCREEN) {
|
||||||
|
|||||||
Reference in New Issue
Block a user