mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-10 15:14:28 +02:00
add demo level & format support
This commit is contained in:
BIN
bin/data/LEVEL2_DEMO.PHD
Normal file
BIN
bin/data/LEVEL2_DEMO.PHD
Normal file
Binary file not shown.
@@ -265,6 +265,7 @@ struct Controller {
|
||||
void move(const vec3 &speed) {
|
||||
vec3 p = pos;
|
||||
pos = pos + speed;
|
||||
//pos.y += 1.0f; TODO: floor portal
|
||||
|
||||
checkPortals(p, pos);
|
||||
|
||||
|
13
src/format.h
13
src/format.h
@@ -4,12 +4,12 @@
|
||||
#include "utils.h"
|
||||
|
||||
namespace TR {
|
||||
#define TR1_DEMO
|
||||
|
||||
#define ENTITY_FLAG_CLEAR 0x0080
|
||||
#define ENTITY_FLAG_VISIBLE 0x0100
|
||||
#define ENTITY_FLAG_MASK 0x3E00
|
||||
|
||||
|
||||
|
||||
#define ENTITY_LARA 0
|
||||
|
||||
#define ENTITY_ENEMY_TWIN 6
|
||||
@@ -131,6 +131,8 @@ namespace TR {
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
||||
|
||||
struct fixed {
|
||||
uint16 L;
|
||||
int16 H;
|
||||
@@ -556,6 +558,11 @@ namespace TR {
|
||||
stream.read(objectTextures, stream.read(objectTexturesCount));
|
||||
stream.read(spriteTextures, stream.read(spriteTexturesCount));
|
||||
stream.read(spriteSequences, stream.read(spriteSequencesCount));
|
||||
|
||||
#ifdef TR1_DEMO
|
||||
stream.read(palette, 256);
|
||||
#endif
|
||||
|
||||
// cameras
|
||||
stream.read(camera, stream.read(camerasCount));
|
||||
// sound sources
|
||||
@@ -570,7 +577,9 @@ namespace TR {
|
||||
stream.read(entities, stream.read(entitiesCount));
|
||||
// palette
|
||||
stream.seek(32 * 256); // skip lightmap palette
|
||||
#ifndef TR1_DEMO
|
||||
stream.read(palette, 256);
|
||||
#endif
|
||||
// cinematic frames for cameras
|
||||
stream.read(cameraFrames, stream.read(cameraFramesCount));
|
||||
// demo data
|
||||
|
@@ -10,7 +10,7 @@ namespace Game {
|
||||
|
||||
void init() {
|
||||
Core::init();
|
||||
level = new Level("data\\LEVEL1.PHD");
|
||||
level = new Level("data\\LEVEL2_DEMO.PHD");
|
||||
}
|
||||
|
||||
void free() {
|
||||
|
@@ -970,7 +970,7 @@ struct Level {
|
||||
}
|
||||
|
||||
void render() {
|
||||
camera.pos = vec3(-lara->pos.x, -lara->pos.y, lara->pos.z) + vec3(0, 1024, -1024);
|
||||
// camera.pos = vec3(-lara->pos.x, -lara->pos.y, lara->pos.z) + vec3(0, 1024, -1024);
|
||||
camera.setup();;
|
||||
|
||||
shader->bind();
|
||||
|
Reference in New Issue
Block a user