-
Notifications
You must be signed in to change notification settings - Fork 2
/
splash_screen.cpp
95 lines (78 loc) · 2.53 KB
/
splash_screen.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* --------------------------------------------------------------------
EXTREME TUXRACER
Copyright (C) 1999-2001 Jasmin F. Patry (Tuxracer)
Copyright (C) 2010 Extreme Tuxracer Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
---------------------------------------------------------------------*/
#include "splash_screen.h"
#include "ogl.h"
#include "textures.h"
#include "audio.h"
#include "gui.h"
#include "course.h"
#include "tux.h"
#include "env.h"
#include "particles.h"
#include "credits.h"
#include "font.h"
#include "game_ctrl.h"
#include "translation.h"
#include "score.h"
void SplashKeys (unsigned int key, bool /*special*/, bool release, int /*x*/, int /*y*/) {
if (release) return;
switch (key) {
case SDLK_ESCAPE: Winsys.Quit (); break;
case SDLK_RETURN: Winsys.SetMode (REGIST); break;
}
}
void SplashInit (void) {
Winsys.ShowCursor (!param.ice_cursor);
init_ui_snow ();
Music.Play (param.menu_music, -1);
g_game.loopdelay = 10;
}
static string fontnam[6] = {"normal", "italic", "bold", "outline", "pc20", "pcoutline"};
void SplashLoop (double /*timestep*/){
Music.Update ();
check_gl_error();
ClearRenderContext ();
set_gl_options (GUI);
SetupGuiDisplay ();
// FT.SetFont ("normal");
Tex.Draw (TEXLOGO, CENTER, 60, param.scale);
FT.SetColor (colDYell);
FT.AutoSizeN (6);
int top = AutoYPosN (60);
int dist = FT.AutoDistanceN (3);
FT.DrawText (CENTER, top, "Loading resources,");
FT.DrawText (CENTER, top+dist, "please wait ...");
if (param.ice_cursor) DrawCursor ();
Winsys.SwapBuffers();
Trans.LoadLanguages ();
Trans.LoadTranslations (param.language);
LoadCreditList ();
Char.LoadCharacterList ();
Course.LoadObjectTypes ();
Course.LoadTerrainTypes ();
Env.LoadEnvironmentList ();
Course.LoadCourseList ();
Score.LoadHighScore (); // after LoadCourseList !!!
Events.LoadEventList ();
Players.LoadAvatars (); // before LoadPlayers !!!
Players.LoadPlayers ();
Winsys.Delay (10);
Winsys.SetMode (REGIST);
}
void SplashTerm () {
}
void splash_screen_register() {
Winsys.SetModeFuncs (SPLASH, SplashInit, SplashLoop, SplashTerm,
SplashKeys, NULL, NULL, NULL, NULL, NULL);
}