Sfoglia il codice sorgente

Test collisions.

legacy
Sam Hocevar sam 14 anni fa
parent
commit
f2213985f5
3 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. BIN
      doc/collisions.png
  2. +1
    -1
      src/test-map.cpp
  3. +3
    -3
      src/tiler.cpp

BIN
doc/collisions.png Vedi File

Prima Dopo
Larghezza: 704  |  Altezza: 672  |  Dimensione: 78 KiB

+ 1
- 1
src/test-map.cpp Vedi File

@@ -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 Vedi File

@@ -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,


Caricamento…
Annulla
Salva