mirror of
https://github.com/halpz/re3.git
synced 2025-07-14 01:48:10 +00:00
Merge branch 'upstream/master'
This commit is contained in:
@ -242,8 +242,15 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
|
||||
else
|
||||
return STREAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
#ifdef BIG_IMG
|
||||
LARGE_INTEGER liDistanceToMove;
|
||||
liDistanceToMove.QuadPart = _GET_OFFSET(offset);
|
||||
liDistanceToMove.QuadPart *= CDSTREAM_SECTOR_SIZE;
|
||||
SetFilePointerEx(hImage, liDistanceToMove, nil, FILE_BEGIN);
|
||||
#else
|
||||
SetFilePointer(hImage, _GET_OFFSET(offset) * CDSTREAM_SECTOR_SIZE, nil, FILE_BEGIN);
|
||||
#endif
|
||||
|
||||
DWORD NumberOfBytesRead;
|
||||
|
||||
|
@ -429,7 +429,7 @@ void *CdStreamThread(void *param)
|
||||
ASSERT(pChannel->hFile >= 0);
|
||||
ASSERT(pChannel->pBuffer != nil );
|
||||
|
||||
lseek(pChannel->hFile, pChannel->nSectorOffset * CDSTREAM_SECTOR_SIZE, SEEK_SET);
|
||||
lseek(pChannel->hFile, (size_t)pChannel->nSectorOffset * (size_t)CDSTREAM_SECTOR_SIZE, SEEK_SET);
|
||||
if (read(pChannel->hFile, pChannel->pBuffer, pChannel->nSectorsToRead * CDSTREAM_SECTOR_SIZE) == -1) {
|
||||
// pChannel->nSectorsToRead == 0 at this point means we wanted to flush channel
|
||||
// STREAM_WAITING is a little hack to make CStreaming not process this data
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,254 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "templates.h"
|
||||
#include "Game.h" // for eLevelName
|
||||
#ifdef VU_COLLISION
|
||||
#include "VuVector.h"
|
||||
#endif
|
||||
|
||||
// If you spawn many tanks at once, you will see that collisions of two entity exceeds 32.
|
||||
#if defined(FIX_BUGS) && !defined(SQUEEZE_PERFORMANCE)
|
||||
#define MAX_COLLISION_POINTS 64
|
||||
#else
|
||||
#define MAX_COLLISION_POINTS 32
|
||||
#endif
|
||||
|
||||
struct CompressedVector
|
||||
{
|
||||
#ifdef COMPRESSED_COL_VECTORS
|
||||
int16 x, y, z;
|
||||
CVector Get(void) const { return CVector(x, y, z)/128.0f; };
|
||||
void Set(float x, float y, float z) { this->x = x*128.0f; this->y = y*128.0f; this->z = z*128.0f; };
|
||||
#ifdef GTA_PS2
|
||||
void Unpack(uint128 &qword) const {
|
||||
__asm__ volatile (
|
||||
"lh $8, 0(%1)\n"
|
||||
"lh $9, 2(%1)\n"
|
||||
"lh $10, 4(%1)\n"
|
||||
"pextlw $10, $8\n"
|
||||
"pextlw $2, $9, $10\n"
|
||||
"sq $2, %0\n"
|
||||
: "=m" (qword)
|
||||
: "r" (this)
|
||||
: "$8", "$9", "$10", "$2"
|
||||
);
|
||||
}
|
||||
#else
|
||||
void Unpack(int32 *qword) const {
|
||||
qword[0] = x;
|
||||
qword[1] = y;
|
||||
qword[2] = z;
|
||||
qword[3] = 0; // junk
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
float x, y, z;
|
||||
CVector Get(void) const { return CVector(x, y, z); };
|
||||
void Set(float x, float y, float z) { this->x = x; this->y = y; this->z = z; };
|
||||
#endif
|
||||
};
|
||||
|
||||
struct CColSphere
|
||||
{
|
||||
// NB: this has to be compatible with a CVuVector
|
||||
CVector center;
|
||||
float radius;
|
||||
uint8 surface;
|
||||
uint8 piece;
|
||||
|
||||
void Set(float radius, const CVector ¢er, uint8 surf, uint8 piece);
|
||||
void Set(float radius, const CVector ¢er) { this->center = center; this->radius = radius; }
|
||||
};
|
||||
|
||||
struct CColBox
|
||||
{
|
||||
CVector min;
|
||||
CVector max;
|
||||
uint8 surface;
|
||||
uint8 piece;
|
||||
|
||||
void Set(const CVector &min, const CVector &max, uint8 surf, uint8 piece);
|
||||
CVector GetSize(void) { return max - min; }
|
||||
};
|
||||
|
||||
struct CColLine
|
||||
{
|
||||
// NB: this has to be compatible with two CVuVectors
|
||||
CVector p0;
|
||||
int pad0;
|
||||
CVector p1;
|
||||
int pad1;
|
||||
|
||||
CColLine(void) { };
|
||||
CColLine(const CVector &p0, const CVector &p1) { this->p0 = p0; this->p1 = p1; };
|
||||
void Set(const CVector &p0, const CVector &p1);
|
||||
};
|
||||
|
||||
struct CColTriangle
|
||||
{
|
||||
uint16 a;
|
||||
uint16 b;
|
||||
uint16 c;
|
||||
uint8 surface;
|
||||
|
||||
void Set(const CompressedVector *v, int a, int b, int c, uint8 surf, uint8 piece);
|
||||
};
|
||||
|
||||
struct CColTrianglePlane
|
||||
{
|
||||
#ifdef VU_COLLISION
|
||||
CompressedVector normal;
|
||||
int16 dist;
|
||||
|
||||
void Set(const CVector &va, const CVector &vb, const CVector &vc);
|
||||
void Set(const CompressedVector *v, CColTriangle &tri) { Set(v[tri.a].Get(), v[tri.b].Get(), v[tri.c].Get()); }
|
||||
void GetNormal(CVector &n) const { n.x = normal.x/4096.0f; n.y = normal.y/4096.0f; n.z = normal.z/4096.0f; }
|
||||
float CalcPoint(const CVector &v) const { CVector n; GetNormal(n); return DotProduct(n, v) - dist/128.0f; };
|
||||
#ifdef GTA_PS2
|
||||
void Unpack(uint128 &qword) const {
|
||||
__asm__ volatile (
|
||||
"lh $8, 0(%1)\n"
|
||||
"lh $9, 2(%1)\n"
|
||||
"lh $10, 4(%1)\n"
|
||||
"lh $11, 6(%1)\n"
|
||||
"pextlw $10, $8\n"
|
||||
"pextlw $11, $9\n"
|
||||
"pextlw $2, $11, $10\n"
|
||||
"sq $2, %0\n"
|
||||
: "=m" (qword)
|
||||
: "r" (this)
|
||||
: "$8", "$9", "$10", "$11", "$2"
|
||||
);
|
||||
}
|
||||
#else
|
||||
void Unpack(int32 *qword) const {
|
||||
qword[0] = normal.x;
|
||||
qword[1] = normal.y;
|
||||
qword[2] = normal.z;
|
||||
qword[3] = dist;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
CVector normal;
|
||||
float dist;
|
||||
uint8 dir;
|
||||
|
||||
void Set(const CVector &va, const CVector &vb, const CVector &vc);
|
||||
void Set(const CompressedVector *v, CColTriangle &tri) { Set(v[tri.a].Get(), v[tri.b].Get(), v[tri.c].Get()); }
|
||||
void GetNormal(CVector &n) const { n = normal; }
|
||||
float CalcPoint(const CVector &v) const { return DotProduct(normal, v) - dist; };
|
||||
#endif
|
||||
};
|
||||
|
||||
struct CColPoint
|
||||
{
|
||||
CVector point;
|
||||
int pad1;
|
||||
// the surface normal on the surface of point
|
||||
CVector normal;
|
||||
int pad2;
|
||||
uint8 surfaceA;
|
||||
uint8 pieceA;
|
||||
uint8 surfaceB;
|
||||
uint8 pieceB;
|
||||
float depth;
|
||||
|
||||
void Set(float depth, uint8 surfA, uint8 pieceA, uint8 surfB, uint8 pieceB) {
|
||||
this->depth = depth;
|
||||
this->surfaceA = surfA;
|
||||
this->pieceA = pieceA;
|
||||
this->surfaceB = surfB;
|
||||
this->pieceB = pieceB;
|
||||
}
|
||||
void Set(uint8 surfA, uint8 pieceA, uint8 surfB, uint8 pieceB) {
|
||||
this->surfaceA = surfA;
|
||||
this->pieceA = pieceA;
|
||||
this->surfaceB = surfB;
|
||||
this->pieceB = pieceB;
|
||||
}
|
||||
};
|
||||
|
||||
struct CStoredCollPoly
|
||||
{
|
||||
#ifdef VU_COLLISION
|
||||
CVuVector verts[3];
|
||||
#else
|
||||
CVector verts[3];
|
||||
#endif
|
||||
bool valid;
|
||||
};
|
||||
|
||||
struct CColModel
|
||||
{
|
||||
CColSphere boundingSphere;
|
||||
CColBox boundingBox;
|
||||
int16 numSpheres;
|
||||
int16 numLines;
|
||||
int16 numBoxes;
|
||||
int16 numTriangles;
|
||||
int32 level;
|
||||
bool ownsCollisionVolumes; // missing on PS2
|
||||
CColSphere *spheres;
|
||||
CColLine *lines;
|
||||
CColBox *boxes;
|
||||
CompressedVector *vertices;
|
||||
CColTriangle *triangles;
|
||||
CColTrianglePlane *trianglePlanes;
|
||||
|
||||
CColModel(void);
|
||||
~CColModel(void);
|
||||
void RemoveCollisionVolumes(void);
|
||||
void CalculateTrianglePlanes(void);
|
||||
void RemoveTrianglePlanes(void);
|
||||
CLink<CColModel*> *GetLinkPtr(void);
|
||||
void SetLinkPtr(CLink<CColModel*>*);
|
||||
void GetTrianglePoint(CVector &v, int i) const;
|
||||
|
||||
CColModel& operator=(const CColModel& other);
|
||||
};
|
||||
|
||||
class CCollision
|
||||
{
|
||||
public:
|
||||
static eLevelName ms_collisionInMemory;
|
||||
static CLinkList<CColModel*> ms_colModelCache;
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
static bool bAlreadyLoaded;
|
||||
#endif
|
||||
|
||||
static void Init(void);
|
||||
static void Shutdown(void);
|
||||
static void Update(void);
|
||||
static void LoadCollisionWhenINeedIt(bool changeLevel);
|
||||
static void SortOutCollisionAfterLoad(void);
|
||||
static void LoadCollisionScreen(eLevelName level);
|
||||
static void DrawColModel(const CMatrix &mat, const CColModel &colModel);
|
||||
static void DrawColModel_Coloured(const CMatrix &mat, const CColModel &colModel, int32 id);
|
||||
|
||||
static void CalculateTrianglePlanes(CColModel *model);
|
||||
|
||||
// all these return true if there's a collision
|
||||
static bool TestSphereSphere(const CColSphere &s1, const CColSphere &s2);
|
||||
static bool TestSphereBox(const CColSphere &sph, const CColBox &box);
|
||||
static bool TestLineBox(const CColLine &line, const CColBox &box);
|
||||
static bool TestVerticalLineBox(const CColLine &line, const CColBox &box);
|
||||
static bool TestLineTriangle(const CColLine &line, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
|
||||
static bool TestLineSphere(const CColLine &line, const CColSphere &sph);
|
||||
static bool TestSphereTriangle(const CColSphere &sphere, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
|
||||
static bool TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough);
|
||||
|
||||
static bool ProcessSphereSphere(const CColSphere &s1, const CColSphere &s2, CColPoint &point, float &mindistsq);
|
||||
static bool ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoint &point, float &mindistsq);
|
||||
static bool ProcessLineBox(const CColLine &line, const CColBox &box, CColPoint &point, float &mindist);
|
||||
static bool ProcessVerticalLineTriangle(const CColLine &line, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist, CStoredCollPoly *poly);
|
||||
static bool ProcessLineTriangle(const CColLine &line , const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist);
|
||||
static bool ProcessLineSphere(const CColLine &line, const CColSphere &sphere, CColPoint &point, float &mindist);
|
||||
static bool ProcessSphereTriangle(const CColSphere &sph, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindistsq);
|
||||
static bool ProcessLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough);
|
||||
static bool ProcessVerticalLine(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly);
|
||||
static int32 ProcessColModels(const CMatrix &matrixA, CColModel &modelA, const CMatrix &matrixB, CColModel &modelB, CColPoint *spherepoints, CColPoint *linepoints, float *linedists);
|
||||
static bool IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CColPoint &point, CStoredCollPoly *poly);
|
||||
|
||||
static float DistToLine(const CVector *l0, const CVector *l1, const CVector *point);
|
||||
static float DistToLine(const CVector *l0, const CVector *l1, const CVector *point, CVector &closest);
|
||||
};
|
@ -2500,10 +2500,11 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
|
||||
nil, /* SHOW_MOUSE_POINTER_TOGGLE */ \
|
||||
}}
|
||||
|
||||
|
||||
const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK");
|
||||
|
||||
#ifdef BUTTON_ICONS
|
||||
const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK");
|
||||
#else
|
||||
const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK");
|
||||
#endif
|
||||
|
||||
|
||||
@ -2524,12 +2525,12 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B",
|
||||
#define PS2_SQUARE "SQUARE"
|
||||
#endif
|
||||
|
||||
const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] =
|
||||
CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT");
|
||||
|
||||
#ifdef BUTTON_ICONS
|
||||
const char *PlayStationButtons[][MAX_CONTROLLERACTIONS] =
|
||||
CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT");
|
||||
#else
|
||||
const char *PlayStationButtons[][MAX_CONTROLLERACTIONS] =
|
||||
CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT");
|
||||
#endif
|
||||
|
||||
#undef PS2_TRIANGLE
|
||||
@ -2547,7 +2548,11 @@ void CControllerConfigManager::GetWideStringOfCommandKeys(uint16 action, wchar *
|
||||
wchar wstr[16];
|
||||
|
||||
// TODO: INI and/or menu setting for Xbox/PS switch
|
||||
const char *(*Buttons)[MAX_CONTROLLERACTIONS] = XboxButtons;
|
||||
#ifdef BUTTON_ICONS
|
||||
const char *(*Buttons)[MAX_CONTROLLERACTIONS] = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons;
|
||||
#else
|
||||
const char *(*Buttons)[MAX_CONTROLLERACTIONS] = XboxButtons_noIcons;
|
||||
#endif
|
||||
|
||||
assert(Buttons[CPad::GetPad(0)->Mode][action] != nil); // we cannot use these
|
||||
AsciiToUnicode(Buttons[CPad::GetPad(0)->Mode][action], wstr);
|
||||
|
@ -332,6 +332,16 @@ CFileLoader::FindRelatedModelInfoCB(RpAtomic *atomic, void *data)
|
||||
return atomic;
|
||||
}
|
||||
|
||||
#ifdef LIBRW
|
||||
void
|
||||
InitClump(RpClump *clump)
|
||||
{
|
||||
RpClumpForAllAtomics(clump, ConvertPlatformAtomic, nil);
|
||||
}
|
||||
#else
|
||||
#define InitClump(clump)
|
||||
#endif
|
||||
|
||||
void
|
||||
CFileLoader::LoadModelFile(const char *filename)
|
||||
{
|
||||
@ -343,6 +353,7 @@ CFileLoader::LoadModelFile(const char *filename)
|
||||
if(RwStreamFindChunk(stream, rwID_CLUMP, nil, nil)){
|
||||
clump = RpClumpStreamRead(stream);
|
||||
if(clump){
|
||||
InitClump(clump);
|
||||
RpClumpForAllAtomics(clump, FindRelatedModelInfoCB, clump);
|
||||
RpClumpDestroy(clump);
|
||||
}
|
||||
@ -368,6 +379,7 @@ CFileLoader::LoadClumpFile(const char *filename)
|
||||
GetNameAndLOD(nodename, name, &n);
|
||||
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, nil);
|
||||
if(mi){
|
||||
InitClump(clump);
|
||||
assert(mi->IsClump());
|
||||
mi->SetClump(clump);
|
||||
}else
|
||||
@ -393,6 +405,7 @@ CFileLoader::LoadClumpFile(RwStream *stream, uint32 id)
|
||||
if (mi->GetModelType() == MITYPE_PED && id != 0 && RwStreamFindChunk(stream, rwID_CLUMP, nil, nil)) {
|
||||
// Read LOD ped
|
||||
clump = RpClumpStreamRead(stream);
|
||||
InitClump(clump);
|
||||
if(clump){
|
||||
((CPedModelInfo*)mi)->SetLowDetailClump(clump);
|
||||
RpClumpDestroy(clump);
|
||||
@ -423,6 +436,7 @@ CFileLoader::FinishLoadClumpFile(RwStream *stream, uint32 id)
|
||||
clump = RpClumpGtaStreamRead2(stream);
|
||||
|
||||
if(clump){
|
||||
InitClump(clump);
|
||||
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(id);
|
||||
mi->SetClump(clump);
|
||||
return true;
|
||||
@ -443,6 +457,7 @@ CFileLoader::LoadAtomicFile(RwStream *stream, uint32 id)
|
||||
clump = RpClumpStreamRead(stream);
|
||||
if(clump == nil)
|
||||
return false;
|
||||
InitClump(clump);
|
||||
gpRelatedModelInfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(id);
|
||||
RpClumpForAllAtomics(clump, SetRelatedModelInfoCB, clump);
|
||||
RpClumpDestroy(clump);
|
||||
@ -806,6 +821,8 @@ CFileLoader::LoadAtomicFile2Return(const char *filename)
|
||||
stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, filename);
|
||||
if(RwStreamFindChunk(stream, rwID_CLUMP, nil, nil))
|
||||
clump = RpClumpStreamRead(stream);
|
||||
if(clump)
|
||||
InitClump(clump);
|
||||
RwStreamClose(stream, nil);
|
||||
return clump;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,6 @@
|
||||
|
||||
#define MENU_X_MARGIN 40.0f
|
||||
#define MENUACTION_POS_Y 60.0f
|
||||
#define MENUACTION_WIDTH 38.0f
|
||||
#define MENUACTION_SCALE_MULT 0.9f
|
||||
|
||||
#define MENURADIO_ICON_SCALE 60.0f
|
||||
@ -235,11 +234,11 @@ enum eMenuScreen
|
||||
MENUPAGE_KEYBOARD_CONTROLS = 55,
|
||||
MENUPAGE_MOUSE_CONTROLS = 56,
|
||||
MENUPAGE_MISSION_RETRY = 57,
|
||||
#ifdef MENU_MAP
|
||||
MENUPAGE_MAP = 58,
|
||||
#endif
|
||||
#ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
#ifdef MENU_MAP
|
||||
MENUPAGE_MAP,
|
||||
#endif
|
||||
#ifdef GRAPHICS_MENU_OPTIONS
|
||||
MENUPAGE_GRAPHICS_SETTINGS,
|
||||
#else
|
||||
@ -380,9 +379,6 @@ enum eMenuAction
|
||||
// MENUACTION_MIPMAPS,
|
||||
// MENUACTION_TEXTURE_FILTERING,
|
||||
//#endif
|
||||
//#ifdef NO_ISLAND_LOADING
|
||||
// MENUACTION_ISLANDLOADING,
|
||||
//#endif
|
||||
};
|
||||
|
||||
enum eCheckHover
|
||||
@ -718,7 +714,6 @@ public:
|
||||
ISLAND_LOADING_HIGH
|
||||
};
|
||||
|
||||
static int8 m_DisplayIslandLoading;
|
||||
static int8 m_PrefsIslandLoading;
|
||||
|
||||
#define ISLAND_LOADING_IS(p) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_##p)
|
||||
@ -786,6 +781,7 @@ public:
|
||||
void PageUpList(bool);
|
||||
void PageDownList(bool);
|
||||
int8 GetPreviousPageOption();
|
||||
void ProcessList(bool &goBack, bool &optionSelected);
|
||||
};
|
||||
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
|
@ -203,20 +203,6 @@ static const char* FrontendFilenames[][2] =
|
||||
{"fe_radio9", "" },
|
||||
};
|
||||
|
||||
#ifdef CUTSCENE_BORDERS_SWITCH
|
||||
bool CMenuManager::m_PrefsCutsceneBorders = true;
|
||||
#endif
|
||||
|
||||
#ifdef MULTISAMPLING
|
||||
int8 CMenuManager::m_nPrefsMSAALevel = 0;
|
||||
int8 CMenuManager::m_nDisplayMSAALevel = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
int8 CMenuManager::m_DisplayIslandLoading = ISLAND_LOADING_LOW;
|
||||
int8 CMenuManager::m_PrefsIslandLoading = ISLAND_LOADING_LOW;
|
||||
#endif
|
||||
|
||||
int32 CMenuManager::m_PrefsSfxVolume = 102;
|
||||
int32 CMenuManager::m_PrefsMusicVolume = 102;
|
||||
int32 CMenuManager::m_PrefsBrightness = 256;
|
||||
|
@ -160,31 +160,9 @@ public:
|
||||
static int32 m_PrefsLanguage;
|
||||
static CONTRCONFIG m_PrefsControllerConfig;
|
||||
static bool m_PrefsUseVibration;
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
enum
|
||||
{
|
||||
ISLAND_LOADING_LOW = 0,
|
||||
ISLAND_LOADING_MEDIUM,
|
||||
ISLAND_LOADING_HIGH
|
||||
};
|
||||
|
||||
static int8 m_DisplayIslandLoading;
|
||||
static int8 m_PrefsIslandLoading;
|
||||
|
||||
#define ISLAND_LOADING_IS(p) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_##p)
|
||||
#define ISLAND_LOADING_ISNT(p) if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_##p)
|
||||
#else
|
||||
#define ISLAND_LOADING_IS(p)
|
||||
#define ISLAND_LOADING_ISNT(p)
|
||||
#endif
|
||||
#ifdef CUTSCENE_BORDERS_SWITCH
|
||||
static bool m_PrefsCutsceneBorders;
|
||||
#endif
|
||||
#ifdef MULTISAMPLING
|
||||
static int8 m_nPrefsMSAALevel;
|
||||
static int8 m_nDisplayMSAALevel;
|
||||
#endif
|
||||
|
||||
#ifdef GTA_PC
|
||||
bool m_bQuitGameNoCD;
|
||||
|
||||
|
@ -128,7 +128,7 @@ void MessageScreen(char *msg)
|
||||
|
||||
CFont::SetFontStyle(FONT_BANK);
|
||||
CFont::SetBackgroundOff();
|
||||
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f // unused
|
||||
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f
|
||||
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.0f));
|
||||
CFont::SetCentreOn();
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(450.0f)); // 450.0f
|
||||
@ -734,10 +734,10 @@ void CGame::InitialiseWhenRestarting(void)
|
||||
|
||||
//CFont::SetFontStyle(?);
|
||||
CFont::SetBackgroundOff();
|
||||
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(160.0f)); // 480.0f // unused
|
||||
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(160.0f)); // 480.0f
|
||||
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.0f));
|
||||
CFont::SetCentreOn();
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(480.0f)); // 480.0f
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(480.0f));
|
||||
CFont::SetJustifyOff();
|
||||
CFont::SetColor(CRGBA(255, 255, 255, 255));
|
||||
CFont::SetBackGroundOnlyTextOff();
|
||||
|
@ -392,6 +392,9 @@ CMenuScreen aScreens[MENUPAGES] = {
|
||||
{ "FET_PAU", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_RESUME, "FEM_RES", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEN_STA", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
#ifdef MENU_MAP
|
||||
MENUACTION_CHANGEMENU, "FEG_MAP", SAVESLOT_NONE, MENUPAGE_MAP,
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FEP_STA", SAVESLOT_NONE, MENUPAGE_STATS,
|
||||
MENUACTION_CHANGEMENU, "FEP_BRI", SAVESLOT_NONE, MENUPAGE_BRIEFS,
|
||||
MENUACTION_CHANGEMENU, "FET_OPT", SAVESLOT_NONE, MENUPAGE_OPTIONS,
|
||||
@ -436,6 +439,14 @@ CMenuScreen aScreens[MENUPAGES] = {
|
||||
},
|
||||
#endif
|
||||
|
||||
#ifdef MENU_MAP
|
||||
// MENUPAGE_MAP
|
||||
{ "FEG_MAP", 1, MENUPAGE_NONE, MENUPAGE_NONE, 2, 2,
|
||||
MENUACTION_UNK110, "", SAVESLOT_NONE, MENUPAGE_NONE, // to prevent cross/enter to go back
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
#endif
|
||||
|
||||
// MENUPAGE_UNK
|
||||
{ "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0,
|
||||
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include "custompipes.h"
|
||||
#include "RwHelper.h"
|
||||
#include "Text.h"
|
||||
#include "Streaming.h"
|
||||
#include "FileLoader.h"
|
||||
#include "Collision.h"
|
||||
#include "ModelInfo.h"
|
||||
|
||||
// Menu screens array is at the bottom of the file.
|
||||
|
||||
@ -48,6 +52,12 @@
|
||||
#define DUALPASS_SELECTOR
|
||||
#endif
|
||||
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
#define ISLAND_LOADING_SELECTOR MENUACTION_CFO_SELECT, "FEM_ISL", { new CCFOSelect((int8*)&CMenuManager::m_PrefsIslandLoading, "IslandLoading", islandLoadingOpts, ARRAY_SIZE(islandLoadingOpts), true, IslandLoadingAfterChange) },
|
||||
#else
|
||||
#define ISLAND_LOADING_SELECTOR
|
||||
#endif
|
||||
|
||||
#ifdef EXTENDED_COLOURFILTER
|
||||
#define POSTFX_SELECTORS \
|
||||
MENUACTION_CFO_SELECT, "FED_CLF", { new CCFOSelect((int8*)&CPostFX::EffectSwitch, "ColourFilter", filterNames, ARRAY_SIZE(filterNames), false, nil) }, \
|
||||
@ -80,6 +90,18 @@ void RestoreDefGraphics(int8 action) {
|
||||
#ifdef MULTISAMPLING
|
||||
FrontEndMenuManager.m_nPrefsMSAALevel = FrontEndMenuManager.m_nDisplayMSAALevel = 0;
|
||||
#endif
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
if (!FrontEndMenuManager.m_bGameNotLoaded) {
|
||||
FrontEndMenuManager.m_PrefsIslandLoading = FrontEndMenuManager.ISLAND_LOADING_LOW;
|
||||
CCollision::bAlreadyLoaded = false;
|
||||
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
|
||||
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
|
||||
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
|
||||
CStreaming::RequestIslands(CGame::currLevel);
|
||||
CStreaming::LoadAllRequestedModels(true);
|
||||
} else
|
||||
FrontEndMenuManager.m_PrefsIslandLoading = FrontEndMenuManager.ISLAND_LOADING_LOW;
|
||||
#endif
|
||||
#ifdef GRAPHICS_MENU_OPTIONS // otherwise Frontend will handle those
|
||||
CMenuManager::m_PrefsFrameLimiter = true;
|
||||
CMenuManager::m_PrefsVsyncDisp = true;
|
||||
@ -120,6 +142,47 @@ void RestoreDefDisplay(int8 action) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
const char *islandLoadingOpts[] = { "FEM_LOW", "FEM_MED", "FEM_HIG" };
|
||||
void IslandLoadingAfterChange(int8 before, int8 after) {
|
||||
if (!FrontEndMenuManager.m_bGameNotLoaded) {
|
||||
if (after > FrontEndMenuManager.ISLAND_LOADING_LOW) {
|
||||
FrontEndMenuManager.m_PrefsIslandLoading = before; // calls below needs previous mode :shrug:
|
||||
|
||||
if (after == FrontEndMenuManager.ISLAND_LOADING_HIGH)
|
||||
CStreaming::RemoveIslandsNotUsed(LEVEL_GENERIC);
|
||||
if (before == FrontEndMenuManager.ISLAND_LOADING_LOW) {
|
||||
if (CGame::currLevel != LEVEL_INDUSTRIAL)
|
||||
CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL);
|
||||
if (CGame::currLevel != LEVEL_COMMERCIAL)
|
||||
CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL);
|
||||
if (CGame::currLevel != LEVEL_SUBURBAN)
|
||||
CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN);
|
||||
CCollision::bAlreadyLoaded = true;
|
||||
FrontEndMenuManager.m_PrefsIslandLoading = after;
|
||||
CStreaming::RequestBigBuildings(CGame::currLevel);
|
||||
|
||||
} else if (before == FrontEndMenuManager.ISLAND_LOADING_HIGH) {
|
||||
FrontEndMenuManager.m_PrefsIslandLoading = after;
|
||||
CStreaming::RequestIslands(CGame::currLevel);
|
||||
} else
|
||||
FrontEndMenuManager.m_PrefsIslandLoading = after;
|
||||
|
||||
} else { // low
|
||||
CCollision::bAlreadyLoaded = false;
|
||||
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
|
||||
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
|
||||
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
|
||||
CStreaming::RequestIslands(CGame::currLevel);
|
||||
}
|
||||
|
||||
CStreaming::LoadAllRequestedModels(true);
|
||||
}
|
||||
|
||||
FrontEndMenuManager.SetHelperText(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MORE_LANGUAGES
|
||||
void LangPolSelect(int8 action)
|
||||
{
|
||||
@ -761,6 +824,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
PIPELINES_SELECTOR
|
||||
#endif
|
||||
ISLAND_LOADING_SELECTOR
|
||||
DUALPASS_SELECTOR
|
||||
MENUACTION_CFO_DYNAMIC, "FET_DEF", { new CCFODynamic(nil, nil, nil, RestoreDefGraphics) },
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
|
||||
@ -770,6 +834,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
|
||||
{ "FET_ADV", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS,
|
||||
new CCustomScreenLayout({MENUSPRITE_MAINMENU, 50, 0, 20, FONT_HEADING, FESCREEN_LEFT_ALIGN, true, MEDIUMTEXT_X_SCALE, MEDIUMTEXT_Y_SCALE}), nil,
|
||||
|
||||
ISLAND_LOADING_SELECTOR
|
||||
DUALPASS_SELECTOR
|
||||
CUTSCENE_BORDERS_TOGGLE
|
||||
FREE_CAM_TOGGLE
|
||||
|
@ -2610,7 +2610,7 @@ void CPad::PrintErrorMessage(void)
|
||||
CFont::SetScale(0.85f, 1.0f);
|
||||
CFont::SetJustifyOff();
|
||||
CFont::SetBackgroundOff();
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 20));
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(SCREEN_WIDTH - 20));
|
||||
CFont::SetCentreOn();
|
||||
CFont::SetPropOn();
|
||||
CFont::SetColor(CRGBA(255, 255, 200, 200));
|
||||
@ -2627,7 +2627,7 @@ void CPad::PrintErrorMessage(void)
|
||||
CFont::SetScale(0.85f, 1.0f);
|
||||
CFont::SetJustifyOff();
|
||||
CFont::SetBackgroundOff();
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 20));
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(SCREEN_WIDTH - 20));
|
||||
CFont::SetCentreOn();
|
||||
CFont::SetPropOn();
|
||||
CFont::SetColor(CRGBA(255, 255, 200, 200));
|
||||
|
@ -390,6 +390,7 @@ CStreaming::LoadCdDirectory(const char *dirname, int n)
|
||||
assert(sizeof(direntry) == 32);
|
||||
while(CFileMgr::Read(fd, (char*)&direntry, sizeof(direntry))){
|
||||
dot = strchr(direntry.name, '.');
|
||||
assert(dot);
|
||||
if(dot) *dot = '\0';
|
||||
if(direntry.size > (uint32)ms_streamingBufferSize)
|
||||
ms_streamingBufferSize = direntry.size;
|
||||
@ -741,7 +742,9 @@ CStreaming::RequestBigBuildings(eLevelName level)
|
||||
b = CPools::GetBuildingPool()->GetSlot(i);
|
||||
if(b && b->bIsBIGBuilding
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
&& ((CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) || (b->m_level == level))
|
||||
&& (((CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_LOW) && (b != pIslandLODindustEntity) && (b != pIslandLODcomIndEntity) &&
|
||||
(b != pIslandLODcomSubEntity) && (b != pIslandLODsubIndEntity) && (b != pIslandLODsubComEntity)
|
||||
) || (b->m_level == level))
|
||||
#else
|
||||
&& b->m_level == level
|
||||
#endif
|
||||
|
@ -1,297 +0,0 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "TempColModels.h"
|
||||
#include "SurfaceTable.h"
|
||||
|
||||
CColModel CTempColModels::ms_colModelPed1;
|
||||
CColModel CTempColModels::ms_colModelPed2;
|
||||
CColModel CTempColModels::ms_colModelBBox;
|
||||
CColModel CTempColModels::ms_colModelBumper1;
|
||||
CColModel CTempColModels::ms_colModelWheel1;
|
||||
CColModel CTempColModels::ms_colModelPanel1;
|
||||
CColModel CTempColModels::ms_colModelBodyPart2;
|
||||
CColModel CTempColModels::ms_colModelBodyPart1;
|
||||
CColModel CTempColModels::ms_colModelCutObj[5];
|
||||
CColModel CTempColModels::ms_colModelPedGroundHit;
|
||||
CColModel CTempColModels::ms_colModelBoot1;
|
||||
CColModel CTempColModels::ms_colModelDoor1;
|
||||
CColModel CTempColModels::ms_colModelBonnet1;
|
||||
|
||||
|
||||
CColSphere s_aPedSpheres[3];
|
||||
CColSphere s_aPed2Spheres[3];
|
||||
CColSphere s_aPedGSpheres[4];
|
||||
#ifdef FIX_BUGS
|
||||
CColSphere s_aDoorSpheres[3];
|
||||
#else
|
||||
CColSphere s_aDoorSpheres[4];
|
||||
#endif
|
||||
CColSphere s_aBumperSpheres[4];
|
||||
CColSphere s_aPanelSpheres[4];
|
||||
CColSphere s_aBonnetSpheres[4];
|
||||
CColSphere s_aBootSpheres[4];
|
||||
CColSphere s_aWheelSpheres[2];
|
||||
CColSphere s_aBodyPartSpheres1[2];
|
||||
CColSphere s_aBodyPartSpheres2[2];
|
||||
|
||||
void
|
||||
CTempColModels::Initialise(void)
|
||||
{
|
||||
#define SET_COLMODEL_SPHERES(colmodel, sphrs)\
|
||||
colmodel.numSpheres = ARRAY_SIZE(sphrs);\
|
||||
colmodel.spheres = sphrs;\
|
||||
colmodel.level = LEVEL_GENERIC;\
|
||||
colmodel.ownsCollisionVolumes = false;\
|
||||
|
||||
int i;
|
||||
|
||||
ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBBox.level = LEVEL_GENERIC;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) {
|
||||
ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelCutObj[i].level = LEVEL_GENERIC;
|
||||
}
|
||||
|
||||
// Ped Spheres
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPedSpheres); i++)
|
||||
s_aPedSpheres[i].radius = 0.35f;
|
||||
|
||||
s_aPedSpheres[0].center = CVector(0.0f, 0.0f, -0.25f);
|
||||
s_aPedSpheres[1].center = CVector(0.0f, 0.0f, 0.15f);
|
||||
s_aPedSpheres[2].center = CVector(0.0f, 0.0f, 0.55f);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPedSpheres); i++) {
|
||||
#else
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPedGSpheres); i++) {
|
||||
#endif
|
||||
s_aPedSpheres[i].surface = SURFACE_PED;
|
||||
s_aPedSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelPed1.boundingSphere.Set(1.25f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelPed1.boundingBox.Set(CVector(-0.35f, -0.35f, -1.0f), CVector(0.35f, 0.35f, 0.9f), SURFACE_DEFAULT, 0);
|
||||
SET_COLMODEL_SPHERES(ms_colModelPed1, s_aPedSpheres);
|
||||
|
||||
// Ped 2 Spheres
|
||||
|
||||
s_aPed2Spheres[0].radius = 0.3f;
|
||||
s_aPed2Spheres[1].radius = 0.4f;
|
||||
s_aPed2Spheres[2].radius = 0.3f;
|
||||
|
||||
s_aPed2Spheres[0].center = CVector(0.0f, 0.35f, -0.9f);
|
||||
s_aPed2Spheres[1].center = CVector(0.0f, 0.0f, -0.9f);
|
||||
s_aPed2Spheres[2].center = CVector(0.0f, -0.35f, -0.9f);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPed2Spheres); i++) {
|
||||
s_aPed2Spheres[i].surface = SURFACE_PED;
|
||||
s_aPed2Spheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelPed2.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelPed2.boundingBox.Set(CVector(-0.7f, -0.7f, -1.2f), CVector(0.7f, 0.7f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelPed2, s_aPed2Spheres);
|
||||
|
||||
// Ped ground collision
|
||||
|
||||
s_aPedGSpheres[0].radius = 0.35f;
|
||||
s_aPedGSpheres[1].radius = 0.35f;
|
||||
s_aPedGSpheres[2].radius = 0.35f;
|
||||
s_aPedGSpheres[3].radius = 0.3f;
|
||||
|
||||
s_aPedGSpheres[0].center = CVector(0.0f, -0.4f, -0.9f);
|
||||
s_aPedGSpheres[1].center = CVector(0.0f, -0.1f, -0.9f);
|
||||
s_aPedGSpheres[2].center = CVector(0.0f, 0.25f, -0.9f);
|
||||
s_aPedGSpheres[3].center = CVector(0.0f, 0.65f, -0.9f);
|
||||
|
||||
s_aPedGSpheres[0].surface = SURFACE_PED;
|
||||
s_aPedGSpheres[1].surface = SURFACE_PED;
|
||||
s_aPedGSpheres[2].surface = SURFACE_PED;
|
||||
s_aPedGSpheres[3].surface = SURFACE_PED;
|
||||
s_aPedGSpheres[0].piece = 4;
|
||||
s_aPedGSpheres[1].piece = 1;
|
||||
s_aPedGSpheres[2].piece = 0;
|
||||
s_aPedGSpheres[3].piece = 6;
|
||||
|
||||
ms_colModelPedGroundHit.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelPedGroundHit.boundingBox.Set(CVector(-0.4f, -1.0f, -1.25f), CVector(0.4f, 1.2f, -0.5f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelPedGroundHit, s_aPedGSpheres);
|
||||
|
||||
// Door Spheres
|
||||
|
||||
s_aDoorSpheres[0].radius = 0.15f;
|
||||
s_aDoorSpheres[1].radius = 0.15f;
|
||||
s_aDoorSpheres[2].radius = 0.25f;
|
||||
|
||||
s_aDoorSpheres[0].center = CVector(0.0f, -0.25f, -0.35f);
|
||||
s_aDoorSpheres[1].center = CVector(0.0f, -0.95f, -0.35f);
|
||||
s_aDoorSpheres[2].center = CVector(0.0f, -0.6f, 0.25f);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
for (i = 0; i < ARRAY_SIZE(s_aDoorSpheres); i++) {
|
||||
#else
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPed2Spheres); i++) {
|
||||
#endif
|
||||
s_aDoorSpheres[i].surface = SURFACE_CAR_PANEL;
|
||||
s_aDoorSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelDoor1.boundingSphere.Set(1.5f, CVector(0.0f, -0.6f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelDoor1.boundingBox.Set(CVector(-0.3f, 0.0f, -0.6f), CVector(0.3f, -1.2f, 0.6f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelDoor1, s_aDoorSpheres);
|
||||
|
||||
// Bumper Spheres
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBumperSpheres); i++)
|
||||
s_aBumperSpheres[i].radius = 0.15f;
|
||||
|
||||
s_aBumperSpheres[0].center = CVector(0.85f, -0.05f, 0.0f);
|
||||
s_aBumperSpheres[1].center = CVector(0.4f, 0.05f, 0.0f);
|
||||
s_aBumperSpheres[2].center = CVector(-0.4f, 0.05f, 0.0f);
|
||||
s_aBumperSpheres[3].center = CVector(-0.85f, -0.05f, 0.0f);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBumperSpheres); i++) {
|
||||
s_aBumperSpheres[i].surface = SURFACE_CAR_PANEL;
|
||||
s_aBumperSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelBumper1.boundingSphere.Set(2.2f, CVector(0.0f, -0.6f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBumper1.boundingBox.Set(CVector(-1.2f, -0.3f, -0.2f), CVector(1.2f, 0.3f, 0.2f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelBumper1, s_aBumperSpheres);
|
||||
|
||||
// Panel Spheres
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPanelSpheres); i++)
|
||||
s_aPanelSpheres[i].radius = 0.15f;
|
||||
|
||||
s_aPanelSpheres[0].center = CVector(0.15f, 0.45f, 0.0f);
|
||||
s_aPanelSpheres[1].center = CVector(0.15f, -0.45f, 0.0f);
|
||||
s_aPanelSpheres[2].center = CVector(-0.15f, -0.45f, 0.0f);
|
||||
s_aPanelSpheres[3].center = CVector(-0.15f, 0.45f, 0.0f);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aPanelSpheres); i++) {
|
||||
s_aPanelSpheres[i].surface = SURFACE_CAR_PANEL;
|
||||
s_aPanelSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelPanel1.boundingSphere.Set(1.4f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelPanel1.boundingBox.Set(CVector(-0.3f, -0.6f, -0.15f), CVector(0.3f, 0.6f, 0.15f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelPanel1, s_aPanelSpheres);
|
||||
|
||||
// Bonnet Spheres
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBonnetSpheres); i++)
|
||||
s_aBonnetSpheres[i].radius = 0.2f;
|
||||
|
||||
s_aBonnetSpheres[0].center = CVector(-0.4f, 0.1f, 0.0f);
|
||||
s_aBonnetSpheres[1].center = CVector(-0.4f, 0.9f, 0.0f);
|
||||
s_aBonnetSpheres[2].center = CVector(0.4f, 0.1f, 0.0f);
|
||||
s_aBonnetSpheres[3].center = CVector(0.4f, 0.9f, 0.0f);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBonnetSpheres); i++) {
|
||||
s_aBonnetSpheres[i].surface = SURFACE_CAR_PANEL;
|
||||
s_aBonnetSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelBonnet1.boundingSphere.Set(1.7f, CVector(0.0f, 0.5f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBonnet1.boundingBox.Set(CVector(-0.7f, -0.2f, -0.3f), CVector(0.7f, 1.2f, 0.3f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelBonnet1, s_aBonnetSpheres);
|
||||
|
||||
// Boot Spheres
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++)
|
||||
s_aBootSpheres[i].radius = 0.2f;
|
||||
|
||||
s_aBootSpheres[0].center = CVector(-0.4f, -0.1f, 0.0f);
|
||||
s_aBootSpheres[1].center = CVector(-0.4f, -0.6f, 0.0f);
|
||||
s_aBootSpheres[2].center = CVector(0.4f, -0.1f, 0.0f);
|
||||
s_aBootSpheres[3].center = CVector(0.4f, -0.6f, 0.0f);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
|
||||
s_aBootSpheres[i].surface = SURFACE_CAR_PANEL;
|
||||
s_aBootSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelBoot1.boundingSphere.Set(1.4f, CVector(0.0f, -0.4f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBoot1.boundingBox.Set(CVector(-0.7f, -0.9f, -0.3f), CVector(0.7f, 0.2f, 0.3f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelBoot1, s_aBootSpheres);
|
||||
|
||||
// Wheel Spheres
|
||||
|
||||
s_aWheelSpheres[0].radius = 0.35f;
|
||||
s_aWheelSpheres[1].radius = 0.35f;
|
||||
|
||||
s_aWheelSpheres[0].center = CVector(-0.3f, 0.0f, 0.0f);
|
||||
s_aWheelSpheres[1].center = CVector(0.3f, 0.0f, 0.0f);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
for (i = 0; i < ARRAY_SIZE(s_aWheelSpheres); i++) {
|
||||
#else
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
|
||||
#endif
|
||||
s_aWheelSpheres[i].surface = SURFACE_WHEELBASE;
|
||||
s_aWheelSpheres[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelWheel1.boundingSphere.Set(1.4f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelWheel1.boundingBox.Set(CVector(-0.7f, -0.4f, -0.4f), CVector(0.7f, 0.4f, 0.4f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelWheel1, s_aWheelSpheres);
|
||||
|
||||
// Body Part Spheres 1
|
||||
|
||||
s_aBodyPartSpheres1[0].radius = 0.2f;
|
||||
s_aBodyPartSpheres1[1].radius = 0.2f;
|
||||
|
||||
s_aBodyPartSpheres1[0].center = CVector(0.0f, 0.0f, 0.0f);
|
||||
s_aBodyPartSpheres1[1].center = CVector(0.8f, 0.0f, 0.0f);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBodyPartSpheres1); i++) {
|
||||
#else
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
|
||||
#endif
|
||||
s_aBodyPartSpheres1[i].surface = SURFACE_PED;
|
||||
s_aBodyPartSpheres1[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelBodyPart1.boundingSphere.Set(0.7f, CVector(0.4f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBodyPart1.boundingBox.Set(CVector(-0.3f, -0.3f, -0.3f), CVector(1.1f, 0.3f, 0.3f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelBodyPart1, s_aBodyPartSpheres1);
|
||||
|
||||
// Body Part Spheres 2
|
||||
|
||||
s_aBodyPartSpheres2[0].radius = 0.15f;
|
||||
s_aBodyPartSpheres2[1].radius = 0.15f;
|
||||
|
||||
s_aBodyPartSpheres2[0].center = CVector(0.0f, 0.0f, 0.0f);
|
||||
s_aBodyPartSpheres2[1].center = CVector(0.5f, 0.0f, 0.0f);
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBodyPartSpheres2); i++) {
|
||||
#else
|
||||
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
|
||||
#endif
|
||||
s_aBodyPartSpheres2[i].surface = SURFACE_PED;
|
||||
s_aBodyPartSpheres2[i].piece = 0;
|
||||
}
|
||||
|
||||
ms_colModelBodyPart2.boundingSphere.Set(0.5f, CVector(0.25f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
|
||||
ms_colModelBodyPart2.boundingBox.Set(CVector(-0.2f, -0.2f, -0.2f), CVector(0.7f, 0.2f, 0.2f), SURFACE_DEFAULT, 0);
|
||||
|
||||
SET_COLMODEL_SPHERES(ms_colModelBodyPart2, s_aBodyPartSpheres2);
|
||||
|
||||
#undef SET_COLMODEL_SPHERES
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Collision.h"
|
||||
|
||||
class CTempColModels
|
||||
{
|
||||
public:
|
||||
static CColModel ms_colModelPed1;
|
||||
static CColModel ms_colModelPed2;
|
||||
static CColModel ms_colModelBBox;
|
||||
static CColModel ms_colModelBumper1;
|
||||
static CColModel ms_colModelWheel1;
|
||||
static CColModel ms_colModelPanel1;
|
||||
static CColModel ms_colModelBodyPart2;
|
||||
static CColModel ms_colModelBodyPart1;
|
||||
static CColModel ms_colModelCutObj[5];
|
||||
static CColModel ms_colModelPedGroundHit;
|
||||
static CColModel ms_colModelBoot1;
|
||||
static CColModel ms_colModelDoor1;
|
||||
static CColModel ms_colModelBonnet1;
|
||||
|
||||
static void Initialise(void);
|
||||
};
|
@ -212,10 +212,10 @@ enum Config {
|
||||
# define TIMEBARS // print debug timers
|
||||
#endif
|
||||
|
||||
#define FIX_BUGS // fixes bugs that we've came across during reversing, TODO: use this more
|
||||
#define FIX_BUGS // fixes bugs that we've came across during reversing
|
||||
#define MORE_LANGUAGES // Add more translations to the game
|
||||
#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible
|
||||
#define LOAD_INI_SETTINGS
|
||||
#define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
// Rendering/display
|
||||
//#define EXTRA_MODEL_FLAGS // from mobile to optimize rendering
|
||||
@ -227,19 +227,11 @@ enum Config {
|
||||
#define PS2_ALPHA_TEST // emulate ps2 alpha test
|
||||
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
|
||||
#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
//#define USE_TEXTURE_POOL
|
||||
#define CUTSCENE_BORDERS_SWITCH
|
||||
#ifdef LIBRW
|
||||
//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
|
||||
//#define EXTENDED_PIPELINES // custom render pipelines (includes Neo)
|
||||
#endif
|
||||
#define MULTISAMPLING // adds MSAA option
|
||||
|
||||
#ifdef LIBRW
|
||||
// these are not supported with librw yet
|
||||
# undef MULTISAMPLING
|
||||
#endif
|
||||
|
||||
// Particle
|
||||
//#define PC_PARTICLE
|
||||
@ -278,7 +270,13 @@ enum Config {
|
||||
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
|
||||
//# define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
|
||||
# define CUSTOM_FRONTEND_OPTIONS
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Advanced Options menu will appear if Display is full
|
||||
|
||||
# ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Advanced Options menu will appear if Display is full
|
||||
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
# define CUTSCENE_BORDERS_SWITCH
|
||||
# define MULTISAMPLING // adds MSAA option
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Script
|
||||
@ -327,6 +325,8 @@ enum Config {
|
||||
#endif
|
||||
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
|
||||
|
||||
// IMG
|
||||
#define BIG_IMG // allows to read larger img files
|
||||
|
||||
//#define SQUEEZE_PERFORMANCE
|
||||
#ifdef SQUEEZE_PERFORMANCE
|
||||
@ -335,3 +335,8 @@ enum Config {
|
||||
#define PC_PARTICLE
|
||||
#define VC_PED_PORTS // To not process collisions always. But should be tested if that's really beneficial
|
||||
#endif
|
||||
|
||||
#ifdef LIBRW
|
||||
// these are not supported with librw yet
|
||||
# undef MULTISAMPLING
|
||||
#endif
|
||||
|
@ -89,7 +89,11 @@ RwRGBA gColourTop;
|
||||
bool gameAlreadyInitialised;
|
||||
|
||||
float NumberOfChunksLoaded;
|
||||
#ifdef GTA_PS2
|
||||
#define TOTALNUMCHUNKS 48.0f
|
||||
#else
|
||||
#define TOTALNUMCHUNKS 73.0f
|
||||
#endif
|
||||
|
||||
bool g_SlowMode = false;
|
||||
char version_name[64];
|
||||
@ -625,20 +629,20 @@ LoadingIslandScreen(const char *levelName)
|
||||
CFont::SetScale(1.5f, 1.5f);
|
||||
CFont::SetPropOn();
|
||||
CFont::SetRightJustifyOn();
|
||||
CFont::SetRightJustifyWrap(150.0f);
|
||||
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(150.0f));
|
||||
CFont::SetFontStyle(FONT_HEADING);
|
||||
sprintf(str, "WELCOME TO");
|
||||
AsciiToUnicode(str, wstr);
|
||||
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
||||
CFont::SetDropShadowPosition(3);
|
||||
CFont::SetColor(CRGBA(243, 237, 71, 255));
|
||||
CFont::SetScale(SCREEN_STRETCH_X(1.2f), SCREEN_STRETCH_Y(1.2f));
|
||||
CFont::PrintString(SCREEN_WIDTH - 20, SCREEN_STRETCH_FROM_BOTTOM(110.0f), TheText.Get("WELCOME"));
|
||||
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.2f));
|
||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_STRETCH_FROM_BOTTOM(110.0f), TheText.Get("WELCOME"));
|
||||
TextCopy(wstr, name);
|
||||
TheText.UpperCase(wstr);
|
||||
CFont::SetColor(CRGBA(243, 237, 71, 255));
|
||||
CFont::SetScale(SCREEN_STRETCH_X(1.2f), SCREEN_STRETCH_Y(1.2f));
|
||||
CFont::PrintString(SCREEN_WIDTH-20, SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr);
|
||||
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.2f));
|
||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr);
|
||||
CFont::DrawFonts();
|
||||
DoRWStuffEndOfFrame();
|
||||
}
|
||||
@ -852,7 +856,7 @@ DisplayGameDebugText()
|
||||
CFont::SetRightJustifyOff();
|
||||
CFont::SetJustifyOff();
|
||||
CFont::SetBackGroundOnlyTextOff();
|
||||
CFont::SetWrapx(SCREEN_WIDTH);
|
||||
CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
|
||||
CFont::SetFontStyle(FONT_HEADING);
|
||||
|
||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||
|
@ -86,7 +86,8 @@ CustomFrontendOptionsPopulate(void)
|
||||
linb::ini cfg;
|
||||
int CheckAndReadIniInt(const char *cat, const char *key, int original)
|
||||
{
|
||||
const char *value = (cfg.get(cat, key, "").c_str());
|
||||
std::string strval = cfg.get(cat, key, "");
|
||||
const char *value = strval.c_str();
|
||||
if (value && value[0] != '\0')
|
||||
return atoi(value);
|
||||
|
||||
@ -95,13 +96,34 @@ int CheckAndReadIniInt(const char *cat, const char *key, int original)
|
||||
|
||||
float CheckAndReadIniFloat(const char *cat, const char *key, float original)
|
||||
{
|
||||
const char *value = (cfg.get(cat, key, "").c_str());
|
||||
std::string strval = cfg.get(cat, key, "");
|
||||
const char *value = strval.c_str();
|
||||
if (value && value[0] != '\0')
|
||||
return atof(value);
|
||||
|
||||
return original;
|
||||
}
|
||||
|
||||
void CheckAndSaveIniInt(const char *cat, const char *key, int val, bool &changed)
|
||||
{
|
||||
char temp[10];
|
||||
if (atoi(cfg.get(cat, key, "xxx").c_str()) != val) { // if .ini doesn't have our key, compare with xxx and forcefully add it
|
||||
changed = true;
|
||||
sprintf(temp, "%u", val);
|
||||
cfg.set(cat, key, temp);
|
||||
}
|
||||
}
|
||||
|
||||
void CheckAndSaveIniFloat(const char *cat, const char *key, float val, bool &changed)
|
||||
{
|
||||
char temp[10];
|
||||
if (atof(cfg.get(cat, key, "xxx").c_str()) != val) { // if .ini doesn't have our key, compare with xxx and forcefully add it
|
||||
changed = true;
|
||||
sprintf(temp, "%f", val);
|
||||
cfg.set(cat, key, temp);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadINISettings()
|
||||
{
|
||||
cfg.load_file("re3.ini");
|
||||
@ -156,11 +178,6 @@ void LoadINISettings()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
CMenuManager::m_PrefsIslandLoading = CheckAndReadIniInt("FrontendOptions", "NoIslandLoading", CMenuManager::m_PrefsIslandLoading);
|
||||
CMenuManager::m_DisplayIslandLoading = CMenuManager::m_PrefsIslandLoading;
|
||||
#endif
|
||||
|
||||
#ifdef EXTENDED_COLOURFILTER
|
||||
CPostFX::Intensity = CheckAndReadIniFloat("CustomPipesValues", "PostFXIntensity", CPostFX::Intensity);
|
||||
#endif
|
||||
@ -192,21 +209,22 @@ void SaveINISettings()
|
||||
break;
|
||||
|
||||
if (option.m_Action < MENUACTION_NOTHING && option.m_CFO->save) {
|
||||
if (atoi(cfg.get("FrontendOptions", option.m_CFO->save, "xxx").c_str()) != *option.m_CFO->value) { // if .ini doesn't have that key compare with xxx, so we can add it
|
||||
changed = true;
|
||||
sprintf(temp, "%u", *option.m_CFO->value);
|
||||
cfg.set("FrontendOptions", option.m_CFO->save, temp);
|
||||
}
|
||||
// Beware: CFO only supports saving uint8 right now
|
||||
CheckAndSaveIniInt("FrontendOptions", option.m_CFO->save, *option.m_CFO->value, changed);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef NO_ISLAND_LOADING
|
||||
if (atoi(cfg.get("FrontendOptions", "NoIslandLoading", "xxx").c_str()) != CMenuManager::m_PrefsIslandLoading) {
|
||||
changed = true;
|
||||
sprintf(temp, "%u", CMenuManager::m_PrefsIslandLoading);
|
||||
cfg.set("FrontendOptions", "NoIslandLoading", temp);
|
||||
}
|
||||
|
||||
#ifdef EXTENDED_COLOURFILTER
|
||||
CheckAndSaveIniFloat("CustomPipesValues", "PostFXIntensity", CPostFX::Intensity, changed);
|
||||
#endif
|
||||
#ifdef EXTENDED_PIPELINES
|
||||
CheckAndSaveIniFloat("CustomPipesValues", "NeoVehicleShininess", CustomPipes::VehicleShininess, changed);
|
||||
CheckAndSaveIniFloat("CustomPipesValues", "NeoVehicleSpecularity", CustomPipes::VehicleSpecularity, changed);
|
||||
CheckAndSaveIniFloat("CustomPipesValues", "RimlightMult", CustomPipes::RimlightMult, changed);
|
||||
CheckAndSaveIniFloat("CustomPipesValues", "LightmapMult", CustomPipes::LightmapMult, changed);
|
||||
CheckAndSaveIniFloat("CustomPipesValues", "GlossMult", CustomPipes::GlossMult, changed);
|
||||
#endif
|
||||
|
||||
if (changed)
|
||||
|
@ -1,21 +0,0 @@
|
||||
.align 4
|
||||
.global Vu0CollisionDmaTag
|
||||
Vu0CollisionDmaTag:
|
||||
DMAcnt *
|
||||
MPG 0, *
|
||||
.vu
|
||||
.include "vu0Collision_1.s"
|
||||
.EndMPG
|
||||
.EndDmaData
|
||||
DMAend
|
||||
|
||||
.global Vu0Collision2DmaTag
|
||||
Vu0Collision2DmaTag:
|
||||
DMAcnt *
|
||||
MPG 0, *
|
||||
.vu
|
||||
.include "vu0Collision_2.s"
|
||||
.EndMPG
|
||||
.EndDmaData
|
||||
DMAend
|
||||
.end
|
@ -1,610 +0,0 @@
|
||||
QuitAndFail:
|
||||
NOP[E] IADDIU VI01, VI00, 0
|
||||
NOP NOP
|
||||
|
||||
|
||||
QuitAndSucceed:
|
||||
NOP[E] IADDIU VI01, VI00, 1
|
||||
NOP NOP
|
||||
|
||||
|
||||
; 20 -- unused
|
||||
; VF12, VF13 xyz: sphere centers
|
||||
; VF14, VF15 x: sphere radii
|
||||
; out:
|
||||
; VI01: set when collision
|
||||
; VF01: supposed to be intersection point?
|
||||
; VF02: normal (pointing towards s1, not normalized)
|
||||
.globl Vu0SphereToSphereCollision
|
||||
Vu0SphereToSphereCollision:
|
||||
SUB.xyz VF02, VF13, VF12 NOP ; dist of centers
|
||||
ADD.x VF04, VF14, VF15 NOP ; s = sum of radii
|
||||
MUL.xyzw VF03, VF02, VF02 NOP ;
|
||||
MUL.x VF04, VF04, VF04 DIV Q, VF14x, VF04x ; square s
|
||||
NOP NOP ;
|
||||
NOP NOP ;
|
||||
MULAx.w ACC, VF00, VF03 NOP ;
|
||||
MADDAy.w ACC, VF00, VF03 NOP ;
|
||||
MADDz.w VF03, VF00, VF03 NOP ; d = DistSq of centers
|
||||
NOP NOP ;
|
||||
MULAw.xyz ACC, VF12, VF00 NOP ;
|
||||
MADDq.xyz VF01, VF02, Q NOP ; intersection, but wrong
|
||||
CLIPw.xyz VF04, VF03 NOP ; compare s and d
|
||||
SUB.xyz VF02, VF00, VF02 NOP ; compute normal
|
||||
NOP NOP ;
|
||||
NOP NOP ;
|
||||
NOP FCAND VI01, 0x3 ; 0x2 cannot be set here
|
||||
NOP[E] NOP ;
|
||||
NOP NOP ;
|
||||
|
||||
|
||||
; B8 -- unused
|
||||
; VF12:
|
||||
; VF13: radius
|
||||
; VF14:
|
||||
; VF15: box dimensions (?)
|
||||
.globl Vu0SphereToAABBCollision
|
||||
Vu0SphereToAABBCollision:
|
||||
SUB.xyz VF03, VF12, VF14 LOI 0.5
|
||||
MULi.xyz VF15, VF15, I NOP
|
||||
MUL.x VF13, VF13, VF13 NOP
|
||||
SUB.xyz VF04, VF03, VF15 NOP
|
||||
ADD.xyz VF05, VF03, VF15 MR32.xyzw VF16, VF15
|
||||
CLIPw.xyz VF03, VF16 MR32.xyzw VF17, VF16
|
||||
MUL.xyz VF04, VF04, VF04 NOP
|
||||
MUL.xyz VF05, VF05, VF05 NOP
|
||||
CLIPw.xyz VF03, VF17 MR32.xyzw VF16, VF17
|
||||
NOP FCAND VI01, 0x1
|
||||
MINI.xyz VF04, VF04, VF05 MFIR.x VF09, VI01
|
||||
NOP NOP
|
||||
CLIPw.xyz VF03, VF16 FCAND VI01, 0x4
|
||||
NOP MFIR.y VF09, VI01
|
||||
NOP NOP
|
||||
MULAx.w ACC, VF00, VF00 NOP
|
||||
ADD.xyz VF01, VF00, VF03 FCAND VI01, 0x10
|
||||
NOP MFIR.z VF09, VI01
|
||||
NOP LOI 2
|
||||
NOP FCAND VI01, 0x30
|
||||
SUBAw.xyz ACC, VF00, VF00 IADD VI04, VI00, VI01
|
||||
ITOF0.xyz VF09, VF09 FCAND VI01, 0x300
|
||||
NOP IADD VI03, VI00, VI01
|
||||
NOP FCAND VI01, 0x3000
|
||||
NOP IADD VI02, VI00, VI01
|
||||
MADDi.xyzw VF09, VF09, I NOP
|
||||
NOP IBEQ VI04, VI00, IgnoreZValue
|
||||
NOP NOP
|
||||
MADDAz.w ACC, VF00, VF04 NOP
|
||||
MUL.z VF01, VF09, VF15 NOP
|
||||
IgnoreZValue:
|
||||
NOP IBEQ VI03, VI00, IgnoreYValue
|
||||
NOP NOP
|
||||
MADDAy.w ACC, VF00, VF04 NOP
|
||||
MUL.y VF01, VF09, VF15 NOP
|
||||
IgnoreYValue:
|
||||
NOP IBEQ VI02, VI00, IgnoreXValue
|
||||
NOP NOP
|
||||
MADDAx.w ACC, VF00, VF04 NOP
|
||||
MUL.x VF01, VF09, VF15 NOP
|
||||
IgnoreXValue:
|
||||
MADDx.w VF06, VF00, VF00 NOP
|
||||
SUB.xyz VF02, VF03, VF01 NOP
|
||||
ADD.xyz VF01, VF01, VF14 NOP
|
||||
MULx.w VF01, VF00, VF00 NOP
|
||||
CLIPw.xyz VF13, VF06 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x1
|
||||
QuitMicrocode:
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
|
||||
|
||||
; 240
|
||||
.globl Vu0LineToSphereCollision
|
||||
Vu0LineToSphereCollision:
|
||||
SUB.xyzw VF01, VF13, VF12 NOP
|
||||
SUB.xyzw VF02, VF14, VF12 NOP
|
||||
MUL.xyz VF03, VF01, VF02 NOP
|
||||
MUL.xyz VF04, VF01, VF01 NOP
|
||||
MUL.x VF15, VF15, VF15 NOP
|
||||
MUL.xyz VF02, VF02, VF02 NOP
|
||||
MULAx.w ACC, VF00, VF03 NOP
|
||||
MADDAy.w ACC, VF00, VF03 NOP
|
||||
MADDz.w VF03, VF00, VF03 NOP
|
||||
MULAx.w ACC, VF00, VF04 NOP
|
||||
MADDAy.w ACC, VF00, VF04 NOP
|
||||
MADDz.w VF01, VF00, VF04 NOP
|
||||
MULAx.w ACC, VF00, VF02 NOP
|
||||
MADDAy.w ACC, VF00, VF02 NOP
|
||||
MADDz.w VF02, VF00, VF02 NOP
|
||||
MULA.w ACC, VF03, VF03 NOP
|
||||
MADDAx.w ACC, VF01, VF15 NOP
|
||||
MSUB.w VF05, VF01, VF02 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP IADDIU VI02, VI00, 0x10
|
||||
NOP FMAND VI01, VI02
|
||||
NOP IBNE VI01, VI00, QuitAndFail
|
||||
NOP NOP
|
||||
CLIPw.xyz VF15, VF02 SQRT Q, VF05w
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x1
|
||||
NOP IBNE VI00, VI01, LineStartInsideSphere
|
||||
NOP NOP
|
||||
SUBq.w VF05, VF03, Q NOP
|
||||
SUB.w VF05, VF05, VF01 DIV Q, VF05w, VF01w
|
||||
NOP FMAND VI01, VI02
|
||||
NOP IBNE VI01, VI00, QuitAndFail
|
||||
NOP NOP
|
||||
NOP FMAND VI01, VI02
|
||||
NOP IBEQ VI01, VI00, QuitAndFail
|
||||
NOP NOP
|
||||
ADDA.xyz ACC, VF12, VF00 NOP
|
||||
MADDq.xyz VF01, VF01, Q NOP
|
||||
MULx.w VF01, VF00, VF00 NOP
|
||||
SUB.xyz VF02, VF01, VF14 NOP
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
LineStartInsideSphere:
|
||||
NOP MOVE.xyzw VF01, VF12
|
||||
NOP[E] IADDIU VI01, VI00, 0x1
|
||||
NOP NOP
|
||||
|
||||
|
||||
; 3C0
|
||||
.globl Vu0LineToAABBCollision
|
||||
Vu0LineToAABBCollision:
|
||||
SUB.xyzw VF08, VF13, VF12 LOI 0.5
|
||||
MULi.xyz VF15, VF15, I IADDIU VI08, VI00, 0x0
|
||||
SUB.xyzw VF12, VF12, VF14 NOP
|
||||
SUB.xyzw VF13, VF13, VF14 NOP
|
||||
NOP DIV Q, VF00w, VF08x
|
||||
NOP MR32.xyzw VF03, VF15
|
||||
SUB.xyz VF06, VF15, VF12 NOP
|
||||
ADD.xyz VF07, VF15, VF12 NOP
|
||||
NOP NOP
|
||||
CLIPw.xyz VF12, VF03 MR32.xyzw VF04, VF03
|
||||
NOP NOP
|
||||
ADDq.x VF09, VF00, Q DIV Q, VF00w, VF08y
|
||||
NOP NOP
|
||||
CLIPw.xyz VF12, VF04 MR32.xyzw VF05, VF04
|
||||
SUB.xyz VF07, VF00, VF07 IADDIU VI06, VI00, 0xCC
|
||||
NOP IADDIU VI07, VI00, 0x30
|
||||
NOP NOP
|
||||
CLIPw.xyz VF12, VF05 FCGET VI02
|
||||
NOP IAND VI02, VI02, VI06
|
||||
ADDq.y VF09, VF00, Q DIV Q, VF00w, VF08z
|
||||
SUB.xyz VF10, VF00, VF10 NOP
|
||||
CLIPw.xyz VF13, VF03 FCGET VI03
|
||||
CLIPw.xyz VF13, VF04 IAND VI03, VI03, VI07
|
||||
CLIPw.xyz VF13, VF05 FCAND VI01, 0x3330
|
||||
NOP IBEQ VI01, VI00, StartPointInsideAABB
|
||||
NOP NOP
|
||||
ADDq.z VF09, VF00, Q FCGET VI04
|
||||
NOP FCGET VI05
|
||||
NOP IAND VI04, VI04, VI06
|
||||
NOP IAND VI05, VI05, VI07
|
||||
MULx.xyz VF17, VF08, VF09 NOP
|
||||
MULy.xyz VF18, VF08, VF09 IADDIU VI07, VI00, 0x80
|
||||
MULz.xyz VF19, VF08, VF09 IAND VI06, VI02, VI07
|
||||
MUL.w VF10, VF00, VF00 IAND VI07, VI04, VI07
|
||||
NOP NOP
|
||||
NOP IBEQ VI06, VI07, CheckMaxXSide
|
||||
NOP NOP
|
||||
MULAx.xyz ACC, VF17, VF07 NOP
|
||||
MADDw.xyz VF16, VF12, VF00 NOP
|
||||
MUL.x VF10, VF07, VF09 NOP
|
||||
CLIPw.xyz VF16, VF04 NOP
|
||||
CLIPw.xyz VF16, VF05 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x330
|
||||
NOP IBNE VI01, VI00, CheckMaxXSide
|
||||
NOP NOP
|
||||
MULx.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
|
||||
ADD.yz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
|
||||
SUBw.x VF02, VF00, VF00 NOP
|
||||
CheckMaxXSide:
|
||||
MULAx.xyz ACC, VF17, VF06 IADDIU VI07, VI00, 0x40
|
||||
MADDw.xyz VF16, VF12, VF00 IAND VI06, VI02, VI07
|
||||
MUL.x VF10, VF06, VF09 IAND VI07, VI04, VI07
|
||||
NOP NOP
|
||||
NOP IBEQ VI06, VI07, CheckMinYSide
|
||||
NOP NOP
|
||||
CLIPw.xyz VF16, VF04 NOP
|
||||
CLIPw.xyz VF16, VF05 NOP
|
||||
CLIPw.xyz VF10, VF10 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0xCC03
|
||||
NOP IBNE VI01, VI00, CheckMinYSide
|
||||
NOP NOP
|
||||
MULx.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
|
||||
ADD.yz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
|
||||
ADDw.x VF02, VF00, VF00 NOP
|
||||
CheckMinYSide:
|
||||
MULAy.xyz ACC, VF18, VF07 IADDIU VI07, VI00, 0x8
|
||||
MADDw.xyz VF16, VF12, VF00 IAND VI06, VI02, VI07
|
||||
MUL.y VF10, VF07, VF09 IAND VI07, VI04, VI07
|
||||
NOP NOP
|
||||
NOP IBEQ VI06, VI07, CheckMaxYSide
|
||||
NOP NOP
|
||||
CLIPw.xyz VF16, VF03 NOP
|
||||
CLIPw.xyz VF16, VF05 NOP
|
||||
CLIPw.xyz VF10, VF10 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3C0C
|
||||
NOP IBNE VI01, VI00, CheckMaxYSide
|
||||
NOP NOP
|
||||
MULy.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
|
||||
ADD.xz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
|
||||
SUBw.y VF02, VF00, VF00 NOP
|
||||
CheckMaxYSide:
|
||||
MULAy.xyz ACC, VF18, VF06 IADDIU VI07, VI00, 0x4
|
||||
MADDw.xyz VF16, VF12, VF00 IAND VI06, VI02, VI07
|
||||
MUL.y VF10, VF06, VF09 IAND VI07, VI04, VI07
|
||||
NOP NOP
|
||||
NOP IBEQ VI06, VI07, CheckMinZSide
|
||||
NOP NOP
|
||||
CLIPw.xyz VF16, VF03 NOP
|
||||
CLIPw.xyz VF16, VF05 NOP
|
||||
CLIPw.xyz VF10, VF10 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3C0C
|
||||
NOP IBNE VI01, VI00, CheckMinZSide
|
||||
NOP NOP
|
||||
MULy.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
|
||||
ADD.xz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
|
||||
ADDw.y VF02, VF00, VF00 NOP
|
||||
CheckMinZSide:
|
||||
MULAz.xyz ACC, VF19, VF07 IADDIU VI07, VI00, 0x20
|
||||
MADDw.xyz VF16, VF12, VF00 IAND VI06, VI03, VI07
|
||||
MUL.z VF10, VF07, VF09 IAND VI07, VI05, VI07
|
||||
NOP NOP
|
||||
NOP IBEQ VI06, VI07, CheckMaxZSide
|
||||
NOP NOP
|
||||
CLIPw.xyz VF16, VF03 NOP
|
||||
CLIPw.xyz VF16, VF04 NOP
|
||||
CLIPw.xyz VF10, VF10 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3330
|
||||
NOP IBNE VI01, VI00, CheckMaxZSide
|
||||
NOP NOP
|
||||
MULz.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
|
||||
ADD.xy VF02, VF00, VF00 MOVE.xyzw VF01, VF16
|
||||
SUBw.z VF02, VF00, VF00 NOP
|
||||
CheckMaxZSide:
|
||||
MULAz.xyz ACC, VF19, VF06 IADDIU VI07, VI00, 0x10
|
||||
MADDw.xyz VF16, VF12, VF00 IAND VI06, VI03, VI07
|
||||
MUL.z VF10, VF06, VF09 IAND VI07, VI05, VI07
|
||||
NOP NOP
|
||||
NOP IBEQ VI06, VI07, DoneAllChecks
|
||||
NOP NOP
|
||||
CLIPw.xyz VF16, VF03 NOP
|
||||
CLIPw.xyz VF16, VF04 NOP
|
||||
CLIPw.xyz VF10, VF10 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3330
|
||||
NOP IBNE VI01, VI00, DoneAllChecks
|
||||
NOP NOP
|
||||
MULz.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
|
||||
ADD.xy VF02, VF00, VF00 MOVE.xyzw VF01, VF16
|
||||
ADDw.z VF02, VF00, VF00 NOP
|
||||
DoneAllChecks:
|
||||
ADD.xyz VF01, VF01, VF14 IADD VI01, VI00, VI08
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
StartPointInsideAABB:
|
||||
ADD.xyz VF01, VF12, VF14 WAITQ
|
||||
NOP IADDIU VI01, VI00, 0x1
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
|
||||
|
||||
; 860
|
||||
.globl Vu0LineToTriangleCollisionCompressedStart
|
||||
Vu0LineToTriangleCollisionCompressedStart:
|
||||
ITOF0.xyzw VF17, VF17 LOI 0.000244140625 ; 1.0/4096.0
|
||||
ITOF0.xyzw VF14, VF14 NOP
|
||||
ITOF0.xyzw VF15, VF15 NOP
|
||||
ITOF0.xyzw VF16, VF16 NOP
|
||||
MULi.xyz VF17, VF17, I LOI 0.0078125 ; 1.0/128.0
|
||||
MULi.w VF17, VF17, I NOP
|
||||
MULi.xyzw VF14, VF14, I NOP
|
||||
MULi.xyzw VF15, VF15, I NOP
|
||||
MULi.xyzw VF16, VF16, I NOP
|
||||
; fall through
|
||||
|
||||
; 8A8
|
||||
; VF12: point0
|
||||
; VF13: point1
|
||||
; VF14-16: verts
|
||||
; VF17: plane
|
||||
; out:
|
||||
; VF01: intersection point
|
||||
; VF02: triangle normal
|
||||
; VF03 x: intersection parameter
|
||||
.globl Vu0LineToTriangleCollisionStart
|
||||
Vu0LineToTriangleCollisionStart:
|
||||
MUL.xyz VF10, VF17, VF12 LOI 0.5
|
||||
MUL.xyz VF11, VF17, VF13 NOP
|
||||
SUB.xyz VF02, VF13, VF12 NOP ; line dist
|
||||
ADD.xyz VF17, VF17, VF00 NOP
|
||||
MULi.w VF03, VF00, I NOP
|
||||
MULAx.w ACC, VF00, VF10 NOP
|
||||
MADDAy.w ACC, VF00, VF10 IADDIU VI06, VI00, 0xE0
|
||||
MADDz.w VF10, VF00, VF10 FMAND VI05, VI06 ; -- normal sign flags, unused
|
||||
MULAx.w ACC, VF00, VF11 NOP
|
||||
MADDAy.w ACC, VF00, VF11 NOP
|
||||
MADDz.w VF11, VF00, VF11 NOP
|
||||
SUB.w VF09, VF17, VF10 NOP ; plane-pos 0
|
||||
CLIPw.xyz VF17, VF03 NOP ; compare normal against 0.5 to figure out which in which dimension to compare
|
||||
NOP IADDIU VI02, VI00, 0x10 ; Sw flag
|
||||
SUBA.w ACC, VF17, VF11 NOP ; plane-pos 1
|
||||
SUB.w VF08, VF11, VF10 FMAND VI01, VI02
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FMAND VI02, VI02
|
||||
NOP IBEQ VI01, VI02, QuitAndFail ; if on same side, no collision
|
||||
NOP NOP
|
||||
NOP DIV Q, VF09w, VF08w ; parameter of intersection
|
||||
NOP FCAND VI01, 0x3 ; check x direction
|
||||
NOP IADDIU VI02, VI01, 0x7F
|
||||
NOP IADDIU VI06, VI00, 0x80
|
||||
NOP IAND VI02, VI02, VI06 ; Sx flag
|
||||
NOP FCAND VI01, 0xC ; check y direction
|
||||
NOP IADDIU VI03, VI01, 0x3F
|
||||
MULAw.xyz ACC, VF12, VF00 IADDIU VI06, VI00, 0x40
|
||||
MADDq.xyz VF01, VF02, Q IAND VI03, VI03, VI06 ; point of intersection -- Sy flag
|
||||
MULx.w VF01, VF00, VF00 FCAND VI01, 0x30 ; -- check z direction
|
||||
ADDq.x VF03, VF00, Q IADDIU VI04, VI01, 0x1F ; output parameter
|
||||
SUB.xyz VF05, VF15, VF14 IADDIU VI06, VI00, 0x20 ; edge vectors
|
||||
SUB.xyz VF08, VF01, VF14 IAND VI04, VI04, VI06 ; edge vectors -- Sz flag
|
||||
SUB.xyz VF06, VF16, VF15 IADD VI06, VI02, VI03 ; edge vectors
|
||||
SUB.xyz VF09, VF01, VF15 IADD VI06, VI06, VI04 ; edge vectors -- combine flags
|
||||
SUB.xyz VF07, VF14, VF16 NOP ; edge vectors
|
||||
SUB.xyz VF10, VF01, VF16 NOP ; edge vectors
|
||||
OPMULA.xyz ACC, VF08, VF05 NOP
|
||||
OPMSUB.xyz VF18, VF05, VF08 NOP ; cross1
|
||||
OPMULA.xyz ACC, VF09, VF06 NOP
|
||||
OPMSUB.xyz VF19, VF06, VF09 NOP ; cross2
|
||||
OPMULA.xyz ACC, VF10, VF07 NOP
|
||||
OPMSUB.xyz VF20, VF07, VF10 FMAND VI02, VI06 ; cross3
|
||||
NOP NOP
|
||||
NOP FMAND VI03, VI06
|
||||
NOP NOP
|
||||
NOP FMAND VI04, VI06
|
||||
NOP NOP
|
||||
NOP IBNE VI03, VI02, QuitAndFail ; point has to lie on the same side of all edges (i.e. inside)
|
||||
NOP NOP
|
||||
NOP IBNE VI04, VI02, QuitAndFail
|
||||
NOP NOP
|
||||
MULw.xyz VF02, VF17, VF00 IADDIU VI01, VI00, 0x1 ; success
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
|
||||
|
||||
; A68
|
||||
; VF12: center
|
||||
; VF14: line origin
|
||||
; VF15: line vector to other point
|
||||
; out: VF16 xyz: nearest point on line; w: distance to that point
|
||||
DistanceBetweenSphereAndLine:
|
||||
SUB.xyz VF20, VF12, VF14 NOP
|
||||
MUL.xyz VF21, VF15, VF15 NOP
|
||||
ADDA.xyz ACC, VF14, VF15 NOP
|
||||
MSUBw.xyz VF25, VF12, VF00 NOP ; VF25 = VF12 - (VF14+VF15)
|
||||
MUL.xyz VF22, VF20, VF20 NOP
|
||||
MUL.xyz VF23, VF20, VF15 NOP
|
||||
MULAx.w ACC, VF00, VF21 NOP
|
||||
MADDAy.w ACC, VF00, VF21 NOP
|
||||
MADDz.w VF21, VF00, VF21 NOP ; MagSq VF15 (line length)
|
||||
MULAx.w ACC, VF00, VF23 NOP
|
||||
MADDAy.w ACC, VF00, VF23 NOP
|
||||
MADDz.w VF23, VF00, VF23 NOP ; dot(VF12-VF14, VF15)
|
||||
MULAx.w ACC, VF00, VF22 NOP
|
||||
MADDAy.w ACC, VF00, VF22 NOP
|
||||
MADDz.w VF22, VF00, VF22 IADDIU VI08, VI00, 0x10 ; MagSq VF12-VF14 -- Sw bit
|
||||
MUL.xyz VF25, VF25, VF25 FMAND VI08, VI08
|
||||
NOP DIV Q, VF23w, VF21w
|
||||
NOP IBNE VI00, VI08, NegativeRatio
|
||||
NOP NOP
|
||||
ADDA.xyz ACC, VF00, VF14 NOP
|
||||
MADDq.xyz VF16, VF15, Q WAITQ ; nearest point on infinte line
|
||||
ADDq.x VF24, VF00, Q NOP ; ratio
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
SUB.xyz VF26, VF16, VF12 NOP
|
||||
CLIPw.xyz VF24, VF00 NOP ; compare ratio to 1.0
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
MUL.xyz VF26, VF26, VF26 NOP
|
||||
NOP FCAND VI01, 0x1
|
||||
NOP IBNE VI00, VI01, RatioGreaterThanOne
|
||||
NOP NOP
|
||||
MULAx.w ACC, VF00, VF26 NOP
|
||||
MADDAy.w ACC, VF00, VF26 NOP
|
||||
MADDz.w VF16, VF00, VF26 NOP ; distance
|
||||
NOP JR VI15
|
||||
NOP NOP
|
||||
NegativeRatio:
|
||||
ADD.xyz VF16, VF00, VF14 NOP ; return line origin
|
||||
MUL.w VF16, VF00, VF22 NOP ; and DistSq to it
|
||||
NOP JR VI15
|
||||
NOP NOP
|
||||
RatioGreaterThanOne:
|
||||
MULAx.w ACC, VF00, VF25 NOP
|
||||
MADDAy.w ACC, VF00, VF25 NOP
|
||||
MADDz.w VF16, VF00, VF25 NOP
|
||||
ADD.xyz VF16, VF14, VF15 NOP ; return toerh line point
|
||||
NOP JR VI15
|
||||
NOP NOP
|
||||
|
||||
|
||||
; BE0
|
||||
.globl Vu0SphereToTriangleCollisionCompressedStart
|
||||
Vu0SphereToTriangleCollisionCompressedStart:
|
||||
ITOF0.xyzw VF17, VF17 LOI 0.000244140625 ; 1.0/4096.0
|
||||
ITOF0.xyzw VF14, VF14 NOP
|
||||
ITOF0.xyzw VF15, VF15 NOP
|
||||
ITOF0.xyzw VF16, VF16 NOP
|
||||
MULi.xyz VF17, VF17, I LOI 0.0078125 ; 1.0/128.0
|
||||
MULi.w VF17, VF17, I NOP
|
||||
MULi.xyzw VF14, VF14, I NOP
|
||||
MULi.xyzw VF15, VF15, I NOP
|
||||
MULi.xyzw VF16, VF16, I NOP
|
||||
; fall through
|
||||
|
||||
; C28
|
||||
; VF12: sphere
|
||||
; VF14-16: verts
|
||||
; VF17: plane
|
||||
; out:
|
||||
; VF01: intersection point
|
||||
; VF02: triangle normal
|
||||
; VF03 x: intersection parameter
|
||||
.globl Vu0SphereToTriangleCollisionStart
|
||||
Vu0SphereToTriangleCollisionStart:
|
||||
MUL.xyz VF02, VF12, VF17 LOI 0.1
|
||||
ADD.xyz VF17, VF17, VF00 NOP
|
||||
ADDw.x VF13, VF00, VF12 NOP
|
||||
NOP NOP
|
||||
MULAx.w ACC, VF00, VF02 IADDIU VI06, VI00, 0xE0
|
||||
MADDAy.w ACC, VF00, VF02 FMAND VI05, VI06 ; normal sign flags
|
||||
MADDAz.w ACC, VF00, VF02 NOP
|
||||
MSUB.w VF02, VF00, VF17 NOP ; center plane pos
|
||||
MULi.w VF03, VF00, I MOVE.xyzw VF04, VF03
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
CLIPw.xyz VF13, VF02 NOP ; compare dist and radius
|
||||
CLIPw.xyz VF17, VF03 NOP
|
||||
MULAw.xyz ACC, VF12, VF00 IADDIU VI07, VI00, 0x0 ; -- clear test case
|
||||
MSUBw.xyz VF01, VF17, VF02 NOP
|
||||
MULx.w VF01, VF00, VF00 FCAND VI01, 0x3 ; projected center on plane
|
||||
ABS.w VF02, VF02 IBEQ VI00, VI01, QuitAndFail ; no intersection
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3 ; -- check x direction
|
||||
SUB.xyz VF02, VF12, VF01 IADDIU VI02, VI01, 0x7F
|
||||
NOP IADDIU VI06, VI00, 0x80
|
||||
SUB.xyz VF05, VF15, VF14 IAND VI02, VI02, VI06
|
||||
SUB.xyz VF08, VF01, VF14 FCAND VI01, 0xC ; -- check y direction
|
||||
SUB.xyz VF06, VF16, VF15 IADDIU VI03, VI01, 0x3F
|
||||
SUB.xyz VF09, VF01, VF15 IADDIU VI06, VI00, 0x40
|
||||
SUB.xyz VF07, VF14, VF16 IAND VI03, VI03, VI06
|
||||
SUB.xyz VF10, VF01, VF16 FCAND VI01, 0x30 ; -- check z direction
|
||||
MUL.xyz VF03, VF02, VF02 IADDIU VI04, VI01, 0x1F
|
||||
OPMULA.xyz ACC, VF08, VF05 IADDIU VI06, VI00, 0x20
|
||||
OPMSUB.xyz VF18, VF05, VF08 IAND VI04, VI04, VI06
|
||||
OPMULA.xyz ACC, VF09, VF06 NOP
|
||||
OPMSUB.xyz VF19, VF06, VF09 IADD VI06, VI02, VI03
|
||||
OPMULA.xyz ACC, VF10, VF07 IADD VI06, VI06, VI04 ; -- combine flags
|
||||
OPMSUB.xyz VF20, VF07, VF10 FMAND VI02, VI06 ; -- cross 1 flags
|
||||
MULAx.w ACC, VF00, VF03 IAND VI05, VI05, VI06
|
||||
MADDAy.w ACC, VF00, VF03 FMAND VI03, VI06 ; -- cross 2 flags
|
||||
MADDz.w VF03, VF00, VF03 IADDIU VI08, VI00, 0x3
|
||||
NOP FMAND VI04, VI06 ; -- cross 3 flags
|
||||
NOP NOP
|
||||
NOP IBNE VI02, VI05, CheckSide2
|
||||
NOP RSQRT Q, VF00w, VF03w
|
||||
ADD.xyz VF04, VF00, VF16 IADDIU VI07, VI07, 0x1 ; inside side 1
|
||||
CheckSide2:
|
||||
NOP IBNE VI03, VI05, CheckSide3
|
||||
NOP NOP
|
||||
ADD.xyz VF04, VF00, VF14 IADDIU VI07, VI07, 0x1 ; inside side 2
|
||||
CheckSide3:
|
||||
NOP IBNE VI04, VI05, FinishCheckingSides
|
||||
NOP NOP
|
||||
ADD.xyz VF04, VF00, VF15 IADDIU VI07, VI07, 0x1 ; inside side 3
|
||||
NOP NOP
|
||||
NOP IBEQ VI07, VI08, TotallyInsideTriangle
|
||||
NOP NOP
|
||||
FinishCheckingSides:
|
||||
MUL.x VF13, VF13, VF13 IADDIU VI08, VI00, 0x2
|
||||
MULq.xyz VF02, VF02, Q WAITQ
|
||||
NOP IBNE VI07, VI08, IntersectionOutsideTwoSides
|
||||
NOP NOP
|
||||
NOP IBEQ VI02, VI05, CheckDistanceSide2
|
||||
NOP NOP
|
||||
NOP MOVE.xyzw VF15, VF05
|
||||
NOP BAL VI15, DistanceBetweenSphereAndLine
|
||||
NOP NOP
|
||||
NOP B ProcessLineResult
|
||||
NOP NOP
|
||||
CheckDistanceSide2:
|
||||
NOP IBEQ VI03, VI05, CheckDistanceSide3
|
||||
NOP NOP
|
||||
NOP MOVE.xyzw VF14, VF15
|
||||
NOP MOVE.xyzw VF15, VF06
|
||||
NOP BAL VI15, DistanceBetweenSphereAndLine
|
||||
NOP NOP
|
||||
NOP B ProcessLineResult
|
||||
NOP NOP
|
||||
CheckDistanceSide3:
|
||||
NOP MOVE.xyzw VF14, VF16
|
||||
NOP MOVE.xyzw VF15, VF07
|
||||
NOP BAL VI15, DistanceBetweenSphereAndLine
|
||||
NOP NOP
|
||||
NOP B ProcessLineResult
|
||||
NOP NOP
|
||||
IntersectionOutsideTwoSides:
|
||||
SUB.xyz VF05, VF04, VF12 NOP
|
||||
ADD.xyz VF01, VF00, VF04 NOP ; col point
|
||||
SUB.xyz VF02, VF12, VF04 NOP
|
||||
NOP NOP
|
||||
MUL.xyz VF05, VF05, VF05 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
MULAx.w ACC, VF00, VF05 NOP
|
||||
MADDAy.w ACC, VF00, VF05 NOP
|
||||
MADDz.w VF05, VF00, VF05 NOP ; distSq to vertex
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
CLIPw.xyz VF13, VF05 SQRT Q, VF05w ; compare radiusSq and distSq
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x1
|
||||
ADDq.x VF03, VF00, Q WAITQ ; dist to vertex
|
||||
NOP IBEQ VI00, VI01, QuitAndFail ; too far
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP DIV Q, VF00w, VF03x
|
||||
MULq.xyz VF02, VF02, Q WAITQ ; col normal
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
TotallyInsideTriangle:
|
||||
ADDw.x VF03, VF00, VF02 WAITQ
|
||||
MULq.xyz VF02, VF02, Q NOP
|
||||
NOP[E] IADDIU VI01, VI00, 0x1
|
||||
NOP NOP
|
||||
ProcessLineResult:
|
||||
CLIPw.xyz VF13, VF16 SQRT Q, VF16w
|
||||
ADD.xyz VF01, VF00, VF16 NOP
|
||||
SUB.xyz VF02, VF12, VF16 NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x1
|
||||
ADDq.x VF03, VF00, Q WAITQ
|
||||
NOP IBEQ VI00, VI01, QuitAndFail
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP DIV Q, VF00w, VF03x
|
||||
MULq.xyz VF02, VF02, Q WAITQ
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
|
||||
EndOfMicrocode:
|
@ -1,191 +0,0 @@
|
||||
QuitAndFail2:
|
||||
NOP[E] IADDIU VI01, VI00, 0x0
|
||||
NOP NOP
|
||||
|
||||
|
||||
QuitAndSucceed2:
|
||||
NOP[E] IADDIU VI01, VI00, 0x1
|
||||
NOP NOP
|
||||
|
||||
|
||||
; 20
|
||||
GetBBVertices:
|
||||
MULw.xy VF02, VF01, VF00 NOP
|
||||
MUL.z VF02, VF01, VF11 NOP
|
||||
MULw.xz VF03, VF01, VF00 NOP
|
||||
MUL.y VF03, VF01, VF11 NOP
|
||||
MULw.x VF04, VF01, VF00 NOP
|
||||
MUL.yz VF04, VF01, VF11 NOP
|
||||
NOP JR VI15
|
||||
NOP NOP
|
||||
|
||||
|
||||
; 60
|
||||
Vu0OBBToOBBCollision:
|
||||
SUBw.xyz VF11, VF00, VF00 LOI 0.5
|
||||
MULi.xyz VF12, VF12, I NOP
|
||||
MULi.xyz VF13, VF13, I NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP MOVE.xyz VF01, VF12
|
||||
NOP BAL VI15, GetBBVertices
|
||||
NOP NOP
|
||||
MULAx.xyz ACC, VF14, VF01 NOP
|
||||
MADDAy.xyz ACC, VF15, VF01 NOP
|
||||
MADDz.xyz VF01, VF16, VF01 NOP
|
||||
MULAx.xyz ACC, VF14, VF02 NOP
|
||||
MADDAy.xyz ACC, VF15, VF02 NOP
|
||||
MADDz.xyz VF02, VF16, VF02 NOP
|
||||
MULAx.xyz ACC, VF14, VF03 NOP
|
||||
MADDAy.xyz ACC, VF15, VF03 NOP
|
||||
MADDz.xyz VF03, VF16, VF03 NOP
|
||||
MULAx.xyz ACC, VF14, VF04 NOP
|
||||
MADDAy.xyz ACC, VF15, VF04 NOP
|
||||
MADDz.xyz VF04, VF16, VF04 NOP
|
||||
ABS.xyz VF05, VF01 NOP
|
||||
ABS.xyz VF06, VF02 NOP
|
||||
ABS.xyz VF07, VF03 NOP
|
||||
ABS.xyz VF08, VF04 NOP
|
||||
NOP NOP
|
||||
MAX.xyz VF05, VF05, VF06 NOP
|
||||
NOP NOP
|
||||
MAX.xyz VF07, VF07, VF08 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
MAX.xyz VF05, VF05, VF07 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
ADD.xyz VF09, VF05, VF13 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
MULx.w VF05, VF00, VF09 NOP
|
||||
MULy.w VF06, VF00, VF09 NOP
|
||||
MULz.w VF07, VF00, VF09 NOP
|
||||
CLIPw.xyz VF17, VF05 NOP
|
||||
CLIPw.xyz VF17, VF06 NOP
|
||||
CLIPw.xyz VF17, VF07 MOVE.xyz VF01, VF13
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3330
|
||||
NOP IBNE VI01, VI00, QuitAndFail2
|
||||
NOP NOP
|
||||
NOP BAL VI15, GetBBVertices
|
||||
NOP NOP
|
||||
MULAx.xyz ACC, VF18, VF01 NOP
|
||||
MADDAy.xyz ACC, VF19, VF01 NOP
|
||||
MADDz.xyz VF01, VF20, VF01 NOP
|
||||
MULAx.xyz ACC, VF18, VF02 NOP
|
||||
MADDAy.xyz ACC, VF19, VF02 NOP
|
||||
MADDz.xyz VF02, VF20, VF02 NOP
|
||||
MULAx.xyz ACC, VF18, VF03 NOP
|
||||
MADDAy.xyz ACC, VF19, VF03 NOP
|
||||
MADDz.xyz VF03, VF20, VF03 NOP
|
||||
MULAx.xyz ACC, VF18, VF04 NOP
|
||||
MADDAy.xyz ACC, VF19, VF04 NOP
|
||||
MADDz.xyz VF04, VF20, VF04 NOP
|
||||
ABS.xyz VF05, VF01 NOP
|
||||
ABS.xyz VF06, VF02 NOP
|
||||
ABS.xyz VF07, VF03 NOP
|
||||
ABS.xyz VF08, VF04 NOP
|
||||
NOP NOP
|
||||
MAX.xyz VF05, VF05, VF06 NOP
|
||||
NOP NOP
|
||||
MAX.xyz VF07, VF07, VF08 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
MAX.xyz VF05, VF05, VF07 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
ADD.xyz VF09, VF05, VF12 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
MULx.w VF05, VF00, VF09 NOP
|
||||
MULy.w VF06, VF00, VF09 NOP
|
||||
MULz.w VF07, VF00, VF09 NOP
|
||||
CLIPw.xyz VF21, VF05 NOP
|
||||
CLIPw.xyz VF21, VF06 NOP
|
||||
CLIPw.xyz VF21, VF07 NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP NOP
|
||||
NOP FCAND VI01, 0x3330
|
||||
NOP IBNE VI01, VI00, QuitAndFail2
|
||||
NOP NOP
|
||||
SUB.xyz VF06, VF02, VF01 NOP
|
||||
SUB.xyz VF07, VF03, VF01 NOP
|
||||
ADD.xyz VF08, VF04, VF01 NOP
|
||||
ADD.x VF09, VF00, VF12 NOP
|
||||
ADD.yz VF09, VF00, VF00 NOP
|
||||
ADD.y VF10, VF00, VF12 NOP
|
||||
ADD.xz VF10, VF00, VF00 NOP
|
||||
ADD.z VF11, VF00, VF12 IADDI VI04, VI00, 0x0
|
||||
ADD.xy VF11, VF00, VF00 IADD VI02, VI00, VI00
|
||||
OPMULA.xyz ACC, VF06, VF09 NOP
|
||||
OPMSUB.xyz VF01, VF09, VF06 NOP
|
||||
OPMULA.xyz ACC, VF06, VF10 NOP
|
||||
OPMSUB.xyz VF02, VF10, VF06 NOP
|
||||
OPMULA.xyz ACC, VF06, VF11 NOP
|
||||
OPMSUB.xyz VF03, VF11, VF06 SQI.xyzw VF01, (VI02++)
|
||||
OPMULA.xyz ACC, VF07, VF09 NOP
|
||||
OPMSUB.xyz VF01, VF09, VF07 SQI.xyzw VF02, (VI02++)
|
||||
OPMULA.xyz ACC, VF07, VF10 NOP
|
||||
OPMSUB.xyz VF02, VF10, VF07 SQI.xyzw VF03, (VI02++)
|
||||
OPMULA.xyz ACC, VF07, VF11 NOP
|
||||
OPMSUB.xyz VF03, VF11, VF07 SQI.xyzw VF01, (VI02++)
|
||||
OPMULA.xyz ACC, VF08, VF09 NOP
|
||||
OPMSUB.xyz VF01, VF09, VF08 SQI.xyzw VF02, (VI02++)
|
||||
OPMULA.xyz ACC, VF08, VF10 NOP
|
||||
OPMSUB.xyz VF02, VF10, VF08 SQI.xyzw VF03, (VI02++)
|
||||
OPMULA.xyz ACC, VF08, VF11 LOI 0.5
|
||||
OPMSUB.xyz VF01, VF11, VF08 SQI.xyzw VF01, (VI02++)
|
||||
MULi.xyz VF06, VF06, I NOP
|
||||
MULi.xyz VF07, VF07, I SQI.xyzw VF02, (VI02++)
|
||||
MULi.xyz VF08, VF08, I NOP
|
||||
MUL.xyz VF02, VF21, VF01 NOP
|
||||
MUL.xyz VF03, VF12, VF01 NOP
|
||||
MUL.xyz VF09, VF06, VF01 NOP
|
||||
MUL.xyz VF10, VF07, VF01 NOP
|
||||
MUL.xyz VF11, VF08, VF01 NOP
|
||||
ABS.xyz VF03, VF03 NOP
|
||||
ADDy.x VF05, VF09, VF09 NOP
|
||||
ADDx.y VF05, VF10, VF10 NOP
|
||||
ADDx.z VF05, VF11, VF11 NOP
|
||||
NOP NOP
|
||||
EdgePairLoop:
|
||||
ADDz.x VF05, VF05, VF09 NOP
|
||||
ADDz.y VF05, VF05, VF10 NOP
|
||||
ADDy.z VF05, VF05, VF11 NOP
|
||||
MULAx.w ACC, VF00, VF02 IADD VI03, VI02, VI00
|
||||
MADDAy.w ACC, VF00, VF02 LQD.xyzw VF01, (--VI02)
|
||||
MADDz.w VF02, VF00, VF02 NOP
|
||||
ABS.xyz VF05, VF05 NOP
|
||||
MULAx.w ACC, VF00, VF03 NOP
|
||||
MADDAy.w ACC, VF00, VF03 NOP
|
||||
MADDAz.w ACC, VF00, VF03 NOP
|
||||
MADDAx.w ACC, VF00, VF05 NOP
|
||||
MADDAy.w ACC, VF00, VF05 NOP
|
||||
MADDz.w VF03, VF00, VF05 NOP
|
||||
ADDw.x VF04, VF00, VF02 NOP
|
||||
MUL.xyz VF02, VF21, VF01 NOP
|
||||
MUL.xyz VF03, VF12, VF01 NOP
|
||||
MUL.xyz VF09, VF06, VF01 NOP
|
||||
CLIPw.xyz VF04, VF03 NOP
|
||||
MUL.xyz VF10, VF07, VF01 NOP
|
||||
MUL.xyz VF11, VF08, VF01 NOP
|
||||
ABS.xyz VF03, VF03 NOP
|
||||
ADDy.x VF05, VF09, VF09 FCAND VI01, 0x3
|
||||
ADDx.y VF05, VF10, VF10 IBNE VI01, VI00, QuitAndFail2
|
||||
ADDx.z VF05, VF11, VF11 NOP
|
||||
NOP IBNE VI03, VI00, EdgePairLoop
|
||||
NOP NOP
|
||||
NOP[E] IADDIU VI01, VI00, 0x1
|
||||
NOP NOP
|
||||
|
||||
EndOfMicrocode2:
|
Reference in New Issue
Block a user