Skip to content

Commit

Permalink
Merge pull request H-uru#92 from Deledrius/obsoleteplatform_removal
Browse files Browse the repository at this point in the history
Remove unused platform code (MacOS9, PS2, XBox).
  • Loading branch information
branan committed Oct 30, 2011
2 parents e8b6c42 + 29de5fb commit 9d135ad
Show file tree
Hide file tree
Showing 32 changed files with 96 additions and 910 deletions.
8 changes: 0 additions & 8 deletions Sources/Plasma/CoreLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ if(UNIX)
hsThread_Unix.cpp
)
endif(UNIX)

# for now we use the Unix file on mac... I think this is Carbon code, which
# we don't want to use. I don't think it's worth support OS9 anymore
#if(APPLE)
# set(CoreLib_SOURCES ${CoreLib_SOURCES}
# hsThread_Mac.cpp
# )
#endif(APPLE)


set(CoreLib_HEADERS
Expand Down
16 changes: 3 additions & 13 deletions Sources/Plasma/CoreLib/HeadSpin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsExceptions.h"


#if HS_BUILD_FOR_MAC
#include <Events.h>
#include <ToolUtils.h>
#include <Windows.h>
#endif

#if HS_BUILD_FOR_WIN32
#ifdef _MSC_VER
# include <crtdbg.h> /* for _RPT_BASE */
Expand Down Expand Up @@ -108,18 +102,14 @@ void hsDebugMessage (const char message[], long val)
if (gHSDebugProc)
gHSDebugProc(&s[1]);
else
#if HS_BUILD_FOR_MAC
DebugStr((unsigned char*)s);
#elif HS_BUILD_FOR_WIN32
#if HS_BUILD_FOR_WIN32
{ OutputDebugString(&s[1]);
OutputDebugString("\n");
}
#elif HS_BUILD_FOR_UNIX
{ fprintf(stderr, "%s\n", &s[1]);
// hsThrow(&s[1]);
}
#elif HS_BUILD_FOR_PS2
fprintf(stderr, "%s\n", &s[1]);
#else
hsThrow(&s[1]);
#endif
Expand Down Expand Up @@ -160,7 +150,7 @@ void hsStatusMessage(const char message[])
if (gHSStatusProc) {
gHSStatusProc(message);
} else {
#if HS_BUILD_FOR_PS2 || HS_BUILD_FOR_UNIX
#if HS_BUILD_FOR_UNIX
printf("%s",message);
int len = strlen(message);
if (len>0 && message[len-1]!='\n')
Expand All @@ -170,7 +160,7 @@ void hsStatusMessage(const char message[])
int len = strlen(message);
if (len>0 && message[len-1]!='\n')
OutputDebugString("\n");
#endif // MAC ?????? TODO
#endif
}
}

Expand Down
4 changes: 0 additions & 4 deletions Sources/Plasma/CoreLib/hsBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

#include "hsFastMath.h"

#if defined(__MWERKS__) && !defined(HS_DEBUGGING)
#pragma optimization_level 2
#endif

const hsScalar hsBounds::kRealSmall = 1.0e-5f;

///////////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 1 addition & 5 deletions Sources/Plasma/CoreLib/hsConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

//////////////////// Specific Compiler Stuff This Section is computed ////////////

#if defined(macintosh) && defined(__POWERPC__)
#define HS_BUILD_FOR_MACPPC 1
#elif defined(macintosh)
#define HS_BUILD_FOR_MAC68K 1
#elif defined(_WIN32)
#if defined(_WIN32)
#define HS_BUILD_FOR_WIN32 1
#elif defined(__unix__)
#define HS_BUILD_FOR_UNIX 1
Expand Down
24 changes: 5 additions & 19 deletions Sources/Plasma/CoreLib/hsFixedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

#include "hsTypes.h"

#if HS_BUILD_FOR_MAC
#include <ToolUtils.h>
#include <FixMath.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -86,21 +81,12 @@ extern "C" {
#define hsFloatToFract(x) hsFract((x) * hsFract1)
#endif

#if HS_BUILD_FOR_MAC68K && !(HS_PIN_MATH_OVERFLOW)
#define hsFixMul(a, b) FixMul(a, b)
#else
hsFixed hsFixMul(hsFixed a, hsFixed b);
#endif

#if HS_BUILD_FOR_MAC && !(HS_PIN_MATH_OVERFLOW) && !(HS_MP_SAFE)
#define hsFixDiv(a, b) FixDiv(a, b)
#define hsFracMul(a, b) FracMul(a, b)
#define hsFracDiv(a, b) FracDiv(a, b)
#else
hsFract hsFixDiv(hsFixed a, hsFixed b);
hsFract hsFracMul(hsFract a, hsFract b);
hsFract hsFracDiv(hsFract a, hsFract b);
#endif
hsFixed hsFixMul(hsFixed a, hsFixed b);

