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