home *** CD-ROM | disk | FTP | other *** search
/ Toolkit for DOOM / DOOMTOOL.ISO / editors / dme301.zip / SOURCE.ZIP / DME.H < prev    next >
Text File  |  1994-07-25  |  9KB  |  262 lines

  1. #define BETA 0 /* 1 if beta version */
  2. #define LL_MAX 16384
  3.  
  4. #define mouse_x (xoffset + (((mousex - midx) * scalers[scale]) >> 1))
  5. #define mouse_y (yoffset + (((midy - mousey) * scalers[scale]) >> 1))
  6. #define adjustx(x) (midx + (((x - xoffset) / scalers[scale]) << 1))
  7. #define adjusty(y) (midy + (((yoffset - y) / scalers[scale]) << 1))
  8.  
  9. typedef unsigned char uchar;
  10. typedef unsigned int uint;
  11. typedef unsigned long ulong;
  12.  
  13. /* main.c */
  14.  
  15. int main(int argc, char *argv[] );
  16. int general_setup(int argc, char *argv[], char *gname);
  17. void main_loop(void);
  18. void set_flags_mask(void);
  19. void gen_help(void);
  20. void clear_map1(void);
  21. void clear_map(void);
  22. int edit_branch(void);
  23. int map_keys(int key);
  24. void draw_vertex(int num, int color, int size);
  25. int new_point_size(int size);
  26. int re_x(void);
  27. int re_y(void);
  28. int add_vertex(void); /* add vertex for line use */
  29. void del_vertex(int num); /* delete vertex and reroute lines to it */
  30. void flip_line(int num);
  31. int add_sidedef(int num);
  32. int between(int x1, int x2, int x3); /* determine if x1 is between x2 & x3 */
  33. void del_line(int num);
  34. void del_sidedef(int num);
  35. int draw_time_graph(int y);
  36. void time_graph(ulong num, ulong max, int x, int y);
  37. void reset_time_graph(ulong num, ulong max, int x, int y);
  38. void change_maps(int mode);
  39. void mouse_on(void);
  40. void mouse_redraw(void);
  41. void mouse_off(void);
  42. int mouse_check(void);
  43. void next_button(void);
  44. void reconfig_mouse(void);
  45. void print_button(int button, char *name);
  46. void adjust_limit(int x, int y, int *xmin, int *ymin, int *xmax, int *ymax);
  47. int rand_color(void);
  48. int stagger_color(void);
  49. int wall_color(int num); /* return wall color for linedef <num> */
  50. void draw_map(void);
  51. void print_roundoff(void);
  52. void draw_line(int number, int style); /* draw linedef <number> */
  53. void draw_line2(int x1, int y1, int x2, int y2);
  54. void draw_box(int xx1, int yy1, int xx2, int yy2);
  55. void draw_point(int xpos, int ypos, int pmaxx, int pmaxy);
  56. int draw_thing(int xpos, int ypos, int type, int angle, char *buffer);
  57. void center_map(void); /* center the map on the screen */
  58. void text(int xx, int yy, char *msg);
  59. void toptext(char *msg);
  60. void toptext2(char *msg, char *msg2);
  61. void window_text1(char far *msg, int center, int xplus, int yplus);
  62. void window_text(char far *msg, int center);
  63. void text_to_window(int column, int row, char huge *msg, int max_len);
  64. void draw_buttons(void);
  65. void set_window(int columns, int rows, int center);
  66. void set_window1(int xsize, int ysize, int center);
  67. void set_window_bars(void);
  68. void set_cancel_bar(void);
  69. void set_button_statuses(int num);
  70. int window_check(void);
  71. void await_release(void); /* wait until mouse buttons released */
  72. void await_release_on(void);
  73. void draw_cursor(int x, int y, int color);
  74. void fatal_error(char *msg, ...); /* terminate with error */
  75. void error(char *errmsg, ...);
  76. void farmem_error(char *msg, ulong size);
  77. void deadend_error(void);
  78. void rd_error(void);
  79. void wr_error(void);
  80. void dir_error(void);
  81. void erase_text(int x, int y, int xsize);
  82. int cursored_get(int x, int y);
  83. int get_number(int x, int y, int old_num, int max, int min);
  84. int getkey(void); /* get normal or extended keypress */
  85. int get8(char *s, char *deflt, int column, int row);
  86. void fix_wadname(char *name);
  87. int get_wadname(char *mode1, char *mode2);
  88. int file_picklist(char *mask);
  89. void sync_time(void);
  90. int wait(int delay); /* attemp to time sync animation */
  91. void open_prog_file(char *name, char *mode);
  92. void init_graphics(int gmode, char *gname);
  93. void init_mouse(void);
  94.  
  95. /* debug.c */
  96.  
  97. void block_test(void);
  98. int seg_test(void);
  99. int node_test(void);
  100. int node_test2(void);
  101. void draw_node(int node, int *ln, int *rn, int *lss, int *rss, int recurse);
  102. void draw_ssec(int ssec);
  103. void draw_seg_vertex(int num, int color);
  104. void color2wall(int line, int col1, int col2);
  105. void test_draw_sector(int line, int sector);
  106.  
  107. /* things.c */
  108.  
  109. int thing_edit(void);
  110. void change_thing(int thing);
  111. int picklist(int num);
  112. void reprint_line(int num, int yy, int max);
  113. int draw_thing2(int xpos, int ypos, int num);
  114. int print_typedesc(int num);
  115. void print_angle(int num);
  116. void box_local_thing(int num);
  117. void box_thing(int x1, int y1, uint offset);
  118. int thing_drag(void);
  119. void del_thing(int num);
  120. void draw_item(int num, int x, int y, char *save);
  121. void plot_colored_point(int x, int y, int color);
  122.  
  123. /* edits.c */
  124.  
  125. int vertex_edit(void);
  126. int vertex_drag(void);
  127. int line_edit(void);
  128. int line_drag1(void);
  129. int line_drag2(void);
  130. void line_and_seg(int num);
  131. void change_line(int line_num, int cur_side);
  132. int select_wall_textr(char far *farname, int x, int y);
  133. int sector_edit(void);
  134. void redraw_sector(int num);
  135. int sector_light(int num);
  136. int round8(int num);
  137. void make_door(int sector);
  138. void blend_sector(int sector);
  139. int change_adjust(int button, int value);
  140. void change_sector(int sector);
  141. void del_sector(int num);
  142. int make_sector(int x, int y, int line, int side, int sector);
  143. void plot_colored_point(int x, int y, int color);
  144. void restore_point(int num);
  145.  
  146. /* linemath.c */
  147.  
  148. int calc_line_cross(int *y, int x1, int y1, int v2, int v3, int v4, uint angle);
  149. int line_visible(int num);
  150. int line_in_rect(int x1, int y1, int x2, int y2, int xmin, int ymin, int xmax, int ymax);
  151. int xclip(int x, int x1, int y1, int x2, int y2);
  152. int yclip(int y, int x1, int y1, int x2, int y2);
  153. int line_dist(int x1, int y1, int x2, int y2);
  154. int line_dist2(int x, int y, int x1, int y1, int x2, int y2);
  155. uint calc_angle(int x1, int y1, int x2, int y2);
  156. int find_next_line(int *vertex, uint *angle, int *line, int side);
  157. int inside_sector(int x, int y);
  158. int line_least_angle(int line1, int line2, uint angle);
  159. int adjusted_angle(uint angle, int x1, int y1, int x2, int y2);
  160. int line_side(int line, int x, int y);
  161. int match_line(int vertex, int vertex2);
  162. int outside_detect(int line1, int side1);
  163. int inside_poly(int x, int y, int *side, int test);
  164. int downward_line(int vertex, int *side, int test);
  165.  
  166. /* advanced.c */
  167.  
  168. void misc_options(void);
  169. void check_lines(void);
  170. long summation(uint num);
  171. void fixup_lines(void);
  172. int wall_check(int line, int side);
  173. void generate_sectors(void);
  174. void fixup_sectors(void);
  175. void generate_nodes(void);
  176. void draw_side(int x1, int y1, int x2, int y2);
  177. void fix_sidedefs(int line);
  178. void fix_sidedef(int line, int side);
  179. void generate_blockmap(void);
  180. int blockmap_add(int num);
  181. void plot_list(int size, int far *list);
  182. void calc_map_data(void);
  183. int test_map(void);
  184. int test_map2(int left, int right, int cur, int far *left_list,
  185.     int far *right_list, int far *cur_list);
  186. int showlist(char *name, int size, char far *list);
  187.  
  188. /* textures.c */
  189.  
  190. void load_textures(void);
  191. int draw_wall_texture(int xpos, int ypos, int xsize, int ysize,
  192.     int xshift, int yshift, char *name);
  193. void wall_textr_pick(char *name);
  194. int free_patch(void);
  195. void box_textr(int x1, int y1, int color);
  196. void fc_textr_pick(char *name);
  197.  
  198. /* memory.c */
  199.  
  200. void *get_mem(uint size, char *name);
  201. void *resize_mem(void *old, uint size, char *name);
  202. void free_mem(void *ptr, char *name);
  203. void huge *get_farmem(ulong size, char *name);
  204. void huge *resize_farmem(void huge *old, ulong size, char *name);
  205. void free_farmem(void huge *ptr, char *name);
  206. void sizeof_mem_block(void *ptr, char *name);
  207. void sizeof_farmem_block(void far *ptr, char *name);
  208. void check_mem(void);
  209. void check_farmem(void);
  210. void mem_log(char *msg, ...);
  211. void statistics(void);
  212. void heaperr(char *func, char *name);
  213. void farheaperr(char *func, char *name);
  214. void fatal_mem_error(char *name, uint size);
  215. void fatal_farmem_error(char *name, ulong size);
  216. void check_if_used(void *ptr, char *name);
  217. void check_if_used_far(void huge *ptr, char *name);
  218.  
  219. /* wad.c */
  220.  
  221. int open_wad(char *name, char *fmode);
  222. int open_wad_seek(char *fmode, char *entry);
  223. int open_iwad_seek(char *fmode, char *entry);
  224. void open_wad_seek_map(char *fmode, int which);
  225. int wad_seek(char *entry);
  226. void load_pwad_startup(void);
  227. void load_wad_map(int which); /* load map info from wad file */
  228. void make_new_wad(void);
  229. int remake_wad(int add);
  230. void find_doom_wad(void);
  231. int open_wad_seekto(char *fmode, char *entry);
  232. int check_commercial(void);
  233. int far_read(char huge *farptr, long len); /* read to a far location */
  234. long fread_long(void);
  235. int fwrite_long(long integer);
  236. int cmp_entry(char *look_for, char far *entry); /* compare wad entry name */
  237. int verify_wad(void); /* make sure this is a wad file */
  238.  
  239. /* reg.c */
  240.  
  241. void version_info(void);
  242. void save_wad_map(int get_name); /* save map info to a pwad file */
  243. int write_wad_entry(char *name, char huge *farptr, long len, char far *entry);
  244. int far_write(char huge *farptr, long len); /* write from a far location */
  245. void sw_notice(void);
  246. void final_screen(void);
  247.  
  248. /* template.c */
  249.  
  250. void make_lists(void);
  251. void mark_vertex(int num);
  252. void mark_line(int num);
  253. int boxmark(int mode);
  254. int mthing_edit(void);
  255. int mvertex_edit(void);
  256. int mline_edit(void);
  257. int msector_edit(void);
  258. void plot_marked(int color);
  259. void move_marked(void);
  260. void unmark_all(void);
  261. void sort_marked(int far *list);
  262.