case sensitive include fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#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_;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include <memory>
|
||||
|
||||
#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 {
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
#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 |
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define YAZE_APPLICATION_UTILS_BITMAP_H
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL_opengl.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#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<tile8>& tiles, const SNESPalette mPalette,
|
||||
const TilesPattern& tp);
|
||||
|
||||
void buildSurface(const std::vector<tile8>& tiles,
|
||||
SNESPalette& mPalette, const TilesPattern& tp);
|
||||
void buildSurface(const std::vector<tile8>& tiles, SNESPalette& mPalette,
|
||||
const TilesPattern& tp);
|
||||
|
||||
void updateScene();
|
||||
void setTilesZoom(unsigned int tileZoom);
|
||||
void setTilesPattern(TilesPattern tp);
|
||||
|
||||
std::unordered_map<unsigned int, SDL_Texture*> imagesCache;
|
||||
|
||||
|
||||
private:
|
||||
unsigned int tilesZoom;
|
||||
TilesPattern tilesPattern;
|
||||
std::vector<tile8> allTiles;
|
||||
std::vector<std::vector<tile8> > arrangedTiles;
|
||||
|
||||
std::vector<std::vector<tile8>> arrangedTiles;
|
||||
};
|
||||
|
||||
} // namespace Graphics
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user