blob: 96137057b0fed2b5d0d40cad584bcf6b815d9a4e [file] [log] [blame]
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef char char2 __attribute__((ext_vector_type(2)));
typedef char char3 __attribute__((ext_vector_type(3)));
typedef char char4 __attribute__((ext_vector_type(4)));
typedef unsigned char uchar;
typedef unsigned char uchar2 __attribute__((ext_vector_type(2)));
typedef unsigned char uchar3 __attribute__((ext_vector_type(3)));
typedef unsigned char uchar4 __attribute__((ext_vector_type(4)));
typedef short short2 __attribute__((ext_vector_type(2)));
typedef short short3 __attribute__((ext_vector_type(3)));
typedef short short4 __attribute__((ext_vector_type(4)));
typedef unsigned short ushort;
typedef unsigned short ushort2 __attribute__((ext_vector_type(2)));
typedef unsigned short ushort3 __attribute__((ext_vector_type(3)));
typedef unsigned short ushort4 __attribute__((ext_vector_type(4)));
typedef int int2 __attribute__((ext_vector_type(2)));
typedef int int3 __attribute__((ext_vector_type(3)));
typedef int int4 __attribute__((ext_vector_type(4)));
typedef unsigned int uint;
typedef unsigned int uint2 __attribute__((ext_vector_type(2)));
typedef unsigned int uint3 __attribute__((ext_vector_type(3)));
typedef unsigned int uint4 __attribute__((ext_vector_type(4)));
typedef float float2 __attribute__((ext_vector_type(2)));
typedef float float3 __attribute__((ext_vector_type(3)));
typedef float float4 __attribute__((ext_vector_type(4)));
typedef short u565;
typedef short u5551;
typedef short u4444;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_element;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_type;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_allocation;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_sampler;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_script;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_mesh;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_fragment;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_vertex;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_raster;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_store;
typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_font;
// RS_KIND_POSITION
typedef float rs_position1;
typedef float2 rs_position2;
typedef float3 rs_position3;
typedef float4 rs_position4;
// RS_KIND_COLOR
typedef float3 rs_color3f;
typedef float4 rs_color4f;
typedef uchar4 rs_color4u;
// RS_KIND_NORMAL
typedef float3 rs_normal;
// RS_KIND_POINT_SIZE
typedef float rs_point_size;
// RS_KIND_TEXTURE
typedef float rs_texture_coord1;
typedef float2 rs_texture_coord2;
typedef float3 rs_texture_coord3;
typedef float4 rs_texture_coord4;
// RS_KIND_INDEX
typedef ushort rs_index;
struct vecF32_2_s {float x; float y;};
struct vecF32_3_s {float x; float y; float z;};
struct vecF32_4_s {float x; float y; float z; float w;};
struct vecU8_4_s {char r; char g; char b; char a;};
typedef struct vecF32_2_s vecF32_2_t;
typedef struct vecF32_3_s vecF32_3_t;
typedef struct vecF32_4_s vecF32_4_t;
typedef struct vecU8_4_s vecU8_4_t;
typedef struct vecU8_4_s vecI8_4_t;
int loadI32(int, int);
float loadF(int, int);
float* loadArrayF(int, int);
int* loadArrayI32(int, int);
void loadVec4(int, int, float *);
void loadMatrix(int, int, float *);
void storeI32(int, int, int);
void storeF(int, int, float);
void storeVec4(int, int, float *);
void storeMatrix(int, int, float *);
float* loadSimpleMeshVerticesF(rs_mesh, int);
void updateSimpleMesh(rs_mesh);
float modf(float, float);
int abs(int);
float absf(float);
float sinf_fast(float);
float cosf_fast(float);
float sinf(float);
float cosf(float);
float asinf(float);
float acosf(float);
float atanf(float);
float atan2f(float, float);
float fabsf(float);
float randf(float);
float randf2(float, float);
float floorf(float);
float fracf(float);
float ceilf(float);
float roundf(float);
float expf(float);
float logf(float);
float powf(float, float);
float maxf(float, float);
float minf(float, float);
int sqrt(int);
float sqrtf(float);
int sqr(int);
float sqrf(float);
int sign(int);
float signf(float);
int clamp(int, int, int);
float clampf(float, float, float);
float distf2(float, float, float, float);
float distf3(float, float, float, float, float, float);
float magf2(float, float);
float magf3(float, float, float);
float radf(float);
float degf(float);
float lerpf(float, float, float);
float normf(float, float, float);
float mapf(float, float, float, float, float);
float noisef(float);
float noisef2(float, float);
float noisef3(float, float, float);
float turbulencef2(float, float, float);
float turbulencef3(float, float, float, float);
int second();
int minute();
int hour();
int day();
int month();
int year();
int uptimeMillis();
int startTimeMillis();
int elapsedTimeMillis();
void matrixLoadIdentity(float *mat);
void matrixLoadFloat(float *mat, float *f);
void matrixLoadMat(float *mat, float *newmat);
void matrixLoadRotate(float *mat, float rot, float x, float y, float z);
void matrixLoadScale(float *mat, float x, float y, float z);
void matrixLoadTranslate(float *mat, float x, float y, float z);
void matrixLoadMultiply(float *mat, float *lhs, float *rhs);
void matrixMultiply(float *mat, float *rhs);
void matrixRotate(float *mat, float rot, float x, float y, float z);
void matrixScale(float *mat, float x, float y, float z);
void matrixTranslate(float *mat, float x, float y, float z);
float2 vec2Rand(float maxLen);
void vec3Norm(struct vecF32_3_s *);
float vec3Length(struct vecF32_3_s *);
void vec3Add(struct vecF32_3_s *dest, struct vecF32_3_s *lhs, struct vecF32_3_s *rhs);
void vec3Sub(struct vecF32_3_s *dest, struct vecF32_3_s *lhs, struct vecF32_3_s *rhs);
void vec3Cross(struct vecF32_3_s *dest, struct vecF32_3_s *lhs, struct vecF32_3_s *rhs);
float vec3Dot(struct vecF32_3_s *lhs, struct vecF32_3_s *rhs);
void vec3Scale(struct vecF32_3_s *lhs, float scale);
void vec4Norm(struct vecF32_4_s *);
float vec4Length(struct vecF32_4_s *);
void vec4Add(struct vecF32_4_s *dest, struct vecF32_4_s *lhs, struct vecF32_4_s *rhs);
void vec4Sub(struct vecF32_4_s *dest, struct vecF32_4_s *lhs, struct vecF32_4_s *rhs);
float vec4Dot(struct vecF32_4_s *lhs, struct vecF32_4_s *rhs);
void vec4Scale(struct vecF32_4_s *lhs, float scale);
void bindProgramFragment(rs_program_fragment);
void bindProgramFragmentStore(rs_program_store);
void bindProgramStore(rs_program_store);
void bindProgramVertex(rs_program_vertex);
void bindSampler(rs_program_fragment, int, rs_sampler);
void bindTexture(rs_program_fragment, int, rs_allocation);
void vpLoadModelMatrix(void *);
void vpLoadTextureMatrix(void *);
void drawRect(float x1, float y1, float x2, float y2, float z);
void drawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4);
void drawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4);
void drawSprite(float x, float y, float z, float w, float h);
void drawSpriteScreenspace(float x, float y, float z, float w, float h);
void drawSpriteScreenspaceCropped(float x, float y, float z, float w, float h, float cx0, float cy0, float cx1, float cy1);
void drawLine(float x1, float y1, float z1, float x2, float y2, float z2);
void drawPoint(float x1, float y1, float z1);
void drawSimpleMesh(rs_mesh ism);
void drawSimpleMeshRange(rs_mesh ism, int start, int len);
void pfClearColor(float, float, float, float);
void color(float, float, float, float);
void hsb(float, float, float, float);
void hsbToRgb(float, float, float, float*);
int hsbToAbgr(float, float, float, float);
void ambient(float, float, float, float);
void diffuse(float, float, float, float);
void specular(float, float, float, float);
void emission(float, float, float, float);
void shininess(float);
void pointAttenuation(float, float, float);
void uploadToTexture(rs_allocation, int);
void uploadToBufferObject(rs_allocation);
void syncToGL(int);
int colorFloatRGBAtoUNorm8(float, float, float, float);
int colorFloatRGBto565(float, float, float);
int getWidth();
int getHeight();
int sendToClient(void *data, int cmdID, int len, int waitForSpace);
void debugF(void *, float);
void debugI32(void *, int);
void debugHexF(void *, float);
void debugHexI32(void *, int);
void scriptCall(rs_script);