diff --git a/bin/OpenLara.exe b/bin/OpenLara.exe index d63936f..e7da36d 100644 Binary files a/bin/OpenLara.exe and b/bin/OpenLara.exe differ diff --git a/src/filter.glsl b/src/filter.glsl index 03710e9..f7f8aa2 100644 --- a/src/filter.glsl +++ b/src/filter.glsl @@ -22,9 +22,15 @@ uniform int uType; vec4 color = vec4(0.0); for (float y = -1.5; y < 2.0; y++) - for (float x = -1.5; x < 2.0; x++) - color += texture2D(sDiffuse, vTexCoord + vec2(x, y) * k); - color /= 16.0; + for (float x = -1.5; x < 2.0; x++) { + vec4 p; + p.xyz = texture2D(sDiffuse, vTexCoord + vec2(x, y) * k).xyz; + p.w = dot(p.xyz, vec3(0.299, 0.587, 0.114)); + p.xyz *= p.w; + color += p; + } + color.xyz /= color.w; + color.w = 1.0; return color; } diff --git a/src/game.h b/src/game.h index a1417c6..034acd4 100644 --- a/src/game.h +++ b/src/game.h @@ -13,7 +13,7 @@ namespace Game { void init() { Core::init(); //level = new Level("LEVEL2_DEMO.PHD", true, false); - //level = new Level("GYM.PHD", false, true); + //level = new Level("GYM.PSX", false, true); //level = new Level("LEVEL3A.PHD", false, false); level = new Level("LEVEL2.PSX", false, false); diff --git a/src/lara.h b/src/lara.h index 8b6ab6f..c25ec1c 100644 --- a/src/lara.h +++ b/src/lara.h @@ -31,7 +31,7 @@ #define DESCENT_SPEED 2048.0f #define MUZZLE_FLASH_TIME 0.1f -#define FLASH_LIGHT_COLOR vec4(0.8f, 0.7f, 0.3f, 3584 * 3584) +#define FLASH_LIGHT_COLOR vec4(0.8f, 0.7f, 0.3f, 3072 * 3072) #define TARGET_MAX_DIST (8.0f * 1024.0f) struct Lara : Character { @@ -289,7 +289,11 @@ struct Lara : Character { pos = vec3(20215, 6656, 52942); angle = vec3(0.0f, PI, 0.0f); getEntity().room = 14; - + + // level 8c + pos = vec3(40913, -1012, 42252); + angle = vec3(0.0f, PI, 0.0f); + getEntity().room = 0; */ updateEntity(); #endif @@ -462,7 +466,7 @@ struct Lara : Character { } void wpnChange(Weapon::Type wType) { - if (wpnCurrent == wType) return; + if (wpnCurrent == wType || home) return; wpnNext = wType; wpnHide(); } diff --git a/src/level.h b/src/level.h index da11fd4..e571e1b 100644 --- a/src/level.h +++ b/src/level.h @@ -855,18 +855,18 @@ struct Level { Debug::begin(); // Debug::Level::rooms(level, lara->pos, lara->getEntity().room); - Debug::Level::lights(level, lara->getRoomIndex()); + // Debug::Level::lights(level, lara->getRoomIndex()); // Debug::Level::sectors(level, lara->getRoomIndex(), (int)lara->pos.y); // Debug::Level::portals(level); // Debug::Level::meshes(level); // Debug::Level::entities(level); - + static int dbg_ambient = 0; dbg_ambient = int(time * 2) % 4; shadow->unbind(sShadow); cube->unbind(sEnvironment); - + atlas->bind(sDiffuse); glEnable(GL_TEXTURE_2D); glDisable(GL_CULL_FACE); glColor3f(1, 1, 1); @@ -884,17 +884,19 @@ struct Level { glTranslatef(0, 0, 256); ambientCache->textures[j * 4 + dbg_ambient]->bind(sDiffuse); + glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex3f(-256, 256, 0); glTexCoord2f(1, 0); glVertex3f( 256, 256, 0); glTexCoord2f(1, 1); glVertex3f( 256, -256, 0); glTexCoord2f(0, 1); glVertex3f(-256, -256, 0); glEnd(); + glPopMatrix(); } glEnable(GL_CULL_FACE); glDisable(GL_TEXTURE_2D); - + glLineWidth(4); glBegin(GL_LINES); float S = 64.0f; @@ -937,7 +939,7 @@ struct Level { glEnd(); glLineWidth(1); - + /* shaders[shGUI]->bind(); Core::mViewProj = mat4(0, (float)Core::width, (float)Core::height, 0, 0, 1); diff --git a/src/platform/web/build.bat b/src/platform/web/build.bat index d71d279..f065120 100644 --- a/src/platform/web/build.bat +++ b/src/platform/web/build.bat @@ -3,7 +3,7 @@ cls set SRC=main.cpp set PROJ=OpenLara set FLAGS=-O3 -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -I../../ -set PRELOAD=./LEVEL2.PSX +set PRELOAD=./GYM.PSX echo. call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file %PRELOAD% gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.js.mem \ No newline at end of file diff --git a/src/platform/web/index.html b/src/platform/web/index.html index 3c468c9..b952e8e 100644 --- a/src/platform/web/index.html +++ b/src/platform/web/index.html @@ -102,7 +102,5 @@ }; - - \ No newline at end of file