Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Commit

Permalink
added command line support to select screen resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
neuromancer committed Dec 13, 2020
1 parent 600def2 commit 6f5d958
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from time import sleep
from pathlib import Path
from random import choice
from argparse import ArgumentParser

import pygame

Expand Down Expand Up @@ -348,18 +349,20 @@ def check_for_events():

if __name__ == '__main__':

if (len(argv) == 2):
state.cdrom_path = argv[1]
else:
print("A path to the CDROM files is required")
exit(-1)
# Arguments
parser = ArgumentParser(description='re-private-eye')
parser.add_argument("CDROM", help="Path to CDROM", type=str)
parser.add_argument("-height", help="Screen height", type=int, default=1024)
parser.add_argument("-width", help="Screen height", type=int, default=768)

options = parser.parse_args()
state.height, state.width = options.height, options.width
state.cdrom_path = options.CDROM

if not isdir(state.cdrom_path):
print(state.cdrom_path, "does not exists")
exit(-1)


#assert(0)
pygame.init()
pygame.font.init() # you have to call this at the start,
state.font = pygame.font.SysFont(pygame.font.get_default_font(), 70)
Expand Down
4 changes: 2 additions & 2 deletions state.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

# Media

height = 1024
width = 768
height = None
width = None
cdrom_path = None
video_to_play = None
sound_to_play = None
Expand Down

0 comments on commit 6f5d958

Please sign in to comment.