Changeset 26 for trunk/Classes/loadscreen.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/loadscreen.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/loadscreen.cpp
r22 r26 44 44 #define MIN_PERCENTAGE 0 45 45 #define MAX_PERCENTAGE 100 46 47 extern bool gRedraw; 46 48 47 49 loadscreen::global_loadscreen_manager* loadscreen::global_loadscreen_manager::manager = 0; … … 209 211 font::word_wrap_text((*tip)["source"], font::SIZE_NORMAL, tip_width); 210 212 211 const int pad = game_config::title_tip_padding; 213 // const int pad = game_config::title_tip_padding; 214 215 #ifdef __IPAD__ 216 const int pad = 10; 217 #else 218 const int pad = 5; 219 #endif 212 220 213 221 SDL_Rect area = font::text_area(text,font::SIZE_NORMAL); … … 299 307 std::string path = game_config::path + "/data/core/images/" + file; 300 308 309 #ifdef __IPAD__ 310 int pvrtcSize = 1024; 311 #else 301 312 int pvrtcSize = 512; 313 #endif 302 314 GLsizei dataSize = (pvrtcSize * pvrtcSize * 4) / 8; 303 315 FILE *fp = fopen(path.c_str(), "rb"); … … 313 325 314 326 glGenTextures(1, &logo_texture_); 315 glBindTexture(GL_TEXTURE_2D, logo_texture_); 327 //glBindTexture(GL_TEXTURE_2D, logo_texture_); 328 cacheBindTexture(GL_TEXTURE_2D, logo_texture_, 1); 316 329 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 317 330 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); … … 319 332 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 320 333 glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, pvrtcSize, pvrtcSize, 0, dataSize, data); 334 #ifndef NDEBUG 321 335 GLenum err = glGetError(); 322 336 if (err != GL_NO_ERROR) … … 326 340 std::cerr << buffer; 327 341 } 342 #endif 328 343 329 344 free(data); … … 336 351 void loadscreen::set_progress(const int percentage, const std::string &text, const bool commit) 337 352 { 353 354 if (gRedraw) 355 { 356 gRedraw = false; 357 logo_drawn_ = false; 358 } 359 338 360 // Saturate percentage. 339 361 prcnt_ = percentage < MIN_PERCENTAGE ? MIN_PERCENTAGE: percentage > MAX_PERCENTAGE ? MAX_PERCENTAGE: percentage; … … 387 409 //SDL_BlitSurface (logo_surface_, 0, gdis, &area); 388 410 //screen_.blit_surface(0, 0, logo_surface_); 389 GLshort vertices[ 8];411 GLshort vertices[12]; 390 412 GLfloat texCoords[8]; 413 414 #ifdef __IPAD__ 415 int size = 1024; 416 #else 417 int size = 512; 418 #endif 391 419 392 420 vertices[0] = 0; 393 421 vertices[1] = 0; 394 vertices[2] = 512;395 vertices[3] = 0;422 vertices[2] = 0; 423 vertices[3] = size; 396 424 vertices[4] = 0; 397 vertices[5] = 512; 398 vertices[6] = 512; 399 vertices[7] = 512; 425 vertices[5] = 0; 426 vertices[6] = 0; 427 vertices[7] = size; 428 vertices[8] = 0; 429 vertices[9] = size; 430 vertices[10] = size; 431 vertices[11] = 0; 400 432 401 433 texCoords[0] = 0; … … 418 450 419 451 // draw logo over everything 452 #ifdef __IPAD__ 453 std::string path = game_config::path + "/data/core/images/misc/logo.png"; 454 surface logo_surface = IMG_Load(path.c_str()); 455 blit_surface((1024-logo_surface.get()->w)/2, -10, logo_surface); 456 457 458 SDL_Rect tip_area = {690, 306, 225, 140}; 459 draw_tip_of_day(screen_, tips_of_day, gui::dialog_frame::titlescreen_style,&tip_area); 460 #else 420 461 std::string path = game_config::path + "/data/core/images/misc/logo_small.png"; 421 462 surface logo_surface = IMG_Load(path.c_str()); … … 425 466 SDL_Rect tip_area = {242, 100, 225, 140}; 426 467 draw_tip_of_day(screen_, tips_of_day, gui::dialog_frame::titlescreen_style,&tip_area); 468 #endif 427 469 428 470 logo_drawn_ = true; … … 432 474 433 475 int pbx = (scrx - pbw)/2; // Horizontal location. 476 #ifdef __IPAD__ 477 int pby = 693; 478 #else 434 479 int pby = 276; //(scry - pbh)/2 + pby_offset_; // Vertical location. 480 #endif 435 481 436 482 // Draw top border.
Note: See TracChangeset
for help on using the changeset viewer.