Shadowrun: Awakened 29 September 2011 - Build 871
Defines | Functions
parse.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PARSEALLOCERR   16
#define PARSEBADFILE   1
#define PARSEBADSUBFILE   2
#define PARSEBADSYNTAX   4
#define PARSEEOF   8
#define PARSENOERR   0

Functions

unsigned int readmodel (char *, SceneHandle)

Define Documentation

#define PARSEALLOCERR   16

Definition at line 69 of file parse.h.

Referenced by add_texture().

#define PARSEBADFILE   1

Definition at line 65 of file parse.h.

Referenced by readmodel().

#define PARSEBADSUBFILE   2

Definition at line 66 of file parse.h.

Referenced by GetTPolyFile().

#define PARSEBADSYNTAX   4

Definition at line 67 of file parse.h.

Referenced by GetObject(), and GetString().

#define PARSEEOF   8

Definition at line 68 of file parse.h.

Referenced by GetObject(), and readmodel().

#define PARSENOERR   0

Function Documentation

unsigned int readmodel ( char *  ,
SceneHandle   
)

Definition at line 205 of file parse.cpp.

References color::b, color::g, GetObject(), GetScenedefs(), numobjectsparsed, PARSEBADFILE, PARSEEOF, PARSENOERR, color::r, reset_tex_table(), and rt_background().

Referenced by main_init_parts().

                                                            {
  FILE * dfile;
  errcode rc;
 
  reset_tex_table(); 
  dfile=NULL;

  dfile=fopen(modelfile,"r");
  if (dfile==NULL) {
    return PARSEBADFILE;
  }

  rc = GetScenedefs(dfile, scene); 
  if (rc != PARSENOERR)
    return rc;

  scenebackcol.r = 0.0; /* default background is black */
  scenebackcol.g = 0.0;
  scenebackcol.b = 0.0;

  numobjectsparsed=0;
  while ((rc = GetObject(dfile, scene)) == PARSENOERR) {
    numobjectsparsed++;
  } 
  fclose(dfile);

  if (rc == PARSEEOF)
    rc = PARSENOERR;

  rt_background(scene, scenebackcol);

  return rc;
}

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net