]> icculus.org git repositories - theoddone33/hheretic.git/blob - pyhexen.py
Some 64-bit fixes
[theoddone33/hheretic.git] / pyhexen.py
1 import sys
2 import pyhexen
3 import pygame
4 from pygame.locals import *
5 import heretic
6
7 def input(events):
8         for event in events:
9                 if event.type == QUIT:
10                         sys.exit(0)
11
12 wad = pyhexen.wad.WadReader ()
13 wad.InitMultipleFiles (['heretic.wad'])
14
15 vid = pyhexen.vid.Video (wad)
16 vid.Init ()
17
18 vid.SetPalette (wad.CacheLumpName('PLAYPAL'))
19
20 menu = pyhexen.menu.Menu (wad, vid)
21
22 game = heretic
23
24 game.menus.CreateMenus (menu)
25
26 menu.Activate ()
27
28 while True:
29         menu.Tick ()
30         
31         vid.DrawRawScreen (wad.CacheLumpName('TITLE'))
32         vid.DrawPatch (4, 160, wad.CacheLumpName('ADVISOR'))
33
34         menu.Draw ()
35         
36         vid.WaitVBL ()
37         
38         input (pygame.event.get())
39