Main Page | Alphabetical List | Class List | File List | Class Members | File Members

editor/editor.c File Reference

#include "editor.h"

Go to the source code of this file.

Defines

#define TILEFIELD_TOP   12

Functions

void initialize_editor (void)
void initialize_map (editor_map *M)
void cleanup_map (editor_map *M)
void set_level_size (int level, int width, int height)
void set_num_maps (int n)
void set_current_map (int n)
void enter_edit_state (void)
void clear_map (void)
void default_map (void)
void draw_current_map (void)
void draw_map_field (void)
void draw_map_tile (int x, int y)
void xor_tile (int x, int y)
void xor_selected_range (void)
void draw_editor_brush (void)
void draw_level_number (void)
void place_tile (int x, int y, int brush)
void editing_state (int key)
void move_cursor (int dx, int dy, int shifted)

Variables

editor_mapcurrent_map = NULL
editor_mapmaps = NULL
int num_maps = 0
int current_map_num = 0
int select_x = 0 select_y=0
int cursor_x = 0 cursor_y=0
int edit_brush = 1
int scroll_x = 0
int scroll_y = 0


Define Documentation

#define TILEFIELD_TOP   12
 

Definition at line 116 of file editor.c.

Referenced by draw_map_field(), draw_map_tile(), and xor_tile().


Function Documentation

void cleanup_map editor_map M  ) 
 

Definition at line 27 of file editor.c.

References editor_map::t.

Referenced by map_delete(), and set_num_maps().

void clear_map void   ) 
 

Definition at line 93 of file editor.c.

References current_map, FIELD_HEIGHT, FIELD_WIDTH, engine_map::t, and TILE_EMPTY.

Referenced by default_map().

void default_map void   ) 
 

Definition at line 103 of file editor.c.

References engine_map::author, clear_map(), engine_map::congrat, current_map, engine_map::gamerules, engine_map::hint, engine_map::name, engine_map::t, TILE_DIAMOND, and TILE_KYE.

Referenced by file_new(), initialize(), and map_insert().

void draw_current_map void   ) 
 

Definition at line 118 of file editor.c.

References clear_screen(), draw_editor_brush(), draw_level_number(), draw_line(), draw_map_field(), and draw_menu_labels().

void draw_editor_brush void   ) 
 

Definition at line 209 of file editor.c.

References draw_sprite(), edit_brush, and tile_sprites.

Referenced by draw_current_map(), and editing_state().

void draw_level_number void   ) 
 

Definition at line 215 of file editor.c.

References clear_rect(), current_map_num, draw_string(), and num_maps.

Referenced by draw_current_map(), and set_current_map().

void draw_map_field void   ) 
 

Definition at line 133 of file editor.c.

References clear_line_range(), draw_line(), draw_map_tile(), FIELD_HEIGHT, FIELD_WIDTH, scroll_x, scroll_y, TILEFIELD_TOP, VIEWPORT_HEIGHT, and VIEWPORT_WIDTH.

Referenced by draw_current_map(), move_cursor(), and undraw_open_menus().

void draw_map_tile int  x,
int  y
 

Definition at line 157 of file editor.c.

References black_square, current_map, cursor_x, cursor_y, draw_sprite(), draw_sprite_xor(), scroll_x, scroll_y, select_x, select_y, engine_map::t, tile_sprites, TILEFIELD_TOP, VIEWPORT_HEIGHT, and VIEWPORT_WIDTH.

Referenced by advance(), clear_effects(), detonate(), draw_map_field(), kye_move(), move_monster(), move_pusher(), move_slider(), place_tile(), shove(), and try_rotate().

void editing_state int  key  ) 
 

Definition at line 249 of file editor.c.

References current_map, cursor_x, cursor_y, draw_current_map(), draw_editor_brush(), edit_brush, edit_copy(), edit_cut(), edit_paste(), edit_select_all(), enter_menu_state(), enter_palette_state(), file_new(), file_open(), file_save(), map_move_down(), map_move_up(), map_next(), map_previous(), map_properties(), move_cursor(), place_tile(), engine_map::t, TILE_WALL_5, transform_mirror_horizontal(), transform_mirror_vertical(), transform_rotate_180(), and transform_smooth().

Referenced by enter_edit_state().

void enter_edit_state void   ) 
 

Definition at line 86 of file editor.c.

References draw_current_map(), editing_state(), and input_state.

Referenced by initialize(), menu_state(), properties_state(), and resize_state().

void initialize_editor void   ) 
 

Definition at line 12 of file editor.c.

