model_audio.c File Reference

#include <math.h>
#include "gui.h"
#include "dijkstra.h"
#include "stage_internal.h"


Defines

#define AUDIO_DEBUG1()   { printf(__VA_ARGS__); fflush(stdout);}
#define AUDIO_DEBUG2()   {}
#define AUDIO_DEBUG_ALLOC()   {}
#define AUDIO_FIG_DESTROY_LATER
#define AUDIO_FIG_DESTROY_LIFEMS   (100)
#define AUDIO_HEARING_RANGE   (INFINITY)
#define AUDIO_USE_CACHE
#define GMC(X, Y)   (mapdata[(X)+(Y)*w])
#define GX2P(X)   ((int) ( ( (X) + geom.size.x/2.0 ) / mres ) )
#define GY2P(Y)   ((int) ( ( (Y) + geom.size.y/2.0 ) / mres ) )
#define PX2G(X)   ((X)*mres-geom.size.x/2.0)
#define PY2G(Y)   ((Y)*mres-geom.size.y/2.0)

Functions

int audio_checkvisible (stg_model_t *mod, double x1, double y1, double x2, double y2)
void audio_create_visibilitygraph (stg_model_t *mod)
void audio_deliver_msgs (gpointer key, gpointer data, gpointer user)
void audio_draw_path (gpointer data, gpointer user)
void audio_find_dist_multi (stg_model_t *mod, stg_pose_t *srcpose, int ndest, GArray *devpose, double *dists, double *angles)
void audio_findpoints (gpointer key, gpointer data, gpointer user)
void audio_free_path (gpointer data, gpointer user)
int audio_init (stg_model_t *mod)
void audio_load (stg_model_t *mod)
void audio_path_destroy (gpointer data)
gboolean audio_pointpair_equal (gconstpointer v1, gconstpointer v2)
guint audio_pointpair_hash (gconstpointer v)
void audio_pointpair_key_destroy (gpointer data)
int audio_raytrace_match (stg_model_t *mod, stg_model_t *hitmod)
int audio_render_cfg (stg_model_t *mod, void *userp)
int audio_render_data (stg_model_t *mod, void *userp)
void audio_render_line (int8_t *buf, int w, int h, int x1, int y1, int x2, int y2, int8_t val)
void audio_render_line2 (int8_t *buf, int w, int h, int x1, int y1, int x2, int y2, int8_t val)
int audio_shutdown (stg_model_t *mod)
int audio_startup (stg_model_t *mod)
stg_pose_taudio_stg_pose_dup (const stg_pose_t *d)
gboolean audio_stg_pose_t_equal (const stg_pose_t p1, const stg_pose_t p2)
int audio_unrender_cfg (stg_model_t *mod, void *userp)
int audio_unrender_data (stg_model_t *mod, void *userp)
int audio_update (stg_model_t *mod)

Variables

GHashTable * dijkstra_adjacency
GHashTable * dijkstra_d
GHashTable * dijkstra_previous

Define Documentation

 
#define AUDIO_DEBUG1  )     { printf(__VA_ARGS__); fflush(stdout);}
 

 
#define AUDIO_DEBUG2  )     {}
 

 
#define AUDIO_DEBUG_ALLOC  )     {}
 

#define AUDIO_FIG_DESTROY_LATER
 

#define AUDIO_FIG_DESTROY_LIFEMS   (100)
 

#define AUDIO_HEARING_RANGE   (INFINITY)
 

#define AUDIO_USE_CACHE
 

#define GMC X,
 )     (mapdata[(X)+(Y)*w])
 

#define GX2P  )     ((int) ( ( (X) + geom.size.x/2.0 ) / mres ) )
 

#define GY2P  )     ((int) ( ( (Y) + geom.size.y/2.0 ) / mres ) )
 

#define PX2G  )     ((X)*mres-geom.size.x/2.0)
 

#define PY2G  )     ((Y)*mres-geom.size.y/2.0)
 


Function Documentation

int audio_checkvisible stg_model_t mod,
double  x1,
double  y1,
double  x2,
double  y2
 

void audio_create_visibilitygraph stg_model_t mod  ) 
 

void audio_deliver_msgs gpointer  key,
gpointer  data,
gpointer  user
 

void audio_draw_path gpointer  data,
gpointer  user
 

void audio_find_dist_multi stg_model_t mod,
stg_pose_t srcpose,
int  ndest,
GArray *  devpose,
double *  dists,
double *  angles
 

Loop over all points and fill the information. If the points are directly visible and don't need dijkstra then put them at the end of list.

if directly visible just calculate the distance

if not directly visible use dijkstra

void audio_findpoints gpointer  key,
gpointer  data,
gpointer  user
 

void audio_free_path gpointer  data,
gpointer  user
 

int audio_init stg_model_t mod  ) 
 

void audio_load stg_model_t mod  ) 
 

void audio_path_destroy gpointer  data  ) 
 

gboolean audio_pointpair_equal gconstpointer  v1,
gconstpointer  v2
 

guint audio_pointpair_hash gconstpointer  v  ) 
 

void audio_pointpair_key_destroy gpointer  data  ) 
 

int audio_raytrace_match stg_model_t mod,
stg_model_t hitmod
 

int audio_render_cfg stg_model_t mod,
void *  userp
 

int audio_render_data stg_model_t mod,
void *  userp
 

void audio_render_line int8_t *  buf,
int  w,
int  h,
int  x1,
int  y1,
int  x2,
int  y2,
int8_t  val
 

void audio_render_line2 int8_t *  buf,
int  w,
int  h,
int  x1,
int  y1,
int  x2,
int  y2,
int8_t  val
 

int audio_shutdown stg_model_t mod  ) 
 

int audio_startup stg_model_t mod  ) 
 

stg_pose_t* audio_stg_pose_dup const stg_pose_t d  ) 
 

gboolean audio_stg_pose_t_equal const stg_pose_t  p1,
const stg_pose_t  p2
 

int audio_unrender_cfg stg_model_t mod,
void *  userp
 

int audio_unrender_data stg_model_t mod,
void *  userp
 

int audio_update stg_model_t mod  ) 
 


Variable Documentation

GHashTable* dijkstra_adjacency
 

GHashTable* dijkstra_d
 

GHashTable* dijkstra_previous
 


Generated on Thu Dec 13 13:55:22 2007 for Stage by  doxygen 1.4.6