Exemplo n.º 1
0
// Load new map
bool j1Map::Load(const char* file_name)
{
    bool ret = true;
    int numTileSets = 0;
    p2SString tmp("%s%s", folder.GetString(), file_name);

    char* buf;
    int size = App->fs->Load(tmp.GetString(), &buf);
    pugi::xml_parse_result result = map_file.load_buffer(buf, size);

//	RELEASE(buf);

    if(result == NULL)
    {
        LOG("Could not load map xml file %s. pugi error: %s", file_name, result.description());
        ret = false;
    }

    if(ret == true)
    {

        numTileSets = LoadMapInfo();// TODO 3: Create and call a private function to load and fill all your map data

    }

    if (numTileSets > 0)
        loadTileSet(numTileSets);// TODO 4: Create and call a private function to load a tileset

    if (map.numLayers > 0)
        LoadLayer(map.numLayers);//Fills maplayer with its information




    map_loaded = ret;

    return ret;
}
Exemplo n.º 2
0
GLTileSet::GLTileSet(const QString& fileName, int TileSize): tileSize(TileSize)
{
    loadTileSet(fileName);
}