Begin documenting qflight.

This commit is contained in:
Bill Currie 2012-12-26 14:39:05 +09:00
parent cc92466725
commit 5720392f37
6 changed files with 70 additions and 3 deletions

View file

@ -29,6 +29,11 @@
#ifndef __entities_h
#define __entities_h
/** \defgroup qflight_entities Light entity data.
\ingroup qflight
*/
//@{
#define DEFAULTLIGHTLEVEL 300
#define DEFAULTFALLOFF 1.0f
@ -98,4 +103,6 @@ void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec);
void LoadEntities (void);
void WriteEntitiesToString (void);
//@}
#endif// __entities_h

View file

@ -29,8 +29,16 @@
#ifndef __light_h
#define __light_h
/** \defgroup qflight QuakeForge light compiler.
*/
#include "QF/bspfile.h"
/** \defgroup qflight_general General functions
\ingroup qflight
*/
//@{
#define ON_EPSILON 0.1
#define MAXLIGHTS 1024
#define LIGHTDISTBIAS 65536.0
@ -114,4 +122,6 @@ extern vec3_t *surfaceorgs;
extern struct entity_s **novislights;
extern int num_novislights;
//@}
#endif// __light_h

View file

@ -27,8 +27,16 @@
Boston, MA 02111-1307, USA
*/
/** \defgroup qflight_noise Light noise functions.
\ingroup qflight
*/
//@{
float noise3d (vec3_t v, int num);
float noiseXYZ (float x, float y, float z, int num);
float noise_scaled (vec3_t v, float s, int num);
float noise_perlin (vec3_t v, float p, int num);
void snap_vector (vec3_t v_old, vec3_t v_new, float scale);
//@}

View file

@ -30,6 +30,11 @@
#include "QF/qtypes.h"
/** \defgroup qflight_options Light command line options.
\ingroup qflight
*/
//@{
typedef struct {
int verbosity; // 0=silent
int threads;
@ -53,4 +58,6 @@ extern const char *this_program;
int DecodeArgs (int argc, char **argv);
void usage (int status);
//@}
#endif//__options_h

View file

@ -27,12 +27,25 @@
Boston, MA 02111-1307, USA
*/
#ifndef __properties_h
#define __properties_h
/** \defgroup qflight_properties Lighting properties
\ingroup qflight
*/
//@{
struct plitem_s;
float parse_float (const char *str);
void parse_color (const char *str, vec3_t color);
float parse_light (const char *str, vec3_t color);
int parse_attenuation (const char *arg);
int parse_noise (const char *arg);
struct plitem_s;
void set_properties (entity_t *ent, struct plitem_s *dict);
void LoadProperties (const char *filename);
//@}
#endif//__properties_h

View file

@ -29,14 +29,34 @@
#ifndef __threads_h
#define __threads_h
/** \defgroup qflight_threads Light thread handling.
\ingroup qflight
*/
//@{
#if defined (HAVE_PTHREAD_H) && defined (HAVE_PTHREAD)
#include <pthread.h>
extern pthread_mutex_t *my_mutex;
#define LOCK do { if (options.threads > 1) pthread_mutex_lock (my_mutex); } while (0);
#define UNLOCK do { if (options.threads > 1) pthread_mutex_unlock (my_mutex); } while (0);
#define LOCK \
do { \
if (options.threads > 1) \
pthread_mutex_lock (my_mutex); \
} while (0)
#define UNLOCK \
do { \
if (options.threads > 1) \
pthread_mutex_unlock (my_mutex); \
} while (0)
#else
#define LOCK
#define UNLOCK
#endif
extern int numthreads;
@ -46,4 +66,6 @@ typedef void *(threadfunc_t) (void *);
void InitThreads (void);
void RunThreadsOn (threadfunc_t func);
//@}
#endif// __threads_h