From 4d1b0dc103e90bdb8596f05149840ee25231a68d Mon Sep 17 00:00:00 2001 From: scawful Date: Mon, 13 Jun 2022 13:50:21 -0400 Subject: [PATCH] case sensitive include fixes --- src/Application/Data/OW/overworld.cc | 4 +- src/Application/Data/OW/overworld.h | 10 ++- src/Application/Data/OW/overworld_map.h | 5 +- src/Application/Editor/overworld_editor.h | 7 +- src/Application/Graphics/bitmap.cc | 88 +++++++---------------- src/Application/Graphics/bitmap.h | 4 +- src/Application/Graphics/scene.h | 13 ++-- src/Application/Graphics/style.h | 2 +- 8 files changed, 42 insertions(+), 91 deletions(-) diff --git a/src/Application/Data/OW/overworld.cc b/src/Application/Data/OW/overworld.cc index 84426cbc..0a640c81 100644 --- a/src/Application/Data/OW/overworld.cc +++ b/src/Application/Data/OW/overworld.cc @@ -1,6 +1,6 @@ #include "overworld.h" -#include "graphics/tile.h" +#include "Graphics/tile.h" namespace yaze { namespace Application { @@ -297,9 +297,7 @@ void Overworld::FetchLargeMaps() { void Overworld::LoadOverworldMap() { overworldMapBitmap = new Bitmap(128, 128, overworldMapPointer); - overworldMapBitmap->Create(&overworldMapTexture); owactualMapBitmap = new Bitmap(512, 512, owactualMapPointer); - owactualMapBitmap->Create(&owactualMapTexture); // Mode 7 char* ptr = overworldMapPointer; diff --git a/src/Application/Data/OW/overworld.h b/src/Application/Data/OW/overworld.h index 68d271fe..e4c5eea4 100644 --- a/src/Application/Data/OW/overworld.h +++ b/src/Application/Data/OW/overworld.h @@ -6,10 +6,10 @@ #include #include -#include "core/constants.h" -#include "data/rom.h" -#include "graphics/bitmap.h" -#include "graphics/tile.h" +#include "Core/constants.h" +#include "Data/rom.h" +#include "Graphics/bitmap.h" +#include "Graphics/tile.h" #include "overworld_map.h" namespace yaze { @@ -28,11 +28,9 @@ class Overworld { char* overworldMapPointer = new char[0x40000]; Graphics::Bitmap* overworldMapBitmap; - GLuint overworldMapTexture; char* owactualMapPointer = new char[0x40000]; Graphics::Bitmap* owactualMapBitmap; - GLuint owactualMapTexture; private: Data::ROM rom_; diff --git a/src/Application/Data/OW/overworld_map.h b/src/Application/Data/OW/overworld_map.h index ad3cbebe..fe8f59bc 100644 --- a/src/Application/Data/OW/overworld_map.h +++ b/src/Application/Data/OW/overworld_map.h @@ -1,11 +1,10 @@ #include -#include "data/rom.h" +#include "Data/rom.h" #include "Graphics/Bitmap.h" -#include "graphics/tile.h" +#include "Graphics/tile.h" #include "imgui/imgui.h" - namespace yaze { namespace Application { namespace Data { diff --git a/src/Application/Editor/overworld_editor.h b/src/Application/Editor/overworld_editor.h index 45487a5e..575f9521 100644 --- a/src/Application/Editor/overworld_editor.h +++ b/src/Application/Editor/overworld_editor.h @@ -3,11 +3,11 @@ #include -#include "Graphics/Icons.h" #include "Data/OW/Overworld.h" +#include "Graphics/Icons.h" #include "Graphics/Palette.h" #include "Graphics/Scene.h" -#include "graphics/tile.h" +#include "Graphics/tile.h" namespace yaze { namespace Application { @@ -44,12 +44,9 @@ class OverworldEditor { int allgfx_width = 0; int allgfx_height = 0; - GLuint *allgfx_texture = nullptr; byte *allGfx16Ptr = new byte[(128 * 7136) / 2]; - GLuint *overworld_texture; - ImGuiTableFlags toolset_table_flags = ImGuiTableFlags_SizingFixedFit; ImGuiTableFlags ow_map_settings_flags = ImGuiTableFlags_Borders; ImGuiTableFlags ow_edit_flags = ImGuiTableFlags_Reorderable | diff --git a/src/Application/Graphics/bitmap.cc b/src/Application/Graphics/bitmap.cc index 23e9eda8..bf0db8cb 100644 --- a/src/Application/Graphics/bitmap.cc +++ b/src/Application/Graphics/bitmap.cc @@ -177,79 +177,41 @@ void CreateAllGfxData(char *romData, char *allgfx16Ptr) { Bitmap::Bitmap(int width, int height, char *data) : width_(width), height_(height), pixel_data_(data) {} -void Bitmap::Create(GLuint *out_texture) { - // // Read the pixel data from the ROM - // SDL_RWops * src = SDL_RWFromMem(pixel_data_, 0); - // // Create the surface from that RW stream - // SDL_Surface* surface = SDL_LoadBMP_RW(src, SDL_FALSE); - // GLenum mode = 0; - // Uint8 bpp = surface->format->charsPerPixel; - // Uint32 rm = surface->format->Rmask; - // if (bpp == 3 && rm == 0x000000ff) mode = GL_RGB; - // if (bpp == 3 && rm == 0x00ff0000) mode = GL_BGR; - // if (bpp == 4 && rm == 0x000000ff) mode = GL_RGBA; - // if (bpp == 4 && rm == 0xff000000) mode = GL_BGRA; - - // GLsizei width = surface->w; - // GLsizei height = surface->h; - // GLenum format = mode; - // GLvoid* pixels = surface->pixels; - - // Create a OpenGL texture identifier - GLuint image_texture; - glGenTextures(1, &image_texture); - glBindTexture(GL_TEXTURE_2D, image_texture); - - // Setup filtering parameters for display - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - // Upload pixels into texture -#if defined(GL_UNPACK_ROW_LENGTH) && !defined(__EMSCRIPTEN__) - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); -#endif - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width_, height_, 0, GL_RGBA, - GL_UNSIGNED_BYTE, pixel_data_); - - *out_texture = image_texture; -} - int Bitmap::GetWidth() { return width_; } int Bitmap::GetHeight() { return height_; } // Simple helper function to load an image into a OpenGL texture with common // settings -bool Bitmap::LoadBitmapFromROM(unsigned char *texture_data, GLuint *out_texture, +bool Bitmap::LoadBitmapFromROM(unsigned char *texture_data, int *out_width, int *out_height) { - // Load from file - int image_width = 0; - int image_height = 0; - if (texture_data == NULL) return false; +// // Load from file +// int image_width = 0; +// int image_height = 0; +// if (texture_data == NULL) return false; - // Create a OpenGL texture identifier - GLuint image_texture; - glGenTextures(1, &image_texture); - glBindTexture(GL_TEXTURE_2D, image_texture); +// // Create a OpenGL texture identifier +// GLuint image_texture; +// glGenTextures(1, &image_texture); +// glBindTexture(GL_TEXTURE_2D, image_texture); - // Setup filtering parameters for display - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); // This is required on WebGL for non - // power-of-two textures - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // Same +// // Setup filtering parameters for display +// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); +// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, +// GL_CLAMP_TO_EDGE); // This is required on WebGL for non +// // power-of-two textures +// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // Same - // Upload pixels into texture -#if defined(GL_UNPACK_ROW_LENGTH) && !defined(__EMSCRIPTEN__) - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); -#endif - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image_width, image_height, 0, GL_RGBA, - GL_UNSIGNED_BYTE, texture_data); +// // Upload pixels into texture +// #if defined(GL_UNPACK_ROW_LENGTH) && !defined(__EMSCRIPTEN__) +// glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); +// #endif +// glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image_width, image_height, 0, GL_RGBA, +// GL_UNSIGNED_BYTE, texture_data); - *out_texture = image_texture; - *out_width = image_width; - *out_height = image_height; +// *out_texture = image_texture; +// *out_width = image_width; +// *out_height = image_height; return true; } diff --git a/src/Application/Graphics/bitmap.h b/src/Application/Graphics/bitmap.h index 29967dd2..5d31d8b8 100644 --- a/src/Application/Graphics/bitmap.h +++ b/src/Application/Graphics/bitmap.h @@ -2,7 +2,6 @@ #define YAZE_APPLICATION_UTILS_BITMAP_H #include -#include #include @@ -17,11 +16,10 @@ class Bitmap { Bitmap() = default; Bitmap(int width, int height, char *data); - void Create(GLuint *out_texture); int GetWidth(); int GetHeight(); - bool LoadBitmapFromROM(unsigned char *texture_data, GLuint *out_texture, + bool LoadBitmapFromROM(unsigned char *texture_data, int *out_width, int *out_height); private: diff --git a/src/Application/Graphics/scene.h b/src/Application/Graphics/scene.h index 28a4feaa..7fee6200 100644 --- a/src/Application/Graphics/scene.h +++ b/src/Application/Graphics/scene.h @@ -7,8 +7,8 @@ #include #include -#include "Core/Renderer.h" -#include "graphics/tile.h" +#include "Core/renderer.h" +#include "Graphics/tile.h" namespace yaze { namespace Application { @@ -20,21 +20,20 @@ class Scene { void buildScene(const std::vector& tiles, const SNESPalette mPalette, const TilesPattern& tp); - void buildSurface(const std::vector& tiles, - SNESPalette& mPalette, const TilesPattern& tp); + void buildSurface(const std::vector& tiles, SNESPalette& mPalette, + const TilesPattern& tp); void updateScene(); void setTilesZoom(unsigned int tileZoom); void setTilesPattern(TilesPattern tp); std::unordered_map imagesCache; - + private: unsigned int tilesZoom; TilesPattern tilesPattern; std::vector allTiles; - std::vector > arrangedTiles; - + std::vector> arrangedTiles; }; } // namespace Graphics diff --git a/src/Application/Graphics/style.h b/src/Application/Graphics/style.h index 1b2df2a9..f51cf116 100644 --- a/src/Application/Graphics/style.h +++ b/src/Application/Graphics/style.h @@ -1,5 +1,5 @@ #ifndef YAZE_APPLICATION_CORE_STYLE_H -#define YAZE_APPLCIATION_CORE_STYLE_H +#define YAZE_APPLICATION_CORE_STYLE_H #include "imgui/imgui.h" #include "imgui/imgui_internal.h"