diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld_editor.cc index abfb9e8b..b3c725fe 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld_editor.cc @@ -1,8 +1,9 @@ #include "overworld_editor.h" -#include +#include #include +#include #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" @@ -116,7 +117,7 @@ void OverworldEditor::DrawToolset() { ImGui::TableNextColumn(); if (ImGui::Button(ICON_MD_UPDATE)) { - overworld_.Load(rom_, allgfxBitmap.GetData()); + overworld_.Load(rom_); } ImGui::TableNextColumn(); diff --git a/src/app/editor/overworld_editor.h b/src/app/editor/overworld_editor.h index 6dba8697..e000c889 100644 --- a/src/app/editor/overworld_editor.h +++ b/src/app/editor/overworld_editor.h @@ -1,7 +1,10 @@ #ifndef YAZE_APP_EDITOR_OVERWORLDEDITOR_H #define YAZE_APP_EDITOR_OVERWORLDEDITOR_H -#include +#include + +#include +#include #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" @@ -39,7 +42,7 @@ class OverworldEditor { // pointer size 1048576 gfx::Bitmap tile16_blockset_bmp_; - // pointer size 32768 + // pointer size 32768 gfx::Bitmap current_gfx_bmp_; // pointer size 456704 @@ -77,7 +80,7 @@ class OverworldEditor { ImGuiTableFlags_SizingStretchSame; }; } // namespace editor -} // namespace gui +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/app/gfx/psuedo_vram.h b/src/app/gfx/psuedo_vram.h index 5c4d29e3..69d7ec12 100644 --- a/src/app/gfx/psuedo_vram.h +++ b/src/app/gfx/psuedo_vram.h @@ -6,7 +6,7 @@ #include #include -#include "app/core/gfx/bitmap.h" +#include "app/gfx/bitmap.h" namespace yaze { namespace app { diff --git a/src/app/zelda3/overworld.cc b/src/app/zelda3/overworld.cc index 82c7727c..2333068d 100644 --- a/src/app/zelda3/overworld.cc +++ b/src/app/zelda3/overworld.cc @@ -10,11 +10,8 @@ namespace zelda3 { using namespace core; using namespace gfx; - - -void Overworld::Load(ROM& rom, uchar* allGfxPtr) { +void Overworld::Load(ROM& rom) { rom_ = rom; - allGfx16Ptr = allGfxPtr; overworldMapPointer = std::make_shared(0x40000); mapblockset16 = std::make_shared(1048576); @@ -35,8 +32,7 @@ void Overworld::Load(ROM& rom, uchar* allGfxPtr) { for (int i = 0; i < 160; i++) { overworld_maps_[i].BuildMap(mapParent, size, gameState, allmapsTilesLW, allmapsTilesDW, allmapsTilesSP, - currentOWgfx16Ptr.get(), allGfx16Ptr, - mapblockset16.get()); + currentOWgfx16Ptr.get(), mapblockset16.get()); } isLoaded = true; diff --git a/src/app/zelda3/overworld.h b/src/app/zelda3/overworld.h index 1c3ff7fc..e51db07a 100644 --- a/src/app/zelda3/overworld.h +++ b/src/app/zelda3/overworld.h @@ -19,14 +19,11 @@ namespace zelda3 { class Overworld { public: - void Load(ROM& rom, uchar* allGfxPtr); + void Load(ROM& rom); auto GetTiles16() const { return tiles16; } auto GetCurrentGfxSetPtr() { return currentOWgfx16Ptr; } auto GetMapBlockset16Ptr() { return mapblockset16; } - std::shared_ptr overworldMapPointer; - gfx::Bitmap overworldMapBitmap; - private: ushort GenerateTile32(int i, int k, int dimension); void AssembleMap32Tiles(); @@ -44,7 +41,6 @@ class Overworld { std::vector> allmapsTilesDW; // 64 maps * (32*32 tiles) std::vector> allmapsTilesSP; // 32 maps * (32*32 tiles) - uchar* allGfx16Ptr = nullptr; std::shared_ptr mapblockset16; std::shared_ptr currentOWgfx16Ptr; @@ -53,6 +49,9 @@ class Overworld { std::vector map16tiles; std::vector overworld_maps_; + gfx::Bitmap overworldMapBitmap; + std::shared_ptr overworldMapPointer; + const int map32address[4] = { core::constants::map32TilesTL, core::constants::map32TilesTR, core::constants::map32TilesBL, core::constants::map32TilesBR}; diff --git a/src/app/zelda3/overworld_map.cc b/src/app/zelda3/overworld_map.cc index ce5ced0f..d89dcab7 100644 --- a/src/app/zelda3/overworld_map.cc +++ b/src/app/zelda3/overworld_map.cc @@ -117,10 +117,8 @@ void OverworldMap::BuildMap(uchar* mapparent_, int count, int gameState, std::vector>& allmapsTilesLW, std::vector>& allmapsTilesDW, std::vector>& allmapsTilesSP, - uchar* currentOWgfx16Ptr, uchar* allGfxPtr, - uchar* mapblockset16) { + uchar* currentOWgfx16Ptr, uchar* mapblockset16) { currentOWgfx16Ptr_ = currentOWgfx16Ptr; - allGfx16Ptr_ = allGfxPtr; mapblockset16_ = mapblockset16; if (large_map_) { @@ -190,6 +188,7 @@ void OverworldMap::CopyTile8bpp16(int x, int y, int tile, uchar* destbmpPtr, void OverworldMap::CopyTile8bpp16From8(int xP, int yP, int tileID, uchar* destbmpPtr, uchar* sourcebmpPtr) { auto gfx16Data = destbmpPtr; + // TODO: PSUEDO VRAM auto gfx8Data = currentOWgfx16Ptr_; int offsets[] = {0, 8, 4096, 4104}; @@ -343,7 +342,9 @@ void OverworldMap::BuildTileset(int gameState) { staticgfx[7] = 91; } + // TODO: PSUEDO VRAM DATA HERE uchar* currentmapgfx8Data = currentOWgfx16Ptr_; + // TODO: PUT GRAPHICS DATA HERE uchar const* allgfxData = allGfx16Ptr_; for (int i = 0; i < 16; i++) { diff --git a/src/app/zelda3/overworld_map.h b/src/app/zelda3/overworld_map.h index 197b4945..cf6d99bb 100644 --- a/src/app/zelda3/overworld_map.h +++ b/src/app/zelda3/overworld_map.h @@ -43,8 +43,7 @@ class OverworldMap { std::vector>& allmapsTilesLW, std::vector>& allmapsTilesDW, std::vector>& allmapsTilesSP, - uchar* currentOWgfx16Ptr, uchar* allGfxPtr, - uchar* mapblockset16); + uchar* currentOWgfx16Ptr, uchar* mapblockset16); void CopyTile8bpp16(int x, int y, int tile, uchar* destbmpPtr, uchar* sourcebmpPtr); void CopyTile8bpp16From8(int xP, int yP, int tileID, uchar* destbmpPtr,