remove app namespace
This commit is contained in:
@@ -6,9 +6,8 @@
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
/**
|
||||
* @namespace yaze::app::zelda3
|
||||
* @namespace yaze::zelda3
|
||||
* @brief Zelda 3 specific classes and functions.
|
||||
*/
|
||||
namespace zelda3 {
|
||||
@@ -319,7 +318,7 @@ static const std::string TileTypeNames[] = {
|
||||
"$FF Door X top? (unused?)"};
|
||||
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_COMMON_H
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "absl/strings/string_view.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -459,7 +458,7 @@ constexpr static inline absl::string_view Type3RoomObjectNames[] = {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_DUNGEON_OBJECT_NAMES_H
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "app/zelda3/dungeon/object_renderer.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -114,5 +113,5 @@ void DungeonObjectRenderer::UpdateObjectBitmap() {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "app/zelda3/dungeon/object_names.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -53,5 +52,5 @@ class DungeonObjectRenderer : public SharedRom {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "app/zelda3/sprite/sprite.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -488,5 +487,5 @@ void Room::LoadChests() {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -4,22 +4,16 @@
|
||||
#include <dungeon.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/constants.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/rom.h"
|
||||
#include "app/zelda3/dungeon/room_object.h"
|
||||
#include "app/zelda3/sprite/sprite.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -113,11 +107,6 @@ class Room : public SharedRom {
|
||||
auto room_size_ptr() const { return room_size_pointer_; }
|
||||
auto set_room_size(uint64_t size) { room_size_ = size; }
|
||||
|
||||
RoomObject AddObject(short oid, uint8_t x, uint8_t y, uint8_t size,
|
||||
uint8_t layer) {
|
||||
return RoomObject(oid, x, y, size, layer);
|
||||
}
|
||||
|
||||
uint8_t blockset = 0;
|
||||
uint8_t spriteset = 0;
|
||||
uint8_t palette = 0;
|
||||
@@ -613,7 +602,7 @@ constexpr std::string_view kEntranceNames[] = {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -352,7 +351,7 @@ class RoomEntrance {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_DUNGEON_ROOM_ENTRANCE_H
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "room_object.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -133,5 +132,5 @@ void RoomObject::DrawTile(gfx::Tile16 t, int xx, int yy,
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -5,17 +5,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "app/emu/cpu/cpu.h"
|
||||
#include "app/emu/memory/memory.h"
|
||||
#include "app/emu/video/ppu.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/rom.h"
|
||||
#include "app/zelda3/dungeon/object_names.h"
|
||||
#include "app/zelda3/dungeon/object_renderer.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -209,7 +203,7 @@ class Subtype3 : public RoomObject {
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_DUNGEON_ROOM_OBJECT_H
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
@@ -88,7 +87,7 @@ static const std::string RoomTag[] = {"Nothing",
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_DUNGEON_ROOM_TAG_H
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
namespace {
|
||||
@@ -1337,5 +1336,5 @@ void Tracker::NewSR(Rom &rom, int bank) {
|
||||
|
||||
} // namespace music
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
/**
|
||||
* @namespace yaze::app::zelda3::music
|
||||
* @namespace yaze::zelda3::music
|
||||
* @brief Contains classes and functions for handling music data in Zelda 3.
|
||||
*
|
||||
* Based off of the HyruleMagic tracker code.
|
||||
@@ -254,7 +253,7 @@ class Tracker {
|
||||
|
||||
} // namespace music
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
#include "overworld.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <future>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/compression.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/rom.h"
|
||||
#include "app/zelda3/overworld/overworld_map.h"
|
||||
#include "app/zelda3/sprite/sprite.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace overworld {
|
||||
|
||||
@@ -1594,5 +1588,5 @@ absl::Status Overworld::SaveMapProperties() {
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
#include "app/zelda3/sprite/sprite.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
/**
|
||||
* @namespace yaze::app::zelda3::overworld
|
||||
* @namespace yaze::zelda3::overworld
|
||||
* @brief Represents the Overworld data.
|
||||
*/
|
||||
namespace overworld {
|
||||
@@ -277,7 +276,7 @@ private:
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "app/zelda3/common.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace overworld {
|
||||
|
||||
@@ -84,7 +83,7 @@ public:
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "app/zelda3/common.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace overworld {
|
||||
|
||||
@@ -204,7 +203,7 @@ class OverworldExit : public GameEntity {
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_OVERWORLD_EXIT_H_
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "app/zelda3/common.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace overworld {
|
||||
|
||||
@@ -102,7 +101,7 @@ public:
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_OVERWORLD_ITEM_H_
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "app/zelda3/overworld/overworld.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace overworld {
|
||||
|
||||
@@ -745,5 +744,5 @@ absl::Status OverworldMap::BuildBitmap(OWBlockset& world_blockset) {
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "app/zelda3/common.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace overworld {
|
||||
|
||||
@@ -187,7 +186,7 @@ class OverworldMap : public GfxContext {
|
||||
|
||||
} // namespace overworld
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
53
src/app/zelda3/screen/dungeon_map.cc
Normal file
53
src/app/zelda3/screen/dungeon_map.cc
Normal file
@@ -0,0 +1,53 @@
|
||||
#include "dungeon_map.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/platform/file_dialog.h"
|
||||
#include "app/core/platform/renderer.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace zelda3 {
|
||||
namespace screen {
|
||||
|
||||
absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
|
||||
std::array<gfx::Bitmap, 4> &sheets,
|
||||
gfx::Tilesheet &tile16_sheet,
|
||||
std::vector<uint8_t> &gfx_bin_data) {
|
||||
std::string bin_file = core::FileDialogWrapper::ShowOpenFileDialog();
|
||||
if (bin_file.empty()) {
|
||||
return absl::InternalError("No file selected");
|
||||
}
|
||||
|
||||
std::ifstream file(bin_file, std::ios::binary);
|
||||
if (file.is_open()) {
|
||||
// Read the gfx data into a buffer
|
||||
std::vector<uint8_t> bin_data((std::istreambuf_iterator<char>(file)),
|
||||
std::istreambuf_iterator<char>());
|
||||
auto converted_bin = gfx::SnesTo8bppSheet(bin_data, 4, 4);
|
||||
gfx_bin_data = converted_bin;
|
||||
tile16_sheet.clear();
|
||||
if (LoadDungeonMapTile16(converted_bin, true).ok()) {
|
||||
std::vector<std::vector<uint8_t>> gfx_sheets;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
gfx_sheets.emplace_back(converted_bin.begin() + (i * 0x1000),
|
||||
converted_bin.begin() + ((i + 1) * 0x1000));
|
||||
sheets[i] = gfx::Bitmap(128, 32, 8, gfx_sheets[i]);
|
||||
sheets[i].ApplyPalette(*rom.mutable_dungeon_palette(3));
|
||||
core::Renderer::GetInstance().RenderBitmap(&sheets[i]);
|
||||
}
|
||||
} else {
|
||||
return absl::InternalError("Failed to load dungeon map tile16");
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace screen
|
||||
} // namespace zelda3
|
||||
|
||||
} // namespace yaze
|
||||
@@ -4,8 +4,11 @@
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/gfx/tilesheet.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace screen {
|
||||
|
||||
@@ -38,8 +41,8 @@ struct DungeonMap {
|
||||
|
||||
DungeonMap(unsigned short boss_room, unsigned char nbr_of_floor,
|
||||
unsigned char nbr_of_basement,
|
||||
const std::vector<std::array<uint8_t, 25>>& floor_rooms,
|
||||
const std::vector<std::array<uint8_t, 25>>& floor_gfx)
|
||||
const std::vector<std::array<uint8_t, 25>> &floor_rooms,
|
||||
const std::vector<std::array<uint8_t, 25>> &floor_gfx)
|
||||
: boss_room(boss_room),
|
||||
nbr_of_floor(nbr_of_floor),
|
||||
nbr_of_basement(nbr_of_basement),
|
||||
@@ -47,9 +50,17 @@ struct DungeonMap {
|
||||
floor_gfx(floor_gfx) {}
|
||||
};
|
||||
|
||||
absl::Status LoadDungeonMapTile16(const std::vector<uint8_t> &gfx_data,
|
||||
bool bin_mode);
|
||||
|
||||
absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
|
||||
std::array<gfx::Bitmap, 4> &sheets,
|
||||
gfx::Tilesheet &tile16_sheet,
|
||||
std::vector<uint8_t> &gfx_bin_data);
|
||||
|
||||
} // namespace screen
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace screen {
|
||||
|
||||
@@ -93,5 +92,5 @@ absl::Status Inventory::BuildTileset() {
|
||||
|
||||
} // namespace screen
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace screen {
|
||||
|
||||
@@ -40,7 +39,7 @@ class Inventory : public SharedRom {
|
||||
|
||||
} // namespace screen
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_INVENTORY_H
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace screen {
|
||||
|
||||
@@ -124,5 +123,5 @@ void TitleScreen::LoadTitleScreen() {
|
||||
|
||||
} // namespace screen
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace screen {
|
||||
|
||||
@@ -77,7 +76,7 @@ class TitleScreen {
|
||||
|
||||
} // namespace screen
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_SCREEN_H
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
static const std::string kOverlordNames[] = {
|
||||
@@ -37,7 +36,7 @@ static const std::string kOverlordNames[] = {
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_SPRITE_OVERLORD_H
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "app/zelda3/overworld/overworld.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
void Sprite::UpdateMapProperties(uint16_t map_id) {
|
||||
@@ -911,5 +910,5 @@ void Sprite::DrawSpriteTile(int x, int y, int srcx, int srcy, int pal,
|
||||
}
|
||||
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "app/zelda3/sprite/overlord.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
static const std::string kSpriteDefaultNames[]{
|
||||
@@ -391,7 +390,7 @@ class Sprite : public GameEntity {
|
||||
};
|
||||
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
SpriteBuilder SpriteBuilder::Create(const std::string& spriteName) {
|
||||
@@ -149,5 +148,5 @@ SpriteInstruction SpriteInstruction::JumpToFunction(
|
||||
}
|
||||
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <vector>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
|
||||
class SpriteInstruction {
|
||||
@@ -125,7 +124,7 @@ class SpriteBuilder {
|
||||
};
|
||||
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_SPRITE_SPRITE_BUILDER_H_
|
||||
Reference in New Issue
Block a user