Browse Source

Fix broken perspective.

legacy
Sam Hocevar sam 14 years ago
parent
commit
bf5fa55d25
3 changed files with 10 additions and 10 deletions
  1. +2
    -2
      src/debugsprite.cpp
  2. +1
    -1
      src/layer.cpp
  3. +7
    -7
      src/tileset.cpp

+ 2
- 2
src/debugsprite.cpp View File

@@ -65,9 +65,9 @@ void DebugSprite::TickDraw(float deltams)
int z = data->z;

data->game->GetScene()->AddTile((data->tiler << 16) | 31,
x - 16, y, z + 32, 1);
data->game->GetScene()->AddTile((data->tiler << 16) | 15,
x - 16, y, z, 1);
data->game->GetScene()->AddTile((data->tiler << 16) | 15,
x - 16, y, z + 32, 1);
}

DebugSprite::~DebugSprite()


+ 1
- 1
src/layer.cpp View File

@@ -41,7 +41,7 @@ void Layer::Render(Scene *scene, int x, int y, int z)
for (int i = 0; i < width; i++)
if (data[j * width + i])
scene->AddTile(data[j * width + i],
x + i * 32, y + j * 32 + altitude,
x + i * 32, y + j * 32 - altitude,
altitude + z, orientation);
}



+ 7
- 7
src/tileset.cpp View File

@@ -129,14 +129,14 @@ void TileSet::BlitTile(uint32_t id, int x, int y, int z, int o)
{
glBindTexture(GL_TEXTURE_2D, data->texture);
glBegin(GL_QUADS);
glTexCoord2f(tx, ty + data->ty);
glVertex3f(x, sqrt2 * (y - 70 + off), sqrt2 * (z + off));
glTexCoord2f(tx + data->tx, ty + data->ty);
glVertex3f(x + 32, sqrt2 * (y - 70 + off), sqrt2 * (z + off));
glTexCoord2f(tx + data->tx, ty);
glVertex3f(x + 32, sqrt2 * (y - 38), sqrt2 * z);
glTexCoord2f(tx, ty);
glVertex3f(x, sqrt2 * (y - 38), sqrt2 * z);
glVertex3f(x, sqrt2 * (y - 38 - off), sqrt2 * (z + off));
glTexCoord2f(tx + data->tx, ty);
glVertex3f(x + 32, sqrt2 * (y - 38 - off), sqrt2 * (z + off));
glTexCoord2f(tx + data->tx, ty + data->ty);
glVertex3f(x + 32, sqrt2 * (y - 70), sqrt2 * z);
glTexCoord2f(tx, ty + data->ty);
glVertex3f(x, sqrt2 * (y - 70), sqrt2 * z);
glEnd();
}
}


Loading…
Cancel
Save