fix overworld allocation on smart pointers

This commit is contained in:
Justin Scofield
2022-07-05 22:21:30 -04:00
parent d75169317b
commit fe4b3ca84f
2 changed files with 7 additions and 4 deletions

View File

@@ -29,6 +29,10 @@ void Overworld::Load(app::rom::ROM& rom, uchar* allGfxPtr) {
rom_ = rom;
allGfx16Ptr = allGfxPtr;
overworldMapPointer = std::make_shared<uchar[]>(0x40000);
mapblockset16 = std::make_shared<uchar[]>(1048576);
currentOWgfx16Ptr = std::make_shared<uchar[]>((128 * 512) / 2);
AssembleMap32Tiles();
AssembleMap16Tiles();
DecompressAllMapTiles();

View File

@@ -24,7 +24,7 @@ class Overworld {
inline auto GetCurrentGfxSetPtr() { return currentOWgfx16Ptr; }
inline auto GetMapBlockset16Ptr() { return mapblockset16; }
std::shared_ptr<uchar[]> overworldMapPointer = std::make_shared<uchar>(0x40000);
std::shared_ptr<uchar[]> overworldMapPointer;
gfx::Bitmap overworldMapBitmap;
private:
@@ -45,9 +45,8 @@ class Overworld {
std::vector<std::vector<ushort>> allmapsTilesSP; // 32 maps * (32*32 tiles)
uchar* allGfx16Ptr = nullptr;
std::shared_ptr<uchar[]> mapblockset16 = std::make_shared<uchar>(1048576);
std::shared_ptr<uchar[]> currentOWgfx16Ptr =
std::make_shared<uchar>((128 * 512) / 2);
std::shared_ptr<uchar[]> mapblockset16;
std::shared_ptr<uchar[]> currentOWgfx16Ptr;
std::vector<gfx::Tile16> tiles16;
std::vector<gfx::Tile32> tiles32;