diff options
author | Treeki <treeki@gmail.com> | 2012-01-15 21:27:19 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-01-15 21:27:19 +0100 |
commit | 0dabea30d98d175e5d7e0655c10757db99ac8295 (patch) | |
tree | a41f5826440f19770348015b2a546ed4dcc7f0bc /include/game.h | |
parent | 1cac64b9ff7384af650fed2bef25fa27069fd589 (diff) | |
download | kamek-0dabea30d98d175e5d7e0655c10757db99ac8295.tar.gz kamek-0dabea30d98d175e5d7e0655c10757db99ac8295.zip |
Cleanups in the include files and other stuff
Diffstat (limited to '')
-rwxr-xr-x | include/game.h | 130 |
1 files changed, 125 insertions, 5 deletions
diff --git a/include/game.h b/include/game.h index 8e7d86a..0871eb1 100755 --- a/include/game.h +++ b/include/game.h @@ -11,8 +11,17 @@ #define offsetof(type, member) ((u32) &(((type *) 0)->member))
+template <typename T>
+inline T min(T one, T two) { return (one < two) ? one : two; }
+template <typename T>
+inline T max(T one, T two) { return (one > two) ? one : two; }
+template <typename T>
+inline T clamp(T value, T one, T two) { return (value < one) ? one : ((value > two) ? two : value); }
+
+
extern "C" {
int strlen(const char *str);
+char *strcpy(char *dest, const char *src);
float atan(float x);
float atan2(float y, float x);
@@ -761,8 +770,15 @@ namespace G3DState { }
+VEC2 GetSomeSizeRelatedBULLSHIT();
+Vec CalculateSomethingAboutRatio(float, float, float, float);
+float CalculateSomethingElseAboutRatio();
+
nw4r::g3d::CameraData *GetCameraByID(int id);
+namespace EGG { class Screen; };
+void DoSomethingCameraRelatedWithEGGScreen(int id, EGG::Screen *screen);
+
int GetCurrentCameraID(); // 80164C80
void SetCurrentCameraID(int id); // 80164C90
@@ -777,6 +793,7 @@ void DrawOpa(); // 80164F70 void DrawXlu(); // 80164F80
bool ChangeAlphaUpdate(bool enable); // 802D3270
+bool ChangeColorUpdate(bool enable); // 802D3210
void DoSpecialDrawing1(); // 8006CAE0
void DoSpecialDrawing2(); // 8006CB40
@@ -784,6 +801,7 @@ void DoSpecialDrawing2(); // 8006CB40 void SetupLYTDrawing(); // 80163360
void ClearLayoutDrawList(); // 801632B0
+void RenderAllLayouts(); // 800067A0
void DrawAllLayoutsBeforeX(int x); // 80163440
void DrawAllLayoutsAfterX(int x); // 801634D0
void DrawAllLayoutsAfterXandBeforeY(int x, int y); // 80163560
@@ -837,7 +855,7 @@ namespace m2d { namespace EGG {
class Frustum {
public:
- GXProjectionType projType;
+ int projType; // 0 = ortho, 1 = perspective.. who needs GXEnum.h anyway
int isCentered;
float width;
float height;
@@ -847,8 +865,8 @@ namespace EGG { float far;
float center_x_maybe;
float center_y_maybe;
- float x_direction;
- float unk2;
+ float horizontalMultiplier;
+ float verticalMultiplier;
float unk3;
short some_flag_bit;
@@ -876,8 +894,8 @@ namespace EGG { void copyAllFields(Frustum &f); // 802C6EE0
- void saveSomething(float f1, float f2, float f3, float f4); // 802C70C0
- void loadSomething(float *f1, float *f2, float *f3, float *f4); // 802C70E0
+ static void saveSomething(float f1, float f2, float f3, float f4); // 802C70C0
+ static void restoreSomething(float *f1, float *f2, float *f3, float *f4); // 802C70E0
void loadPerspective(); // 802C7110
void loadOrtho(); // 802C7140
@@ -891,6 +909,97 @@ namespace EGG { void getOrthoVars(float *top, float *bottom, float *left, float *right); // 802C7480
};
+
+
+ class Screen : public Frustum {
+ public:
+ struct Info {
+ float viewportX, viewportY, viewportWidth, viewportHeight;
+ float viewportNearZ, viewportFarZ;
+
+ int scissorX, scissorY, scissorWidth, scissorHeight;
+ int scissorOffsetX, scissorOffsetY;
+ };
+
+ Screen(); // 802D0FB0; creates perspective screen with basic settings
+ Screen(Screen *pParent, bool isCentered, float m40, float m44, float width, float height); // 802D1080
+ Screen(Screen &s); // 802D1140
+
+ ~Screen(); // not called by the retail game.. dunno how to make CodeWarrior do this, who gives a fuck
+
+ void loadDirectly();
+ void loadIntoCamera(nw4r::g3d::Camera cam);
+
+ void setSomeVars(bool isCentered, float m40, float m44, float width, float height); // 802D1500
+
+ Info *getStructContainingInfo(); // 802D1AB0
+
+ void doSomethingWithAPassedMatrix(Mtx m, float f1, float f2, float f3, float f4); // 802D1B40
+
+ //protected:
+ void copyAllFields(Screen &s); // 802D1430
+ void setParent(Screen *pParent = 0); // 802D1540
+
+ void useScreenWidth640(); // 802D15A0
+ void calculateCrap(); // 802D15D0
+
+ bool checkIfFlag1IsSet(); // 802D1B10
+
+
+ Screen *parent; // I think it's the parent screen, anyway ...
+ float _40, _44, _48, _4C, _50, _54;
+ Info info;
+ };
+
+
+ class LookAtCamera /* : public BaseCamera */ {
+ public:
+ virtual Mtx *getMatrix();
+ virtual Mtx *getMatrixAgain();
+ virtual void callCalculateMatrix();
+ virtual void calculateMatrix();
+ virtual void loadMatricesIntoGX();
+ virtual void _vf1C(); // null
+ virtual Vec getCamPos();
+ virtual void doStuffInvolvingVfsAndOtherObject(void *unkType);
+ virtual void _vf28(); // null
+ virtual Mtx *getPreviousMatrix();
+
+ void assignToNW4RCamera(nw4r::g3d::Camera &cam); // 802BEB70
+ Vec getStuffFromMatrix(); // 802BEBC0
+ Vec getMoreStuffFromMatrix(); // 802BEC20
+ Vec getEvenMoreStuffFromMatrix(); // 802BEC80
+
+ private:
+ Mtx matrix;
+ Mtx previousMatrix;
+
+ public:
+ Vec camPos, target, camUp;
+ };
+
+ class ProjectOrtho /* : public something? */ {
+ public:
+ virtual GXProjectionType getProjectionType();
+ virtual void setGXProjection();
+ virtual void _vf10(); // null
+ virtual VEC2 _vf14(VEC2 *something);
+ virtual Vec _vf18(float something, /*BaseCamera?*/ LookAtCamera *camera);
+ virtual Vec _vf1C(float something, /*BaseCamera?*/ LookAtCamera *camera);
+ virtual Vec _vf20(VEC2 *something);
+ virtual void _vf24();
+ virtual void setOrthoOntoCamera(nw4r::g3d::Camera &cam);
+ virtual void _vf2C(); // null
+ virtual void setGXProjectionUnscaled(); // does not take aspect ratio into account
+
+ ProjectOrtho(); // 802BF6C0
+ void setVolume(float top, float bottom, float left, float right); // 802BF710
+ void setDefaults(); // I think? 802BF830
+
+ Mtx44 matrix; // unused? dunno
+ void *_44; // dunno type
+ float near, far, top, bottom, left, right;
+ };
}
@@ -2337,5 +2446,16 @@ inline u8 *getResource(const char *arcName, const char *fileName) { inline void scaleDown(Vec* scale, float amt) { scale->x -= amt; scale->y -= amt; scale->z -= amt; }
inline void scaleUp(Vec* scale, float amt) { scale->x -= amt; scale->y -= amt; scale->z -= amt; }
+
+
+
+
+struct SSM { short width, height; float xScale, yScale; };
+extern SSM ScreenSizesAndMultipliers[3];
+extern int currentScreenSizeID;
+
+extern float GlobalScreenWidth, GlobalScreenHeight;
+
+
#endif
|