mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add loading screen with random WOWEE splash images
- Add loading screen system with stb_image for JPEG loading - Two loading screen images (orc and dwarf) randomly selected - Display loading screen while terrain data loads - Cache WMO inverse matrices to reduce per-frame computation - Stub WMO liquid rendering (needs coordinate system fix) - Update spawn point to Stormwind Trade District
This commit is contained in:
parent
665a73e75f
commit
01bf3b4c08
14 changed files with 8395 additions and 165 deletions
|
|
@ -126,10 +126,9 @@ private:
|
|||
static constexpr float WOW_GRAVITY = -19.29f;
|
||||
static constexpr float WOW_JUMP_VELOCITY = 7.96f;
|
||||
|
||||
// Default spawn position (on terrain near Stormwind)
|
||||
// Terrain chunks are around X=[-9100, -9066], Y=[-533, 0]
|
||||
glm::vec3 defaultPosition = glm::vec3(-9080.0f, -100.0f, 100.0f);
|
||||
float defaultYaw = 180.0f; // Look south toward Stormwind gate
|
||||
// Default spawn position (Stormwind Trade District)
|
||||
glm::vec3 defaultPosition = glm::vec3(-8830.0f, 640.0f, 200.0f);
|
||||
float defaultYaw = 0.0f; // Look north toward canals
|
||||
float defaultPitch = -5.0f;
|
||||
};
|
||||
|
||||
|
|
|
|||
50
include/rendering/loading_screen.hpp
Normal file
50
include/rendering/loading_screen.hpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class LoadingScreen {
|
||||
public:
|
||||
LoadingScreen();
|
||||
~LoadingScreen();
|
||||
|
||||
bool initialize();
|
||||
void shutdown();
|
||||
|
||||
// Select a random loading screen image
|
||||
void selectRandomImage();
|
||||
|
||||
// Render the loading screen (call in a loop while loading)
|
||||
void render();
|
||||
|
||||
// Update loading progress (0.0 to 1.0)
|
||||
void setProgress(float progress) { loadProgress = progress; }
|
||||
|
||||
// Set loading status text
|
||||
void setStatus(const std::string& status) { statusText = status; }
|
||||
|
||||
private:
|
||||
bool loadImage(const std::string& path);
|
||||
void createQuad();
|
||||
|
||||
GLuint textureId = 0;
|
||||
GLuint vao = 0;
|
||||
GLuint vbo = 0;
|
||||
GLuint shaderId = 0;
|
||||
|
||||
std::vector<std::string> imagePaths;
|
||||
int currentImageIndex = 0;
|
||||
|
||||
float loadProgress = 0.0f;
|
||||
std::string statusText = "Loading...";
|
||||
|
||||
int imageWidth = 0;
|
||||
int imageHeight = 0;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
|
|
@ -9,6 +9,7 @@ namespace wowee {
|
|||
namespace pipeline {
|
||||
struct ADTTerrain;
|
||||
struct LiquidData;
|
||||
struct WMOLiquid;
|
||||
}
|
||||
|
||||
namespace rendering {
|
||||
|
|
@ -28,6 +29,9 @@ struct WaterSurface {
|
|||
// Owning tile coordinates (for per-tile removal)
|
||||
int tileX = -1, tileY = -1;
|
||||
|
||||
// Owning WMO instance ID (for WMO liquid removal, 0 = terrain water)
|
||||
uint32_t wmoId = 0;
|
||||
|
||||
// Water layer dimensions within chunk (0-7 offset, 1-8 size)
|
||||
uint8_t xOffset = 0;
|
||||
uint8_t yOffset = 0;
|
||||
|
|
@ -73,6 +77,20 @@ public:
|
|||
void loadFromTerrain(const pipeline::ADTTerrain& terrain, bool append = false,
|
||||
int tileX = -1, int tileY = -1);
|
||||
|
||||
/**
|
||||
* Load water surface from WMO liquid data
|
||||
* @param liquid WMO liquid data from MLIQ chunk
|
||||
* @param modelMatrix WMO instance model matrix for transforming to world space
|
||||
* @param wmoId WMO instance ID for tracking ownership
|
||||
*/
|
||||
void loadFromWMO(const pipeline::WMOLiquid& liquid, const glm::mat4& modelMatrix, uint32_t wmoId);
|
||||
|
||||
/**
|
||||
* Remove all water surfaces belonging to a specific WMO instance
|
||||
* @param wmoId WMO instance ID
|
||||
*/
|
||||
void removeWMO(uint32_t wmoId);
|
||||
|
||||
/**
|
||||
* Remove all water surfaces belonging to a specific tile
|
||||
* @param tileX Tile X coordinate
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ private:
|
|||
glm::vec3 rotation; // Euler angles (radians)
|
||||
float scale;
|
||||
glm::mat4 modelMatrix;
|
||||
glm::mat4 invModelMatrix; // Cached inverse for collision
|
||||
|
||||
void updateModelMatrix();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue