Consider non-level areas for level lights.

This commit is contained in:
Dario 2021-04-28 17:11:54 -03:00
parent f2426a4684
commit 8d1874d40a
3 changed files with 536 additions and 490 deletions

View File

@ -28,20 +28,20 @@
"attenuationExponent": 0.0,
"attenuationRadius": 99999997952.0,
"diffuseColor": [
0.800000011920929,
0.75,
0.6499999761581421
0.6499999761581421,
0.6000000238418579,
0.5
],
"flickerIntensity": 0.0,
"groupBits": 1,
"pointRadius": 5000.0,
"pointRadius": 350.0,
"position": [
100000.0,
200000.0,
100000.0
10000.0,
20000.0,
10000.0
],
"shadowOffset": 0.0,
"specularIntensity": 0.6499999761581421
"specularIntensity": 0.6000000238418579
}
]
},

File diff suppressed because it is too large Load Diff

View File

@ -1449,13 +1449,23 @@ static void gfx_rt64_rapi_start_frame(void) {
int levelIndex = gCurrLevelNum;
int courseIndex = gCurrCourseNum;
int areaIndex = gCurrAreaIndex;
int spawnAreaIndex = gPlayerSpawnInfos[0].areaIndex;
// Do not use these values if the area does not have a valid player spawn.
// This means the game is on a non-playable level, like a menu.
if (spawnAreaIndex < 0) {
levelIndex = 0;
courseIndex = 0;
areaIndex = 0;
}
RT64_LIGHT *lights = RT64.levelLights[levelIndex][areaIndex];
int *lightCount = &RT64.levelLightCounts[levelIndex][areaIndex];
if (RT64.inspector != nullptr) {
char marioMessage[256] = "";
char levelMessage[256] = "";
sprintf(marioMessage, "Mario pos: %.1f %.1f %.1f", gMarioState->pos[0], gMarioState->pos[1], gMarioState->pos[2]);
sprintf(levelMessage, "Level #%d Course #%d Area #%d", levelIndex, courseIndex, areaIndex);
sprintf(levelMessage, "Level #%d Course #%d Area #%d Spawn #%d", levelIndex, courseIndex, areaIndex, spawnAreaIndex);
RT64.lib.PrintToInspector(RT64.inspector, marioMessage);
RT64.lib.PrintToInspector(RT64.inspector, levelMessage);
RT64.lib.PrintToInspector(RT64.inspector, "F1: Toggle inspectors");