Tachyon (current)
Current Main Branch
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "tachyon.h"
#include "parse.h"
Go to the source code of this file.
Macros | |
#define | PARSE_INTERNAL |
#define | ERROR_READBUF_SIZE 65536 |
Functions | |
static int | stringcmp (const char *a, const char *b) |
static void | reset_tex_table (parsehandle *ph, SceneHandle scene) |
static void | free_tex_table (parsehandle *ph, SceneHandle scene) |
static errcode | add_texture (parsehandle *ph, void *tex, const char *name) |
static void * | find_texture (parsehandle *ph, const char *name) |
apiflt | degtorad (apiflt deg) |
static void | degvectoradvec (apivector *degvec) |
static void | InitRot3d (RotMat *rot, apiflt x, apiflt y, apiflt z) |
static void | Rotate3d (RotMat *rot, apivector *vec) |
static void | Scale3d (apivector *scale, apivector *vec) |
static void | Trans3d (apivector *trans, apivector *vec) |
static void | PrintSyntaxError (parsehandle *ph, const char *string, const char *found) |
static errcode | GetString (parsehandle *ph, const char *string) |
unsigned int | readmodel (const char *modelfile, SceneHandle scene) |
static errcode | ReadIncludeFile (parsehandle *ph, const char *includefile, SceneHandle scene) |
static errcode | GetScenedefs (parsehandle *ph, SceneHandle scene) |
static errcode | GetShaderMode (parsehandle *ph, SceneHandle scene) |
static errcode | GetCamera (parsehandle *ph, SceneHandle scene) |
static errcode | GetObject (parsehandle *ph, SceneHandle scene) |
static errcode | GetInt (parsehandle *ph, int *i) |
static errcode | GetVector (parsehandle *ph, apivector *v1) |
static errcode | GetColor (parsehandle *ph, apicolor *c1) |
static errcode | GetImageDef (parsehandle *ph, SceneHandle scene) |
static errcode | GetTexDef (parsehandle *ph, SceneHandle scene) |
static errcode | GetTexAlias (parsehandle *ph) |
static errcode | GetTexture (parsehandle *ph, SceneHandle scene, void **tex) |
void * | GetTexBody (parsehandle *ph, SceneHandle scene, int modeflag) |
static errcode | GetDirLight (parsehandle *ph, SceneHandle scene) |
static errcode | GetLight (parsehandle *ph, SceneHandle scene) |
static errcode | GetSkyLight (parsehandle *ph, SceneHandle scene) |
static errcode | GetSpotLight (parsehandle *ph, SceneHandle scene) |
static errcode | GetFog (parsehandle *ph, SceneHandle scene) |
static errcode | GetBackGnd (parsehandle *ph, SceneHandle scene) |
static errcode | GetBackGndGradient (parsehandle *ph, SceneHandle scene) |
static errcode | GetCylinder (parsehandle *ph, SceneHandle scene) |
static errcode | GetFCylinder (parsehandle *ph, SceneHandle scene) |
static errcode | GetPolyCylinder (parsehandle *ph, SceneHandle scene) |
static errcode | GetSphere (parsehandle *ph, SceneHandle scene) |
static errcode | GetPlane (parsehandle *ph, SceneHandle scene) |
static errcode | GetVol (parsehandle *ph, SceneHandle scene) |
static errcode | GetBox (parsehandle *ph, SceneHandle scene) |
static errcode | GetRing (parsehandle *ph, SceneHandle scene) |
static errcode | GetTri (parsehandle *ph, SceneHandle scene) |
static errcode | GetSTri (parsehandle *ph, SceneHandle scene) |
static errcode | GetVCSTri (parsehandle *ph, SceneHandle scene) |
static errcode | GetVertexArray (parsehandle *ph, SceneHandle scene) |
static errcode | GetLandScape (parsehandle *ph, SceneHandle scene) |
static errcode | GetTPolyFile (parsehandle *ph, SceneHandle scene) |
static errcode | GetClipGroup (parsehandle *ph, SceneHandle scene) |
static errcode | GetClipGroupEnd (parsehandle *ph, SceneHandle scene) |
#define ERROR_READBUF_SIZE 65536 |
Definition at line 27 of file parse.c.
Referenced by PrintSyntaxError().
|
static |
Definition at line 85 of file parse.c.
References PARSEALLOCERR, PARSENOERR, and rt_hash_insert().
Referenced by GetTexAlias(), and GetTexDef().
Definition at line 124 of file parse.c.
Referenced by degvectoradvec().
|
static |
Definition at line 130 of file parse.c.
References degtorad(), apivector::x, apivector::y, and apivector::z.
Referenced by GetTPolyFile().
|
static |
Definition at line 112 of file parse.c.
References HASH_FAIL, and rt_hash_lookup().
Referenced by GetTexAlias(), and GetTexture().
|
static |
|
static |
Definition at line 1167 of file parse.c.
References apicolor::b, apicolor::g, PARSENOERR, apicolor::r, rt_background(), and scenebackcol.
Referenced by GetObject().
|
static |
Definition at line 1181 of file parse.c.
References GetString(), PARSEBADSYNTAX, rt_background_gradient(), rt_background_mode(), RT_BACKGROUND_TEXTURE_SKY_ORTHO_PLANE, RT_BACKGROUND_TEXTURE_SKY_SPHERE, rt_color(), rt_vector(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1364 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_box().
Referenced by GetObject().
|
static |
Definition at line 410 of file parse.c.
References GetString(), PARSEBADSYNTAX, PARSENOERR, rt_camera_dof(), rt_camera_eye_separation(), rt_camera_frustum(), rt_camera_projection(), rt_camera_setup(), RT_PROJECTION_EQUIRECTANGULAR, RT_PROJECTION_FISHEYE, RT_PROJECTION_ORTHOGRAPHIC, RT_PROJECTION_PERSPECTIVE, RT_PROJECTION_PERSPECTIVE_DOF, RT_PROJECTION_STEREO_EQUIRECTANGULAR, stringcmp(), apivector::x, apivector::y, and apivector::z.
Referenced by GetObject().
|
static |
Definition at line 1915 of file parse.c.
References PARSEBADSYNTAX, PARSEEOF, PARSENOERR, rt_clip_fv(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1946 of file parse.c.
References PARSENOERR, and rt_clip_off().
Referenced by GetObject().
|
static |
Definition at line 673 of file parse.c.
References apicolor::b, apicolor::g, GetString(), and apicolor::r.
Referenced by GetFog(), GetLight(), and GetSpotLight().
|
static |
Definition at line 1225 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_cylinder().
Referenced by GetObject().
|
static |
Definition at line 971 of file parse.c.
References apicolor::b, apitexture::col, apicolor::g, GetString(), GetVector(), apicolor::r, rt_directional_light(), rt_texture(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1246 of file parse.c.
References GetString(), GetTexture(), GetVector(), rt_fcylinder(), apivector::x, apivector::y, and apivector::z.
Referenced by GetObject().
|
static |
Definition at line 1133 of file parse.c.
References GetColor(), GetString(), PARSENOERR, RT_FOG_EXP, RT_FOG_EXP2, RT_FOG_LINEAR, rt_fog_mode(), RT_FOG_NONE, rt_fog_parms(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 686 of file parse.c.
References GetInt(), GetString(), PARSEBADSYNTAX, PARSENOERR, and rt_define_teximage_rgb24().
Referenced by GetObject().
|
static |
Definition at line 638 of file parse.c.
References PARSEBADSYNTAX, and PARSENOERR.
Referenced by GetImageDef(), and GetVertexArray().
|
static |
Definition at line 1820 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_landscape().
Referenced by GetObject().
|
static |
Definition at line 996 of file parse.c.
References apicolor::b, apitexture::col, apicolor::g, GetColor(), GetString(), GetVector(), apicolor::r, rt_light(), rt_light_attenuation(), rt_texture(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 513 of file parse.c.
References GetBackGnd(), GetBackGndGradient(), GetBox(), GetCamera(), GetClipGroup(), GetClipGroupEnd(), GetCylinder(), GetDirLight(), GetFCylinder(), GetFog(), GetImageDef(), GetLandScape(), GetLight(), GetPlane(), GetPolyCylinder(), GetRing(), GetShaderMode(), GetSkyLight(), GetSphere(), GetSpotLight(), GetSTri(), GetTexAlias(), GetTexDef(), GetTPolyFile(), GetTri(), GetVCSTri(), GetVertexArray(), GetVol(), PARSEBADSYNTAX, PARSEEOF, PARSENOERR, PrintSyntaxError(), ReadIncludeFile(), and stringcmp().
Referenced by ReadIncludeFile(), and readmodel().
|
static |
Definition at line 1325 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_plane().
Referenced by GetObject().
|
static |
Definition at line 1275 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_polycylinder().
Referenced by GetObject().
|
static |
Definition at line 1380 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_ring().
Referenced by GetObject().
|
static |
Definition at line 320 of file parse.c.
References GetString(), PARSENOERR, rt_outputfile(), rt_resolution(), and rt_verbose().
Referenced by readmodel().
|
static |
Definition at line 334 of file parse.c.
References apicolor::b, apicolor::g, GetString(), PARSEBADSYNTAX, PARSENOERR, apicolor::r, rt_ambient_occlusion(), RT_AO_MAXDIST_UNLIMITED, rt_fog_rendering_mode(), RT_FOG_VMD, rt_rescale_lights(), RT_SHADER_FULL, RT_SHADER_LOW, RT_SHADER_LOWEST, RT_SHADER_MEDIUM, rt_shadermode(), rt_shadow_filtering(), rt_trans_max_surfaces(), rt_trans_mode(), RT_TRANS_ORIG, RT_TRANS_RASTER3D, RT_TRANS_VMD, and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1045 of file parse.c.
References apicolor::b, apicolor::g, GetString(), apicolor::r, rt_ambient_occlusion(), RT_AO_MAXDIST_UNLIMITED, and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1305 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_sphere().
Referenced by GetObject().
|
static |
Definition at line 1074 of file parse.c.
References apicolor::b, apitexture::col, apicolor::g, GetColor(), GetString(), GetVector(), apicolor::r, rt_light_attenuation(), rt_spotlight(), rt_texture(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1423 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_stri().
Referenced by GetObject().
|
static |
Definition at line 213 of file parse.c.
References PARSEBADSYNTAX, PARSENOERR, PrintSyntaxError(), and stringcmp().
Referenced by GetBackGndGradient(), GetBox(), GetCamera(), GetColor(), GetCylinder(), GetDirLight(), GetFCylinder(), GetFog(), GetImageDef(), GetLandScape(), GetLight(), GetPlane(), GetPolyCylinder(), GetRing(), GetScenedefs(), GetShaderMode(), GetSkyLight(), GetSphere(), GetSpotLight(), GetSTri(), GetTexBody(), GetTPolyFile(), GetTri(), GetVCSTri(), GetVertexArray(), and GetVol().
|
static |
Definition at line 777 of file parse.c.
References add_texture(), find_texture(), and PARSENOERR.
Referenced by GetObject().
void* GetTexBody | ( | parsehandle * | ph, |
SceneHandle | scene, | ||
int | modeflag | ||
) |
Definition at line 803 of file parse.c.
References apitexture::ambient, apicolor::b, apitexture::col, apitexture::ctr, apitexture::diffuse, apicolor::g, GetString(), GetVector(), apitexture::imap, apitexture::opacity, PARSEBADSYNTAX, apicolor::r, apitexture::rot, RT_PHONG_METAL, RT_PHONG_PLASTIC, rt_tex_outline(), rt_tex_phong(), rt_tex_transmode(), rt_texture(), RT_TEXTURE_3D_CHECKER, RT_TEXTURE_CONSTANT, RT_TEXTURE_CYLINDRICAL_CHECKER, RT_TEXTURE_CYLINDRICAL_IMAGE, RT_TEXTURE_GRADIENT, RT_TEXTURE_GRIT, RT_TEXTURE_MARBLE, RT_TEXTURE_PLANAR_IMAGE, RT_TEXTURE_SPHERICAL_IMAGE, RT_TEXTURE_VOLUME_IMAGE, RT_TEXTURE_WOOD, RT_TRANS_ORIG, RT_TRANS_RASTER3D, apitexture::scale, apitexture::specular, stringcmp(), apitexture::texturefunc, apitexture::uaxs, apitexture::vaxs, and apitexture::waxs.
Referenced by GetTexDef(), GetTexture(), GetVCSTri(), and GetVertexArray().
|
static |
Definition at line 768 of file parse.c.
References add_texture(), GetTexBody(), and PARSENOERR.
Referenced by GetObject().
|
static |
Definition at line 789 of file parse.c.
References find_texture(), GetTexBody(), PARSENOERR, and stringcmp().
Referenced by GetBox(), GetCylinder(), GetFCylinder(), GetLandScape(), GetPlane(), GetPolyCylinder(), GetRing(), GetSphere(), GetSTri(), GetTPolyFile(), GetTri(), and GetVol().
|
static |
Definition at line 1846 of file parse.c.
References degvectoradvec(), GetString(), GetTexture(), GetVector(), InitRot3d(), PARSEBADSUBFILE, Rotate3d(), rt_tri(), Scale3d(), Trans3d(), apivector::x, apivector::y, and apivector::z.
Referenced by GetObject().
|
static |
Definition at line 1402 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_tri().
Referenced by GetObject().
|
static |
Definition at line 1453 of file parse.c.
References apicolor::b, apicolor::g, GetString(), GetTexBody(), GetVector(), apicolor::r, and rt_vcstri().
Referenced by GetObject().
|
static |
Definition at line 648 of file parse.c.
References PARSEBADSYNTAX, PARSENOERR, apivector::x, apivector::y, and apivector::z.
Referenced by GetBox(), GetCylinder(), GetDirLight(), GetFCylinder(), GetLandScape(), GetLight(), GetPlane(), GetPolyCylinder(), GetRing(), GetSphere(), GetSpotLight(), GetSTri(), GetTexBody(), GetTPolyFile(), GetTri(), GetVCSTri(), and GetVol().
|
static |
Definition at line 1584 of file parse.c.
References GetInt(), GetString(), GetTexBody(), PARSEBADSYNTAX, PARSENOERR, rt_color(), rt_stri(), rt_texture_copy_vcstri(), rt_vcstri(), rt_vector(), and stringcmp().
Referenced by GetObject().
|
static |
Definition at line 1342 of file parse.c.
References GetString(), GetTexture(), GetVector(), and rt_scalarvol().
Referenced by GetObject().
Definition at line 139 of file parse.c.
Referenced by GetTPolyFile().
|
static |
Definition at line 173 of file parse.c.
References ERROR_READBUF_SIZE.
Referenced by GetObject(), and GetString().
|
static |
Definition at line 282 of file parse.c.
References GetObject(), PARSEBADSUBFILE, PARSEEOF, and PARSENOERR.
Referenced by GetObject().
unsigned int readmodel | ( | const char * | modelfile, |
SceneHandle | scene | ||
) |
Definition at line 225 of file parse.c.
References free_tex_table(), GetObject(), GetScenedefs(), PARSEBADFILE, PARSEBADSYNTAX, PARSEEOF, PARSENOERR, reset_tex_table(), RT_TRANS_ORIG, and stringcmp().
Referenced by main().
|
static |
Definition at line 49 of file parse.c.
References apitexture::ambient, apicolor::b, apitexture::col, apitexture::diffuse, apicolor::g, apitexture::opacity, apicolor::r, rt_hash_init(), rt_texture(), apitexture::specular, and apitexture::texturefunc.
Referenced by readmodel().
|
static |
Definition at line 153 of file parse.c.
References apivector::x, apivector::y, and apivector::z.
Referenced by GetTPolyFile().
Definition at line 161 of file parse.c.
References apivector::x, apivector::y, and apivector::z.
Referenced by GetTPolyFile().
|
static |
Definition at line 32 of file parse.c.
Referenced by GetBackGndGradient(), GetCamera(), GetClipGroup(), GetDirLight(), GetFog(), GetLight(), GetObject(), GetShaderMode(), GetSkyLight(), GetSpotLight(), GetString(), GetTexBody(), GetTexture(), GetVertexArray(), and readmodel().
Definition at line 167 of file parse.c.
References apivector::x, apivector::y, and apivector::z.
Referenced by GetTPolyFile().