#include <stdio.h>
#include <stdlib.h>

#include "raylib.h"

#define ENTITY_COUNT 10000000
#define TEST_DOD

typedef struct DoDState
{
    Vector2* positions;
    Color* colors;
    Vector2* outputs;
} DoDState;

typedef struct ObjState
{
    Vector2 position;
    Color color;
    Vector2 output;
} ObjState;

ObjState objects[ENTITY_COUNT];

Vector2 positions[ENTITY_COUNT];
Color colors[ENTITY_COUNT];
Vector2 outputs[ENTITY_COUNT];


void AWESOME_FUNCTION(void)
{
#ifdef TEST_DOD
    for (int i = 0; i < ENTITY_COUNT; i++)
    {
        const Vector2 output = (Vector2){
        // positions[i] = (Vector2){
            positions[i].x * 2,
            positions[i].y * 2,
        };
        outputs[i] = output;
    }
#else
    for (int i = 0; i < ENTITY_COUNT; i++)
    {
        const Vector2 output = (Vector2){
            objects[i].position.x * objects[i].color.r,
            objects[i].position.y * objects[i].color.b,
        };
        objects[i].output = output;
    }
#endif
}

int main(void)
{
    // Populate the data
    int r = rand();
    for (int i = 0; i < ENTITY_COUNT; i++)
    {
        positions[i].x = (float)r / RAND_MAX;
        positions[i].y = (float)r / RAND_MAX;

        colors[i].r = r % 256;
        colors[i].g = r % 256;
        colors[i].b = r % 256;
        colors[i].a = r % 256;

        objects[i].position = positions[i];
        objects[i].color = colors[i];
    }

    AWESOME_FUNCTION();

    return 0;
}