hsFract hsFixDiv(hsFixed a, hsFixed b);
hsFract hsFracMul(hsFract a, hsFract b);
hsFract hsFracDiv(hsFract a, hsFract b);

hsFract hsFracSqrt(hsFract value);
#define hsFixSqrt(value) (hsFracSqrt(value) >> 7)
Expand Down
8 changes: 0 additions & 8 deletions Sources/Plasma/CoreLib/hsGeometry3.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,6 @@ struct hsVector3 : public hsScalarTriple {

void Normalize()
{
#if HS_BUILD_FOR_PS2
hsScalar length = this->Magnitude();
hsIfDebugMessage(length == 0, "Err: Normalizing hsVector3 of length 0", 0);
if (length == 0)
return;
NormalizeVU0(length, (MATRIX4)this);
#else
hsScalar length = this->Magnitude();
// hsIfDebugMessage(length == 0, "Err: Normalizing hsVector3 of length 0", 0);
if (length == 0)
Expand All @@ -212,7 +205,6 @@ struct hsVector3 : public hsScalarTriple {
fX = hsScalarMul(fX, invMag);
fY = hsScalarMul(fY, invMag);
fZ = hsScalarMul(fZ, invMag);
#endif
}
inline void Renormalize() // if the vector is already close to unit length
{
Expand Down
40 changes: 4 additions & 36 deletions Sources/Plasma/CoreLib/hsMatrix44.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ hsMatrix44 operator*(const hsMatrix44& a, const hsMatrix44& b)
if( b.fFlags & hsMatrix44::kIsIdent )
return a;

#if HS_BUILD_FOR_PS2
MulMatrixVU0(a.fMap, b.fMap, c.fMap);
#else
c.fMap[0][0] = hsScalarMul(a.fMap[0][0], b.fMap[0][0]) + hsScalarMul(a.fMap[0][1], b.fMap[1][0]) + hsScalarMul(a.fMap[0][2], b.fMap[2][0]) + hsScalarMul(a.fMap[0][3], b.fMap[3][0]);
c.fMap[0][1] = hsScalarMul(a.fMap[0][0], b.fMap[0][1]) + hsScalarMul(a.fMap[0][1], b.fMap[1][1]) + hsScalarMul(a.fMap[0][2], b.fMap[2][1]) + hsScalarMul(a.fMap[0][3], b.fMap[3][1]);
c.fMap[0][2] = hsScalarMul(a.fMap[0][0], b.fMap[0][2]) + hsScalarMul(a.fMap[0][1], b.fMap[1][2]) + hsScalarMul(a.fMap[0][2], b.fMap[2][2]) + hsScalarMul(a.fMap[0][3], b.fMap[3][2]);
Expand All @@ -145,7 +142,6 @@ hsMatrix44 operator*(const hsMatrix44& a, const hsMatrix44& b)
c.fMap[3][1] = hsScalarMul(a.fMap[3][0], b.fMap[0][1]) + hsScalarMul(a.fMap[3][1], b.fMap[1][1]) + hsScalarMul(a.fMap[3][2], b.fMap[2][1]) + hsScalarMul(a.fMap[3][3], b.fMap[3][1]);
c.fMap[3][2] = hsScalarMul(a.fMap[3][0], b.fMap[0][2]) + hsScalarMul(a.fMap[3][1], b.fMap[1][2]) + hsScalarMul(a.fMap[3][2], b.fMap[2][2]) + hsScalarMul(a.fMap[3][3], b.fMap[3][2]);
c.fMap[3][3] = hsScalarMul(a.fMap[3][0], b.fMap[0][3]) + hsScalarMul(a.fMap[3][1], b.fMap[1][3]) + hsScalarMul(a.fMap[3][2], b.fMap[2][3]) + hsScalarMul(a.fMap[3][3], b.fMap[3][3]);
#endif

return c;
}
Expand All @@ -157,13 +153,9 @@ hsVector3 operator*(const hsMatrix44& m, const hsVector3& p)

hsVector3 rVal;

#if HS_BUILD_FOR_PS2
MulVectorVU0(m.fMap, (MATRIX4) &p, (MATRIX4) &rVal);
#else
rVal.fX = hsScalarMul(p.fX, m.fMap[0][0]) + hsScalarMul(p.fY, m.fMap[0][1]) + hsScalarMul(p.fZ, m.fMap[0][2]);
rVal.fY = hsScalarMul(p.fX, m.fMap[1][0]) + hsScalarMul(p.fY, m.fMap[1][1]) + hsScalarMul(p.fZ, m.fMap[1][2]);
rVal.fZ = hsScalarMul(p.fX, m.fMap[2][0]) + hsScalarMul(p.fY, m.fMap[2][1]) + hsScalarMul(p.fZ, m.fMap[2][2]);
#endif

return rVal;
}
Expand All @@ -183,9 +175,6 @@ hsMatrix44 hsMatrix44::operator*(const hsMatrix44& b) const
if( b.fFlags & hsMatrix44::kIsIdent )
return *this;

#if HS_BUILD_FOR_PS2
MulMatrixVU0(fMap, b.fMap, c.fMap);
#else
c.fMap[0][0] = hsScalarMul(fMap[0][0], b.fMap[0][0]) + hsScalarMul(fMap[0][1], b.fMap[1][0]) + hsScalarMul(fMap[0][2], b.fMap[2][0]) + hsScalarMul(fMap[0][3], b.fMap[3][0]);
c.fMap[0][1] = hsScalarMul(fMap[0][0], b.fMap[0][1]) + hsScalarMul(fMap[0][1], b.fMap[1][1]) + hsScalarMul(fMap[0][2], b.fMap[2][1]) + hsScalarMul(fMap[0][3], b.fMap[3][1]);
c.fMap[0][2] = hsScalarMul(fMap[0][0], b.fMap[0][2]) + hsScalarMul(fMap[0][1], b.fMap[1][2]) + hsScalarMul(fMap[0][2], b.fMap[2][2]) + hsScalarMul(fMap[0][3], b.fMap[3][2]);
Expand All @@ -205,7 +194,6 @@ hsMatrix44 hsMatrix44::operator*(const hsMatrix44& b) const
c.fMap[3][1] = hsScalarMul(fMap[3][0], b.fMap[0][1]) + hsScalarMul(fMap[3][1], b.fMap[1][1]) + hsScalarMul(fMap[3][2], b.fMap[2][1]) + hsScalarMul(fMap[3][3], b.fMap[3][1]);
c.fMap[3][2] = hsScalarMul(fMap[3][0], b.fMap[0][2]) + hsScalarMul(fMap[3][1], b.fMap[1][2]) + hsScalarMul(fMap[3][2], b.fMap[2][2]) + hsScalarMul(fMap[3][3], b.fMap[3][2]);
c.fMap[3][3] = hsScalarMul(fMap[3][0], b.fMap[0][3]) + hsScalarMul(fMap[3][1], b.fMap[1][3]) + hsScalarMul(fMap[3][2], b.fMap[2][3]) + hsScalarMul(fMap[3][3], b.fMap[3][3]);
#endif

return c;
}
Expand All @@ -217,13 +205,9 @@ hsVector3 hsMatrix44::operator*(const hsVector3& p) const

