Start folder for puzzle decks.
[naja.git] / naja / __main__.py
index 7bc1442f33b4113bdb91db71562d7da54a7c32c0..5b76b2d1e6aff75e73e39f1c05c38f9e99c2c62f 100644 (file)
@@ -6,9 +6,10 @@ import pygame.locals as pgl
 from naja.constants import SCREEN
 from naja.engine import Engine
 from naja.sound import sound
-from naja.options import parse_args
+from naja.options import parse_args, options
 from naja.resources.loader import Loader
 from naja.scenes.menu import MenuScene
+from naja.utils import warp_to_game_state
 
 
 def main():
@@ -21,7 +22,11 @@ def main():
     # can't use convert_alpha until we've created a window with set_mode
     r = Loader('data')
     r.CONVERT_ALPHA = False
-    pygame.display.set_icon(r.get_image('robot_24.png', basedir='icons'))
+    icon_filename = 'robot_24.png'
+    # OSX accepts big icons, but scales up small icons smoothly
+    if sys.platform == 'darwin':
+        icon_filename = 'robot_512.png'
+    pygame.display.set_icon(r.get_image(icon_filename, basedir='icons'))
 
     pygame.display.set_mode(SCREEN, pgl.SWSURFACE)
     pygame.display.set_caption('Robolock II')
@@ -30,6 +35,10 @@ def main():
     screen = pygame.display.get_surface()
     scene = MenuScene(None)
     engine = Engine(screen, scene, None)
+
+    if options.game_state is not None:
+        warp_to_game_state(options.game_state)
+
     engine.run()