Devilution
Diablo devolved - magic behind the 1996 computer game
doom.cpp
Go to the documentation of this file.
1 
6 #include "all.h"
7 
9 
12 BYTE *pDoomCel;
13 BOOL doomflag;
15 
16 /*
17 void doom_reset_state()
18 {
19  if (DoomQuestState <= 0) {
20  DoomQuestState = 0;
21  }
22 }
23 
24 void doom_play_movie()
25 {
26  if (DoomQuestState < 36001) {
27  DoomQuestState++;
28  if (DoomQuestState == 36001) {
29  PlayInGameMovie("gendata\\doom.smk");
30  DoomQuestState++;
31  }
32  }
33 }
34 */
35 
37 {
38  if (DoomQuestState == 36001) {
39  return 31;
40  }
41 
42  return DoomQuestState / 1200;
43 }
44 
46 {
47  pDoomCel = DiabloAllocPtr(0x38000);
48 }
49 
51 {
53 }
54 
56 {
57  if (doom_quest_time == 31) {
58  strcpy(tempstr, "Items\\Map\\MapZDoom.CEL");
59  } else if (doom_quest_time < 10) {
60  sprintf(tempstr, "Items\\Map\\MapZ000%i.CEL", doom_quest_time);
61  } else {
62  sprintf(tempstr, "Items\\Map\\MapZ00%i.CEL", doom_quest_time);
63  }
65 }
66 
67 void doom_init()
68 {
69  doomflag = TRUE;
71  doom_quest_time = doom_get_frame_from_time() == 31 ? 31 : 0;
73 }
74 
75 void doom_close()
76 {
77  if (doomflag) {
78  doomflag = FALSE;
79  doom_cleanup();
80  }
81 }
82 
83 void doom_draw()
84 {
85  if (!doomflag) {
86  return;
87  }
88 
89  if (doom_quest_time != 31) {
91  if (doom_stars_drawn >= 5) {
92  doom_stars_drawn = 0;
95  doom_quest_time = 0;
96  }
98  }
99  }
100 
102 }
103 
doom_load_graphics
void doom_load_graphics()
Definition: doom.cpp:55
doom_alloc_cel
void doom_alloc_cel()
Definition: doom.cpp:45
pDoomCel
BYTE * pDoomCel
Definition: doom.cpp:12
PANEL_Y
#define PANEL_Y
Definition: defs.h:137
doomflag
BOOL doomflag
Definition: doom.cpp:13
doom_get_frame_from_time
int doom_get_frame_from_time()
Definition: doom.cpp:36
MemFreeDbg
#define MemFreeDbg(p)
Definition: defs.h:157
doom_stars_drawn
int doom_stars_drawn
Definition: doom.cpp:11
doom_init
void doom_init()
Definition: doom.cpp:67
all.h
doom_draw
void doom_draw()
Definition: doom.cpp:83
LoadFileWithMem
DWORD LoadFileWithMem(const char *pszName, void *p)
Load a file in to the given buffer.
Definition: engine.cpp:830
SCREEN_WIDTH
#define SCREEN_WIDTH
Definition: defs.h:105
DEVILUTION_END_NAMESPACE
#define DEVILUTION_END_NAMESPACE
Definition: types.h:10
CelDraw
void CelDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit CEL sprite to the back buffer at the given coordinates.
Definition: engine.cpp:47
doom_cleanup
void doom_cleanup()
Definition: doom.cpp:50
tempstr
char tempstr[256]
Definition: control.cpp:41
DiabloAllocPtr
BYTE * DiabloAllocPtr(DWORD dwBytes)
Multithreaded safe malloc.
Definition: engine.cpp:765
doom_close
void doom_close()
Definition: doom.cpp:75
DoomQuestState
int DoomQuestState
Definition: doom.cpp:14
DEVILUTION_BEGIN_NAMESPACE
Definition: sha.cpp:10
SCREEN_X
#define SCREEN_X
Definition: defs.h:125
doom_quest_time
DEVILUTION_BEGIN_NAMESPACE int doom_quest_time
Definition: doom.cpp:10