3
*************************************************************************
5
ArmageTron -- Just another Tron Lightcycle Game in 3D.
6
Copyright (C) 2000 Manuel Moos (manuel@moosnet.de)
8
**************************************************************************
10
This program is free software; you can redistribute it and/or
11
modify it under the terms of the GNU General Public License
12
as published by the Free Software Foundation; either version 2
13
of the License, or (at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
***************************************************************************
40
static tString lala_logoTexture("Anonymous/original/textures/KGN_logo.png");
41
static nSettingItem<tString> lalala_logoTexture("TEXTURE_LOGO", lala_logoTexture);
42
rFileTexture sg_LogoTexture(rTextureGroups::TEX_FONT, lala_logoTexture, 0,0,1);
45
static rFileTexture sg_LogoTexture(rTextureGroups::TEX_FONT, "textures/KGN_logo.png",0,0,1);
46
static rISurfaceTexture* sg_LogoMPTitle = NULL;
50
static bool sg_Displayed = true;
51
static bool sg_Spinning = false;
52
static bool sg_Big = true;
54
static eCoord sg_SpinStatus(1,0); // current spinning position
55
static REAL sg_SizeStatus(1); // 1 -> big , 0 -> small
56
static REAL sg_DisplayStatus(-1); // 1 -> displayed, 0->invisible
58
void gLogo::SetDisplayed(bool d, bool immediately)
60
if (sg_Displayed == false && d == true && sg_DisplayStatus < .01)
61
sg_SpinStatus = eCoord(0, 1);
65
sg_DisplayStatus = d ? 1 : 0;
68
void gLogo::SetSpinning(bool s)
72
sg_SpinStatus = eCoord(1, 0);
74
void gLogo::SetBig(bool b, bool immediately)
78
sg_SizeStatus = b ? 1 : 0;
83
static tString sg_title("Anonymous/original/textures/title.jpg");
84
static nSettingItem<tString> gg_title("TEXTURE_TITLE", sg_title);
86
static tString sg_mp_title("Anonymous/original/moviepack/title.jpg");
87
static nSettingItem<tString> gg_mp_title("TEXTURE_MP_TITLE", sg_mp_title);
96
if (sg_MoviePack() && !sg_LogoMPTitle)
98
sg_LogoMPTitle = tNEW(rFileTexture)(rTextureGroups::TEX_FONT, "moviepack/title.jpg",0,0,1);
99
// sg_LogoMPTitle = tNEW(rFileTexture)(rTextureGroups::TEX_FONT, sg_mp_title, 0,0,1);
100
sg_DisplayStatus = 1;
103
renderer->SetFlag(rRenderer::DEPTH_TEST, false);
105
static REAL lasttime = 0;
106
REAL time = tSysTimeFloat();
107
REAL dt = time - lasttime;
110
if (!sg_Displayed && sg_DisplayStatus < .00001)
115
// update state variables
116
if (sg_Displayed && sg_Big)
118
sg_DisplayStatus += dt;
119
if (sg_DisplayStatus > 1)
120
sg_DisplayStatus = 1;
124
sg_DisplayStatus -= dt;
125
if (sg_DisplayStatus < 0)
126
sg_DisplayStatus = 0;
129
sg_LogoMPTitle->Select();
131
if (sg_DisplayStatus <= .01 || !sg_LogoMPTitle->Loaded())
134
Color(1,1,1, sg_DisplayStatus);
154
sg_LogoMPTitle = tNEW(rFileTexture)(rTextureGroups::TEX_FONT, "textures/title.jpg",0,0,1);
155
// sg_LogoMPTitle = tNEW(rFileTexture)(rTextureGroups::TEX_FONT, sg_title,0,0,1);
157
sg_DisplayStatus = 1;
159
// update state variables
160
if (sg_Displayed && sg_Big)
162
sg_DisplayStatus += dt;
163
if (sg_DisplayStatus > 1)
164
sg_DisplayStatus = 1;
168
sg_DisplayStatus -= dt;
169
if (sg_DisplayStatus < 0)
170
sg_DisplayStatus = 0;
173
sg_LogoMPTitle->Select();
175
if (sg_DisplayStatus <= .01 || !sg_LogoMPTitle->Loaded())
178
Color(1,1,1, sg_DisplayStatus);
197
sg_LogoTexture.Select();
199
if ( !sg_LogoTexture.Loaded() )
204
// update state variables
207
sg_SpinStatus = sg_SpinStatus.Turn(1, dt * 2 * .2 / (sg_SizeStatus + .2));
208
sg_SpinStatus = sg_SpinStatus * (1/sqrt(sg_SpinStatus.NormSquared()));
214
if (sg_SizeStatus > 1)
219
sg_SizeStatus *= (1 - 2 * dt);
220
// if (sg_SizeStatus < 0)
221
// sg_SizeStatus = 0;
226
sg_DisplayStatus += dt;
227
if (sg_DisplayStatus > 1)
228
sg_DisplayStatus = 1;
232
sg_DisplayStatus -= dt*.3;
233
if (sg_DisplayStatus < 0)
234
sg_DisplayStatus = 0;
237
if (sg_DisplayStatus < 0)
240
eCoord center(.8*(sg_SizeStatus*sg_SizeStatus-1), .8*(1-sg_SizeStatus));
241
REAL e =.8 * (sg_SizeStatus + .1);
242
eCoord extension(e, - .7 * e * fabs(sg_SpinStatus.x));
244
eCoord ur = center - extension;
245
eCoord ll = center + extension;
247
Color(1,1,1, sg_DisplayStatus);
274
tDESTROY(sg_LogoMPTitle);