- few optimizations

This commit is contained in:
Ilya Shurumov 2022-04-09 22:09:10 +06:00
parent 459131407c
commit db073a7287
2 changed files with 5 additions and 12 deletions

View File

@ -1300,10 +1300,11 @@ void DrawMapPSX(int* comp_val)
int cellx, cellz;
int hloop, vloop;
#if 0 //def PSX
#ifdef PSX
CELL_ITERATOR& ci = *(CELL_ITERATOR*)(u_char*)getScratchAddr(0);
MATRIX& mRotStore = *(MATRIX*)((u_char*)getScratchAddr(0) + sizeof(CELL_ITERATOR));
DrawMapData& drawData = *(DrawMapData*)((u_char*)getScratchAddr(0) + sizeof(CELL_ITERATOR) + sizeof(MATRIX));
static_assert(sizeof(CELL_ITERATOR) + sizeof(MATRIX) + sizeof(DrawMapData) < 1024, "scratchpad overflow");
#else
CELL_ITERATOR ci;
MATRIX mRotStore;

View File

@ -751,9 +751,6 @@ void GlobalTimeStep(void)
void SetShadowPoints(CAR_DATA* c0, VECTOR* outpoints)
{
int i;
SVECTOR disp;
VECTOR pointPos;
VECTOR surfaceNormal;
CAR_COSMETICS* car_cos;
sdPlane* surfacePtr;
@ -766,15 +763,10 @@ void SetShadowPoints(CAR_DATA* c0, VECTOR* outpoints)
for (i = 0; i < 4; i++)
{
disp = car_cos->cPoints[i];
gte_ldv0(&disp);
gte_ldv0(&car_cos->cPoints[i]);
gte_rtv0tr();
gte_stlvnl(&pointPos);
FindSurfaceD2(&pointPos, &surfaceNormal, &outpoints[i], &surfacePtr);
gte_stlvnl(&outpoints[i]);
outpoints[i].vy = MapHeight(&outpoints[i]);
}
}