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/TextureAtlas.cpp

    r22 r26  
    7373            break; 
    7474        case MAP_BASE_TRANSITION: 
    75             //filename += "base_transition.map.png"; 
     75#ifdef __IPAD__          
     76            filename += "map.base_transition.png"; 
     77#else 
    7678            filename += "map.base_transition.pvrtc"; 
    7779            pvrtcSize = 1024; 
     80#endif 
    7881            break; 
    7982        case MAP_OVERLAY_MISC: 
     
    204207     
    205208    glGenTextures(1, &gTexIds[mapId]);   
    206     glBindTexture(GL_TEXTURE_2D, gTexIds[mapId]); 
     209    //glBindTexture(GL_TEXTURE_2D, gTexIds[mapId]); 
     210    cacheBindTexture(GL_TEXTURE_2D, gTexIds[mapId], true); 
     211 
    207212    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 
    208213    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 
     
    238243        fclose(fp); 
    239244        glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, pvrtcSize, pvrtcSize, 0, dataSize, data); 
     245         
     246#ifndef NDEBUG       
    240247        GLenum err = glGetError(); 
    241248        if (err != GL_NO_ERROR) 
     
    245252            std::cerr << buffer; 
    246253        } 
     254#endif 
    247255         
    248256        free(data); 
     
    479487    maxv = (GLfloat) (clippedSrc.y + clippedSrc.h) / gTexH[tinfo.mapId]; 
    480488     
    481     GLshort vertices[8]; 
     489    GLshort vertices[12]; 
    482490    GLfloat texCoords[8]; 
    483491 
    484492    vertices[0] = minx; 
    485493    vertices[1] = miny; 
    486     vertices[2] = maxx; 
    487     vertices[3] = miny; 
    488     vertices[4] = minx; 
    489     vertices[5] = maxy; 
    490     vertices[6] = maxx; 
     494    vertices[2] = 0; 
     495    vertices[3] = maxx; 
     496    vertices[4] = miny; 
     497    vertices[5] = 0; 
     498    vertices[6] = minx; 
    491499    vertices[7] = maxy; 
     500    vertices[8] = 0; 
     501    vertices[9] = maxx; 
     502    vertices[10] = maxy; 
     503    vertices[11] = 0; 
    492504/*   
    493505    B---C       ->      A B 
     
    522534//  glTexCoordPointer(2, GL_FLOAT, 0, texCoords); 
    523535//  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 
    524     renderQueueAddTexture(vertices, texCoords, gTexIds[tinfo.mapId], drawColor, brightness); 
    525      
     536     
     537    renderQueueAddTexture(vertices, texCoords, gTexIds[tinfo.mapId], drawColor, brightness);     
    526538} 
    527539 
Note: See TracChangeset for help on using the changeset viewer.