Ignore:
Timestamp:
2010-05-28 07:39:52 (2 years ago)
Author:
kpoole
Message:

Episode 5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Classes/loadscreen.cpp

    r22 r26  
    4444#define MIN_PERCENTAGE   0 
    4545#define MAX_PERCENTAGE 100 
     46 
     47extern bool gRedraw; 
    4648 
    4749loadscreen::global_loadscreen_manager* loadscreen::global_loadscreen_manager::manager = 0; 
     
    209211            font::word_wrap_text((*tip)["source"], font::SIZE_NORMAL, tip_width); 
    210212             
    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 
    212220             
    213221            SDL_Rect area = font::text_area(text,font::SIZE_NORMAL); 
     
    299307    std::string path = game_config::path + "/data/core/images/" + file;  
    300308     
     309#ifdef __IPAD__ 
     310    int pvrtcSize = 1024; 
     311#else 
    301312    int pvrtcSize = 512; 
     313#endif 
    302314    GLsizei dataSize = (pvrtcSize * pvrtcSize * 4) / 8; 
    303315    FILE *fp = fopen(path.c_str(), "rb"); 
     
    313325     
    314326    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); 
    316329    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 
    317330    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 
     
    319332    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 
    320333    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, pvrtcSize, pvrtcSize, 0, dataSize, data); 
     334#ifndef NDEBUG 
    321335    GLenum err = glGetError(); 
    322336    if (err != GL_NO_ERROR) 
     
    326340        std::cerr << buffer; 
    327341    } 
     342#endif 
    328343     
    329344    free(data); 
     
    336351void loadscreen::set_progress(const int percentage, const std::string &text, const bool commit) 
    337352{ 
     353     
     354    if (gRedraw) 
     355    { 
     356        gRedraw = false; 
     357        logo_drawn_ = false; 
     358    } 
     359     
    338360    // Saturate percentage. 
    339361    prcnt_ = percentage < MIN_PERCENTAGE ? MIN_PERCENTAGE: percentage > MAX_PERCENTAGE ? MAX_PERCENTAGE: percentage; 
     
    387409        //SDL_BlitSurface (logo_surface_, 0, gdis, &area);       
    388410        //screen_.blit_surface(0, 0, logo_surface_); 
    389         GLshort vertices[8]; 
     411        GLshort vertices[12]; 
    390412        GLfloat texCoords[8]; 
     413         
     414#ifdef __IPAD__ 
     415        int size = 1024; 
     416#else 
     417        int size = 512; 
     418#endif 
    391419         
    392420        vertices[0] = 0; 
    393421        vertices[1] = 0; 
    394         vertices[2] = 512; 
    395         vertices[3] = 0; 
     422        vertices[2] = 0; 
     423        vertices[3] = size; 
    396424        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; 
    400432 
    401433        texCoords[0] = 0; 
     
    418450         
    419451        // 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 
    420461        std::string path = game_config::path + "/data/core/images/misc/logo_small.png"; 
    421462        surface logo_surface = IMG_Load(path.c_str()); 
     
    425466        SDL_Rect tip_area = {242, 100, 225, 140}; 
    426467        draw_tip_of_day(screen_, tips_of_day, gui::dialog_frame::titlescreen_style,&tip_area); 
     468#endif 
    427469 
    428470        logo_drawn_ = true; 
     
    432474     
    433475    int pbx = (scrx - pbw)/2;                   // Horizontal location. 
     476#ifdef __IPAD__  
     477    int pby = 693; 
     478#else 
    434479    int pby = 276; //(scry - pbh)/2 + pby_offset_;      // Vertical location. 
     480#endif 
    435481 
    436482    // Draw top border. 
Note: See TracChangeset for help on using the changeset viewer.