mirror of
https://github.com/XProger/OpenLara.git
synced 2025-01-17 21:09:00 +01:00
#15 add binary data and windows executable
This commit is contained in:
parent
5b2bd646e9
commit
2b8436be4b
BIN
bin/008.ogg
BIN
bin/008.ogg
Binary file not shown.
BIN
bin/CUT1.PHD
BIN
bin/CUT1.PHD
Binary file not shown.
@ -1 +0,0 @@
|
||||
OpenLara CUT1.PHD 008.ogg
|
BIN
bin/OpenLara.exe
BIN
bin/OpenLara.exe
Binary file not shown.
BIN
bin/audio/track_02.ogg
Normal file
BIN
bin/audio/track_02.ogg
Normal file
Binary file not shown.
BIN
bin/audio/track_04.ogg
Normal file
BIN
bin/audio/track_04.ogg
Normal file
Binary file not shown.
BIN
bin/audio/track_09.ogg
Normal file
BIN
bin/audio/track_09.ogg
Normal file
Binary file not shown.
BIN
bin/audio/track_12.ogg
Normal file
BIN
bin/audio/track_12.ogg
Normal file
Binary file not shown.
BIN
bin/audio/track_13.ogg
Normal file
BIN
bin/audio/track_13.ogg
Normal file
Binary file not shown.
BIN
bin/level/TITLE.PSX
Normal file
BIN
bin/level/TITLE.PSX
Normal file
Binary file not shown.
BIN
bin/level/TITLEH.PCX
Normal file
BIN
bin/level/TITLEH.PCX
Normal file
Binary file not shown.
@ -296,7 +296,7 @@ struct AmbientCache {
|
||||
Task &task = tasks[i];
|
||||
|
||||
bool oldFlip = level->isFlipped;
|
||||
level->isFlipped = task.flip;
|
||||
level->isFlipped = task.flip != 0;
|
||||
renderAmbient(task.room, task.sector, &task.cube->colors[0]);
|
||||
level->isFlipped = oldFlip;
|
||||
|
||||
|
@ -47,7 +47,7 @@ struct Collision {
|
||||
return;
|
||||
}
|
||||
|
||||
int hCell = info[NONE].ceiling - (hpos.y - maxHeight);
|
||||
int hCell = info[NONE].ceiling - (int(hpos.y) - maxHeight);
|
||||
if (hCell > 0) {
|
||||
if (hCell > 128) {
|
||||
pos.x -= velocity.x;
|
||||
@ -59,7 +59,7 @@ struct Collision {
|
||||
}
|
||||
}
|
||||
|
||||
int hFloor = info[NONE].floor - (hpos.y + minHeight);
|
||||
int hFloor = info[NONE].floor - (int(hpos.y) + minHeight);
|
||||
if (hFloor < 0 && hFloor > -256) {
|
||||
pos.y = info[NONE].floor - minHeight - offset.y;
|
||||
side = BOTTOM;
|
||||
|
32
src/core.h
32
src/core.h
@ -140,6 +140,24 @@
|
||||
namespace Core {
|
||||
float deltaTime;
|
||||
int width, height;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
bool ambient;
|
||||
bool lighting;
|
||||
bool shadows;
|
||||
bool water;
|
||||
bool contact;
|
||||
} detail;
|
||||
|
||||
struct {
|
||||
bool retarget;
|
||||
} controls;
|
||||
|
||||
struct {
|
||||
bool reverb;
|
||||
} audio;
|
||||
} settings;
|
||||
}
|
||||
|
||||
#include "utils.h"
|
||||
@ -441,20 +459,6 @@ namespace Core {
|
||||
frame++;
|
||||
}
|
||||
} stats;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
bool ambient;
|
||||
bool lighting;
|
||||
bool shadows;
|
||||
bool water;
|
||||
bool contact;
|
||||
} detail;
|
||||
|
||||
struct {
|
||||
bool retarget;
|
||||
} controls;
|
||||
} settings;
|
||||
}
|
||||
|
||||
#include "texture.h"
|
||||
|
@ -2052,7 +2052,7 @@ namespace TR {
|
||||
return room.sectors[sx * room.zSectors + sz];
|
||||
}
|
||||
|
||||
Room::Sector& getSector(uint8 roomIndex, int x, int z, int §orIndex) {
|
||||
Room::Sector& getSector(int roomIndex, int x, int z, int §orIndex) {
|
||||
ASSERT(roomIndex >= 0 && roomIndex < roomsCount);
|
||||
Room &room = rooms[roomIndex];
|
||||
x -= room.info.x;
|
||||
|
10
src/game.h
10
src/game.h
@ -12,7 +12,7 @@ namespace Game {
|
||||
void startLevel(Stream *lvl) {
|
||||
delete level;
|
||||
level = new Level(*lvl);
|
||||
UI::init(level);
|
||||
UI::game = level;
|
||||
delete lvl;
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@ namespace Game {
|
||||
|
||||
void init(Stream *lvl) {
|
||||
Core::init();
|
||||
UI::init(level);
|
||||
|
||||
Sound::callback = stopChannel;
|
||||
|
||||
Core::settings.detail.ambient = true;
|
||||
@ -29,25 +31,25 @@ namespace Game {
|
||||
Core::settings.detail.shadows = true;
|
||||
Core::settings.detail.water = Core::support.texFloat || Core::support.texHalf;
|
||||
Core::settings.detail.contact = false;
|
||||
|
||||
#ifdef __RPI__
|
||||
Core::settings.detail.ambient = false;
|
||||
Core::settings.detail.shadows = false;
|
||||
#endif
|
||||
|
||||
Core::settings.controls.retarget = true;
|
||||
Core::settings.audio.reverb = true;
|
||||
|
||||
level = NULL;
|
||||
startLevel(lvl);
|
||||
}
|
||||
|
||||
void init(char *lvlName = NULL, char *sndName = NULL) {
|
||||
if (!lvlName) lvlName = (char*)"LEVEL2.PSX";
|
||||
if (!lvlName) lvlName = (char*)"level/LEVEL2.PSX";
|
||||
init(new Stream(lvlName));
|
||||
}
|
||||
|
||||
void free() {
|
||||
delete level;
|
||||
UI::free();
|
||||
Core::free();
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@
|
||||
proc.connect(ctx.destination);
|
||||
}
|
||||
|
||||
var gl = canvasElement.getContext("webgl", {antialias:false}) || canvasElement.getContext("experimental-webgl", {antialias:false});
|
||||
var gl = canvasElement.getContext("webgl", {antialias:false, premultipliedAlpha: false}) || canvasElement.getContext("experimental-webgl", {antialias:false, premultipliedAlpha: false});
|
||||
|
||||
Module.setStatus('Downloading...');
|
||||
window.onerror = function(event) {
|
||||
@ -107,7 +107,7 @@
|
||||
<input type="button" value="Browse Level" onclick="document.getElementById('browseFile').click();" /> (.PHD, .PSX)
|
||||
<p style="margin:8px">
|
||||
OpenLara on <a target="_blank" href="https://github.com/XProger/OpenLara">github</a> & <a target="_blank" href="https://www.facebook.com/OpenLaraTR">facebook</a><br>
|
||||
<br><i>last update: 1.09.2017</i><br>
|
||||
<br><i>last update: 6.09.2017</i><br>
|
||||
</p>
|
||||
</span>
|
||||
|
||||
|
@ -8,15 +8,12 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Editor|Win32 = Editor|Win32
|
||||
Profile|Win32 = Profile|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Editor|Win32.ActiveCfg = Editor|Win32
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Editor|Win32.Build.0 = Editor|Win32
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{6935E070-59B8-418A-9241-70BACB4217B5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
|
@ -1,14 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Editor|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>../../../bin</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>data/LEVEL3A.PSX</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>../../../bin</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>data/LEVEL2.PHD</LocalDebuggerCommandArguments>
|
||||
<LocalDebuggerCommandArguments>
|
||||
</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>../../../bin</LocalDebuggerWorkingDirectory>
|
||||
@ -17,6 +13,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>../../../bin</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>data/LEVEL2.PSX</LocalDebuggerCommandArguments>
|
||||
<LocalDebuggerCommandArguments>
|
||||
</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -581,7 +581,8 @@ namespace Sound {
|
||||
void fill(Frame *frames, int count) {
|
||||
if (!channelsCount) {
|
||||
memset(frames, 0, sizeof(frames[0]) * count);
|
||||
reverb.process(frames, count);
|
||||
if (Core::settings.audio.reverb)
|
||||
reverb.process(frames, count);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -630,7 +631,8 @@ namespace Sound {
|
||||
frames[i].R = clamp(result[i].R, -32768, 32767);
|
||||
}
|
||||
|
||||
reverb.process(frames, count);
|
||||
if (Core::settings.audio.reverb)
|
||||
reverb.process(frames, count);
|
||||
|
||||
delete[] buffer;
|
||||
delete[] result;
|
||||
|
@ -158,7 +158,7 @@ struct TrapBoulder : Controller {
|
||||
vec3 dir = getDir();
|
||||
|
||||
if (pos.y >= info.floor - 256) {
|
||||
pos.y = info.floor;
|
||||
pos.y = float(info.floor);
|
||||
velocity = dir * animation.getSpeed();
|
||||
if (state != STATE_ROLL)
|
||||
animation.setState(STATE_ROLL);
|
||||
@ -328,12 +328,12 @@ struct Door : Controller {
|
||||
};
|
||||
|
||||
struct BlockInfo {
|
||||
uint8 roomIndex[2];
|
||||
int roomIndex[2];
|
||||
int sectorIndex[2];
|
||||
TR::Room::Sector sectors[2];
|
||||
|
||||
BlockInfo() {}
|
||||
BlockInfo(TR::Level *level, uint8 room, int nx, int nz, int x, int z, bool flip) {
|
||||
BlockInfo(TR::Level *level, int room, int nx, int nz, int x, int z, bool flip) {
|
||||
// front
|
||||
roomIndex[0] = room;
|
||||
roomIndex[1] = TR::NO_ROOM;
|
||||
|
21
src/ui.h
21
src/ui.h
@ -130,12 +130,31 @@ namespace UI {
|
||||
}
|
||||
|
||||
#undef MAX_CHARS
|
||||
/*
|
||||
Texture *texInv, *texAction;
|
||||
|
||||
|
||||
Texture* loadRAW(int width, int height, const char *name) {
|
||||
FILE *f = fopen(name, "rb");
|
||||
ASSERT(f);
|
||||
uint8 *data = new uint8[width * height * 4];
|
||||
fread(data, 1, width * height * 4, f);
|
||||
fclose(f);
|
||||
Texture *tex = new Texture(width, height, Texture::RGBA, false, data);
|
||||
delete[] data;
|
||||
return tex;
|
||||
}
|
||||
*/
|
||||
void init(IGame *game) {
|
||||
UI::game = game;
|
||||
showHelp = false;
|
||||
helpTipTime = 5.0f;
|
||||
// texInv = loadRAW(64, 64, "btn_inv.raw");
|
||||
// texAction = loadRAW(64, 64, "btn_action.raw");
|
||||
}
|
||||
|
||||
void free() {
|
||||
// delete texInv;
|
||||
// delete texAction;
|
||||
}
|
||||
|
||||
void update() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user