mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-14 17:14:29 +02:00
minor fixes
This commit is contained in:
@@ -577,7 +577,7 @@ namespace Debug {
|
|||||||
FILE *f = fopen(buf, "wb");
|
FILE *f = fopen(buf, "wb");
|
||||||
|
|
||||||
if (level->version == TR::VER_TR1_PSX) {
|
if (level->version == TR::VER_TR1_PSX) {
|
||||||
int dataSize = level->soundSize[index] / 16 * 28 * 2 * 4;
|
uint32 dataSize = level->soundSize[index] / 16 * 28 * 2 * 4;
|
||||||
|
|
||||||
struct Header {
|
struct Header {
|
||||||
uint32 RIFF;
|
uint32 RIFF;
|
||||||
@@ -596,10 +596,10 @@ namespace Debug {
|
|||||||
uint32 data;
|
uint32 data;
|
||||||
uint32 dataSize;
|
uint32 dataSize;
|
||||||
} header = {
|
} header = {
|
||||||
FOURCC("RIFF"), (uint32) sizeof(Header) - 8 + dataSize,
|
FOURCC("RIFF"), sizeof(Header) - 8 + dataSize,
|
||||||
FOURCC("WAVE"), FOURCC("fmt "), 16,
|
FOURCC("WAVE"), FOURCC("fmt "), 16,
|
||||||
{ 1, 1, 44100, 44100 * 16 / 8, 0, 16 },
|
{ 1, 1, 44100, 44100 * 16 / 8, 0, 16 },
|
||||||
FOURCC("data"), (uint32) dataSize
|
FOURCC("data"), dataSize
|
||||||
};
|
};
|
||||||
|
|
||||||
fwrite(&header, sizeof(header), 1, f);
|
fwrite(&header, sizeof(header), 1, f);
|
||||||
@@ -686,7 +686,7 @@ namespace Debug {
|
|||||||
|
|
||||||
TR::Level::FloorInfo info;
|
TR::Level::FloorInfo info;
|
||||||
controller->getFloorInfo(controller->getRoomIndex(), controller->pos, info);
|
controller->getFloorInfo(controller->getRoomIndex(), controller->pos, info);
|
||||||
sprintf(buf, "floor = %d, roomBelow = %d, roomAbove = %d, height = %d", info.floorIndex, info.roomBelow, info.roomAbove, info.floor - info.ceiling);
|
sprintf(buf, "floor = %d, roomBelow = %d, roomAbove = %d, height = %d", info.floorIndex, info.roomBelow, info.roomAbove, int(info.floor - info.ceiling));
|
||||||
Debug::Draw::text(vec2(16, y += 16), vec4(1.0f), buf);
|
Debug::Draw::text(vec2(16, y += 16), vec4(1.0f), buf);
|
||||||
|
|
||||||
y += 16;
|
y += 16;
|
||||||
|
@@ -2124,7 +2124,7 @@ struct Lara : Character {
|
|||||||
float ceiling = c.info[Collision::FRONT].ceiling;
|
float ceiling = c.info[Collision::FRONT].ceiling;
|
||||||
float hands = bounds.min.y;
|
float hands = bounds.min.y;
|
||||||
|
|
||||||
if (abs(floor - hands) < 64 && floor != ceiling) {
|
if (fabsf(floor - hands) < 64 && floor != ceiling) {
|
||||||
alignToWall(-LARA_RADIUS);
|
alignToWall(-LARA_RADIUS);
|
||||||
pos.y = float(floor + LARA_HANG_OFFSET);
|
pos.y = float(floor + LARA_HANG_OFFSET);
|
||||||
stand = STAND_HANG;
|
stand = STAND_HANG;
|
||||||
@@ -2804,7 +2804,7 @@ struct Lara : Character {
|
|||||||
} else {
|
} else {
|
||||||
// fast distance check for object
|
// fast distance check for object
|
||||||
if (e.type != TR::Entity::HAMMER_HANDLE && e.type != TR::Entity::HAMMER_BLOCK && e.type != TR::Entity::SCION_HOLDER)
|
if (e.type != TR::Entity::HAMMER_HANDLE && e.type != TR::Entity::HAMMER_BLOCK && e.type != TR::Entity::SCION_HOLDER)
|
||||||
if (abs(pos.x - controller->pos.x) > 1024 || abs(pos.z - controller->pos.z) > 1024 || abs(pos.y - controller->pos.y) > 2048) continue;
|
if (fabsf(pos.x - controller->pos.x) > 1024 || fabsf(pos.z - controller->pos.z) > 1024 || fabsf(pos.y - controller->pos.y) > 2048) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 dir = pos - vec3(0.0f, 128.0f, 0.0f) - controller->pos;
|
vec3 dir = pos - vec3(0.0f, 128.0f, 0.0f) - controller->pos;
|
||||||
|
@@ -621,7 +621,7 @@ struct TrapFloor : Controller {
|
|||||||
virtual bool activate() {
|
virtual bool activate() {
|
||||||
if (state != STATE_STATIC) return false;
|
if (state != STATE_STATIC) return false;
|
||||||
vec3 &p = ((Controller*)level->laraController)->pos;
|
vec3 &p = ((Controller*)level->laraController)->pos;
|
||||||
if (abs(p.y - (pos.y - 512.0f)) <= 8 && Controller::activate()) {
|
if (fabsf(p.y - (pos.y - 512.0f)) <= 8 && Controller::activate()) {
|
||||||
animation.setState(STATE_SHAKE);
|
animation.setState(STATE_SHAKE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,7 @@ typedef unsigned char uint8;
|
|||||||
typedef unsigned short uint16;
|
typedef unsigned short uint16;
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
|
|
||||||
#define FOURCC(str) (((uint8*)(str))[0] | (((uint8*)(str))[1] << 8) | (((uint8*)(str))[2] << 16) | (((uint8*)(str))[3] << 24) )
|
#define FOURCC(str) uint32(((uint8*)(str))[0] | (((uint8*)(str))[1] << 8) | (((uint8*)(str))[2] << 16) | (((uint8*)(str))[3] << 24) )
|
||||||
|
|
||||||
#define COUNT(arr) (sizeof(arr) / sizeof(arr[0]))
|
#define COUNT(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||||
|
|
||||||
@@ -1031,6 +1031,7 @@ struct Stream {
|
|||||||
LOG("error loading file \"%s\"\n", name);
|
LOG("error loading file \"%s\"\n", name);
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(NULL, userData);
|
callback(NULL, userData);
|
||||||
|
delete this;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
|
Reference in New Issue
Block a user