mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Merge remote-tracking branch 'isle/master'
This commit is contained in:
commit
e568740208
@ -92,8 +92,8 @@ class LegoPathActor : public LegoActor {
|
|||||||
float p_srcScale,
|
float p_srcScale,
|
||||||
LegoUnknown100db7f4& p_destEdge,
|
LegoUnknown100db7f4& p_destEdge,
|
||||||
float p_destScale
|
float p_destScale
|
||||||
); // vtable+0x88
|
); // vtable+0x88
|
||||||
virtual MxS32 VTable0x8c(float p_time, Matrix4& p_transform); // vtable+0x8c
|
virtual MxS32 VTable0x8c(float p_time, MxMatrix& p_transform); // vtable+0x8c
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d40
|
// FUNCTION: LEGO1 0x10002d40
|
||||||
virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90
|
virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90
|
||||||
|
|||||||
@ -121,9 +121,9 @@ void LegoBackgroundColor::SetLightColor(float p_r, float p_g, float p_b)
|
|||||||
{
|
{
|
||||||
if (!VideoManager()->GetVideoParam().Flags().GetF2bit0()) {
|
if (!VideoManager()->GetVideoParam().Flags().GetF2bit0()) {
|
||||||
// TODO: Computed constants based on what?
|
// TODO: Computed constants based on what?
|
||||||
p_r *= 4.3478260869565215;
|
p_r *= 1. / 0.23;
|
||||||
p_g *= 1.5873015873015872;
|
p_g *= 1. / 0.63;
|
||||||
p_b *= 1.1764705882352942;
|
p_b *= 1. / 0.85;
|
||||||
|
|
||||||
if (p_r > 1.0) {
|
if (p_r > 1.0) {
|
||||||
p_r = 1.0;
|
p_r = 1.0;
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
#include "mxutilities.h"
|
#include "mxutilities.h"
|
||||||
#include "mxvariabletable.h"
|
#include "mxvariabletable.h"
|
||||||
|
|
||||||
|
#include <mxdebug.h>
|
||||||
#include <vec.h>
|
#include <vec.h>
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(LegoPathActor, 0x154)
|
DECOMP_SIZE_ASSERT(LegoPathActor, 0x154)
|
||||||
@ -233,7 +234,7 @@ MxResult LegoPathActor::VTable0x84(
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002e100
|
// FUNCTION: LEGO1 0x1002e100
|
||||||
// FUNCTION: BETA10 0x100b0520
|
// FUNCTION: BETA10 0x100b0520
|
||||||
MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
MxS32 LegoPathActor::VTable0x8c(float p_time, MxMatrix& p_transform)
|
||||||
{
|
{
|
||||||
if (m_userNavFlag && m_actorState == c_initial) {
|
if (m_userNavFlag && m_actorState == c_initial) {
|
||||||
m_lastTime = p_time;
|
m_lastTime = p_time;
|
||||||
@ -243,22 +244,27 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
p4 = Vector3(m_roi->GetWorldPosition());
|
p4 = Vector3(m_roi->GetWorldPosition());
|
||||||
|
|
||||||
LegoNavController* nav = NavController();
|
LegoNavController* nav = NavController();
|
||||||
|
assert(nav);
|
||||||
|
|
||||||
m_worldSpeed = nav->GetLinearVel();
|
m_worldSpeed = nav->GetLinearVel();
|
||||||
|
|
||||||
if (nav->CalculateNewPosDir(p4, p5, p2, p1, m_boundary->GetUnknown0x14())) {
|
if (nav->CalculateNewPosDir(p4, p5, p2, p1, m_boundary->GetUnknown0x14())) {
|
||||||
Mx3DPointFloat p6;
|
Mx3DPointFloat p6;
|
||||||
p6 = p2;
|
p6 = p2;
|
||||||
|
MxS32 result = 0;
|
||||||
|
|
||||||
m_unk0xe9 = m_boundary->Intersect(m_roi->GetWorldBoundingSphere().Radius(), p4, p2, p3, m_destEdge);
|
m_unk0xe9 = m_boundary->Intersect(m_roi->GetWorldBoundingSphere().Radius(), p4, p2, p3, m_destEdge);
|
||||||
if (m_unk0xe9 == -1) {
|
if (m_unk0xe9 == -1) {
|
||||||
|
MxTrace("Intersect returned -1\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (m_unk0xe9 != 0) {
|
if (m_unk0xe9 != 0) {
|
||||||
p2 = p3;
|
p2 = p3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MxS32 result = VTable0x68(p4, p2, p3);
|
result = VTable0x68(p4, p2, p3);
|
||||||
|
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
p2 = p4;
|
p2 = p4;
|
||||||
@ -309,11 +315,17 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
dir = p1;
|
dir = p1;
|
||||||
up = *m_boundary->GetUnknown0x14();
|
up = *m_boundary->GetUnknown0x14();
|
||||||
right.EqualsCross(up, dir);
|
right.EqualsCross(up, dir);
|
||||||
right.Unitize();
|
|
||||||
|
MxS32 res = right.Unitize();
|
||||||
|
assert(res == 0);
|
||||||
|
|
||||||
dir.EqualsCross(right, up);
|
dir.EqualsCross(right, up);
|
||||||
pos = p2;
|
pos = p2;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (p_time >= 0 && m_worldSpeed > 0) {
|
else if (p_time >= 0 && m_worldSpeed > 0) {
|
||||||
float f = (m_BADuration - m_unk0x7c) / m_worldSpeed + m_lastTime;
|
float f = (m_BADuration - m_unk0x7c) / m_worldSpeed + m_lastTime;
|
||||||
@ -332,13 +344,16 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
m_lastTime = f;
|
m_lastTime = f;
|
||||||
p_transform.SetIdentity();
|
p_transform.SetIdentity();
|
||||||
|
|
||||||
|
LegoResult r;
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUnknown0x14(), 0);
|
r = m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUnknown0x14(), 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUnknown0x14(), 1);
|
r = m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUnknown0x14(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(r == 0); // SUCCESS
|
||||||
|
|
||||||
Vector3 pos1(p_transform[3]);
|
Vector3 pos1(p_transform[3]);
|
||||||
Vector3 pos2(m_unk0xec[3]);
|
Vector3 pos2(m_unk0xec[3]);
|
||||||
Mx3DPointFloat p1;
|
Mx3DPointFloat p1;
|
||||||
@ -350,16 +365,17 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
else {
|
else {
|
||||||
m_boundary->FUN_100575b0(pos2, pos1, this);
|
m_boundary->FUN_100575b0(pos2, pos1, this);
|
||||||
pos2 = pos1;
|
pos2 = pos1;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_unk0xe9 != 0) {
|
if (m_unk0xe9 != 0) {
|
||||||
VTable0x9c();
|
VTable0x9c();
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002e740
|
// FUNCTION: LEGO1 0x1002e740
|
||||||
|
|||||||
@ -1163,7 +1163,7 @@ undefined4 LegoAnim::GetActorUnknown0x04(LegoU32 p_index)
|
|||||||
return m_modelList[p_index].m_unk0x04;
|
return m_modelList[p_index].m_unk0x04;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100a0f60
|
// FUNCTION: LEGO1 0x100a0f60
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "legounknown.h"
|
#include "legounknown.h"
|
||||||
|
|
||||||
|
#include "mxgeometry/mxmatrix.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(LegoUnknown, 0x50)
|
DECOMP_SIZE_ASSERT(LegoUnknown, 0x50)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009a0f0
|
// FUNCTION: LEGO1 0x1009a0f0
|
||||||
@ -29,7 +31,7 @@ void LegoUnknown::FUN_1009a140(const Vector3& p_point1, Vector3& p_point2, Vecto
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009a1e0
|
// FUNCTION: LEGO1 0x1009a1e0
|
||||||
// FUNCTION: BETA10 0x10182d61
|
// FUNCTION: BETA10 0x10182d61
|
||||||
LegoResult LegoUnknown::FUN_1009a1e0(float p_f1, Matrix4& p_mat, Vector3& p_v, LegoU32 p_und)
|
LegoResult LegoUnknown::FUN_1009a1e0(float p_f1, MxMatrix& p_mat, Vector3& p_v, LegoU32 p_und)
|
||||||
{
|
{
|
||||||
Vector3 v1(p_mat[3]);
|
Vector3 v1(p_mat[3]);
|
||||||
Vector3 v2(p_mat[0]);
|
Vector3 v2(p_mat[0]);
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#include "legotypes.h"
|
#include "legotypes.h"
|
||||||
#include "mxgeometry/mxgeometry3d.h"
|
#include "mxgeometry/mxgeometry3d.h"
|
||||||
|
|
||||||
class Matrix4;
|
class MxMatrix;
|
||||||
|
|
||||||
// SIZE 0x50
|
// SIZE 0x50
|
||||||
class LegoUnknown {
|
class LegoUnknown {
|
||||||
@ -13,7 +13,7 @@ class LegoUnknown {
|
|||||||
~LegoUnknown();
|
~LegoUnknown();
|
||||||
|
|
||||||
void FUN_1009a140(const Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, Vector3& p_point4);
|
void FUN_1009a140(const Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, Vector3& p_point4);
|
||||||
LegoResult FUN_1009a1e0(float p_f1, Matrix4& p_mat, Vector3& p_v, LegoU32 p_und);
|
LegoResult FUN_1009a1e0(float p_f1, MxMatrix& p_mat, Vector3& p_v, LegoU32 p_und);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Mx3DPointFloat m_unk0x00[4]; // 0x00
|
Mx3DPointFloat m_unk0x00[4]; // 0x00
|
||||||
|
|||||||
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac);
|
DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac);
|
||||||
|
|
||||||
|
#define RGB555_CREATE(R, G, B) (((R) << 10) | (G) << 5 | (B) << 0)
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x1010215c
|
// GLOBAL: LEGO1 0x1010215c
|
||||||
MxU32 g_unk0x1010215c = 0;
|
MxU32 g_unk0x1010215c = 0;
|
||||||
|
|
||||||
@ -1004,8 +1006,8 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(
|
|||||||
if (p_transparent) {
|
if (p_transparent) {
|
||||||
for (MxS32 y = 0; y < heightAbs; y++) {
|
for (MxS32 y = 0; y < heightAbs; y++) {
|
||||||
for (MxS32 x = 0; x < widthNormal; x++) {
|
for (MxS32 x = 0; x < widthNormal; x++) {
|
||||||
if (*bitmapSrcPtr == NULL) {
|
if (*bitmapSrcPtr == 0) {
|
||||||
*surfaceData = 31775;
|
*surfaceData = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*surfaceData = m_16bitPal[*bitmapSrcPtr];
|
*surfaceData = m_16bitPal[*bitmapSrcPtr];
|
||||||
@ -1020,7 +1022,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(
|
|||||||
}
|
}
|
||||||
|
|
||||||
DDCOLORKEY key;
|
DDCOLORKEY key;
|
||||||
key.dwColorSpaceLowValue = key.dwColorSpaceHighValue = 31775;
|
key.dwColorSpaceLowValue = key.dwColorSpaceHighValue = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||||
surface->SetColorKey(DDCKEY_SRCBLT, &key);
|
surface->SetColorKey(DDCKEY_SRCBLT, &key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1126,7 +1128,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
|||||||
for (MxS32 y = 0; y < 16; y++) {
|
for (MxS32 y = 0; y < 16; y++) {
|
||||||
if ((y > 10 || x) && (x > 10 || y) && x + y != 10) {
|
if ((y > 10 || x) && (x > 10 || y) && x + y != 10) {
|
||||||
if (x + y > 10) {
|
if (x + y > 10) {
|
||||||
*surface2 = 31775;
|
*surface2 = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*surface2 = -1;
|
*surface2 = -1;
|
||||||
@ -1142,8 +1144,8 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
|||||||
|
|
||||||
newSurface->Unlock(ddsd.lpSurface);
|
newSurface->Unlock(ddsd.lpSurface);
|
||||||
DDCOLORKEY colorkey;
|
DDCOLORKEY colorkey;
|
||||||
colorkey.dwColorSpaceHighValue = 31775;
|
colorkey.dwColorSpaceHighValue = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||||
colorkey.dwColorSpaceLowValue = 31775;
|
colorkey.dwColorSpaceLowValue = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||||
newSurface->SetColorKey(DDCKEY_SRCBLT, &colorkey);
|
newSurface->SetColorKey(DDCKEY_SRCBLT, &colorkey);
|
||||||
|
|
||||||
return newSurface;
|
return newSurface;
|
||||||
|
|||||||
@ -81,7 +81,7 @@ TglD3DRMIMAGE::TglD3DRMIMAGE(
|
|||||||
void TglD3DRMIMAGE::Destroy()
|
void TglD3DRMIMAGE::Destroy()
|
||||||
{
|
{
|
||||||
if (m_texelsAllocatedByClient == 0) {
|
if (m_texelsAllocatedByClient == 0) {
|
||||||
delete m_image.buffer1;
|
delete[] ((char*) m_image.buffer1);
|
||||||
}
|
}
|
||||||
delete m_image.palette;
|
delete m_image.palette;
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ Result TglD3DRMIMAGE::CreateBuffer(int width, int height, int depth, void* pBuff
|
|||||||
m_image.bytes_per_line = width;
|
m_image.bytes_per_line = width;
|
||||||
|
|
||||||
if (!m_texelsAllocatedByClient) {
|
if (!m_texelsAllocatedByClient) {
|
||||||
delete[] m_image.buffer1;
|
delete[] ((char*) m_image.buffer1);
|
||||||
m_image.buffer1 = NULL;
|
m_image.buffer1 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user