Changeset 141


Ignore:
Timestamp:
Aug 19, 2010, 2:58:31 AM (10 years ago)
Author:
sam
Message:

Fix Z-sorting yet again, and add real level support to map loading.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/debugsprite.cpp

    r138 r141  
    5353    Asset::TickRender(delta_time);
    5454
    55     data->game->GetScene()->AddTile((data->tiler << 16) | 15, 300, 200, 32, 1);
    56     data->game->GetScene()->AddTile((data->tiler << 16) | 31, 300, 200, 0, 1);
     55    data->game->GetScene()->AddTile((data->tiler << 16) | 15, 320, 240, 32, 1);
     56    data->game->GetScene()->AddTile((data->tiler << 16) | 31, 320, 240, 0, 1);
    5757}
    5858
  • trunk/src/layer.cpp

    r137 r141  
    88#endif
    99
    10 #include <stdlib.h>
     10#include <cstdlib>
    1111
    1212#include "layer.h"
     
    4141        for (int i = 0; i < width; i++)
    4242            if (data[j * width + i])
    43                 scene->AddTile(data[j * width + i], x + i * 32, y + j * 32,
     43                scene->AddTile(data[j * width + i],
     44                               x + i * 32, y + j * 32 + altitude,
    4445                               altitude + z, orientation);
    4546}
  • trunk/src/map.cpp

    r133 r141  
    131131                                       sizeof(Layer **) * (data->nlayers + 1));
    132132            orientation = toupper(a) == 'V' ? 1 : 0;
     133            level = i * 32;
    133134            data->width = j;
    134135            data->height = k;
  • trunk/src/scene.cpp

    r138 r141  
    7373        data->tiles = (Tile *)realloc(data->tiles,
    7474                                      (data->ntiles + 1024) * sizeof(Tile));
    75     data->tiles[data->ntiles].prio = y - 2 * 32 * z + (o ? 0 : 32);
     75    data->tiles[data->ntiles].prio = -y - 2 * 32 * z + (o ? 0 : 32);
    7676    data->tiles[data->ntiles].code = code;
    7777    data->tiles[data->ntiles].x = x;
Note: See TracChangeset for help on using the changeset viewer.