Merge branch 'static-game-try-1'

This commit is contained in:
Sandro Sobczyński
2020-11-04 13:21:08 +01:00
29 changed files with 224 additions and 235 deletions
+3 -2
View File
@@ -24,12 +24,12 @@ class Engine
{
public:
Engine(const ScreenSettings &screen);
Engine();
~Engine();
void init(Game *t_game, u32 t_gifPacketSize);
void setDefaultScreen();
void setScreen(ScreenSettings &t_settings);
Renderer *renderer;
Audio audio;
ScreenSettings screen;
@@ -37,9 +37,10 @@ public:
float fps;
private:
void firePS2();
u8 fpsDelayer;
Timer timer;
u8 isInitialized, isScreenInitialized;
u8 isInitialized;
void gameLoop();
Game *game;
s32 mainThreadId;
+1 -1
View File
@@ -35,7 +35,7 @@ public:
void makeZRotation(float t_radians);
void translate(float t_x, float t_y, float t_z);
void setPerspective(ScreenSettings &screen);
void print();
const void print() const;
};
#endif
+1 -1
View File
@@ -27,7 +27,7 @@ public:
void update(Vector3 &a, Vector3 &b, Vector3 &c);
inline float distanceTo(Vector3 &t_vec) { return this->distance + this->normal.innerProduct(t_vec); }
void print();
const void print() const;
};
#endif
+1 -1
View File
@@ -33,7 +33,7 @@ public:
void set(const float &t_x, const float &t_y);
void set(const Point &v);
void print();
const void print() const;
};
#endif
+1 -1
View File
@@ -54,7 +54,7 @@ public:
void set(const float &x, const float &y, const float &z);
void copy(Vector3 &v);
float distanceTo(Vector3 &v);
void print();
const void print() const;
};
#endif
@@ -21,7 +21,6 @@ struct ScreenSettings
float aspectRatio;
float nearPlaneDist;
float farPlaneDist;
/** change it to 4096.0F to check out frustum culling! 😎 */
float projectionScale;
};
+1 -1
View File
@@ -33,7 +33,7 @@ public:
~GifSender();
void initPacket(u8 context);
void addObject(RenderData *t_renderData, Mesh *t_objects3D, u32 vertexCount, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer);
void addObject(RenderData *t_renderData, Mesh &t_mesh, u32 vertexCount, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer);
void addClear(zbuffer_t *t_zBuffer);
void sendPacket();
void sendClear(zbuffer_t *t_zBuffer);
+9 -9
View File
@@ -35,22 +35,22 @@ public:
prim_t prim;
/** PATH3 Many + lighting */
void drawByPath3(Mesh **t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount);
void drawByPath3(Mesh *t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount);
/** PATH3 Single + lighting */
void drawByPath3(Mesh *t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount);
void drawByPath3(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount);
/** PATH3 Many */
void drawByPath3(Mesh **t_meshes, u16 t_amount);
void drawByPath3(Mesh *t_meshes, u16 t_amount);
/** PATH3 Single */
void drawByPath3(Mesh *t_mesh);
void drawByPath3(Mesh &t_mesh);
/** PATH1 Many + lighting */
void draw(Mesh **t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount);
void draw(Mesh *t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount);
/** PATH1 Single + lighting */
void draw(Mesh *t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount);
void draw(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount);
/** PATH1 Many */
void draw(Mesh **t_meshes, u16 t_amount);
void draw(Mesh *t_meshes, u16 t_amount);
/** PATH1 Single */
void draw(Mesh *t_mesh);
void draw(Mesh &t_mesh);
void setCameraDefinitions(Matrix *t_worldView, Vector3 *t_cameraPos, Plane *t_planes);
@@ -59,7 +59,7 @@ public:
TextureRepository *getTextureRepository() { return &textureRepo; };
private:
void changeTexture(Mesh *t_mesh, u32 t_materialId);
void changeTexture(const Mesh &t_mesh, u32 t_materialId);
u32 lastTextureId;
texbuffer_t textureBuffer;
u8 isTextureVRAMAllocated;
+2 -2
View File
@@ -28,11 +28,11 @@ public:
~VifSender();
// TODO refactor
void drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, Mesh *t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer);
void drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, const Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer);
void sendMatrices(const RenderData &t_renderData, const Vector3 &t_position, const Vector3 &t_rotation);
private:
void drawVertices(Mesh *t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *textureBuffer);
void drawVertices(const Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *textureBuffer);
VU1 vu1; // TODO
MATRIX localWorld, localScreen;
VECTOR position, rotation;