refactor: header file for every module
This commit is contained in:
+26
-9
@@ -118,6 +118,13 @@ typedef struct {
|
||||
float weight;
|
||||
} Physics;
|
||||
|
||||
typedef struct {
|
||||
bool overlapping;
|
||||
bool hasDirection; // false when centers coincide, direction/overlap unset
|
||||
Vector2 direction; // normalized, points from B to A
|
||||
float overlap;
|
||||
} CircleCollision;
|
||||
|
||||
typedef struct {
|
||||
Shader shader;
|
||||
int resolutionLoc;
|
||||
@@ -152,13 +159,12 @@ void UpdateArray(Array *array, void (*updateFunc)(void *));
|
||||
void RenderArray(Array *array, void (*renderFunc)(void *));
|
||||
void FreeArray(Array **array);
|
||||
|
||||
Camera2D *GetCamera(void);
|
||||
Rectangle GetCameraRectangle(void);
|
||||
void CreateCamera(Vector2 playerPosition, float initZoom);
|
||||
void UpdateCameraTarget(Vector2 *position, const float smoothness);
|
||||
void UpdateCameraZoom(const float *scaleFactor, const float *minZoom,
|
||||
Rectangle GetCameraRectangle(Camera2D *camera);
|
||||
Camera2D CreateCamera(Vector2 playerPosition, float initZoom);
|
||||
void UpdateCameraTarget(Camera2D *camera, Vector2 *position, const float smoothness);
|
||||
void UpdateCameraZoom(Camera2D *camera, const float *scaleFactor, const float *minZoom,
|
||||
const float *maxZoom);
|
||||
void UpdateCamera2D(Vector2 *position, Mouse *mouse);
|
||||
void UpdateCamera2D(Camera2D *camera, Vector2 *position, Mouse *mouse);
|
||||
|
||||
void InitConfig(Config *config, const char *path);
|
||||
int GetConfigInt(Config *config, const char *key);
|
||||
@@ -182,6 +188,10 @@ ImageButton CreateImageButton(ButtonState state, Texture2D *texture,
|
||||
const TextureAsset *asset, Vector2 *source,
|
||||
Vector2 *clicked, Vector2 *hover,
|
||||
Rectangle *destRec);
|
||||
ImageButton CreateMenuButton(Texture2D *texture, const TextureAsset *asset,
|
||||
int textureRow, int screenRank, int buttonWidth,
|
||||
int buttonHeight, Vector2 windowCenter,
|
||||
int buttonSpacing);
|
||||
ImageElement CreateImageElement(Texture2D *texture, const TextureAsset *asset,
|
||||
Vector2 *source, Rectangle *destRec);
|
||||
int isImageButtonClicked(ImageButton *b, Sound soundHover, Sound soundClick);
|
||||
@@ -195,7 +205,7 @@ void renderButton(Button *b);
|
||||
Mouse CreateMouse(float zoomSpeed, float minZoom, float maxZoom,
|
||||
Texture2D *texture);
|
||||
void UpdateMouseScreen(Mouse *mouse);
|
||||
void UpdateMouse(Mouse *mouse);
|
||||
void UpdateMouse(Mouse *mouse, Camera2D *camera);
|
||||
Vector2 GetDirectionVector(void);
|
||||
|
||||
ObjectArray CreateObjectArray(const Object *prototype, const size_t count);
|
||||
@@ -220,6 +230,9 @@ void UpdatePhysicsPosition(Vector2 *position, Vector2 *velocity);
|
||||
void UpdatePhysicsSpeed(float *speed, float *newSpeed);
|
||||
void UpdatePhysics(Physics *physics, Vector2 direction);
|
||||
|
||||
CircleCollision CheckCircleCollision(Vector2 posA, float radiusA,
|
||||
Vector2 posB, float radiusB);
|
||||
|
||||
PostProcessing CreatePostFX(const char *shaderPath);
|
||||
void UpdatePostFX(PostProcessing *postFX);
|
||||
void RenderPostFX(PostProcessing *postFX, RenderTexture2D *target);
|
||||
@@ -243,7 +256,11 @@ float Cross2D(Vector2 a, Vector2 b);
|
||||
Vector2 GetPositionInsideRectangle(Rectangle rec);
|
||||
Vector2 GetPositionOutsideRectangle(Rectangle rec, int min, int max);
|
||||
|
||||
bool SaveStorageValue(const char *fileName, unsigned int position, int value);
|
||||
int LoadStorageValue(const char *fileName, unsigned int position);
|
||||
bool SaveStorageData(const char *fileName, int version, const void *data, unsigned int dataSize);
|
||||
bool LoadStorageData(const char *fileName, int expectedVersion, void *data, unsigned int dataSize);
|
||||
|
||||
Texture2D LoadTextureCached(const char *path);
|
||||
Sound LoadSoundCached(const char *path);
|
||||
void UnloadCachedAssets(void);
|
||||
|
||||
#endif // ENGINE_H
|
||||
|
||||
Reference in New Issue
Block a user