mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 07:23:05 +00:00
TITANIC: Renamings & cleanup for markers drawing
This commit is contained in:
parent
ede1965e65
commit
d56124e624
@ -199,8 +199,9 @@ int CStarCamera::proc27() const {
|
||||
return _viewport._field24;
|
||||
}
|
||||
|
||||
FVector CStarCamera::proc28(int index, const FVector &src) {
|
||||
FVector CStarCamera::getRelativePos(int index, const FVector &src) {
|
||||
FVector dest;
|
||||
|
||||
dest._x = ((_viewport._valArray[index] + src._x) * _viewport._centerVector._x)
|
||||
/ (_viewport._centerVector._y * src._z);
|
||||
dest._y = src._y * _viewport._centerVector._x / (_viewport._centerVector._z * src._z);
|
||||
|
@ -140,7 +140,12 @@ public:
|
||||
|
||||
virtual double proc26() const;
|
||||
virtual int proc27() const;
|
||||
virtual FVector proc28(int index, const FVector &src);
|
||||
|
||||
/**
|
||||
* Return the passed vector relative to the center of the viewpoint
|
||||
*/
|
||||
virtual FVector getRelativePos(int index, const FVector &src);
|
||||
|
||||
virtual FVector proc29(int index, const FVector &src);
|
||||
virtual FVector proc30(int index, const FVector &v);
|
||||
virtual FVector proc31(int index, const FVector &v);
|
||||
|
@ -298,7 +298,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector
|
||||
|
||||
for (int ctr2 = 0; ctr2 < size2; ++ctr2) {
|
||||
GridEntry &gridEntry = _grid[ctr2];
|
||||
tempV = camera->proc28(2, gridEntry);
|
||||
tempV = camera->getRelativePos(2, gridEntry);
|
||||
gridEntry._position._x = tempV._x;
|
||||
gridEntry._position._y = tempV._y + vector2._y;
|
||||
}
|
||||
@ -320,7 +320,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector
|
||||
|
||||
for (int ctr2 = 0; ctr2 < size2; ++ctr2) {
|
||||
GridEntry &gridEntry = _grid[ctr2];
|
||||
tempV = camera->proc28(0, gridEntry);
|
||||
tempV = camera->getRelativePos(0, gridEntry);
|
||||
gridEntry._position._x = tempV._x + vector2._x;
|
||||
gridEntry._position._y = tempV._y + vector2._y;
|
||||
}
|
||||
@ -342,7 +342,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector
|
||||
|
||||
for (int ctr2 = 0; ctr2 < size2; ++ctr2) {
|
||||
GridEntry &gridEntry = _grid[ctr2];
|
||||
tempV = camera->proc28(1, gridEntry);
|
||||
tempV = camera->getRelativePos(1, gridEntry);
|
||||
gridEntry._position._x = tempV._x + vector2._x;
|
||||
gridEntry._position._y = tempV._y + vector2._y;
|
||||
}
|
||||
@ -402,7 +402,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector
|
||||
|
||||
for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) {
|
||||
GridEntry &gridEntry = _grid[ctr];
|
||||
tempV = camera->proc28(2, gridEntry);
|
||||
tempV = camera->getRelativePos(2, gridEntry);
|
||||
gridEntry._position._x = tempV._x + vector2._x;
|
||||
gridEntry._position._y = tempV._y + vector2._y;
|
||||
}
|
||||
@ -424,7 +424,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector
|
||||
|
||||
for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) {
|
||||
GridEntry &gridEntry = _grid[ctr];
|
||||
tempV = camera->proc28(2, gridEntry);
|
||||
tempV = camera->getRelativePos(2, gridEntry);
|
||||
gridEntry._position._x = tempV._x + vector2._x;
|
||||
gridEntry._position._y = tempV._y + vector2._y;
|
||||
}
|
||||
@ -446,7 +446,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector
|
||||
|
||||
for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) {
|
||||
GridEntry &gridEntry = _grid[ctr];
|
||||
tempV = camera->proc28(2, gridEntry);
|
||||
tempV = camera->getRelativePos(2, gridEntry);
|
||||
gridEntry._position._x = tempV._x + vector2._x;
|
||||
gridEntry._position._y = tempV._y + vector2._y;
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ double CStarField::fn5(CSurfaceArea *surfaceArea, CStarCamera *camera,
|
||||
if (camera->getThreshold() >= tv._z)
|
||||
return -1.0;
|
||||
|
||||
tv = camera->proc28(2, tv);
|
||||
tv = camera->getRelativePos(2, tv);
|
||||
|
||||
v1 = FVector(tv._x + surfaceArea->_centroid._x,
|
||||
tv._y + surfaceArea->_centroid._y, tv._z);
|
||||
|
@ -34,7 +34,7 @@ void CStarMarkers::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarClo
|
||||
FPoint center((double)surfaceArea->_width * 0.5,
|
||||
surfaceArea->_height * 0.5);
|
||||
FVector newV;
|
||||
double x1, x2, x3, y1, y2, y3;
|
||||
double xl, xc, xr, yt, yc, yb;
|
||||
|
||||
uint savedPixel = surfaceArea->_pixel;
|
||||
surfaceArea->_pixel = 0xffff;
|
||||
@ -50,18 +50,18 @@ void CStarMarkers::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarClo
|
||||
+ pose._row2._z * star._position._y + pose._vector._z;
|
||||
|
||||
if (newV._z > threshold) {
|
||||
FVector vTemp = camera->proc28(2, newV);
|
||||
FVector vTemp = camera->getRelativePos(2, newV);
|
||||
|
||||
x2 = center._x + vTemp._x;
|
||||
y1 = center._y + vTemp._y;
|
||||
y2 = y1 + 4.0;
|
||||
x1 = x2 - 4.0;
|
||||
x3 = x2 + 4.0;
|
||||
y3 = y1 - 4.0;
|
||||
surfaceArea->drawLine(FPoint(x1, y1), FPoint(x2, y2));
|
||||
surfaceArea->drawLine(FPoint(x2, y2), FPoint(x3, y1));
|
||||
surfaceArea->drawLine(FPoint(x3, y1), FPoint(x2, y3));
|
||||
surfaceArea->drawLine(FPoint(x2, y3), FPoint(x1, y1));
|
||||
xc = center._x + vTemp._x;
|
||||
yc = center._y + vTemp._y;
|
||||
yb = yc + 4.0;
|
||||
xl = xc - 4.0;
|
||||
xr = xc + 4.0;
|
||||
yt = yc - 4.0;
|
||||
surfaceArea->drawLine(FPoint(xl, yc), FPoint(xc, yb)); // bottom-left
|
||||
surfaceArea->drawLine(FPoint(xc, yb), FPoint(xr, yc)); // bottom-right
|
||||
surfaceArea->drawLine(FPoint(xr, yc), FPoint(xc, yt)); // top-right
|
||||
surfaceArea->drawLine(FPoint(xc, yt), FPoint(xl, yc)); // top-left
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ void CStarPoints1::draw(CSurfaceArea *surface, CStarCamera *camera) {
|
||||
vector3._z = vTemp._x * pose._row1._z + vTemp._y * pose._row2._z + vTemp._z * pose._row3._z + pose._vector._z;
|
||||
|
||||
if (flag && vector1._z > threshold && vector3._z > threshold) {
|
||||
vector2 = camera->proc28(2, vector1);
|
||||
vector4 = camera->proc28(2, vector3);
|
||||
vector2 = camera->getRelativePos(2, vector1);
|
||||
vector4 = camera->getRelativePos(2, vector3);
|
||||
|
||||
r.bottom = vector4._y + vHeight2;
|
||||
r.right = vector4._x + vWidth2;
|
||||
|
@ -99,8 +99,8 @@ void CStarPoints2::draw(CSurfaceArea *surface, CStarCamera *camera) {
|
||||
+ pose._row1._y * se._v2._x + pose._vector._y;
|
||||
|
||||
if (vector1._z > threshold && vector3._z > threshold) {
|
||||
vector2 = camera->proc28(2, vector1);
|
||||
vector4 = camera->proc28(2, vector3);
|
||||
vector2 = camera->getRelativePos(2, vector1);
|
||||
vector4 = camera->getRelativePos(2, vector3);
|
||||
|
||||
r.bottom = vector4._y + vHeight2;
|
||||
r.right = vector4._x + vWidth2;
|
||||
|
@ -45,7 +45,7 @@ void CBaseStarRef::process(CSurfaceArea *surface, CStarCamera *camera) {
|
||||
double hyp = vector1._x * vector1._x + vector1._y * vector1._y + vector1._z * vector1._z;
|
||||
|
||||
if (vector1._z > threshold && hyp >= 1.0e12 && hyp < MAX_VAL) {
|
||||
vector2 = camera->proc28(2, vector1);
|
||||
vector2 = camera->getRelativePos(2, vector1);
|
||||
|
||||
const Common::Point pt((int)(vector2._x + vWidth2 - -0.5),
|
||||
(int)(vector2._y + vHeight2 - -0.5));
|
||||
|
Loading…
x
Reference in New Issue
Block a user