This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
frostbite/snowlib/WorldReader.h

24 lines
838 B
C
Raw Permalink Normal View History

2020-02-06 13:23:46 +13:00
#pragma once
2021-04-02 11:49:11 +13:00
#include <memory>
2021-03-23 13:05:58 +13:00
#include "GameType.h"
2020-02-06 13:23:46 +13:00
class World;
class LmpRepository;
class TopoPatch;
class WorldReader
{
public:
2021-03-23 13:05:58 +13:00
WorldReader(GameType gameType) : gameType(gameType) {}
2020-02-06 13:23:46 +13:00
World* readWorld(LmpRepository* lmpRepository, const char* name);
private:
2021-03-23 13:05:58 +13:00
GameType gameType;
2020-02-06 13:23:46 +13:00
void decodeWorldFile(World* world, const unsigned char* data, int dataLength);
void decodeTopography(World* world, const unsigned char* data, int dataLength);
2021-04-02 11:49:11 +13:00
std::shared_ptr<TopoPatch> readTopoPatch(const unsigned char* data, int offset);
2021-03-23 13:05:58 +13:00
void readTextureChunkOffsets(World* world, const unsigned char* data, int dataLength, int worldTexOffsetsOffset, int texMinx, int texMiny, int texMaxx, int texMaxy);
2021-04-02 11:49:11 +13:00
void readElements(World* world, const unsigned char* data, int dataLength, int elementBase, int numElements, int texMinx, int texMiny);
2020-02-06 13:23:46 +13:00
};