OpenXcom  1.0
Open-source clone of the original X-Com
StartState.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "../Engine/State.h"
21 #include <sstream>
22 
23 namespace OpenXcom
24 {
25 
26 class Text;
27 class Font;
28 class Timer;
29 class Language;
30 
31 enum LoadingPhase { LOADING_STARTED, LOADING_FAILED, LOADING_SUCCESSFUL, LOADING_DONE };
32 
36 class StartState : public State
37 {
38 private:
39  Text *_text, *_cursor;
40  Font *_font;
41  Timer *_timer;
42  Language *_lang;
43  int _anim;
44 
45  SDL_Thread *_thread;
46  std::ostringstream _output;
47 public:
48  static LoadingPhase loading;
49  static std::string error;
50 
52  StartState();
54  ~StartState();
56  void init();
58  void think();
60  void handle(Action *action);
62  void animate();
64  void addLine(const std::string &str);
66  static int load(void *game_ptr);
67 };
68 
69 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
static int load(void *game_ptr)
Loads the game resources.
Definition: StartState.cpp:278
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Timer used to run code in fixed intervals.
Definition: Timer.h:35
Text string displayed on screen.
Definition: Text.h:40
void animate()
Animates the terminal.
Definition: StartState.cpp:207
void init()
Reset everything.
Definition: StartState.cpp:124
Initializes the game and loads all required content.
Definition: StartState.h:36
Contains strings used throughout the game for localization.
Definition: Language.h:39
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:46
void think()
Displays messages.
Definition: StartState.cpp:149
void addLine(const std::string &str)
Adds a line of text.
Definition: StartState.cpp:263
~StartState()
Cleans up the Start state.
Definition: StartState.cpp:110
StartState()
Creates the Start state.
Definition: StartState.cpp:51
void handle(Action *action)
Handles key clicks.
Definition: StartState.cpp:192
Definition: BaseInfoState.cpp:40