hsVector3 rVal;

#if HS_BUILD_FOR_PS2
MulVectorVU0(fMap, (MATRIX4) &p, (MATRIX4) &rVal);
#else
rVal.fX = hsScalarMul(p.fX, fMap[0][0]) + hsScalarMul(p.fY, fMap[0][1]) + hsScalarMul(p.fZ, fMap[0][2]);
rVal.fY = hsScalarMul(p.fX, fMap[1][0]) + hsScalarMul(p.fY, fMap[1][1]) + hsScalarMul(p.fZ, fMap[1][2]);
rVal.fZ = hsScalarMul(p.fX, fMap[2][0]) + hsScalarMul(p.fY, fMap[2][1]) + hsScalarMul(p.fZ, fMap[2][2]);
#endif

return rVal;
}
Expand Down Expand Up @@ -271,9 +255,6 @@ int hsMatrix44::operator==(const hsMatrix44& ss) const

hsMatrix44& hsMatrix44::Scale(const hsVector3* scale)
{
#if HS_BUILD_FOR_PS2
MulScaleVU0(fMap, (MATRIX4 *) scale);
#else
fMap[0][0] *= scale->fX;
fMap[0][1] *= scale->fX;
fMap[0][2] *= scale->fX;
Expand All @@ -288,7 +269,7 @@ hsMatrix44& hsMatrix44::Scale(const hsVector3* scale)
fMap[2][1] *= scale->fZ;
fMap[2][2] *= scale->fZ;
fMap[2][3] *= scale->fZ;
#endif

NotIdentity();
return *this;
}
Expand Down Expand Up @@ -318,14 +299,10 @@ hsVector3 hsMatrix44::RemoveScale()

