#include "utils.h" Vector2 randomDirection2(int seed, int* nextSeed) { Vector2 direction; direction.x = FT_RANDOM16(seed) % RANDOM_DIRECTION_UNITS; direction.y = FT_RANDOM16(seed) % RANDOM_DIRECTION_UNITS; direction.x -= RANDOM_DIRECTION_UNITS / 2.0; direction.y -= RANDOM_DIRECTION_UNITS / 2.0; if (nextSeed != NULL) { *nextSeed = seed; } return Vector2Normalize(direction); } Vector3 randomDirection3(int seed, int* nextSeed) { Vector3 direction; direction.x = FT_RANDOM16(seed) % RANDOM_DIRECTION_UNITS; direction.y = FT_RANDOM16(seed) % RANDOM_DIRECTION_UNITS; direction.z = FT_RANDOM16(seed) % RANDOM_DIRECTION_UNITS; direction.x -= RANDOM_DIRECTION_UNITS / 2.0; direction.y -= RANDOM_DIRECTION_UNITS / 2.0; direction.z -= RANDOM_DIRECTION_UNITS / 2.0; if (nextSeed != NULL) { *nextSeed = seed; } return Vector3Normalize(direction); } Image colorsToImage(Color* colors, int width, int height) { return (Image){ .data = colors, .width = width, .height = height, .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; } size_t getStringLength(const char* text, size_t maxLength) { size_t stringLength = 0; while (stringLength < maxLength && text[stringLength] != '\0') { ++stringLength; } return stringLength; } // Why does the universe feel strange to exist in?