-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
cGame_draw.cpp
60 lines (41 loc) · 1.57 KB
/
cGame_draw.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Dune II - The Maker
Author : Stefan Hendriks
Contact: [email protected]
Website: http://dune2themaker.fundynamic.com
2001 - 2022 (c) code by Stefan Hendriks
*/
#include "cGame.h"
#include "d2tmc.h"
#include "data/gfxdata.h"
#include <allegro.h>
// Fading between menu items
void cGame::initiateFadingOut() {
// set state to fade out
m_fadeAction = eFadeAction::FADE_OUT; // fade out
// copy the last bitmap of screen into a separate bitmap which we use for fading out.
draw_sprite(bmp_fadeout, bmp_screen, 0, 0);
}
// this shows the you have lost bmp at screen, after mouse press the mentat debriefing state will begin
void cGame::drawStateLosing() {
blit(bmp_winlose, bmp_screen, 0, 0, 0, 0, m_screenX, m_screenY);
draw_sprite(bmp_screen, (BITMAP *) gfxdata[MOUSE_NORMAL].dat, mouse_x, mouse_y);
if (m_mouse->isLeftButtonClicked()) {
m_state = GAME_LOSEBRIEF;
createAndPrepareMentatForHumanPlayer(!m_skirmish);
// FADE OUT
initiateFadingOut();
}
}
// this shows the you have won bmp at screen, after mouse press the mentat debriefing state will begin
void cGame::drawStateWinning() {
blit(bmp_winlose, bmp_screen, 0, 0, 0, 0, m_screenX, m_screenY);
draw_sprite(bmp_screen, (BITMAP *) gfxdata[MOUSE_NORMAL].dat, mouse_x, mouse_y);
if (m_mouse->isLeftButtonClicked()) {
// Mentat will be happy, after that enter "Select your next Conquest"
m_state = GAME_WINBRIEF;
createAndPrepareMentatForHumanPlayer(!m_skirmish);
// FADE OUT
initiateFadingOut();
}
}