mirror of
https://github.com/csd4ni3l/browser.git
synced 2026-01-01 04:03:43 +01:00
fix game crashing on startup because of a small issue
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import logging, traceback
|
import logging, traceback
|
||||||
|
|
||||||
import pyglet.display
|
import pyglet.display, arcade
|
||||||
|
|
||||||
def dump_platform():
|
def dump_platform():
|
||||||
import platform
|
import platform
|
||||||
@@ -41,7 +41,7 @@ def on_exception(*exc_info):
|
|||||||
|
|
||||||
def get_closest_resolution():
|
def get_closest_resolution():
|
||||||
allowed_resolutions = [(1366, 768), (1440, 900), (1600,900), (1920,1080), (2560,1440), (3840,2160)]
|
allowed_resolutions = [(1366, 768), (1440, 900), (1600,900), (1920,1080), (2560,1440), (3840,2160)]
|
||||||
screen_width, screen_height = pyglet.display.get_display().width, pyglet.display.get_display().height
|
screen_width, screen_height = arcade.get_screens()[0].width, arcade.get_screens()[0].height
|
||||||
if (screen_width, screen_height) in allowed_resolutions:
|
if (screen_width, screen_height) in allowed_resolutions:
|
||||||
if not allowed_resolutions.index((screen_width, screen_height)) == 0:
|
if not allowed_resolutions.index((screen_width, screen_height)) == 0:
|
||||||
closest_resolution = allowed_resolutions[allowed_resolutions.index((screen_width, screen_height))-1]
|
closest_resolution = allowed_resolutions[allowed_resolutions.index((screen_width, screen_height))-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user