Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,125 +0,0 @@
|
||||
#include "rom.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "Core/constants.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace Data {
|
||||
|
||||
ROM::~ROM() {
|
||||
if (loaded) {
|
||||
delete[] current_rom_;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: check if the rom has a header on load
|
||||
void ROM::LoadFromFile(const std::string &path) {
|
||||
size_ = std::filesystem::file_size(path.c_str());
|
||||
std::ifstream file(path.c_str(), std::ios::binary);
|
||||
if (!file.is_open()) {
|
||||
std::cout << "Error: Could not open ROM file " << path << std::endl;
|
||||
return;
|
||||
}
|
||||
current_rom_ = new unsigned char[size_];
|
||||
for (unsigned int i = 0; i < size_; i++) {
|
||||
char byte_read_ = ' ';
|
||||
file.read(&byte_read_, sizeof(char));
|
||||
current_rom_[i] = byte_read_;
|
||||
}
|
||||
file.close();
|
||||
memcpy(title, current_rom_ + 32704, 21);
|
||||
version_ = current_rom_[27];
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
std::vector<tile8> ROM::ExtractTiles(Graphics::TilePreset &preset) {
|
||||
std::cout << "Extracting tiles..." << std::endl;
|
||||
uint filePos = 0;
|
||||
uint size_out = 0;
|
||||
uint size = preset.length_;
|
||||
int tilePos = preset.pc_tiles_location_;
|
||||
std::vector<tile8> rawTiles;
|
||||
filePos = GetRomPosition(preset, tilePos, preset.SNESTilesLocation);
|
||||
std::cout << "ROM Position: " << filePos << " from "
|
||||
<< preset.SNESTilesLocation << std::endl;
|
||||
|
||||
// decompress the graphics
|
||||
auto data = (char *)malloc(sizeof(char) * size);
|
||||
memcpy(data, (current_rom_ + filePos), size);
|
||||
data = alttp_decompress_gfx(data, 0, size, &size_out, &compressed_size_);
|
||||
std::cout << "size: " << size << std::endl;
|
||||
std::cout << "lastCompressedSize: " << compressed_size_ << std::endl;
|
||||
if (data == nullptr) {
|
||||
std::cout << alttp_decompression_error << std::endl;
|
||||
return rawTiles;
|
||||
}
|
||||
|
||||
// unpack the tiles based on their depth
|
||||
unsigned tileCpt = 0;
|
||||
std::cout << "Unpacking tiles..." << std::endl;
|
||||
for (unsigned int tilePos = 0; tilePos < size;
|
||||
tilePos += preset.bits_per_pixel_ * 8) {
|
||||
tile8 newTile = unpack_bpp_tile(data, tilePos, preset.bits_per_pixel_);
|
||||
newTile.id = tileCpt;
|
||||
rawTiles.push_back(newTile);
|
||||
tileCpt++;
|
||||
}
|
||||
std::cout << "Done unpacking tiles" << std::endl;
|
||||
free(data);
|
||||
std::cout << "Done extracting tiles." << std::endl;
|
||||
return rawTiles;
|
||||
}
|
||||
|
||||
Graphics::SNESPalette ROM::ExtractPalette(Graphics::TilePreset &preset) {
|
||||
unsigned int filePos = GetRomPosition(preset, preset.pc_palette_location_,
|
||||
preset.SNESPaletteLocation);
|
||||
std::cout << "Palette pos : " << filePos << std::endl; // TODO: make this hex
|
||||
unsigned int palette_size = pow(2, preset.bits_per_pixel_); // - 1;
|
||||
|
||||
auto palette_data = std::make_unique<unsigned char[]>(palette_size * 2);
|
||||
memcpy(palette_data.get(), current_rom_ + filePos, palette_size * 2);
|
||||
|
||||
// char *ab = (char *)malloc(sizeof(char) * (palette_size * 2));
|
||||
// memcpy(ab, current_rom_ + filePos, palette_size * 2);
|
||||
|
||||
for (int i = 0; i < palette_size; i++) {
|
||||
std::cout << palette_data[i];
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
const unsigned char *data = palette_data.get();
|
||||
Graphics::SNESPalette pal(data);
|
||||
if (preset.no_zero_color_) {
|
||||
Graphics::SNESColor col;
|
||||
|
||||
col.setRgb(ImVec4(153, 153, 153, 255));
|
||||
pal.colors.push_back(col);
|
||||
pal.colors.erase(pal.colors.begin(),
|
||||
pal.colors.begin() + pal.colors.size() - 1);
|
||||
}
|
||||
return pal;
|
||||
}
|
||||
|
||||
uint32_t ROM::GetRomPosition(const Graphics::TilePreset &preset, int directAddr,
|
||||
unsigned int snesAddr) const {
|
||||
unsigned int filePos = -1;
|
||||
std::cout << "directAddr:" << directAddr << std::endl;
|
||||
if (directAddr == -1) {
|
||||
filePos = rommapping_snes_to_pc(snesAddr, type_, has_header_);
|
||||
} else {
|
||||
filePos = directAddr;
|
||||
if (has_header_) filePos += 0x200;
|
||||
}
|
||||
std::cout << "filePos:" << filePos << std::endl;
|
||||
return filePos;
|
||||
}
|
||||
|
||||
int AddressFromBytes(uchar addr1, uchar addr2, uchar addr3) {
|
||||
return (addr1 << 16) | (addr2 << 8) | addr3;
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
} // namespace Application
|
||||
} // namespace yaze
|
||||
@@ -32,19 +32,18 @@ add_library("NintendoCompression" STATIC ${SNESHACKING_SOURCES})
|
||||
add_executable(
|
||||
yaze
|
||||
yaze.cc
|
||||
Application/Core/controller.cc
|
||||
Application/Core/renderer.cc
|
||||
Application/Core/window.cc
|
||||
Application/Data/rom.cc
|
||||
Application/Data/OW/overworld.cc
|
||||
Application/Data/OW/overworld_map.cc
|
||||
Application/Graphics/bitmap.cc
|
||||
Application/Graphics/tile.cc
|
||||
Application/Graphics/palette.cc
|
||||
Application/Graphics/style.cc
|
||||
Application/Graphics/scene.cc
|
||||
Application/Editor/editor.cc
|
||||
Application/Editor/overworld_editor.cc
|
||||
application/Core/controller.cc
|
||||
application/Core/input.cc
|
||||
application/Data/rom.cc
|
||||
application/Data/OW/overworld.cc
|
||||
application/Data/OW/overworld_map.cc
|
||||
application/Graphics/bitmap.cc
|
||||
application/Graphics/tile.cc
|
||||
application/Graphics/palette.cc
|
||||
application/Graphics/style.cc
|
||||
application/Graphics/scene.cc
|
||||
application/Editor/editor.cc
|
||||
application/Editor/overworld_editor.cc
|
||||
# GUI libraries
|
||||
${IMGUI_PATH}/imgui.cpp
|
||||
${IMGUI_PATH}/imgui_demo.cpp
|
||||
@@ -67,7 +66,7 @@ add_executable(
|
||||
target_include_directories(
|
||||
yaze PUBLIC
|
||||
Library/
|
||||
Application/
|
||||
application/
|
||||
"C:/msys64/mingw64/include/libpng16"
|
||||
"C:/msys64/mingw64/include/SDL2"
|
||||
"C:/msys64/mingw64/include"
|
||||
|
||||
@@ -21,7 +21,7 @@ using uint = unsigned int;
|
||||
using uchar = unsigned char;
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Core {
|
||||
namespace Constants {
|
||||
|
||||
@@ -1226,7 +1226,7 @@ static const std::string TileTypeNames[] = {
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace Core
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "Editor/editor.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Core {
|
||||
|
||||
bool Controller::isActive() const { return active_; }
|
||||
@@ -181,5 +181,5 @@ void Controller::CreateGuiContext() {
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -15,7 +15,7 @@
|
||||
int main(int argc, char **argv);
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Core {
|
||||
|
||||
class Controller {
|
||||
@@ -49,7 +49,7 @@ class Controller {
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APPLICATION_CORE_CONTROLLER_H
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "controller.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
yaze::Application::Core::Controller controller;
|
||||
yaze::application::Core::Controller controller;
|
||||
controller.onEntry();
|
||||
while (controller.isActive()) {
|
||||
controller.onInput();
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Data {
|
||||
|
||||
using namespace Core;
|
||||
@@ -345,5 +345,5 @@ void Overworld::LoadOverworldMap() {
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "overworld_map.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Data {
|
||||
|
||||
class Overworld {
|
||||
@@ -68,7 +68,7 @@ class Overworld {
|
||||
};
|
||||
|
||||
} // namespace Data
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Data {
|
||||
|
||||
using namespace Core;
|
||||
@@ -355,5 +355,5 @@ void OverworldMap::BuildTileset(int gameState) {
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Data {
|
||||
|
||||
using ushort = unsigned short;
|
||||
@@ -73,5 +73,5 @@ class OverworldMap {
|
||||
};
|
||||
|
||||
} // namespace Data
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
246
src/application/Data/rom.cc
Normal file
246
src/application/Data/rom.cc
Normal file
@@ -0,0 +1,246 @@
|
||||
#include "rom.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "Core/constants.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace application {
|
||||
namespace Data {
|
||||
|
||||
ROM::~ROM() {
|
||||
if (loaded) {
|
||||
delete[] current_rom_;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: check if the rom has a header on load
|
||||
void ROM::LoadFromFile(const std::string &path) {
|
||||
size_ = std::filesystem::file_size(path.c_str());
|
||||
std::ifstream file(path.c_str(), std::ios::binary);
|
||||
if (!file.is_open()) {
|
||||
std::cout << "Error: Could not open ROM file " << path << std::endl;
|
||||
return;
|
||||
}
|
||||
current_rom_ = new unsigned char[size_];
|
||||
for (unsigned int i = 0; i < size_; i++) {
|
||||
char byte_read_ = ' ';
|
||||
file.read(&byte_read_, sizeof(char));
|
||||
current_rom_[i] = byte_read_;
|
||||
}
|
||||
file.close();
|
||||
memcpy(title, current_rom_ + 32704, 21);
|
||||
version_ = current_rom_[27];
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
std::vector<tile8> ROM::ExtractTiles(Graphics::TilePreset &preset) {
|
||||
std::cout << "Extracting tiles..." << std::endl;
|
||||
uint filePos = 0;
|
||||
uint size_out = 0;
|
||||
uint size = preset.length_;
|
||||
int tilePos = preset.pc_tiles_location_;
|
||||
std::vector<tile8> rawTiles;
|
||||
filePos = GetRomPosition(tilePos, preset.SNESTilesLocation);
|
||||
std::cout << "ROM Position: " << filePos << " from "
|
||||
<< preset.SNESTilesLocation << std::endl;
|
||||
|
||||
// decompress the graphics
|
||||
auto data = (char *)malloc(sizeof(char) * size);
|
||||
memcpy(data, (current_rom_ + filePos), size);
|
||||
data = alttp_decompress_gfx(data, 0, size, &size_out, &compressed_size_);
|
||||
std::cout << "size: " << size << std::endl;
|
||||
std::cout << "lastCompressedSize: " << compressed_size_ << std::endl;
|
||||
if (data == nullptr) {
|
||||
std::cout << alttp_decompression_error << std::endl;
|
||||
return rawTiles;
|
||||
}
|
||||
// data = Decompress(filePos);
|
||||
|
||||
// unpack the tiles based on their depth
|
||||
unsigned tileCpt = 0;
|
||||
std::cout << "Unpacking tiles..." << std::endl;
|
||||
for (unsigned int tilePos = 0; tilePos < size;
|
||||
tilePos += preset.bits_per_pixel_ * 8) {
|
||||
tile8 newTile = unpack_bpp_tile(data, tilePos, preset.bits_per_pixel_);
|
||||
newTile.id = tileCpt;
|
||||
rawTiles.push_back(newTile);
|
||||
tileCpt++;
|
||||
}
|
||||
std::cout << "Done unpacking tiles" << std::endl;
|
||||
free(data);
|
||||
std::cout << "Done extracting tiles." << std::endl;
|
||||
return rawTiles;
|
||||
}
|
||||
|
||||
Graphics::SNESPalette ROM::ExtractPalette(Graphics::TilePreset &preset) {
|
||||
uint filePos =
|
||||
GetRomPosition(preset.pc_palette_location_, preset.SNESPaletteLocation);
|
||||
std::cout << "Palette pos : " << filePos << std::endl; // TODO: make this hex
|
||||
uint palette_size = pow(2, preset.bits_per_pixel_); // - 1;
|
||||
|
||||
auto palette_data = std::make_unique<unsigned char[]>(palette_size * 2);
|
||||
memcpy(palette_data.get(), current_rom_ + filePos, palette_size * 2);
|
||||
|
||||
// char *ab = (char *)malloc(sizeof(char) * (palette_size * 2));
|
||||
// memcpy(ab, current_rom_ + filePos, palette_size * 2);
|
||||
|
||||
for (int i = 0; i < palette_size; i++) {
|
||||
std::cout << palette_data[i];
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
const unsigned char *data = palette_data.get();
|
||||
Graphics::SNESPalette pal(data);
|
||||
if (preset.no_zero_color_) {
|
||||
Graphics::SNESColor col;
|
||||
|
||||
col.setRgb(ImVec4(153, 153, 153, 255));
|
||||
pal.colors.push_back(col);
|
||||
pal.colors.erase(pal.colors.begin(),
|
||||
pal.colors.begin() + pal.colors.size() - 1);
|
||||
}
|
||||
return pal;
|
||||
}
|
||||
|
||||
uint32_t ROM::GetRomPosition(int direct_addr, uint snes_addr) const {
|
||||
unsigned int filePos = -1;
|
||||
std::cout << "directAddr:" << direct_addr << std::endl;
|
||||
if (direct_addr == -1) {
|
||||
filePos = rommapping_snes_to_pc(snes_addr, type_, has_header_);
|
||||
} else {
|
||||
filePos = direct_addr;
|
||||
if (has_header_) filePos += 0x200;
|
||||
}
|
||||
std::cout << "filePos:" << filePos << std::endl;
|
||||
return filePos;
|
||||
}
|
||||
|
||||
// unsigned char *sheetBuffer = (unsigned char *)malloc(0x1000);
|
||||
// unsigned char bitmask[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
|
||||
// void SNES3bppTo8bppSheet() // 128x32
|
||||
// {
|
||||
// char *buffer = new char[0x800];
|
||||
// int xx = 0; // positions where we are at on the sheet
|
||||
// int yy = 0;
|
||||
// int pos = 0;
|
||||
// int ypos = 0;
|
||||
// for (int i = 0; i < 64; i++) // for each tiles //16 per lines
|
||||
// {
|
||||
// for (int y = 0; y < 8; y++) // for each lines
|
||||
// {
|
||||
// //[0] + [1] + [16]
|
||||
// for (int x = 0; x < 8; x++) {
|
||||
// unsigned char b1 =
|
||||
// (unsigned char)((buffer[(y * 2) + (24 * pos)] & (bitmask[x])));
|
||||
// unsigned char b2 =
|
||||
// (unsigned char)(buffer[((y * 2) + (24 * pos)) + 1] &
|
||||
// (bitmask[x]));
|
||||
// unsigned char b3 =
|
||||
// (unsigned char)(buffer[(16 + y) + (24 * pos)] & (bitmask[x]));
|
||||
// unsigned char b = 0;
|
||||
// if (b1 != 0) {
|
||||
// b |= 1;
|
||||
// };
|
||||
// if (b2 != 0) {
|
||||
// b |= 2;
|
||||
// };
|
||||
// if (b3 != 0) {
|
||||
// b |= 4;
|
||||
// };
|
||||
// sheetBuffer[x + (xx) + (y * 128) + (yy * 1024)] = b;
|
||||
// }
|
||||
// }
|
||||
// pos++;
|
||||
// ypos++;
|
||||
// xx += 8;
|
||||
// if (ypos >= 16) {
|
||||
// yy++;
|
||||
// xx = 0;
|
||||
// ypos = 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
char *ROM::Decompress(int pos, bool reversed) {
|
||||
char *buffer = new char[0x800];
|
||||
for (int i = 0; i < 0x800; i++) {
|
||||
buffer[i] = 0;
|
||||
}
|
||||
unsigned int bufferPos = 0;
|
||||
unsigned char cmd = 0;
|
||||
unsigned int length = 0;
|
||||
|
||||
unsigned char databyte = (unsigned char)current_rom_[pos];
|
||||
while (true) {
|
||||
databyte = (unsigned char)current_rom_[pos];
|
||||
if (databyte == 0xFF) // End of decompression
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if ((databyte & 0xE0) == 0xE0) // Expanded Command
|
||||
{
|
||||
cmd = (unsigned char)((databyte >> 2) & 0x07);
|
||||
length =
|
||||
(unsigned short)(((current_rom_[pos] << 8) | current_rom_[pos + 1]) &
|
||||
0x3FF);
|
||||
pos += 2; // Advance 2 bytes in ROM
|
||||
} else // Normal Command
|
||||
{
|
||||
cmd = (unsigned char)((databyte >> 5) & 0x07);
|
||||
length = (unsigned char)(databyte & 0x1F);
|
||||
pos += 1; // Advance 1 byte in ROM
|
||||
}
|
||||
length += 1; // Every commands are at least 1 size even if 00
|
||||
switch (cmd) {
|
||||
case 00: // Direct Copy (Could be replaced with a MEMCPY)
|
||||
for (int i = 0; i < length; i++) {
|
||||
buffer[bufferPos++] = (unsigned char)current_rom_[pos++];
|
||||
}
|
||||
// Do not advance in the ROM
|
||||
break;
|
||||
case 01: // Byte Fill
|
||||
for (int i = 0; i < length; i++) {
|
||||
buffer[bufferPos++] = (unsigned char)current_rom_[pos];
|
||||
}
|
||||
pos += 1; // Advance 1 byte in the ROM
|
||||
break;
|
||||
case 02: // Word Fill
|
||||
for (int i = 0; i < length; i += 2) {
|
||||
buffer[bufferPos++] = (unsigned char)current_rom_[pos];
|
||||
buffer[bufferPos++] = (unsigned char)current_rom_[pos + 1];
|
||||
}
|
||||
pos += 2; // Advance 2 byte in the ROM
|
||||
break;
|
||||
case 03: // Increasing Fill
|
||||
{
|
||||
unsigned char incByte = (unsigned char)current_rom_[pos];
|
||||
for (int i = 0; i < (unsigned int)length; i++) {
|
||||
buffer[bufferPos++] = (unsigned char)incByte++;
|
||||
}
|
||||
pos += 1; // Advance 1 byte in the ROM
|
||||
} break;
|
||||
case 04: // Repeat (Reversed byte order for maps)
|
||||
{
|
||||
unsigned short s1 = ((current_rom_[pos + 1] & 0xFF) << 8);
|
||||
unsigned short s2 = ((current_rom_[pos] & 0xFF));
|
||||
unsigned short Addr = (unsigned short)(s1 | s2);
|
||||
for (int i = 0; i < length; i++) {
|
||||
buffer[bufferPos] = (unsigned char)buffer[Addr + i];
|
||||
bufferPos++;
|
||||
}
|
||||
pos += 2; // Advance 2 bytes in the ROM
|
||||
} break;
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
int AddressFromBytes(uchar addr1, uchar addr2, uchar addr3) {
|
||||
return (addr1 << 16) | (addr2 << 8) | addr3;
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -17,25 +17,27 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Data {
|
||||
|
||||
int AddressFromBytes(uchar addr1, uchar addr2, uchar addr3);
|
||||
|
||||
class ROM {
|
||||
public:
|
||||
ROM() = default;
|
||||
~ROM();
|
||||
|
||||
void LoadFromFile(const std::string& path);
|
||||
std::vector<tile8> ExtractTiles(Graphics::TilePreset& preset);
|
||||
Graphics::SNESPalette ExtractPalette(Graphics::TilePreset& preset);
|
||||
uint32_t GetRomPosition(const Graphics::TilePreset& preset, int directAddr,
|
||||
unsigned int snesAddr) const;
|
||||
|
||||
uint32_t GetRomPosition(int direct_addr, uint snes_addr) const;
|
||||
inline uchar* GetRawData() { return current_rom_; }
|
||||
const uchar* getTitle() const { return title; }
|
||||
long int getSize() const { return size_; }
|
||||
char getVersion() const { return version_; }
|
||||
bool isLoaded() const { return loaded; }
|
||||
char* Decompress(int pos, bool reversed = false);
|
||||
|
||||
private:
|
||||
bool loaded = false;
|
||||
@@ -48,10 +50,14 @@ class ROM {
|
||||
uint compress_size_;
|
||||
long int size_;
|
||||
enum rom_type type_ = LoROM;
|
||||
|
||||
std::shared_ptr<uchar> rom_ptr_;
|
||||
std::unordered_map<unsigned int, std::shared_ptr<uchar[2048]>>
|
||||
decompressed_sheets;
|
||||
};
|
||||
|
||||
} // namespace Data
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Editor {
|
||||
|
||||
using namespace Core;
|
||||
@@ -266,14 +266,14 @@ void Editor::DrawSurface() {
|
||||
tile8 tile = arranged_tiles_[j][i];
|
||||
// SDL_PIXELFORMAT_RGB888 ?
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(
|
||||
0, 8, 8, SDL_BITSPERPIXEL(3), SDL_PIXELFORMAT_RGB444);
|
||||
0, 8, 8, SDL_BITSPERPIXEL(4), SDL_PIXELFORMAT_RGB444);
|
||||
if (surface == nullptr) {
|
||||
SDL_Log("SDL_CreateRGBSurfaceWithFormat() failed: %s", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
SDL_PixelFormat *format = surface->format;
|
||||
format->palette = current_palette_.GetSDL_Palette();
|
||||
char *ptr = (char *)surface->pixels;
|
||||
uchar *ptr = (uchar *)surface->pixels;
|
||||
|
||||
for (int k = 0; k < 8; k++) {
|
||||
for (int l = 0; l < 8; l++) {
|
||||
@@ -341,7 +341,7 @@ void Editor::DrawProjectEditor() {
|
||||
ImGui::Image((void *)(SDL_Texture *)texture, ImVec2(32, 32));
|
||||
if (i != 16) {
|
||||
ImGui::SameLine();
|
||||
} else if ( i == 16 ) {
|
||||
} else if (i == 16) {
|
||||
i = 0;
|
||||
}
|
||||
i++;
|
||||
@@ -506,5 +506,5 @@ void Editor::DrawScreenEditor() {
|
||||
}
|
||||
|
||||
} // namespace Editor
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Editor {
|
||||
|
||||
class Editor {
|
||||
@@ -65,7 +65,7 @@ class Editor {
|
||||
};
|
||||
|
||||
} // namespace Editor
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APPLICATION_VIEW_EDITOR_H
|
||||
@@ -27,7 +27,7 @@
|
||||
// have an overworld map viewer, in less than few hours if are able to
|
||||
// understand the data quickly
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Editor {
|
||||
void OverworldEditor::Update() {
|
||||
if (rom_.isLoaded()) {
|
||||
@@ -286,5 +286,5 @@ void OverworldEditor::DrawChangelist() {
|
||||
}
|
||||
|
||||
} // namespace Editor
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Editor {
|
||||
|
||||
static constexpr unsigned int k4BPP = 4;
|
||||
@@ -70,7 +70,7 @@ class OverworldEditor {
|
||||
bool opt_enable_grid = true;
|
||||
};
|
||||
} // namespace Editor
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "tile_editor.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Editor {
|
||||
|
||||
void TileEditor::UpdateScreen() {}
|
||||
} // namespace Editor
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -2,14 +2,14 @@
|
||||
#define YAZE_APPLICATION_EDITOR_TILEEDITOR_H
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Editor {
|
||||
class TileEditor {
|
||||
public:
|
||||
void UpdateScreen();
|
||||
};
|
||||
} // namespace Editor
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Data/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
int GetPCGfxAddress(char *romData, char id) {
|
||||
@@ -174,5 +174,5 @@ void CreateAllGfxData(char *romData, char *allgfx16Ptr) {
|
||||
}
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Core/constants.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
class Bitmap {
|
||||
@@ -31,7 +31,7 @@ char *CreateAllGfxDataRaw(char *romData);
|
||||
void CreateAllGfxData(char *romData, char *allgfx16Ptr);
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -1696,7 +1696,7 @@
|
||||
#define ICON_MD_SET_MEAL "\xef\x87\xaa" // U+f1ea
|
||||
#define ICON_MD_SETTINGS "\xee\xa2\xb8" // U+e8b8
|
||||
#define ICON_MD_SETTINGS_ACCESSIBILITY "\xef\x81\x9d" // U+f05d
|
||||
#define ICON_MD_SETTINGS_APPLICATIONS "\xee\xa2\xb9" // U+e8b9
|
||||
#define ICON_MD_SETTINGS_applicationS "\xee\xa2\xb9" // U+e8b9
|
||||
#define ICON_MD_SETTINGS_BACKUP_RESTORE "\xee\xa2\xba" // U+e8ba
|
||||
#define ICON_MD_SETTINGS_BLUETOOTH "\xee\xa2\xbb" // U+e8bb
|
||||
#define ICON_MD_SETTINGS_BRIGHTNESS "\xee\xa2\xbd" // U+e8bd
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <cstring>
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
SNESColor::SNESColor() : rgb(ImVec4(0.f, 0.f, 0.f, 0.f)) {}
|
||||
@@ -109,5 +109,5 @@ SDL_Palette* SNESPalette::GetSDL_Palette() {
|
||||
}
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
struct SNESColor {
|
||||
@@ -44,7 +44,7 @@ class SNESPalette {
|
||||
};
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APPLICATION_GRAPHICS_PALETTE_H
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
void Scene::buildSurface(const std::vector<tile8>& tiles, SNESPalette& mPalette,
|
||||
@@ -74,5 +74,5 @@ void Scene::setTilesZoom(unsigned int tileZoom) {
|
||||
void Scene::setTilesPattern(TilesPattern tp) { tilesPattern = tp; }
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Graphics/tile.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
class Scene {
|
||||
@@ -33,7 +33,7 @@ class Scene {
|
||||
};
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "imgui/imgui_internal.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Core {
|
||||
namespace Style {
|
||||
|
||||
@@ -109,5 +109,5 @@ void ColorsYaze() {
|
||||
}
|
||||
} // namespace Style
|
||||
} // namespace Core
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <imgui/imgui_internal.h>
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Core {
|
||||
namespace Style {
|
||||
|
||||
@@ -13,7 +13,7 @@ void ColorsYaze();
|
||||
|
||||
} // namespace Style
|
||||
} // namespace Core
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <regex>
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
TilesPattern::TilesPattern() {
|
||||
@@ -149,5 +149,5 @@ std::vector<std::vector<tile8> > TilesPattern::transform(
|
||||
}
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "Graphics/palette.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace application {
|
||||
namespace Graphics {
|
||||
|
||||
// vhopppcc cccccccc
|
||||
@@ -100,7 +100,7 @@ class TilePreset {
|
||||
};
|
||||
|
||||
} // namespace Graphics
|
||||
} // namespace Application
|
||||
} // namespace application
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef YAZE_YAZE_H
|
||||
#define YAZE_YAZE_H
|
||||
|
||||
#include "Application/Core/controller.h"
|
||||
#include "Application/Core/entry_point.h"
|
||||
#include "application/Core/controller.h"
|
||||
#include "application/Core/entry_point.h"
|
||||
|
||||
#endif // YAZE_YAZE_H
|
||||
Reference in New Issue
Block a user