Removed that logo from this bramch aswell..
[dbw.git] / src / cutscene.cpp
blobd45b214323f90337e5cbcfe0ddbb70bda018c705
1 /*
2 Copyright © 2004 Parallel Realities
3 Copyright © 2007-2008 Kővágó Zoltán <DirtY.iCE.hu@gmail.com>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include "CEngine.h"
23 #include "CGame.h"
24 #include "CGraphics.h"
25 #include "console/console.hpp"
26 #include "screens/cutscene.hpp"
28 /**
29 * @file src/cutscene.cpp
30 * Currently an ugly hack, see screens/cutscene.cpp for the actual cutscene code.
34 /**
35 * @todo Implement the new map system, then replace this ugly hack!
37 void checkStartCutscene()
39 #if DEMO
40 return;
41 #endif
43 // Easy mode doesn't have cutscenes!
44 // * hmm.. in easy mode you couldn't reach these levels at all!
45 /*if (game.skill == 0)
47 return;
48 }*/
50 std::string cutscene_file;
52 debug("misc", 2) << "Check begin cutscene '" << game.stageName << "'" << std::endl;
54 if (strcmp(game.stageName, "BioMech Assimilator") == 0)
55 cutscene_file = "levels/original/biomech_assimilator.start.dbwcs";
56 else if (strcmp(game.stageName, "BioMech Communications") == 0)
57 cutscene_file = "levels/original/biomech_communications.start.dbwcs";
58 else if (strcmp(game.stageName, "BioMech HQ") == 0)
59 cutscene_file = "levels/original/biomech_hq.start.dbwcs";
60 else if (strcmp(game.stageName, "Final Battle") == 0)
61 cutscene_file = "levels/original/final_battle.start.dbwcs";
62 else if (strcmp(game.stageName, "BioMech Supply Depot") == 0)
63 cutscene_file = "levels/original/biomech_supplydepot.start.dbwcs";
64 else
65 return;
67 Screens::Cutscene cutscene(cutscene_file);
69 bool ok = true;
71 while (ok = cutscene.EventProcess())
73 cutscene.Draw();
74 graphics.updateScreen();
75 engine.getInput();
80 void checkEndCutscene()
82 /* // Easy mode doesn't have cutscenes!
83 if (game.skill == 0)
85 return;
86 }*/
88 debug("misc", 2) << "Check end cutscene '" << game.stageName << "'" << std::endl;
90 std::string cutscene_file;
92 if (strcmp(game.stageName, "Ancient Tomb #4") == 0)
93 cutscene_file = "levels/original/ancient_tomb_4.end.dbwcs";
94 else if (strcmp(game.stageName, "BioMech Assimilator") == 0)
95 cutscene_file = "levels/original/biomech_assimilator.end.dbwcs";
96 else if (strcmp(game.stageName, "BioMech Communications") == 0)
97 cutscene_file = "levels/original/biomech_communications.end.dbwcs";
98 else if (strcmp(game.stageName, "BioMech HQ") == 0)
99 cutscene_file = "levels/original/biomech_hq.end.dbwcs";
100 else if (strcmp(game.stageName, "BioMech Supply Depot") == 0)
101 cutscene_file = "levels/original/biomech_supplydepot.end.dbwcs";
102 else if (strcmp(game.stageName, "Final Battle") == 0)
103 cutscene_file = "levels/original/final_battle.end.dbwcs";
104 else
105 return;
107 Screens::Cutscene cutscene(cutscene_file);
109 bool ok = true;
111 while (ok = cutscene.EventProcess())
113 cutscene.Draw();
114 graphics.updateScreen();
115 engine.getInput();
119 void easyGameFinished()
122 Screens::Cutscene cutscene("levels/original/easy_mode.end.dbwcs");
124 bool ok = true;
126 while (ok = cutscene.EventProcess())
128 cutscene.Draw();
129 graphics.updateScreen();
130 engine.getInput();