Changeset 195:b8701c0bb184


Ignore:
Timestamp:
Sep 3, 2013, 8:10:38 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
5d6ea0435ca8398b9034fd78b3160c5ef5b4e21c
Message:

Reorder startup to avoid pygame init issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/area_editor.py

    r187 r195  
    358358
    359359if __name__ == "__main__":
    360     if len(sys.argv) == 2:
    361         level = EditorLevel(sys.argv[1])
    362         level.load(pymunk.Space())
    363     elif len(sys.argv) == 4:
    364         level = EditorLevel(sys.argv[1], int(sys.argv[2]), int(sys.argv[3]))
    365     else:
     360    if len(sys.argv) not in [2, 4]:
    366361        print 'Please supply a levelname or levelname and level size'
    367362        sys.exit()
     
    370365    pygame.display.set_mode((SCREEN[0] + MENU_WIDTH, SCREEN[1]),
    371366                            pgl.SWSURFACE)
     367    if len(sys.argv) == 2:
     368        level = EditorLevel(sys.argv[1])
     369        level.load(pymunk.Space())
     370    elif len(sys.argv) == 4:
     371        level = EditorLevel(sys.argv[1], int(sys.argv[2]), int(sys.argv[3]))
    372372    pygame.display.set_caption('Nagslang Area Editor')
    373373    pygame.key.set_repeat(200, 100)
Note: See TracChangeset for help on using the changeset viewer.