persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
Environment.hpp
Go to the documentation of this file.
1#pragma once
2#include <array>
3#include <nds.h>
4
8
9// Largest textureCount across all current g_environmentDb entries (dorm = 32).
10// Bump this if a future room introduces more textures than that.
11constexpr int MAX_ENVIRONMENT_TEXTURES = 32;
12
13// One generic runtime representation of a room's 3D geometry
15{
16 public:
22
55 bool load(const EnvironmentDbEntry* entry, std::array<const unsigned int*, MAX_ENVIRONMENT_TEXTURES> bitmaps);
56
66 void draw();
67
89 void drawBillboards(bool faceCamera, ae::q20_12_t camX, ae::q20_12_t camY, ae::q20_12_t camZ);
90
104 void cleanup();
105
106 private:
108
112
113 MathManager& math = MathManager::getInstance();
114 RenderManager& render = RenderManager::getInstance();
115};
constexpr int MAX_ENVIRONMENT_TEXTURES
Manager for hardware specific rendering functionse.
int textureIDs[MAX_ENVIRONMENT_TEXTURES]
const EnvironmentDbEntry * dbEntry
void cleanup()
Frees all display lists and deletes all textures owned by this Environment, and clears the current da...
void drawBillboards(bool faceCamera, ae::q20_12_t camX, ae::q20_12_t camY, ae::q20_12_t camZ)
Renders every billboard quad defined for the currently loaded environment.
RenderManager & render
Environment()
Constructs an empty Environment with all texture and display-list slots cleared and no database entry...
void draw()
Renders every loaded texture/display-list pair for the currently loaded environment.
u32 * displayLists[MAX_ENVIRONMENT_TEXTURES]
u32 dlSizes[MAX_ENVIRONMENT_TEXTURES]
MathManager & math
bool load(const EnvironmentDbEntry *entry, std::array< const unsigned int *, MAX_ENVIRONMENT_TEXTURES > bitmaps)
Loads environment geometry (display lists) and textures from the compiled .bin file described by an E...