Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_iso_astar.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "nilorea/n_common.h"
#include "nilorea/n_log.h"
#include "nilorea/n_astar.h"
#include "nilorea/n_dead_reckoning.h"
#include "nilorea/n_iso_engine.h"
#include "nilorea/n_trajectory.h"
+ Include dependency graph for ex_iso_astar.c:

Go to the source code of this file.

Macros

#define M_PI   3.14159265358979323846
 
#define MAP_H   20
 
#define MAP_W   20
 
#define MAX_HEIGHT   5
 
#define NUM_TERRAINS   4
 
#define TILE_WIDTH   64.0f
 

Functions

static void build_test_map (ISO_MAP *map)
 
static ASTAR_PATHdemo_astar (const ISO_MAP *map)
 
static void demo_astar_standalone (void)
 
static void demo_dead_reckoning (const ISO_MAP *map, const ASTAR_PATH *path)
 
static void demo_iso_engine (ISO_MAP *map)
 
int main (int argc, char *argv[])
 
static void print_map_ascii (const ISO_MAP *map, const ASTAR_PATH *path)
 

Variables

static const char * terrain_names [] = {"Grass", "Sand", "Water", "Rock"}
 

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846
Examples
ex_gui_isometric.c, and ex_trajectory.c.

Definition at line 57 of file ex_iso_astar.c.

◆ MAP_H

#define MAP_H   20

Definition at line 62 of file ex_iso_astar.c.

◆ MAP_W

#define MAP_W   20

Definition at line 61 of file ex_iso_astar.c.

◆ MAX_HEIGHT

#define MAX_HEIGHT   5

Definition at line 64 of file ex_iso_astar.c.

◆ NUM_TERRAINS

#define NUM_TERRAINS   4

Definition at line 63 of file ex_iso_astar.c.

◆ TILE_WIDTH

#define TILE_WIDTH   64.0f
Examples
ex_iso_astar.c.

Definition at line 65 of file ex_iso_astar.c.

Function Documentation

◆ build_test_map()

static void build_test_map ( ISO_MAP map)
static
Examples
ex_iso_astar.c.

Definition at line 118 of file ex_iso_astar.c.

References BLCK, ISO_MAP::height, iso_map_set_ability(), iso_map_set_height(), iso_map_set_terrain(), MAX_HEIGHT, WALK, and ISO_MAP::width.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ demo_astar()

◆ demo_astar_standalone()

static void demo_astar_standalone ( void  )
static

◆ demo_dead_reckoning()

◆ demo_iso_engine()

◆ main()

◆ print_map_ascii()

static void print_map_ascii ( const ISO_MAP map,
const ASTAR_PATH path 
)
static
Examples
ex_iso_astar.c.

Definition at line 70 of file ex_iso_astar.c.

References BLCK, ISO_MAP::height, iso_map_get_ability(), iso_map_get_height(), iso_map_get_terrain(), ASTAR_PATH::length, MAP_H, MAP_W, ASTAR_PATH::nodes, ISO_MAP::width, ASTAR_NODE::x, and ASTAR_NODE::y.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ terrain_names

const char* terrain_names[] = {"Grass", "Sand", "Water", "Rock"}
static

Definition at line 67 of file ex_iso_astar.c.