1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-14 17:14:29 +02:00

#3 fix smooth animation for player2; fix ambient cube colors; fix explosion sprites

This commit is contained in:
XProger
2018-05-11 18:23:43 +03:00
parent 6b94d7d0e0
commit 09273341ec
2 changed files with 13 additions and 3 deletions

View File

@@ -49,6 +49,8 @@ struct ShaderCache {
#define rsShadow (RS_DEPTH_TEST | RS_DEPTH_WRITE | RS_CULL_BACK)
void prepareCompose(int fx) {
compile(Core::passCompose, Shader::SPRITE, fx, rsBase);
compile(Core::passCompose, Shader::MIRROR, fx, rsBase);
compile(Core::passCompose, Shader::ROOM, fx, rsFull);
compile(Core::passCompose, Shader::ROOM, fx, rsFull | RS_DISCARD);
@@ -59,8 +61,12 @@ struct ShaderCache {
compile(Core::passCompose, Shader::ENTITY, fx | FX_UNDERWATER, rsFull);
compile(Core::passCompose, Shader::ENTITY, fx | FX_UNDERWATER, rsFull | RS_DISCARD);
compile(Core::passCompose, Shader::ENTITY, fx, rsFull | RS_DISCARD);
compile(Core::passCompose, Shader::SPRITE, fx, rsFull);
compile(Core::passCompose, Shader::SPRITE, fx | FX_UNDERWATER, rsFull);
compile(Core::passCompose, Shader::SPRITE, fx, rsFull | RS_DISCARD);
compile(Core::passCompose, Shader::SPRITE, fx | FX_UNDERWATER, rsFull | RS_DISCARD);
compile(Core::passCompose, Shader::FLASH, fx, rsFull | RS_BLEND_MULT);
compile(Core::passCompose, Shader::FLASH, fx, rsFull | RS_BLEND_MULT | RS_DISCARD);
}
@@ -109,6 +115,9 @@ struct ShaderCache {
fx |= FX_ALPHA_TEST;
#ifndef FFP
if (shaders[pass][type][fx])
return shaders[pass][type][fx];
int def[SD_MAX], defCount = 0;
#define SD_ADD(x) (def[defCount++] = SD_##x)
@@ -195,7 +204,7 @@ struct AmbientCache {
enum int32 {
BLANK, WAIT, READY
} status;
vec3 colors[6]; // TODO: ubyte4[6]
vec4 colors[6]; // TODO: ubyte4[6]
} *items;
int *offsets;
@@ -245,7 +254,7 @@ struct AmbientCache {
task.cube->status = Cube::WAIT;
}
void renderAmbient(int room, int sector, vec3 *colors) {
void renderAmbient(int room, int sector, vec4 *colors) {
PROFILE_MARKER("PASS_AMBIENT");
TR::Room &r = level->rooms[room];
@@ -282,7 +291,7 @@ struct AmbientCache {
// get result color from 1x1 textures
for (int j = 0; j < 6; j++) {
Core::setTarget(textures[j * 4 + 3], RT_LOAD_COLOR);
colors[j] = Core::copyPixel(0, 0).xyz();
colors[j] = Core::copyPixel(0, 0);
}
Core::setDepthTest(true);

View File

@@ -502,6 +502,7 @@ struct Level : IGame {
e.rotation = TR::angle(normalizeAngle(angle));
e.intensity = -1;
e.flags.value = 0;
e.flags.smooth = true;
e.modelIndex = level.getModelIndex(e.type);
break;
}