From fbe20d1adc26e724c92a9070d49a97808676c047 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Mon, 15 Aug 2011 15:50:10 -0400 Subject: special camera mode --- camera.py | 13 +++++++++++++ images/doomhud.png | Bin 0 -> 17911 bytes 2 files changed, 13 insertions(+) create mode 100644 images/doomhud.png diff --git a/camera.py b/camera.py index c270472..d7c2038 100755 --- a/camera.py +++ b/camera.py @@ -79,6 +79,17 @@ class Camera(Thread): pygame.display.set_caption('') self.clock = pygame.time.Clock() + self.doom_mode = False + try: + if self.width == 640: # SECRET DOOM MODE! + print 'shotgun activated!' + self.doom_hud = pygame.image.load('images/doomhud.png').convert_alpha() + rect = self.doom_hud.get_rect() + self.doom_rect = rect.move(0, self.height - rect.height) + self.doom_mode = True + except: + pass + lower_bound, upper_bound = self.geometry.mesh.get_bounds() self.scale = np.linalg.norm(upper_bound-lower_bound) @@ -212,6 +223,8 @@ class Camera(Thread): self.kernels.ray_trace(np.int32(self.pixels_gpu.size), self.origins_gpu, self.directions_gpu, self.pixels_gpu, block=(self.nblocks,1,1), grid=(self.pixels_gpu.size//self.nblocks+1,1)) pygame.surfarray.blit_array(self.screen, self.pixels_gpu.get().reshape(self.size)) + if self.doom_mode: + self.screen.blit(self.doom_hud, self.doom_rect) pygame.display.flip() if self.movie: diff --git a/images/doomhud.png b/images/doomhud.png new file mode 100644 index 0000000..3c11b78 Binary files /dev/null and b/images/doomhud.png differ -- cgit