still working on adding frames to config
This commit is contained in:
parent
3fa74e8f9e
commit
0591b6ca6e
10 changed files with 199 additions and 53 deletions
|
|
@ -68,9 +68,10 @@ void ARC_EngineData_Destroy(ARC_EngineData *data){
|
|||
#endif // ARC_SDL
|
||||
|
||||
ARC_Mouse_Destroy(data->mouse);
|
||||
ARC_Keyboard_Destroy(data->keyboard);
|
||||
ARC_Renderer_Destroy(data->renderer);
|
||||
ARC_Window_Destroy(data->window);
|
||||
ARC_Handler_Destroy(data->state, NULL); //TODO: replace null with cleanup function
|
||||
ARC_Handler_Destroy(data->state, data->cleanfn);
|
||||
}
|
||||
|
||||
void ARC_Engine_Run(ARC_EngineData *data){
|
||||
|
|
@ -84,7 +85,10 @@ void ARC_Engine_Run(ARC_EngineData *data){
|
|||
|
||||
double lastTime = 0, currentTime;
|
||||
|
||||
while(1){
|
||||
data->dt = 0;
|
||||
data->running = 0;
|
||||
|
||||
while(!data->running){
|
||||
#ifdef ARC_SDL
|
||||
currentTime = SDL_GetTicks();
|
||||
data->dt = currentTime - lastTime;
|
||||
|
|
@ -99,6 +103,7 @@ void ARC_Engine_Run(ARC_EngineData *data){
|
|||
|
||||
ARC_Keyboard_Update(data->keyboard);
|
||||
|
||||
ARC_Handler_Clean(data->state, data->cleanfn);
|
||||
ARC_Handler_Iterate(data->state, ARC_State_Update);
|
||||
|
||||
ARC_Renderer_Clear(data->renderer);
|
||||
|
|
|
|||
|
|
@ -10,25 +10,33 @@
|
|||
#include "arc/graphics/sdl/sprite.h"
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
#include "arc/graphics/sdl/spritesheet.h"
|
||||
#include "arc/math/point.h"
|
||||
#include "arc/math/rectangle.h"
|
||||
|
||||
// #define ARC_DEFAULT_CONFIG
|
||||
#include "arc/std/defaults/config.h"
|
||||
|
||||
SDL_Renderer *global_renderer;
|
||||
|
||||
int32_t ARC_SDL_Rect_Read (ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
int32_t ARC_Point_Read (ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
int32_t ARC_Rect_Read (ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
int32_t ARC_RectArray_Read (ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
int32_t ARC_SDL_Texture_Read(ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
int32_t ARC_Spritesheet_Read(ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
int32_t ARC_Sprite_Read (ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value);
|
||||
|
||||
int32_t ARC_SDL_Rect_Delete (ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
int32_t ARC_Point_Delete (ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
int32_t ARC_Rect_Delete (ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
int32_t ARC_RectArray_Delete (ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
int32_t ARC_SDL_Texture_Delete(ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
int32_t ARC_Spritesheet_Delete(ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
int32_t ARC_Sprite_Delete (ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value);
|
||||
|
||||
void ARC_GraphicsConfig_Init(ARC_Config *config, ARC_Renderer *renderer){
|
||||
global_renderer = renderer->renderer;
|
||||
ARC_ConfigKey_Add(config, (char *)"SDL_Rect" , (ARC_ConfigKeyRead) ARC_SDL_Rect_Read , (ARC_ConfigKeyDelete) ARC_SDL_Rect_Delete );
|
||||
ARC_ConfigKey_Add(config, (char *)"ARC_Point" , (ARC_ConfigKeyRead) ARC_Point_Read , (ARC_ConfigKeyDelete) ARC_Point_Delete );
|
||||
ARC_ConfigKey_Add(config, (char *)"ARC_Rect" , (ARC_ConfigKeyRead) ARC_Rect_Read , (ARC_ConfigKeyDelete) ARC_Rect_Delete );
|
||||
ARC_ConfigKey_Add(config, (char *)"ARC_RectArray" , (ARC_ConfigKeyRead) ARC_RectArray_Read , (ARC_ConfigKeyDelete) ARC_RectArray_Delete );
|
||||
ARC_ConfigKey_Add(config, (char *)"SDL_Texture" , (ARC_ConfigKeyRead) ARC_SDL_Texture_Read, (ARC_ConfigKeyDelete) ARC_SDL_Texture_Delete);
|
||||
ARC_ConfigKey_Add(config, (char *)"ARC_Spritesheet", (ARC_ConfigKeyRead) ARC_Spritesheet_Read, (ARC_ConfigKeyDelete) ARC_Spritesheet_Delete);
|
||||
ARC_ConfigKey_Add(config, (char *)"ARC_Sprite" , (ARC_ConfigKeyRead) ARC_Sprite_Read , (ARC_ConfigKeyDelete) ARC_Sprite_Delete );
|
||||
|
|
@ -50,14 +58,37 @@ int32_t ARC_SDL_Texture_Load(const char *path, SDL_Texture **texture){
|
|||
return 0;
|
||||
}
|
||||
|
||||
int32_t ARC_SDL_Rect_Read(ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value){
|
||||
int32_t ARC_Point_Read(ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value){
|
||||
ARC_StringSubstr_StripWhitespaceEnds((char *)data, subdata);
|
||||
if(data[subdata->index] != '{' || data[subdata->index + subdata->length - 1] != '}'){ return ARC_ERRNO_DATA; }
|
||||
subdata->index++;
|
||||
subdata->length -= 2;
|
||||
|
||||
uint64_t split;
|
||||
*value = malloc(sizeof(SDL_Rect));
|
||||
*value = malloc(sizeof(ARC_Rect));
|
||||
|
||||
//x
|
||||
int32_t err = ARC_String_Find(((char *)data) + subdata->index, (char *)",", &split);
|
||||
if(err){ return err; }
|
||||
if(split == ~((uint64_t)0) || split > subdata->length){ return ARC_ERRNO_DATA; }
|
||||
ARC_StringSubstr temp = { subdata->index, split };
|
||||
((SDL_Point *) *value)->x = (int)ARC_String_ToUint64_t(data, &temp);
|
||||
|
||||
//y
|
||||
temp = (ARC_StringSubstr){ temp.index + split + 1, subdata->length - split - 1 };
|
||||
((SDL_Point *) *value)->y = (int)ARC_String_ToUint64_t(data, &temp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ARC_Rect_Read(ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value){
|
||||
ARC_StringSubstr_StripWhitespaceEnds((char *)data, subdata);
|
||||
if(data[subdata->index] != '{' || data[subdata->index + subdata->length - 1] != '}'){ return ARC_ERRNO_DATA; }
|
||||
subdata->index++;
|
||||
subdata->length -= 2;
|
||||
|
||||
uint64_t split;
|
||||
*value = malloc(sizeof(ARC_Rect));
|
||||
|
||||
//x
|
||||
int32_t err = ARC_String_Find(((char *)data) + subdata->index, (char *)",", &split);
|
||||
|
|
@ -82,11 +113,59 @@ int32_t ARC_SDL_Rect_Read(ARC_Config* config, const char *data, ARC_StringSubstr
|
|||
temp.length = split;
|
||||
((SDL_Rect *) *value)->w = (int)ARC_String_ToUint64_t(data, &temp);
|
||||
|
||||
//hhttps://w2g.tv/8r0knvefgpciytccsw
|
||||
//h
|
||||
temp = (ARC_StringSubstr){ temp.index + split + 1, subdata->length - split - 1 };
|
||||
((SDL_Rect *) *value)->h = (int)ARC_String_ToUint64_t(data, &temp);
|
||||
|
||||
SDL_Rect *ntemp = ((SDL_Rect *) *value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ARC_RectArray_Read(ARC_Config* config, const char *data, ARC_StringSubstr *subdata, void **value){
|
||||
ARC_StringSubstr_StripWhitespaceEnds((char *)data, subdata);
|
||||
if(data[subdata->index] != '{' || data[subdata->index + subdata->length - 1] != '}'){ return ARC_ERRNO_DATA; }
|
||||
subdata->index++;
|
||||
subdata->length -= 2;
|
||||
|
||||
uint64_t arraySize = 1;
|
||||
uint8_t encapsulated = 0;
|
||||
for(uint64_t i = subdata->index; i < subdata->index + subdata->length; i++){
|
||||
if(data[i] == '{'){
|
||||
encapsulated++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(data[i] == '}'){
|
||||
encapsulated--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!encapsulated && data[i] == ','){
|
||||
arraySize++;
|
||||
}
|
||||
}
|
||||
|
||||
*value = malloc(sizeof(ARC_Rect) * arraySize);
|
||||
ARC_StringSubstr temp = { subdata->index, subdata->index };
|
||||
arraySize = 0;
|
||||
encapsulated = 0;
|
||||
for(uint64_t i = subdata->index; i < subdata->index + subdata->length; i++){
|
||||
if(data[i] == '{'){
|
||||
encapsulated++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(data[i] == '}'){
|
||||
encapsulated--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!encapsulated && data[i] == ','){
|
||||
temp.length = i - temp.index - 1;
|
||||
ARC_Rect *tempRect = ((ARC_Rect *) *value) + arraySize;
|
||||
arraySize++;
|
||||
ARC_Rect_Read(config, data, &temp, (void **) &tempRect);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -178,22 +257,39 @@ int32_t ARC_Sprite_Read(ARC_Config* config, const char *data, ARC_StringSubstr *
|
|||
//bounds
|
||||
temp = (ARC_StringSubstr){ subdata->index + split + 1, subdata->length - split - 1 };
|
||||
ARC_StringSubstr_StripWhitespaceEnds((char *)data, &temp);
|
||||
SDL_Rect *bounds = (SDL_Rect *)ARC_Config_GetReference(config, (char *)data, &temp);
|
||||
ARC_Rect *bounds = (ARC_Rect *)ARC_Config_GetReference(config, (char *)data, &temp);
|
||||
|
||||
if(!bounds){
|
||||
ARC_ConfigKey_Read_Uint64_t(config, data, &temp, (void **)&bounds);
|
||||
err = ARC_Rect_Read(config, data, &temp, (void **)&bounds);
|
||||
if(err){ return ARC_ERRNO_DATA; }
|
||||
}
|
||||
|
||||
//scale bounds on spritesheet size
|
||||
if(spritesheet->size){
|
||||
bounds->x *= *spritesheet->size;
|
||||
bounds->y *= *spritesheet->size;
|
||||
bounds->w *= *spritesheet->size;
|
||||
bounds->h *= *spritesheet->size;
|
||||
}
|
||||
|
||||
*value = malloc(sizeof(ARC_Sprite));
|
||||
((ARC_Sprite *) *value)->spritesheet = spritesheet;
|
||||
((ARC_Sprite *) *value)->bounds = bounds;
|
||||
((ARC_Sprite *) *value)->frames = bounds;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ARC_SDL_Rect_Delete(ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value){
|
||||
if((SDL_Rect *)value){ free((SDL_Rect *)value); }
|
||||
int32_t ARC_Point_Delete(ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value){
|
||||
if((ARC_Point *)value){ free((ARC_Point *)value); }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ARC_Rect_Delete(ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value){
|
||||
if((ARC_Rect *)value){ free((ARC_Rect *)value); }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ARC_RectArray_Delete(ARC_Config* config, const char* data, ARC_StringSubstr *subdata, void *value){
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -265,7 +361,7 @@ int32_t ARC_Sprite_Delete(ARC_Config* config, const char* data, ARC_StringSubstr
|
|||
ARC_StringSubstr_StripWhitespaceEnds((char *)data, &temp);
|
||||
SDL_Rect *bounds = (SDL_Rect *)ARC_Config_GetReference(config, (char *)data, &temp);
|
||||
|
||||
if(!bounds){ ARC_SDL_Rect_Delete(config, data, &temp, (void *)sprite->bounds); }
|
||||
if(!bounds){ ARC_Rect_Delete(config, data, &temp, (void *)sprite->frames); }
|
||||
|
||||
free(sprite);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ void ARC_Mouse_Update(ARC_Mouse *mouse){
|
|||
*mouse->scroll = mouse->event->wheel.y;
|
||||
}
|
||||
|
||||
uint32_t buttons = SDL_GetMouseState(&(mouse->coords->x), &(mouse->coords->y));
|
||||
|
||||
if(mouse->event->type != SDL_MOUSEBUTTONDOWN && mouse->event->type != SDL_MOUSEBUTTONUP){
|
||||
if(!*mouse->buttonsReleased){
|
||||
return;
|
||||
|
|
@ -82,7 +84,6 @@ void ARC_Mouse_Update(ARC_Mouse *mouse){
|
|||
return;
|
||||
}
|
||||
|
||||
uint32_t buttons = SDL_GetMouseState(&(mouse->coords->x), &(mouse->coords->y));
|
||||
ARC_Mouse_UpdateButton(mouse, ARC_MOUSE_LEFT , &buttons, SDL_BUTTON_LMASK );
|
||||
ARC_Mouse_UpdateButton(mouse, ARC_MOUSE_MIDDLE, &buttons, SDL_BUTTON_MMASK );
|
||||
ARC_Mouse_UpdateButton(mouse, ARC_MOUSE_RIGHT , &buttons, SDL_BUTTON_RMASK );
|
||||
|
|
@ -90,8 +91,8 @@ void ARC_Mouse_Update(ARC_Mouse *mouse){
|
|||
ARC_Mouse_UpdateButton(mouse, ARC_MOUSE_X2 , &buttons, SDL_BUTTON_X2MASK);
|
||||
}
|
||||
|
||||
ARC_Point ARC_Mouse_GetCoords(ARC_Mouse *mouse){
|
||||
return *mouse->coords;
|
||||
ARC_Point *ARC_Mouse_GetCoords(ARC_Mouse *mouse){
|
||||
return mouse->coords;
|
||||
}
|
||||
|
||||
ARC_MouseState ARC_Mouse_GetState(ARC_Mouse *mouse, ARC_MouseButton button){
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ void ARC_Handler_Remove(ARC_Handler *handler, void *data){
|
|||
}
|
||||
|
||||
void ARC_Handler_RemoveIndex(ARC_Handler *handler, uint32_t *index){
|
||||
if(!*ARC_Vector_Size(handler->data)){
|
||||
return;
|
||||
}
|
||||
|
||||
void *data = ARC_Vector_Get(handler->data, index);
|
||||
ARC_Vector_Add(handler->trash, data);
|
||||
ARC_Vector_RemoveIndex(handler->data, index);
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ struct ARC_Vector {
|
|||
|
||||
void ARC_Vector_Create(ARC_Vector **vector, uint32_t dataSize){
|
||||
*vector = (ARC_Vector *) malloc(sizeof(ARC_Vector));
|
||||
(*vector)->currentSize = (uint32_t *) malloc(sizeof(uint32_t));
|
||||
(*vector)->capacity = (uint32_t *) malloc(sizeof(uint32_t));
|
||||
(*vector)->dataSize = (uint32_t *) malloc(sizeof(uint32_t));
|
||||
(*vector)->data = (void *) malloc(dataSize);
|
||||
(*vector)->currentSize = (uint32_t *)malloc(sizeof(uint32_t));
|
||||
(*vector)->capacity = (uint32_t *)malloc(sizeof(uint32_t));
|
||||
(*vector)->dataSize = (uint32_t *)malloc(sizeof(uint32_t));
|
||||
(*vector)->data = (void *)malloc(dataSize);
|
||||
|
||||
*((*vector)->currentSize) = 0;
|
||||
*((*vector)->capacity) = 1;
|
||||
*((*vector)->dataSize) = dataSize;
|
||||
*(*vector)->currentSize = 0;
|
||||
*(*vector)->capacity = 1;
|
||||
*(*vector)->dataSize = dataSize;
|
||||
}
|
||||
|
||||
void ARC_Vector_Destroy(ARC_Vector *vector){
|
||||
|
|
@ -32,33 +32,36 @@ void ARC_Vector_Destroy(ARC_Vector *vector){
|
|||
}
|
||||
|
||||
void ARC_Vector_Add(ARC_Vector *vector, void *data){
|
||||
if(*(vector->currentSize) == ~((uint32_t)0)){
|
||||
if(*vector->currentSize == ~((uint32_t)0)){
|
||||
arc_errno = ARC_ERRNO_OVERFLOW;
|
||||
return;
|
||||
}
|
||||
|
||||
if(*(vector->currentSize) == *(vector->capacity)){
|
||||
*(vector->capacity) <<= 1;
|
||||
if(*vector->currentSize == *vector->capacity){
|
||||
if(!*vector->capacity){
|
||||
++*vector->capacity;
|
||||
}
|
||||
*vector->capacity <<= 1;
|
||||
|
||||
vector->data = (void *) realloc(vector->data, *(vector->dataSize) * *(vector->capacity));
|
||||
vector->data = (void *)realloc(vector->data, *vector->dataSize * *vector->capacity);
|
||||
}
|
||||
|
||||
memcpy(vector->data + (*(vector->currentSize) * *(vector->dataSize)), data, *(vector->dataSize));
|
||||
memcpy(vector->data + (*vector->currentSize * *vector->dataSize), data, *vector->dataSize);
|
||||
++*(vector->currentSize);
|
||||
}
|
||||
|
||||
void ARC_Vector_Remove(ARC_Vector *vector, void *data, ARC_Vector_CompareDataFn compare){
|
||||
if(!*(vector->currentSize)){
|
||||
if(!*vector->currentSize){
|
||||
arc_errno = ARC_ERRNO_DATA;
|
||||
return;
|
||||
}
|
||||
|
||||
--*(vector->currentSize);
|
||||
|
||||
if(*(vector->currentSize) != *(vector->capacity) >> 1){
|
||||
for(uint32_t i = 0; i <= *(vector->currentSize); i++){
|
||||
if(!compare(data, vector->data + (i * *(vector->dataSize)))){
|
||||
memcpy(vector->data + (i * *(vector->dataSize)), vector->data + ((i + 1) * *(vector->dataSize)), *(vector->currentSize - i) * *(vector->dataSize));
|
||||
if(*vector->currentSize != *vector->capacity >> 1){
|
||||
for(uint32_t i = 0; i <= *vector->currentSize; i++){
|
||||
if(!compare(data, vector->data + (i * *vector->dataSize))){
|
||||
memcpy(vector->data + (i * *vector->dataSize), vector->data + ((i + 1) * *vector->dataSize), *(vector->currentSize - i) * *vector->dataSize);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -67,13 +70,13 @@ void ARC_Vector_Remove(ARC_Vector *vector, void *data, ARC_Vector_CompareDataFn
|
|||
return;
|
||||
}
|
||||
|
||||
*(vector->capacity) >>= 1;
|
||||
void *temp = (void *) malloc(*(vector->dataSize) * *(vector->capacity));
|
||||
*vector->capacity >>= 1;
|
||||
void *temp = (void *) malloc(*vector->dataSize * *vector->capacity);
|
||||
|
||||
for(uint32_t i = 0; i <= *(vector->currentSize); i++){
|
||||
if(compare(data, vector->data + (i * *(vector->dataSize)))){
|
||||
memcpy(temp, vector->data, i * *(vector->dataSize));
|
||||
memcpy(temp + (i * *(vector->dataSize)), vector->data + ((i + 1) * *(vector->dataSize)), *(vector->currentSize - i) * *(vector->dataSize));
|
||||
for(uint32_t i = 0; i <= *vector->currentSize; i++){
|
||||
if(compare(data, vector->data + (i * *vector->dataSize))){
|
||||
memcpy(temp, vector->data, i * *vector->dataSize);
|
||||
memcpy(temp + (i * *vector->dataSize), vector->data + ((i + 1) * *vector->dataSize), *(vector->currentSize - i) * *vector->dataSize);
|
||||
free(vector->data);
|
||||
vector->data = temp;
|
||||
return;
|
||||
|
|
@ -84,21 +87,21 @@ void ARC_Vector_Remove(ARC_Vector *vector, void *data, ARC_Vector_CompareDataFn
|
|||
}
|
||||
|
||||
void ARC_Vector_RemoveIndex(ARC_Vector *vector, uint32_t *index){
|
||||
if(!*(vector->currentSize) || *index >= *(vector->currentSize)){
|
||||
if(!*vector->currentSize || *index >= *vector->currentSize){
|
||||
arc_errno = ARC_ERRNO_DATA;
|
||||
return;
|
||||
}
|
||||
|
||||
--*(vector->currentSize);
|
||||
if(*(vector->currentSize) != *(vector->capacity) >> 1){
|
||||
memcpy(vector->data + (*index * *(vector->dataSize)), vector->data + ((*index + 1) * *(vector->dataSize)), *(vector->currentSize - *index) * *(vector->dataSize));
|
||||
--*vector->currentSize;
|
||||
if(*vector->currentSize != *vector->capacity >> 1){
|
||||
memcpy(vector->data + (*index * *vector->dataSize), vector->data + ((*index + 1) * *vector->dataSize), *(vector->currentSize - *index) * *vector->dataSize);
|
||||
return;
|
||||
}
|
||||
|
||||
*(vector->capacity) >>= 1;
|
||||
void **temp = (void **) malloc(sizeof(void *) * (*(vector->capacity)));
|
||||
memcpy(temp, vector->data, *index * *(vector->dataSize));
|
||||
memcpy(temp + (*index * *(vector->dataSize)), vector->data + ((*index + 1) * *(vector->dataSize)), *(vector->currentSize - *index) * *(vector->dataSize));
|
||||
*vector->capacity >>= 1;
|
||||
void **temp = (void **)malloc(sizeof(void *) * (*(vector->capacity)));
|
||||
memcpy(temp, vector->data, *index * *vector->dataSize);
|
||||
memcpy(temp + (*index * *vector->dataSize), vector->data + ((*index + 1) * *vector->dataSize), *(vector->currentSize - *index) * *vector->dataSize);
|
||||
|
||||
free(vector->data);
|
||||
vector->data = temp;
|
||||
|
|
@ -106,4 +109,4 @@ void ARC_Vector_RemoveIndex(ARC_Vector *vector, uint32_t *index){
|
|||
|
||||
uint32_t *ARC_Vector_Size(ARC_Vector *vector){ return vector->currentSize; }
|
||||
|
||||
void *ARC_Vector_Get(ARC_Vector *vector, uint32_t *index){ return (void *)(uint8_t (*)[*(vector->dataSize)]) vector->data + (*index * *(vector->dataSize)); }
|
||||
void *ARC_Vector_Get(ARC_Vector *vector, uint32_t *index){ return (void *)(uint8_t (*)[*vector->dataSize]) vector->data + (*index * *vector->dataSize); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue