1
0
forked from ndyer/pygame-dvd

fixing some formatting and adding a comment

This commit is contained in:
Nicholas Dyer 2025-01-06 23:16:06 -05:00
parent 2957bb867f
commit b96954c5c1
Signed by: ndyer
GPG Key ID: B4FEDEE7298D2503
2 changed files with 9 additions and 1 deletions

View File

@ -8,12 +8,19 @@ VALID_SURFACES = [
'steam_screen'
]
def get_screen_resolution():
"""
Gets the current resolution using xrandr
Returns:
tuple: The current resolution as a tuple.
"""
command_output = subprocess.check_output(['xrandr']).decode('utf-8')
for line in command_output.split('\n'):
if '*' in line:
return tuple(map(int, line.split()[0].split('x')))
def main(windowed_mode=False):
"""
Main scene manager to display the scenes of the application

View File

@ -6,6 +6,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SCALE_RATIO = (0.325 / 800.0)
SPEED_RATIO = (2.5 / 800.0)
class SteamLogo(pygame.sprite.Sprite):
"""
A Pygame sprite representing a Steam logo that moves around the screen.
@ -85,7 +86,7 @@ class SteamLogo(pygame.sprite.Sprite):
# If this is a mini logo, make it 80% darker
if self.is_mini:
color_surface.fill(tuple(int(x / 5) for x in new_color))
else: # If not, make it the generated color.
else: # If not, make it the generated color.
color_surface.fill(new_color)
# Replace the drawn image with a copy of the base image and apply the randomly generated color.