Merge branch 'master' of github.com:Allanis/LibD

This commit is contained in:
Tamir Atias 2012-04-17 20:55:32 +03:00
commit 054e4f0c08

View File

@ -1,5 +1,6 @@
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <string.h>
#include "Level.h" #include "Level.h"
#include "Layer.h" #include "Layer.h"
#include "Tileset.h" #include "Tileset.h"
@ -28,8 +29,8 @@ Level::~Level() {
_tilesets.clear(); _tilesets.clear();
if(_collisions) { if(_collisions) {
delete[] _collisions; delete[] _collisions;
_collisions = NULL; _collisions = NULL;
} }
if(_bgm) { if(_bgm) {
@ -73,7 +74,7 @@ bool Level::Load(const std::string& filename) {
for(int i = 0; i < map.GetNumLayers(); i++) { for(int i = 0; i < map.GetNumLayers(); i++) {
const Tmx::Layer* tmxLayer = map.GetLayer(i); const Tmx::Layer* tmxLayer = map.GetLayer(i);
if(!stricmp(tmxLayer->GetName().c_str(), "collision")) { if(!strcmp(tmxLayer->GetName().c_str(), "collision")) {
for(int x = 0; x < _width; x++) { for(int x = 0; x < _width; x++) {
for(int y = 0; y < _height; y++) { for(int y = 0; y < _height; y++) {
Tmx::MapTile tile = tmxLayer->GetTile(x, y); Tmx::MapTile tile = tmxLayer->GetTile(x, y);