added extern c to most files

This commit is contained in:
herbglitch 2023-01-30 23:22:34 -07:00
parent b024e8d5c1
commit 5badf331fd
7 changed files with 40 additions and 6 deletions

View file

@ -3,16 +3,27 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ARC_Point {
int32_t x, y;
int32_t x;
int32_t y;
} ARC_Point;
typedef struct ARC_UPoint {
uint32_t x, y;
uint32_t x;
uint32_t y;
} ARC_UPoint;
typedef struct ARC_FPoint {
float x, y;
float x;
float y;
} ARC_FPoint;
#ifdef __cplusplus
}
#endif
#endif // ARC_MATH_POINT_H_

View file

@ -3,6 +3,10 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ARC_Rect {
int32_t x;
int32_t y;
@ -21,4 +25,8 @@ int32_t ARC_Rect_Intersects(ARC_Rect *rect1, ARC_Rect *rect2);
int32_t ARC_Rect_LineIntersects(ARC_Rect *rect, int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2);
#ifdef __cplusplus
}
#endif
#endif // ARC_MATH_POINT_H_

View file

@ -1,6 +1,10 @@
#ifndef ARC_MATH_VECTOR2_H_
#define ARC_MATH_VECTOR2_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ARC_Vector2 {
float x, y;
} ARC_Vector2;
@ -9,4 +13,10 @@ typedef struct ARC_DVector2 {
double x, y;
} ARC_DVector2;
void ARC_Vector2_Normalize(ARC_Vector2 *vector);
#ifdef __cplusplus
}
#endif
#endif // ARC_MATH_VECTOR2_H_

View file

@ -3,6 +3,10 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief a type that holds an array of data and its size
*/
@ -11,4 +15,8 @@ typedef struct ARC_Array {
void *data;
} ARC_Array;
#ifdef __cplusplus
}
#endif
#endif //ARC_STD_ARRAY_H_

View file

@ -2,7 +2,6 @@
#include <stddef.h>
void ARC_State_Update(void *data){
ARC_State *temp = (ARC_State *)data;
((ARC_State *)data)->updateFn(((ARC_State *)data)->data);
}

View file

@ -43,7 +43,6 @@ uint8_t ARC_CSV_Read(ARC_Config *config, ARC_String *string, void **value){
uint32_t index = 0;
for(uint32_t y = 0; y < height; y++){
uint32_t width = 0;
uint32_t data = 0;
uint32_t x = 0;
for(uint32_t i = index; i < fileData->length; i++){

View file

@ -28,7 +28,6 @@ void ARC_Sprite_Copy(ARC_Sprite **newSprite, ARC_Sprite *oldSprite){
}
void ARC_Sprite_Render(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_Rect *renderBounds){
ARC_Rect *temp = (ARC_Rect *)sprite->frames->data + *sprite->frameIndex;
SDL_RenderCopy(renderer->renderer, sprite->spritesheet->texture, (SDL_Rect *)sprite->frames->data + *sprite->frameIndex, (SDL_Rect *)renderBounds);
}