Changeset 26 for trunk/Classes/TextureAtlas.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/TextureAtlas.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/TextureAtlas.cpp
r22 r26 73 73 break; 74 74 case MAP_BASE_TRANSITION: 75 //filename += "base_transition.map.png"; 75 #ifdef __IPAD__ 76 filename += "map.base_transition.png"; 77 #else 76 78 filename += "map.base_transition.pvrtc"; 77 79 pvrtcSize = 1024; 80 #endif 78 81 break; 79 82 case MAP_OVERLAY_MISC: … … 204 207 205 208 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 207 212 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 208 213 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); … … 238 243 fclose(fp); 239 244 glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, pvrtcSize, pvrtcSize, 0, dataSize, data); 245 246 #ifndef NDEBUG 240 247 GLenum err = glGetError(); 241 248 if (err != GL_NO_ERROR) … … 245 252 std::cerr << buffer; 246 253 } 254 #endif 247 255 248 256 free(data); … … 479 487 maxv = (GLfloat) (clippedSrc.y + clippedSrc.h) / gTexH[tinfo.mapId]; 480 488 481 GLshort vertices[ 8];489 GLshort vertices[12]; 482 490 GLfloat texCoords[8]; 483 491 484 492 vertices[0] = minx; 485 493 vertices[1] = miny; 486 vertices[2] = maxx;487 vertices[3] = m iny;488 vertices[4] = min x;489 vertices[5] = maxy;490 vertices[6] = m axx;494 vertices[2] = 0; 495 vertices[3] = maxx; 496 vertices[4] = miny; 497 vertices[5] = 0; 498 vertices[6] = minx; 491 499 vertices[7] = maxy; 500 vertices[8] = 0; 501 vertices[9] = maxx; 502 vertices[10] = maxy; 503 vertices[11] = 0; 492 504 /* 493 505 B---C -> A B … … 522 534 // glTexCoordPointer(2, GL_FLOAT, 0, texCoords); 523 535 // 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); 526 538 } 527 539
Note: See TracChangeset
for help on using the changeset viewer.