#ifndef ALL_H #define ALL_H #include "raylib.h" #include "raymath.h" #include "rlgl.h" #include "config.h" // Resolve conflicts between Raylib and nonstd.h #define Color NS_Color #include "libraries/nonstd.h" #undef Color #include "libraries/vfs.h" #include #include // --- Map Structures --- typedef struct { Vector3 p[3]; char texture[64]; float shift[2]; float rotate; float scale[2]; } MapPlane; typedef struct { MapPlane *planes; int plane_count; } MapBrush; typedef struct { char key[64]; char value[256]; } MapProperty; typedef struct { MapProperty *properties; int property_count; MapBrush *brushes; int brush_count; } MapEntity; typedef struct { MapEntity *entities; int entity_count; } Map; typedef struct { const char *data; size_t length; size_t pos; } MapParser; typedef struct { Vector3 normal; float dist; } Plane; typedef struct { Vector3 *verts; int count; } Polygon; typedef struct { char texture[64]; array(float) vertices; array(float) texcoords; array(float) normals; } TextureGroup; typedef struct { char name[64]; Texture2D tex; } CachedTexture; // --- Game State --- typedef struct { Camera camera; Model *world_models; int world_model_count; bool cursor_captured; bool vsync; } GameState; extern GameState game; // --- Prototypes --- // Map char map_peek(MapParser *p); char map_get(MapParser *p); void map_skip_whitespace(MapParser *p); bool map_expect(MapParser *p, char expected); void map_parse_token(MapParser *p, char *buffer, int size); Vector3 map_parse_vector(MapParser *p); Map ParseMap(const char *filename); void FreeMap(Map map); // Geometry Plane PlaneFromPoints(Vector3 p1, Vector3 p2, Vector3 p3); void PolyFree(Polygon p); Polygon PolyClip(Polygon poly, Plane plane); Polygon CreateLargeQuad(Plane plane); Vector2 GetUV(Vector3 p, MapPlane *mp, Plane plane); // Game Texture2D GetTexture(const char *name); void InitGame(void); void UpdateGame(void); void DrawGame(void); bool LoadMap(const char *filename); void UnloadMap(void); #endif