Imports the current Win32 source for the pod-racing game 'Red Planet', built on the MUNGA engine and its L4 (Win32/DirectX) platform layer: - MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend - RP / RP_L4: Red Planet game logic and Win32 application - DivLoader, Setup1: asset loader and installer project - lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies Removed stale Subversion metadata and added .gitignore/.gitattributes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
124 lines
2.5 KiB
C++
124 lines
2.5 KiB
C++
#pragma once
|
|
|
|
#include "memblock.h"
|
|
#include "matrix.h"
|
|
#include "linmtrx.h"
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~ AffineMatrixStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class AffineMatrixStack:
|
|
public MemoryStack
|
|
{
|
|
public:
|
|
AffineMatrixStack(
|
|
size_t start,
|
|
size_t delta
|
|
):
|
|
MemoryStack(sizeof(AffineMatrix),start,delta)
|
|
{}
|
|
|
|
AffineMatrix*
|
|
Peek()
|
|
{
|
|
Check(this);
|
|
return Cast_Object(AffineMatrix*,MemoryStack::Peek());
|
|
}
|
|
|
|
AffineMatrixStack&
|
|
Concatenate(const AffineMatrix& matrix);
|
|
AffineMatrixStack&
|
|
operator*=(const AffineMatrix& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
|
|
AffineMatrix&
|
|
Push(const AffineMatrix& matrix)
|
|
{
|
|
Check(this); Check(&matrix);
|
|
return *Cast_Object(AffineMatrix*,MemoryStack::Push(&matrix));
|
|
}
|
|
|
|
operator AffineMatrix&()
|
|
{Check(this); return *Peek();}
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~ LinearMatrixStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class LinearMatrixStack:
|
|
public MemoryStack
|
|
{
|
|
public:
|
|
LinearMatrixStack(
|
|
size_t start,
|
|
size_t delta
|
|
):
|
|
MemoryStack(sizeof(LinearMatrix),start,delta)
|
|
{}
|
|
|
|
LinearMatrix*
|
|
Peek()
|
|
{
|
|
Check(this);
|
|
return Cast_Object(LinearMatrix*,MemoryStack::Peek());
|
|
}
|
|
|
|
LinearMatrixStack&
|
|
Concatenate(const LinearMatrix& matrix);
|
|
LinearMatrixStack&
|
|
operator*=(const LinearMatrix& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
|
|
LinearMatrix&
|
|
Push(const LinearMatrix& matrix)
|
|
{
|
|
Check(this); Check(&matrix);
|
|
return *Cast_Object(LinearMatrix*,MemoryStack::Push(&matrix));
|
|
}
|
|
|
|
operator LinearMatrix&()
|
|
{Check(this); return *Peek();}
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~ Matrix4x4Stack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class Matrix4x4Stack:
|
|
public MemoryStack
|
|
{
|
|
public:
|
|
Matrix4x4Stack(
|
|
size_t start,
|
|
size_t delta
|
|
):
|
|
MemoryStack(sizeof(Matrix4x4),start,delta)
|
|
{}
|
|
|
|
Matrix4x4*
|
|
Peek()
|
|
{
|
|
Check(this);
|
|
return Cast_Object(Matrix4x4*,MemoryStack::Peek());
|
|
}
|
|
|
|
Matrix4x4Stack&
|
|
Concatenate(const Matrix4x4& matrix);
|
|
Matrix4x4Stack&
|
|
Concatenate(const AffineMatrix& matrix);
|
|
Matrix4x4Stack&
|
|
operator*=(const Matrix4x4& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
Matrix4x4Stack&
|
|
operator*=(const AffineMatrix& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
|
|
Matrix4x4&
|
|
Push(const Matrix4x4& matrix)
|
|
{
|
|
Check(this); Check(&matrix);
|
|
return *Cast_Object(Matrix4x4*,MemoryStack::Push(&matrix));
|
|
}
|
|
Matrix4x4&
|
|
Push(const AffineMatrix& matrix);
|
|
|
|
operator Matrix4x4&()
|
|
{Check(this); return *Peek();}
|
|
};
|