-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_intro.cpp
44 lines (35 loc) · 1008 Bytes
/
show_intro.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "header.h"
#include "globals.h"
bool show_intro() {
Mix_PlayChannel(-1, SOUNDS[SND_OPENING], 0);
// message processing loop
bool done = false;
while (!done) {
SDL_Event event;
while (SDL_PollEvent(&event))
{
// check for messages
switch (event.type)
{
// exit if the window is closed
case SDL_QUIT:
done = true;
break;
// check for keypresses
case SDL_KEYDOWN:
{
// exit if ANY PRESSED
done = true;
break;
}
} // end switch
} // end of message processing
print_full_picture(BITMAPS[IMG_INTRO]);
put_text_at(-1,300,"PRESS ANY KEY TO CONTINUE");
SDL_Flip(MAIN_SCREEN);
SDL_Delay(100);
}
Mix_HaltChannel(-1);
//Mix_HaltMusic();
return true;
}