Changeset 1952
- Timestamp:
- Sep 26, 2012, 3:51:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tileset.cpp
r1808 r1952 269 269 float *vertex, float *texture) 270 270 { 271 float tx = data->tx * ((id & 0xffff) % data->count.x); 272 float ty = data->ty * ((id & 0xffff) / data->count.x); 271 float dtx = data->tx; 272 float dty = data->ty; 273 float tx = dtx * ((id & 0xffff) % data->count.x); 274 float ty = dty * ((id & 0xffff) / data->count.x); 273 275 274 276 int dx = data->size.x * scale.x; … … 276 278 int dz = o ? data->size.y * scale.y : 0; 277 279 280 /* If scaling is negative, switch triangle winding */ 281 if (scale.x * scale.y < 0.0f) 282 { 283 pos.x += dx; 284 dx = -dx; 285 286 tx += dtx; 287 dtx = -dtx; 288 } 289 278 290 if (!data->img && data->m_tex) 279 291 { … … 283 295 *vertex++ = pos.y + dy; 284 296 *vertex++ = pos.z + dz; 285 *texture++ = tx + d ata->tx;297 *texture++ = tx + dtx; 286 298 *texture++ = ty; 287 299 … … 295 307 *vertex++ = tmp[6] = pos.y; 296 308 *vertex++ = tmp[7] = pos.z; 297 *texture++ = tmp[8] = tx + d ata->tx;298 *texture++ = tmp[9] = ty + d ata->ty;309 *texture++ = tmp[8] = tx + dtx; 310 *texture++ = tmp[9] = ty + dty; 299 311 300 312 *vertex++ = tmp[5]; … … 314 326 *vertex++ = pos.z; 315 327 *texture++ = tx; 316 *texture++ = ty + d ata->ty;328 *texture++ = ty + dty; 317 329 } 318 330 else
Note: See TracChangeset
for help on using the changeset viewer.