Explorar el Código

Test collisions.

legacy
Sam Hocevar sam hace 14 años
padre
commit
f2213985f5
Se han modificado 3 ficheros con 4 adiciones y 4 borrados
  1. BIN
      doc/collisions.png
  2. +1
    -1
      src/test-map.cpp
  3. +3
    -3
      src/tiler.cpp

BIN
doc/collisions.png Ver fichero

Antes Después
Anchura: 704  |  Altura: 672  |  Tamaño: 78 KiB

+ 1
- 1
src/test-map.cpp Ver fichero

@@ -19,7 +19,7 @@ int nlayers = 0;

void LoadMap(void)
{
FILE *fp = popen("grep '^ ' maps/testmap.tmx | while read i; do echo -n \"$i\" | perl -MMIME::Base64 -ne 'print decode_base64($_)' | gunzip; done", "r");
FILE *fp = popen("grep '^ [^< ]' maps/testmap.tmx | while read i; do echo -n \"$i\" | perl -MMIME::Base64 -ne 'print decode_base64($_)' | gunzip; done", "r");
while (fp && !feof(fp))
{
layers[nlayers] = (int *)malloc(width * height * sizeof(int));


+ 3
- 3
src/tiler.cpp Ver fichero

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


Cargando…
Cancelar
Guardar