#ifndef __lighting_h__ #define __lighting_h__ #include #include "types.h" extern BITMAP* buffer; /* lighting.c */ extern void combine_maps(BITMAP* light, BITMAP* vis, BITMAP* img, BITMAP* buf); /* imgutil.c */ extern BITMAP** load_lighting_maps(void); /* config.c (ugh) */ extern int depth; extern int width; extern int height; extern int use_overbright; extern int use_shadow; /* heap.c */ #define process_heap(h, f) _process_heap((h), ((void(*)(void*))(f))) #define create_heap(h, p, s, c, d) _create_heap((h), (p), (s), \ ((void*(*)(void))(c)), ((void(*)(void*))(d))) #define PROC_VA(f) ((void(*)(void*, va_list))(f)) extern void* new_from_heap(Heap* heap); extern void delete_from_heap(Heap* heap, void* data); extern void _process_heap(Heap* heap, void (*proc)(void*)); extern void process_heap_va(Heap* heap, void (*proc)(void*, va_list), ...); extern void empty_heap(Heap* heap); extern void _create_heap(Heap* heap, int capacity, int step, void*(*create)(void), void(*destroy)(void*)); extern void destroy_heap(Heap* heap); /* vwedge.c */ extern VWedge* create_vwedge(); extern void destroy_vwedge(VWedge* wedge); extern void process_vwedge_vis(VWedge* wedge); extern void draw_vwedge(BITMAP* bmp, VWedge* wedge, int color); /* vline.c */ extern VLine* create_vline(void); extern void destroy_vline(VLine* vline); extern void find_vlines(Heap* lines, Heap* world); extern void draw_vlines(BITMAP* bmp, int x, int y, Heap* lines, int color); extern void add_vertex_to_vline(VLine* vline, int x, int y); /* polygon.c */ extern Polygon* create_polygon(void); extern void destroy_polygon(Polygon* poly); /* math.c */ extern int dist(int x1, int y1, int x2, int y2); extern int sqr_dist(int x1, int y1, int x2, int y2); extern int middle_point(int x1, int y1, int x2, int y2, int x3, int y3); extern int intersection(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int* _x, int* _y, int c); extern int same_side(int x1, int y1, int x2, int y2, int xa, int ya, int xb, int yb); extern int collinear(int x1, int y1, int x2, int y2, int x3, int y3); #endif