changed tile.h and tile16.cc to snes_tile
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
include_directories(Library/cmake)
|
include_directories(lib/cmake)
|
||||||
include_directories(/usr/local/Cellar/libpng/1.6.37/include/libpng16/)
|
include_directories(/usr/local/Cellar/libpng/1.6.37/include/libpng16/)
|
||||||
|
|
||||||
# find libraries --------------------------------------------------------------------------------------------------
|
# find libraries --------------------------------------------------------------------------------------------------
|
||||||
@@ -49,7 +49,7 @@ add_executable(
|
|||||||
app/core/constants.cc
|
app/core/constants.cc
|
||||||
app/core/controller.cc
|
app/core/controller.cc
|
||||||
app/gfx/bitmap.cc
|
app/gfx/bitmap.cc
|
||||||
app/gfx/tile16.cc
|
app/gfx/snes_tile.cc
|
||||||
app/gfx/snes_palette.cc
|
app/gfx/snes_palette.cc
|
||||||
app/zelda3/overworld.cc
|
app/zelda3/overworld.cc
|
||||||
app/zelda3/overworld_map.cc
|
app/zelda3/overworld_map.cc
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "app/editor/dungeon_editor.h"
|
#include "app/editor/dungeon_editor.h"
|
||||||
#include "app/editor/overworld_editor.h"
|
#include "app/editor/overworld_editor.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
#include "app/gfx/snes_palette.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
#include "gui/canvas.h"
|
#include "gui/canvas.h"
|
||||||
#include "gui/icons.h"
|
#include "gui/icons.h"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "app/editor/dungeon_editor.h"
|
#include "app/editor/dungeon_editor.h"
|
||||||
#include "app/editor/overworld_editor.h"
|
#include "app/editor/overworld_editor.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
#include "app/gfx/snes_palette.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
#include "gui/canvas.h"
|
#include "gui/canvas.h"
|
||||||
#include "gui/icons.h"
|
#include "gui/icons.h"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
#include "app/gfx/snes_palette.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/zelda3/overworld.h"
|
#include "app/zelda3/overworld.h"
|
||||||
#include "gui/icons.h"
|
#include "gui/icons.h"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
#include "app/gfx/snes_palette.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/zelda3/overworld.h"
|
#include "app/zelda3/overworld.h"
|
||||||
#include "gui/icons.h"
|
#include "gui/icons.h"
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,27 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "app/core/constants.h"
|
#include "app/core/constants.h"
|
||||||
#include "tile.h"
|
#include "snes_tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
|
||||||
|
TileInfo GetTilesInfo(ushort tile) {
|
||||||
|
// vhopppcc cccccccc
|
||||||
|
ushort o = 0;
|
||||||
|
ushort v = 0;
|
||||||
|
ushort h = 0;
|
||||||
|
auto tid = (ushort)(tile & 0x3FF);
|
||||||
|
auto p = (uchar)((tile >> 10) & 0x07);
|
||||||
|
|
||||||
|
o = (ushort)((tile & 0x2000) >> 13);
|
||||||
|
h = (ushort)((tile & 0x4000) >> 14);
|
||||||
|
v = (ushort)((tile & 0x8000) >> 15);
|
||||||
|
|
||||||
|
return TileInfo(tid, p, v, h, o);
|
||||||
|
}
|
||||||
|
|
||||||
void BuildTiles16Gfx(uchar *mapblockset16, uchar *currentOWgfx16Ptr,
|
void BuildTiles16Gfx(uchar *mapblockset16, uchar *currentOWgfx16Ptr,
|
||||||
std::vector<Tile16> &allTiles) {
|
std::vector<Tile16> &allTiles) {
|
||||||
uchar *gfx16Data = mapblockset16;
|
uchar *gfx16Data = mapblockset16;
|
||||||
@@ -79,6 +79,7 @@ class Tile16 {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TileInfo GetTilesInfo(ushort tile);
|
||||||
void BuildTiles16Gfx(uchar* mapblockset16, uchar* currentOWgfx16Ptr,
|
void BuildTiles16Gfx(uchar* mapblockset16, uchar* currentOWgfx16Ptr,
|
||||||
std::vector<Tile16>& allTiles);
|
std::vector<Tile16>& allTiles);
|
||||||
void CopyTile16(int x, int y, int xx, int yy, int offset, TileInfo tile,
|
void CopyTile16(int x, int y, int xx, int yy, int offset, TileInfo tile,
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "app/core/constants.h"
|
#include "app/core/constants.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include "app/core/common.h"
|
#include "app/core/common.h"
|
||||||
#include "app/core/constants.h"
|
#include "app/core/constants.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "overworld.h"
|
#include "overworld.h"
|
||||||
|
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
@@ -10,28 +10,15 @@ namespace zelda3 {
|
|||||||
using namespace core;
|
using namespace core;
|
||||||
using namespace gfx;
|
using namespace gfx;
|
||||||
|
|
||||||
static TileInfo GetTilesInfo(ushort tile) {
|
|
||||||
// vhopppcc cccccccc
|
|
||||||
ushort o = 0;
|
|
||||||
ushort v = 0;
|
|
||||||
ushort h = 0;
|
|
||||||
auto tid = (ushort)(tile & 0x3FF);
|
|
||||||
auto p = (uchar)((tile >> 10) & 0x07);
|
|
||||||
|
|
||||||
o = (ushort)((tile & 0x2000) >> 13);
|
|
||||||
h = (ushort)((tile & 0x4000) >> 14);
|
|
||||||
v = (ushort)((tile & 0x8000) >> 15);
|
|
||||||
|
|
||||||
return TileInfo(tid, p, v, h, o);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Overworld::Load(ROM& rom, uchar* allGfxPtr) {
|
void Overworld::Load(ROM& rom, uchar* allGfxPtr) {
|
||||||
rom_ = rom;
|
rom_ = rom;
|
||||||
allGfx16Ptr = allGfxPtr;
|
allGfx16Ptr = allGfxPtr;
|
||||||
|
|
||||||
overworldMapPointer = std::make_shared<uchar>(0x40000);
|
overworldMapPointer = std::make_shared<uchar[]>(0x40000);
|
||||||
mapblockset16 = std::make_shared<uchar>(1048576);
|
mapblockset16 = std::make_shared<uchar[]>(1048576);
|
||||||
currentOWgfx16Ptr = std::make_shared<uchar>((128 * 512) / 2);
|
currentOWgfx16Ptr = std::make_shared<uchar[]>((128 * 512) / 2);
|
||||||
|
|
||||||
AssembleMap32Tiles();
|
AssembleMap32Tiles();
|
||||||
AssembleMap16Tiles();
|
AssembleMap16Tiles();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "app/core/constants.h"
|
#include "app/core/constants.h"
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
#include "app/zelda3/overworld_map.h"
|
#include "app/zelda3/overworld_map.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
#include "overworld_map.h"
|
#include "overworld_map.h"
|
||||||
|
|
||||||
|
#include <imgui/imgui.h>
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "app/core/common.h"
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "app/core/common.h"
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
@@ -37,8 +38,7 @@ class OverworldMap {
|
|||||||
uchar* staticgfx = new uchar[16];
|
uchar* staticgfx = new uchar[16];
|
||||||
std::vector<std::vector<ushort>> tiles_used_;
|
std::vector<std::vector<ushort>> tiles_used_;
|
||||||
|
|
||||||
OverworldMap(ROM& rom, const std::vector<gfx::Tile16>& tiles16,
|
OverworldMap(ROM& rom, const std::vector<gfx::Tile16>& tiles16, int index);
|
||||||
int index);
|
|
||||||
void BuildMap(uchar* mapParent, int count, int gameState,
|
void BuildMap(uchar* mapParent, int count, int gameState,
|
||||||
std::vector<std::vector<ushort>>& allmapsTilesLW,
|
std::vector<std::vector<ushort>>& allmapsTilesLW,
|
||||||
std::vector<std::vector<ushort>>& allmapsTilesDW,
|
std::vector<std::vector<ushort>>& allmapsTilesDW,
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ add_executable(
|
|||||||
yaze_test
|
yaze_test
|
||||||
yaze_test.cc
|
yaze_test.cc
|
||||||
../src/app/rom.cc
|
../src/app/rom.cc
|
||||||
../src/app/gfx/tile16.cc
|
../src/app/gfx/snes_tile.cc
|
||||||
../src/app/gfx/snes_palette.cc
|
../src/app/gfx/snes_palette.cc
|
||||||
|
../src/app/core/common.cc
|
||||||
${SNESHACKING_PATH}/compressions/alttpcompression.c
|
${SNESHACKING_PATH}/compressions/alttpcompression.c
|
||||||
${SNESHACKING_PATH}/compressions/stdnintendo.c
|
${SNESHACKING_PATH}/compressions/stdnintendo.c
|
||||||
${SNESHACKING_PATH}/tile.c
|
${SNESHACKING_PATH}/tile.c
|
||||||
|
|||||||
Reference in New Issue
Block a user