Changeset 422
- Timestamp:
- Feb 7, 2011, 9:21:50 PM (10 years ago)
- Location:
- trunk/monsterz
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/monsterz.h
r384 r422 19 19 static char const * const PNG_ICONS = "monsterz/gfx/icons.png"; 20 20 static char const * const PNG_TITLE = "monsterz/gfx/title0.png"; 21 static char const * const PNG_CLOUDS = "monsterz/gfx/titleclouds.png"; 22 static char const * const PNG_STARS = "monsterz/gfx/titlestars.png"; 21 23 static char const * const PNG_TITLEANIM[] = 22 24 { -
trunk/monsterz/title.cpp
r337 r422 31 31 32 32 private: 33 int title, logo;33 int title, stars, clouds, logo; 34 34 int anim[6]; 35 35 int event[7]; … … 51 51 } 52 52 period, nextperiod; 53 54 float2 cloudpos[5]; 55 float2 cloudspeed[5]; 53 56 54 57 float timer, length; … … 109 112 data->logo = Tiler::Register(PNG_LOGO, 380, 181, 1.0f); 110 113 data->title = Tiler::Register(PNG_TITLE, 384, 384, 1.0f); 114 data->stars = Tiler::Register(PNG_STARS, 384, 144, 1.0f); 115 data->clouds = Tiler::Register(PNG_CLOUDS, 160, 32, 1.0f); 111 116 for (int n = 0; n < 6; n++) 112 117 data->anim[n] = Tiler::Register(PNG_TITLEANIM[n], … … 120 125 data->timer = RandF(2000.0f, 3000.0f); 121 126 127 for (int n = 0; n < 5; n++) 128 { 129 data->cloudpos[n] = float2(RandF(384), RandF(130, 190)); 130 data->cloudspeed[n] = RandF(-0.01f, 0.01f); 131 } 132 122 133 position = int3(24, 72, 1); 123 134 bbox[0] = position; … … 140 151 static int const t1[] = { 31, 26, 7, 7, 32, 6, 31 }; 141 152 static int const t2[] = { 2, 4, 11, 4, 6, 2 }; 153 154 for (int n = 0; n < 5; n++) 155 { 156 data->cloudpos[n].x += deltams * data->cloudspeed[n].x; 157 if (data->cloudpos[n].x > 384.0f) 158 data->cloudpos[n].x -= 384.0f; 159 else if (data->cloudpos[n].x < 0.0f) 160 data->cloudpos[n].x += 384.0f; 161 } 142 162 143 163 switch (data->state) … … 235 255 Scene::GetDefault()->AddTile((data->title << 16) | backid, 24, 72, 1, 0); 236 256 257 /* The stars */ 258 if (data->period != TitleData::DAY) 259 { 260 Scene::GetDefault()->AddTile((data->stars << 16) | 0, 261 24 + 0, 72 + 240, 2, 0); 262 } 263 264 /* The clouds. FIXME: tune color grading later */ 265 int cloudoff = data->period == TitleData::DAY ? 0 : 3; 266 267 for (int n = 0; n < 5; n++) 268 { 269 int cloudid = n * 4 + cloudoff; 270 Scene::GetDefault()->AddTile((data->clouds << 16) | cloudid, 271 24 + data->cloudpos[n].x, 272 72 + data->cloudpos[n].y, 2, 0); 273 Scene::GetDefault()->AddTile((data->clouds << 16) | cloudid, 274 24 + data->cloudpos[n].x - 384.0f, 275 72 + data->cloudpos[n].y, 2, 0); 276 } 277 237 278 /* Maybe an animation? */ 238 279 int tiler = 0; … … 265 306 266 307 /* The logo, on top of the rest. */ 267 Scene::GetDefault()->AddTile((data->logo << 16) | 0, 26, 250, 2, 0);308 Scene::GetDefault()->AddTile((data->logo << 16) | 0, 26, 250, 3, 0); 268 309 } 269 310 … … 278 319 Tiler::Deregister(data->logo); 279 320 Tiler::Deregister(data->title); 321 Tiler::Deregister(data->stars); 322 Tiler::Deregister(data->clouds); 280 323 for (int n = 0; n < 6; n++) 281 324 Tiler::Deregister(data->anim[n]); -
trunk/monsterz/title.h
r332 r422 28 28 virtual ~Title(); 29 29 30 char const *GetName() { return "<title>"; } 31 30 32 int IsClicked() const; 31 33
Note: See TracChangeset
for help on using the changeset viewer.