Browse Source

Fix default tiler image.

legacy
Sam Hocevar sam 15 years ago
parent
commit
51a2711e19
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/tiler.cpp

+ 4
- 4
src/tiler.cpp View File

@@ -53,7 +53,7 @@ Tiler::Tiler()
data->ntiles = 0; data->ntiles = 0;


/* One tile texture */ /* One tile texture */
SDL_Surface *img = IMG_Load("art/test/groundtest.png");
SDL_Surface *img = IMG_Load("art/test/grasstest.png");


if (!img) if (!img)
{ {
@@ -106,16 +106,16 @@ void Tiler::Render()
for (int n = 0; n < data->ntiles; n++) for (int n = 0; n < data->ntiles; n++)
{ {
int tile = data->tiles[4 * n]; int tile = data->tiles[4 * n];
float ty = .0208333333f * (tile / 16);
float ty = .0625f * (tile / 16);
float tx = .0625f * (tile % 16); float tx = .0625f * (tile % 16);
uvs[8 * n + 0] = tx; uvs[8 * n + 0] = tx;
uvs[8 * n + 1] = ty; uvs[8 * n + 1] = ty;
uvs[8 * n + 2] = tx + .0625f; uvs[8 * n + 2] = tx + .0625f;
uvs[8 * n + 3] = ty; uvs[8 * n + 3] = ty;
uvs[8 * n + 4] = tx + .0625f; uvs[8 * n + 4] = tx + .0625f;
uvs[8 * n + 5] = ty + .0208333333f;
uvs[8 * n + 5] = ty + .0625f;
uvs[8 * n + 6] = tx; uvs[8 * n + 6] = tx;
uvs[8 * n + 7] = ty + .0208333333f;
uvs[8 * n + 7] = ty + .0625f;
} }
glBindBuffer(GL_ARRAY_BUFFER, data->buflist[1]); glBindBuffer(GL_ARRAY_BUFFER, data->buflist[1]);
glBufferData(GL_ARRAY_BUFFER, glBufferData(GL_ARRAY_BUFFER,


Loading…
Cancel
Save