|
persona-3-dual
A DS demake of Persona 3
|
#include <Environment.hpp>

Public Member Functions | |
| Environment () | |
| Constructs an empty Environment with all texture and display-list slots cleared and no database entry attached. | |
| 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 EnvironmentDbEntry. | |
| void | draw () |
| Renders every loaded texture/display-list pair for the currently loaded environment. | |
| 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. | |
| void | cleanup () |
| Frees all display lists and deletes all textures owned by this Environment, and clears the current database entry. | |
Private Attributes | |
| const EnvironmentDbEntry * | dbEntry |
| u32 * | displayLists [MAX_ENVIRONMENT_TEXTURES] |
| u32 | dlSizes [MAX_ENVIRONMENT_TEXTURES] |
| int | textureIDs [MAX_ENVIRONMENT_TEXTURES] |
| MathManager & | math = MathManager::getInstance() |
| RenderManager & | render = RenderManager::getInstance() |
Definition at line 14 of file Environment.hpp.
| Environment::Environment | ( | ) |
Constructs an empty Environment with all texture and display-list slots cleared and no database entry attached.
Definition at line 10 of file Environment.cpp.
| void Environment::cleanup | ( | ) |
Frees all display lists and deletes all textures owned by this Environment, and clears the current database entry.
Safe to call at any time, including when no environment is loaded
Definition at line 187 of file Environment.cpp.

| void Environment::draw | ( | ) |
Renders every loaded texture/display-list pair for the currently loaded environment.
Does nothing if no environment is currently loaded (dbEntry is null). Skips any texture slot that has no bound texture ID, and skips the draw call itself (but still binds the texture) if that slot has no display list, guarding against corrupted or missing display-list pointers.
Definition at line 144 of file Environment.cpp.
| void Environment::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.
| faceCamera | If true, each billboard's right vector is recomputed every call so it always faces the given camera position (classic screen-facing billboarding). If false, billboards use a fixed world-axis-aligned orientation. |
| camX | World-space X coordinate of the camera, used only when faceCamera is true. |
| camY | World-space Y coordinate of the camera (unused. billboards only rotate about the Y axis). |
| camZ | World-space Z coordinate of the camera, used only when faceCamera is true. |
Definition at line 162 of file Environment.cpp.
| bool Environment::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 EnvironmentDbEntry.
Always begins with a hard reset (cleanup()) of any previously loaded state, so this is safe to call repeatedly across room transitions without leaking display lists or texture slots. On any failure the partially loaded state is cleaned up again before returning.
| entry | Pointer to the database entry describing this environment (name, texture metadata/count, binary file name). Must be non-null and have textureCount <= MAX_ENVIRONMENT_TEXTURES, otherwise this fails immediately. |
| bitmaps | Array of raw bitmap pointers, one per texture slot, to be uploaded to VRAM. Max size of MAX_ENVIRONMENT_TEXTURES. May be null, or contain null entries, in which case the corresponding texture slot(s) are skipped. |
entry was invalid, the file could not be opened or failed magic/size validation, or an allocation failed while reading display list data.Definition at line 20 of file Environment.cpp.

|
private |
Definition at line 107 of file Environment.hpp.
|
private |
Definition at line 109 of file Environment.hpp.
|
private |
Definition at line 110 of file Environment.hpp.
|
private |
Definition at line 113 of file Environment.hpp.
|
private |
Definition at line 114 of file Environment.hpp.
|
private |
Definition at line 111 of file Environment.hpp.