mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-06 13:16:52 +02:00
fix visibility check for renderEnvironment
This commit is contained in:
14
src/cache.h
14
src/cache.h
@@ -791,13 +791,13 @@ struct WaterCache {
|
||||
y = Core::viewportDef.y;
|
||||
} else
|
||||
x = y = 0;
|
||||
#ifdef _OS_IOS
|
||||
Core::setTarget(refract, RT_LOAD_DEPTH | RT_STORE_COLOR | RT_STORE_DEPTH);
|
||||
blitTexture(screen);
|
||||
Core::setTarget(screen, RT_LOAD_COLOR | RT_LOAD_DEPTH | RT_STORE_COLOR);
|
||||
#else
|
||||
Core::copyTarget(refract, 0, 0, x, y, Core::viewportDef.width, Core::viewportDef.height); // copy framebuffer into refraction texture
|
||||
#endif
|
||||
|
||||
if (screen) { // only for iOS devices
|
||||
Core::setTarget(refract, RT_LOAD_DEPTH | RT_STORE_COLOR | RT_STORE_DEPTH);
|
||||
blitTexture(screen);
|
||||
Core::setTarget(screen, RT_LOAD_COLOR | RT_LOAD_DEPTH | RT_STORE_COLOR);
|
||||
} else
|
||||
Core::copyTarget(refract, 0, 0, x, y, Core::viewportDef.width, Core::viewportDef.height); // copy framebuffer into refraction texture
|
||||
}
|
||||
|
||||
void simulate() {
|
||||
|
11
src/level.h
11
src/level.h
@@ -440,19 +440,16 @@ struct Level : IGame {
|
||||
Core::Pass tmpPass = Core::pass;
|
||||
Core::eye = 0.0f;
|
||||
|
||||
// TODO: fix for wrong room visibility checks, FIX IT!
|
||||
int roomsCount = 0;
|
||||
int roomsList[256];
|
||||
for (int i = 0; i < level.roomsCount; i++)
|
||||
roomsList[roomsCount++] = i;
|
||||
// -----
|
||||
int16 rIndex = roomIndex;
|
||||
level.getSector(rIndex, pos); // fix room index for overlapped blocks
|
||||
|
||||
// render level into cube faces or texture images
|
||||
for (int i = 0; i < 6; i++) {
|
||||
setupCubeCamera(pos, i);
|
||||
Core::pass = pass;
|
||||
Texture *target = (targets[0]->opt & OPT_CUBEMAP) ? targets[0] : targets[i * stride];
|
||||
Core::setTarget(target, RT_CLEAR_COLOR | RT_CLEAR_DEPTH | RT_STORE_COLOR, i);
|
||||
renderView(roomIndex, false, false, roomsCount, roomsList);
|
||||
renderView(rIndex, false, false);
|
||||
}
|
||||
|
||||
Core::pass = tmpPass;
|
||||
|
Reference in New Issue
Block a user