hsMatrix44& hsMatrix44::Translate(const hsVector3* pt)
{
#if HS_BUILD_FOR_PS2
TranslateVU0(fMap, (MATRIX4 *) pt); /* SUNSOFT */
#else
for (int i =0; i < 3; i++)
{
fMap[i][3] += (*pt)[i];
}
#endif
NotIdentity();
return *this;
}
Expand Down Expand Up @@ -686,9 +663,6 @@ static inline hsScalar Determinant3(hsScalar a, hsScalar b, hsScalar c,

hsScalar hsMatrix44::GetDeterminant() const
{
#if HS_BUILD_FOR_PS2
return (GetDeterminantVU0(fMap));
#else
return (fMap[0][0]*Determinant3(fMap[1][1], fMap[2][1], fMap[3][1],
fMap[1][2], fMap[2][2], fMap[3][2],
fMap[1][3], fMap[2][3], fMap[3][3]) -
Expand All @@ -701,15 +675,11 @@ hsScalar hsMatrix44::GetDeterminant() const
fMap[3][0]*Determinant3(fMap[0][1], fMap[1][1], fMap[2][1],
fMap[0][2], fMap[1][2], fMap[2][2],
fMap[0][3], fMap[1][3], fMap[2][3]));
#endif
}


hsMatrix44 *hsMatrix44::GetAdjoint(hsMatrix44 *adj) const
{
#if HS_BUILD_FOR_PS2
GetAdjointVU0(fMap, adj->fMap);
#else
float a1, a2, a3, a4, b1, b2, b3, b4;
float c1, c2, c3, c4, d1, d2, d3, d4;
/*
Expand Down Expand Up @@ -774,7 +744,7 @@ hsMatrix44 *hsMatrix44::GetAdjoint(hsMatrix44 *adj) const
adj->fMap[1][3] = Determinant3(a1, a2, a3, c1, c2, c3, d1, d2, d3);
adj->fMap[2][3] = -Determinant3(a1, a2, a3, b1, b2, b3, d1, d2, d3);
adj->fMap[3][3] = Determinant3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
#endif

adj->NotIdentity();
return adj;
}
Expand All @@ -792,13 +762,11 @@ hsMatrix44* hsMatrix44::GetInverse(hsMatrix44* inverse) const

det = hsScalarInvert(det);
GetAdjoint(inverse);
#if HS_BUILD_FOR_PS2
MatMulVU0(inverse->fMap, det);
#else

for (i=0; i<4; i++)
for (j=0; j<4; j++)
inverse->fMap[i][j] *= det;
#endif

return inverse;
}

Expand Down
22 changes: 6 additions & 16 deletions Sources/Plasma/CoreLib/hsMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#if HS_BUILD_FOR_MAC
#include <Memory.h>
#else
#include <string.h>
#endif

#include <string.h>

#include "hsMemory.h"
#include "hsExceptions.h"
Expand All @@ -52,17 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

///////////////////////////////////////////////////////////////////////////////////////////

#if HS_BUILD_FOR_MAC
void HSMemory::BlockMove(const void* src, void* dst, UInt32 length)
{
::BlockMoveData(src, dst, length);
}
#else
void HSMemory::BlockMove(const void* src, void* dst, UInt32 length)
{
memmove(dst, src, length);
}
#endif
void HSMemory::BlockMove(const void* src, void* dst, UInt32 length)
{
memmove(dst, src, length);
}

hsBool HSMemory::EqualBlocks(const void* block1, const void* block2, UInt32 length)
{
Expand Down
4 changes: 0 additions & 4 deletions Sources/Plasma/CoreLib/hsMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

class HSMemory {
public:
#if HS_BUILD_FOR_MAC
static void BlockMove(const void* src, void* dst, UInt32 length);
#else
static void BlockMove(const void* src, void* dst, UInt32 length);
#endif
static void Clear(void *m, UInt32 byteLen);
static void ClearMemory(void *m, UInt32 byteLen) { HSMemory::Clear(m, byteLen); }

Expand Down
6 changes: 0 additions & 6 deletions Sources/Plasma/CoreLib/hsPoint2.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

#include "hsScalar.h"

#if __MWERKS__
// This guy disables MetroWerks' desire to only include a file once, which obviously gets
// in the way of our little HS_POINT2.inc trick
#pragma once off
#endif

#define HS_POINT2_NAME hsIntPoint2
#define HS_POINT2_TYPE Int32
#include "HS_POINT2.inc"
Expand Down
Loading

0 comments on commit 9d135ad

Please sign in to comment.