References set_current_map(), and set_num_maps().

Referenced by initialize().

void initialize_map editor_map M  ) 
 

Definition at line 19 of file editor.c.

Referenced by set_num_maps().

void move_cursor int  dx,
int  dy,
int  shifted
 

Definition at line 303 of file editor.c.

References cursor_x, cursor_y, draw_map_field(), FIELD_HEIGHT, FIELD_WIDTH, SCROLL_INCR_X, SCROLL_INCR_Y, scroll_x, scroll_y, select_x, select_y, VIEWPORT_HEIGHT, VIEWPORT_WIDTH, and xor_selected_range().

Referenced by adjust_map_size(), and editing_state().

void place_tile int  x,
int  y,
int  brush
 

Definition at line 225 of file editor.c.

References current_map, draw_map_tile(), FIELD_HEIGHT, FIELD_WIDTH, engine_map::t, TILE_EMPTY, and TILE_KYE.

Referenced by editing_state().

void set_current_map int  n  ) 
 

Definition at line 77 of file editor.c.

References current_map, current_map_num, draw_level_number(), and maps.

Referenced by file_new(), initialize_editor(), load_dckye_lib(), load_skye_lib_r1(), load_skye_lib_r2(), map_import_level(), map_insert(), map_move_down(), map_move_up(), map_next(), map_previous(), and set_num_maps().

void set_level_size int  level,
int  width,
int  height
 

Definition at line 34 of file editor.c.

References editor_map::height, map_square, maps, editor_map::t, and editor_map::width.

Referenced by adjust_map_size(), load_skye_level(), load_skye_level_r1(), load_skye_level_r2(), and set_num_maps().

void set_num_maps int  n  ) 
 

Definition at line 59 of file editor.c.

References cleanup_map(), current_map_num, initialize_map(), maps, num_maps, set_current_map(), and set_level_size().

Referenced by cleanup(), file_new(), initialize_editor(), load_dckye_lib(), load_skye_lib_r1(), load_skye_lib_r2(), map_delete(), and map_insert().

void xor_selected_range void   ) 
 

Definition at line 182 of file editor.c.

References cursor_x, cursor_y, get_selected_region(), scroll_x, scroll_y, select_x, select_y, VIEWPORT_HEIGHT, VIEWPORT_WIDTH, and xor_tile().

Referenced by move_cursor().

void xor_tile int  x,
int  y
 

Definition at line 174 of file editor.c.

References black_square, draw_sprite_xor(), scroll_x, scroll_y, and TILEFIELD_TOP.

Referenced by xor_selected_range().


Variable Documentation

editor_map* current_map = NULL
 

Definition at line 3 of file editor.c.

int current_map_num = 0
 

Definition at line 6 of file editor.c.

Referenced by adjust_map_size(), draw_level_number(), map_delete(), map_import_level(), map_insert(), map_move_down(), map_move_up(), map_next(), map_previous(), set_current_map(), and set_num_maps().

int cursor_x = 0 cursor_y=0
 

Definition at line 8 of file editor.c.

Referenced by adjust_map_size(), draw_map_tile(), edit_paste(), edit_select_all(), editing_state(), get_selected_region(), move_cursor(), and xor_selected_range().

int edit_brush = 1
 

Definition at line 9 of file editor.c.

Referenced by draw_editor_brush(), and editing_state().

editor_map* maps = NULL
 

Definition at line 4 of file editor.c.

Referenced by cleanup(), load_dckye_level(), load_skye_level_r1(), load_skye_level_r2(), map_delete(), map_insert(), map_move_down(), map_move_up(), set_current_map(), set_level_size(), set_num_maps(), and write_skye_level_r2().

int num_maps = 0
 

Definition at line 5 of file editor.c.

Referenced by draw_level_number(), load_dckye_lib(), map_delete(), map_insert(), map_move_down(), map_next(), save_skyelib_r2(), and set_num_maps().

int scroll_x = 0
 

Definition at line 129 of file editor.c.

int scroll_y = 0
 

Definition at line 130 of file editor.c.

Referenced by _drawtile(), center_viewport(), clip_scroll_pos(), draw_current_map(), draw_map_field(), draw_map_tile(), move_cursor(), scroll_viewport(), xor_selected_range(), and xor_tile().

int select_x = 0 select_y=0
 

Definition at line 7 of file editor.c.

Referenced by draw_map_tile(), edit_select_all(), get_selected_region(), move_cursor(), and xor_selected_range().


Generated on Thu Apr 22 14:06:33 2004 for SKye by doxygen 1.3.6