#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <graphapp.h>
Go to the source code of this file.
Data Structures | |
struct | tile |
struct | map |
struct | prop_strings |
struct | minmax |
struct | tprops |
struct | MapEditorMainClass |
struct | TileWinClass |
struct | NewMapWinClass |
struct | TilePropClass |
struct | HelpWinClass |
struct | MiniMapWinClass |
Defines | |
#define | TILESIZE 32 |
#define | TILEDEPTH 8 |
#define | TWINWIDTH 250 |
#define | MAXMAPHEIGHT 150 |
#define | MAXMAPWIDTH 180 |
#define | MAINWINWIDTH 750 |
#define | MAINWINHEIGHT 550 |
#define | MAXHITPOINTS 50 |
#define | MAXDAMAGE 50 |
#define | BACKGROUND_BEGIN 0 |
#define | BACKGROUND_END 176 |
#define | ENEMY_BEGIN 177 |
#define | ENEMY_END 192 |
#define | KEY_BEGIN 193 |
#define | KEY_END 193 |
#define | TELEPORTER_BEGIN 194 |
#define | TELEPORTER_END 194 |
#define | EXIT_BEGIN 195 |
#define | EXIT_END 195 |
#define | SCROLL_BEGIN 196 |
#define | SCROLL_END 196 |
#define | DOOR_BEGIN 197 |
#define | DOOR_END 200 |
#define | POWERUP_BEGIN 201 |
#define | POWERUP_END 207 |
#define | GOLD_BEGIN 208 |
#define | GOLD_END 215 |
#define | GENERATOR_BEGIN 216 |
#define | GENERATOR_END 216 |
#define | TRAPS_BEGIN 217 |
#define | TRAPS_END 220 |
#define | EMPTY_BEGIN 221 |
#define | EMPTY_END 255 |
#define | BG_MIN_DAMAGE 0 |
#define | BG_MAX_DAMAGE 10000 |
#define | ENMY_MIN_HTPTS -1 |
#define | ENMY_MAX_HTPTS 1000 |
#define | ENMY_MIN_DAMAGE 0 |
#define | ENMY_MAX_DAMAGE 100 |
#define | EXIT_MAX 20 |
#define | POWERUP_MIN -255 |
#define | POWERUP_MAX 255 |
#define | GOLD_MIN 5 |
#define | GOLD_MAX 500 |
#define | GEN_MIDX_MIN 177 |
#define | GEN_MIDX_MAX 192 |
#define | GEN_MIN_HTPTS -1 |
#define | GEN_MAX_HTPTS 500 |
#define | TRAP_MIN_DAMAGE 0 |
#define | TRAP_MAX_DAMAGE 100 |
Typedefs | |
typedef struct MapEditorMainClass | MainWin |
typedef struct TileWinClass | TileWin |
typedef struct NewMapWinClass | NewMapWin |
typedef struct TilePropClass | PropWin |
typedef struct HelpWinClass | HelpWin |
typedef struct MiniMapWinClass | MMapWin |
Functions | |
int | init_main_window (MainWin *) |
int | init_tile_window () |
int | init_size_window () |
int | init_prop_window () |
int | init_help_window () |
int | init_minimap_window () |
void | mapdrawing_coor (Control *, int, Point) |
void | mapdrawing_click (Control *, int, Point) |
void | mapdrawing_drag (Control *, int, Point) |
void | mapdrawing_mouseup (Control *, int, Point) |
void | mapdrawing_move (Window *, unsigned long) |
void | mapdrawing_undo (Window *, unsigned long) |
void | minimap_coor (Control *, int, Point) |
void | minimap_click (Control *, int, Point) |
void | choose_map_level (Control *) |
void | choose_start_pt (Control *) |
void | show_sizewin (MenuItem *) |
void | show_tilewin (MenuItem *) |
void | show_helpwin (MenuItem *) |
void | show_mmapwin (MenuItem *) |
void | show_propwin () |
void | show_grid (MenuItem *) |
Basically toggles the grid menu_item and calls the function to redraw the map. | |
void | open_mapfile (MenuItem *) |
void | save_mapfile (MenuItem *) |
void | exit_prog (MenuItem *) |
void | exit_mainwin (Window *) |
void | exit_tilewin (Window *) |
void | exit_sizewin (Window *) |
void | exit_propwin (Window *) |
void | exit_helpwin (Window *) |
void | exit_mmapwin (Window *) |
void | load_tiles (MenuItem *) |
Ask user to select a tile property file. | |
void | timer_callback (Timer *) |
If the clicktime timer is valid, delete it. | |
void | view_tiles (Control *) |
Display a set of 64 tiles in twin. | |
void | which_tile_props (int, tprops *) |
Given an index value, the walkable, hitpoints & damage properties for a tile will be looked up and saved in the tprops pointer. | |
void | choose_tile (Control *) |
void | ok_sizewin (Control *) |
void | cancel_sizewin (Control *) |
void | ok_propwin (Control *) |
void | cancel_propwin (Control *) |
void | cancel_helpwin (Control *) |
void | set_currentimg_props (int) |
void | redraw_map (Control *, Graphics *) |
void | redraw_minimap (Control *, Graphics *) |
void | get_prop_strings (int, int, prop_strings *) |
void | get_tile_prop_minmax (int, minmax *) |
void | copy_rect_image (Image *dest, Point dp, Image *src, Rect sr) |
#define BACKGROUND_BEGIN 0 |
#define BACKGROUND_END 176 |
#define BG_MAX_DAMAGE 10000 |
#define BG_MIN_DAMAGE 0 |
#define DOOR_BEGIN 197 |
#define DOOR_END 200 |
#define EMPTY_BEGIN 221 |
#define EMPTY_END 255 |
#define ENEMY_BEGIN 177 |
#define ENEMY_END 192 |
#define ENMY_MAX_DAMAGE 100 |
#define ENMY_MAX_HTPTS 1000 |
#define ENMY_MIN_DAMAGE 0 |
#define ENMY_MIN_HTPTS -1 |
#define EXIT_BEGIN 195 |
#define EXIT_END 195 |
#define EXIT_MAX 20 |
#define GEN_MAX_HTPTS 500 |
#define GEN_MIDX_MAX 192 |
#define GEN_MIDX_MIN 177 |
#define GEN_MIN_HTPTS -1 |
#define GENERATOR_BEGIN 216 |
#define GENERATOR_END 216 |
#define GOLD_BEGIN 208 |
#define GOLD_END 215 |
#define GOLD_MAX 500 |
#define GOLD_MIN 5 |
#define KEY_BEGIN 193 |
#define KEY_END 193 |
#define MAINWINHEIGHT 550 |
#define MAINWINWIDTH 750 |
#define MAXMAPHEIGHT 150 |
Definition at line 22 of file mapedit.h.
Referenced by init_main_window(), ok_sizewin(), open_mapfile(), and show_sizewin().
#define MAXMAPWIDTH 180 |
Definition at line 23 of file mapedit.h.
Referenced by init_main_window(), ok_sizewin(), open_mapfile(), and show_sizewin().
#define POWERUP_BEGIN 201 |
#define POWERUP_END 207 |
#define POWERUP_MAX 255 |
#define POWERUP_MIN -255 |
#define SCROLL_BEGIN 196 |
#define SCROLL_END 196 |
#define TELEPORTER_BEGIN 194 |
#define TELEPORTER_END 194 |
#define TILEDEPTH 8 |
#define TILESIZE 32 |
Definition at line 19 of file mapedit.h.
Referenced by init_main_window(), init_minimap_window(), init_size_window(), init_tile_window(), load_tiles(), mapdrawing_click(), mapdrawing_coor(), mapdrawing_drag(), mapdrawing_mouseup(), mapdrawing_undo(), ok_sizewin(), open_mapfile(), and redraw_map().
#define TRAP_MAX_DAMAGE 100 |
#define TRAP_MIN_DAMAGE 0 |
#define TRAPS_BEGIN 217 |
#define TRAPS_END 220 |
#define TWINWIDTH 250 |
typedef struct HelpWinClass HelpWin |
typedef struct MapEditorMainClass MainWin |
typedef struct MiniMapWinClass MMapWin |
typedef struct NewMapWinClass NewMapWin |
typedef struct TilePropClass PropWin |
typedef struct TileWinClass TileWin |
void cancel_helpwin | ( | Control * | ) |
Definition at line 1837 of file mapedit.c.
References exit_helpwin(), and HelpWinClass::win.
Referenced by init_help_window().
void cancel_propwin | ( | Control * | ) |
Definition at line 1834 of file mapedit.c.
References exit_propwin(), and TilePropClass::win.
Referenced by init_prop_window().
void cancel_sizewin | ( | Control * | ) |
Definition at line 1831 of file mapedit.c.
References exit_sizewin(), and NewMapWinClass::win.
Referenced by init_size_window().
void choose_map_level | ( | Control * | ) |
Definition at line 820 of file mapedit.c.
References MapEditorMainClass::currentmaplevel, debug, dstring, MapEditorMainClass::mapdrawing, MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, redraw_map(), redraw_minimap(), MapEditorMainClass::showlev0btn, MapEditorMainClass::showlev1btn, and MapEditorMainClass::showmergedbtn.
Referenced by choose_tile(), init_main_window(), and mapdrawing_undo().
void choose_start_pt | ( | Control * | ) |
Definition at line 943 of file mapedit.c.
References MapEditorMainClass::choose_startpt_flag, and MapEditorMainClass::startpointbtn.
Referenced by init_main_window().
void choose_tile | ( | Control * | ) |
Definition at line 1498 of file mapedit.c.
References tile::bit, choose_map_level(), MapEditorMainClass::ctile, MapEditorMainClass::currentimgpic, tile::img, tile::index, MapEditorMainClass::lcurrentimg, MapEditorMainClass::lcurrentimgindex, tile::name, set_currentimg_props(), MapEditorMainClass::showlev0btn, MapEditorMainClass::showlev1btn, and MapEditorMainClass::win.
Referenced by init_tile_window().
void copy_rect_image | ( | Image * | dest, | |
Point | dp, | |||
Image * | src, | |||
Rect | sr | |||
) |
Definition at line 1937 of file mapedit.c.
Referenced by mapdrawing_click(), mapdrawing_mouseup(), mapdrawing_undo(), and open_mapfile().
void exit_helpwin | ( | Window * | ) |
Definition at line 1870 of file mapedit.c.
References MapEditorMainClass::mapdrawing, redraw_map(), and HelpWinClass::win.
Referenced by cancel_helpwin(), and init_help_window().
void exit_mainwin | ( | Window * | ) |
Definition at line 1249 of file mapedit.c.
References app, MapEditorMainClass::save_flag, MapEditorMainClass::save_item, and save_mapfile().
Referenced by exit_prog(), and init_main_window().
void exit_mmapwin | ( | Window * | ) |
Definition at line 1841 of file mapedit.c.
References MapEditorMainClass::mapdrawing, MapEditorMainClass::mmap_item, redraw_map(), and MiniMapWinClass::win.
Referenced by init_minimap_window().
void exit_prog | ( | MenuItem * | ) |
Definition at line 1246 of file mapedit.c.
References exit_mainwin(), and MapEditorMainClass::win.
Referenced by init_main_window(), and mapdrawing_undo().
void exit_propwin | ( | Window * | ) |
Definition at line 1864 of file mapedit.c.
References MapEditorMainClass::mapdrawing, redraw_map(), and TilePropClass::win.
Referenced by cancel_propwin(), and init_prop_window().
void exit_sizewin | ( | Window * | ) |
Definition at line 1856 of file mapedit.c.
References NewMapWinClass::heightfield, MapEditorMainClass::mapdrawing, redraw_map(), NewMapWinClass::widthfield, and NewMapWinClass::win.
Referenced by cancel_sizewin(), and init_size_window().
void exit_tilewin | ( | Window * | ) |
Definition at line 1848 of file mapedit.c.
References MapEditorMainClass::mapdrawing, redraw_map(), MapEditorMainClass::tilewin_item, MapEditorMainClass::win, and TileWinClass::win.
Referenced by init_tile_window().
void get_prop_strings | ( | int | , | |
int | , | |||
prop_strings * | ||||
) |
Definition at line 1577 of file mapedit.c.
References tprops::damage, TilePropClass::damagefield, MapEditorMainClass::damagefield, prop_strings::first, tprops::hitpoints, TilePropClass::hitpointsfield, MapEditorMainClass::hitpointsfield, prop_strings::second, prop_strings::third, tprops::walkable, TilePropClass::walkablebox, MapEditorMainClass::walkablebox, and which_tile_props().
Referenced by mapdrawing_coor(), ok_propwin(), and show_propwin().
void get_tile_prop_minmax | ( | int | , | |
minmax * | ||||
) |
Definition at line 1785 of file mapedit.c.
References BG_MAX_DAMAGE, BG_MIN_DAMAGE, ENMY_MAX_DAMAGE, ENMY_MAX_HTPTS, ENMY_MIN_DAMAGE, ENMY_MIN_HTPTS, EXIT_MAX, minmax::first, GEN_MAX_HTPTS, GEN_MIDX_MAX, GEN_MIDX_MIN, GEN_MIN_HTPTS, GOLD_MAX, GOLD_MIN, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, POWERUP_MAX, POWERUP_MIN, minmax::second, TRAP_MAX_DAMAGE, and TRAP_MIN_DAMAGE.
Referenced by ok_propwin().
int init_help_window | ( | ) |
Definition at line 253 of file mapedit.c.
References app, cancel_helpwin(), exit_helpwin(), HelpWinClass::exitbtn, HelpWinClass::ltext, and HelpWinClass::win.
Referenced by app_main().
int init_main_window | ( | MainWin * | ) |
Definition at line 45 of file mapedit.c.
References app, MapEditorMainClass::bit, MapEditorMainClass::char_start_pt, choose_map_level(), choose_start_pt(), MapEditorMainClass::choose_startpt_flag, MapEditorMainClass::ctile, MapEditorMainClass::ctile_edit, MapEditorMainClass::ctile_prop_edit, MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentimgpic, MapEditorMainClass::currentmaplevel, map::damage, tile::damage, MapEditorMainClass::damagefield, debug, debug2, MapEditorMainClass::double_click_flag, MapEditorMainClass::drag_flag, MapEditorMainClass::drag_start_pt, exit_mainwin(), exit_prog(), MapEditorMainClass::file_menu, MapEditorMainClass::filename, MapEditorMainClass::grid, MapEditorMainClass::gridgraphics, MapEditorMainClass::help_item, MapEditorMainClass::help_menu, map::hitpoints, tile::hitpoints, MapEditorMainClass::hitpointsfield, MapEditorMainClass::htilenum, map::index, tile::index, MapEditorMainClass::lcoor, MapEditorMainClass::lcurrentimg, MapEditorMainClass::lcurrentimgindex, MapEditorMainClass::lcurrentprop, MapEditorMainClass::ldamage, MapEditorMainClass::lev1, MapEditorMainClass::lev1graphics, MapEditorMainClass::lhitpoints, MapEditorMainClass::line1_item, MapEditorMainClass::lmapsize, MapEditorMainClass::lmove, load_tiles(), MapEditorMainClass::loadtiles_item, MapEditorMainClass::lproperties, MapEditorMainClass::ltcoor, MapEditorMainClass::main_menubar, MAINWINHEIGHT, MAINWINWIDTH, MapEditorMainClass::mapdrawheight, MapEditorMainClass::mapdrawing, mapdrawing_click(), mapdrawing_coor(), mapdrawing_drag(), mapdrawing_mouseup(), mapdrawing_move(), mapdrawing_undo(), MapEditorMainClass::mapdrawtheight, MapEditorMainClass::mapdrawtwidth, MapEditorMainClass::mapdrawwidth, MapEditorMainClass::mapgraphics, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MAXMAPHEIGHT, MAXMAPWIDTH, MapEditorMainClass::mmap_item, tile::name, MapEditorMainClass::new_item, MapEditorMainClass::open_item, open_mapfile(), MapEditorMainClass::options_menu, MapEditorMainClass::quit_item, redraw_map(), MapEditorMainClass::save_flag, MapEditorMainClass::save_item, save_mapfile(), show_grid(), show_helpwin(), show_mmapwin(), show_sizewin(), show_tilewin(), MapEditorMainClass::showgrid_item, MapEditorMainClass::showlev0btn, MapEditorMainClass::showlev1btn, MapEditorMainClass::showmergedbtn, MapEditorMainClass::startpointbtn, MapEditorMainClass::startptxfield, MapEditorMainClass::startptyfield, TILESIZE, MapEditorMainClass::tilewin_item, MapEditorMainClass::vtilenum, map::walkable, tile::walkable, MapEditorMainClass::walkablebox, and MapEditorMainClass::win.
Referenced by app_main().
int init_minimap_window | ( | ) |
Definition at line 292 of file mapedit.c.
References app, exit_mmapwin(), MiniMapWinClass::frame, MiniMapWinClass::instr_label, MiniMapWinClass::lev0_image, MiniMapWinClass::lev1_image, MapEditorMainClass::mapdrawtheight, MapEditorMainClass::mapdrawtwidth, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, minimap_click(), minimap_coor(), MiniMapWinClass::mmap, MiniMapWinClass::mmap_bit, MiniMapWinClass::mmap_graphics, MiniMapWinClass::r, redraw_minimap(), MiniMapWinClass::size_label, TILESIZE, and MiniMapWinClass::win.
Referenced by app_main().
int init_prop_window | ( | ) |
Definition at line 238 of file mapedit.c.
References app, TilePropClass::cancel, cancel_propwin(), TilePropClass::damagefield, exit_propwin(), TilePropClass::hitpointsfield, TilePropClass::ldamage, TilePropClass::lhitpoints, TilePropClass::ltileinfo, TilePropClass::ok, ok_propwin(), TilePropClass::walkablebox, and TilePropClass::win.
Referenced by app_main().
int init_size_window | ( | ) |
Definition at line 220 of file mapedit.c.
References app, NewMapWinClass::cancel, cancel_sizewin(), exit_sizewin(), NewMapWinClass::heightfield, NewMapWinClass::lheight, NewMapWinClass::ltilesize, NewMapWinClass::lwidth, NewMapWinClass::ok, ok_sizewin(), NewMapWinClass::sheight, NewMapWinClass::swidth, TILESIZE, NewMapWinClass::widthfield, and NewMapWinClass::win.
Referenced by app_main().
int init_tile_window | ( | ) |
Definition at line 176 of file mapedit.c.
References app, choose_tile(), exit_tilewin(), TileWinClass::first_btn, TileWinClass::fourth_btn, TileWinClass::offset, TileWinClass::r, TileWinClass::second_btn, TileWinClass::third_btn, TileWinClass::tile_btn, TileWinClass::tile_columns, TileWinClass::tile_label, TileWinClass::tile_rows, TileWinClass::tile_size, TILEDEPTH, TILESIZE, TWINWIDTH, view_tiles(), and TileWinClass::win.
Referenced by app_main().
void load_tiles | ( | MenuItem * | m | ) |
Ask user to select a tile property file.
Open the file and parse each line. For a valid tile line, store tile filename and properties in tilearray at index corresponding to tile index. Loop through tilearray, read each tile image file into tilearray[index].img. Scale as necessary. Convert image to bitmap and store in tilearray[index].bit Display up to first 64 tiles in tilewin as image buttons.
Definition at line 1282 of file mapedit.c.
References tile::bit, tile::damage, TileWinClass::first_btn, TileWinClass::fourth_btn, tile::hitpoints, tprops::hitpoints, tile::img, tile::name, TileWinClass::second_btn, TileWinClass::third_btn, TileWinClass::tile_btn, tilefile, tilenames, TILESIZE, MapEditorMainClass::tilewin_item, tile::walkable, tprops::walkable, which_tile_props(), and TileWinClass::win.
Referenced by init_main_window(), mapdrawing_undo(), and open_mapfile().
void mapdrawing_click | ( | Control * | , | |
int | , | |||
Point | ||||
) |
Definition at line 327 of file mapedit.c.
References app, tile::bit, MapEditorMainClass::char_start_pt, MapEditorMainClass::choose_startpt_flag, clicktime, copy_rect_image(), MapEditorMainClass::ctile, MapEditorMainClass::ctile_edit, MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentimgpic, MapEditorMainClass::currentmaplevel, tile::damage, map::damage, debug, debug2, MapEditorMainClass::double_click_flag, dstring, tile::hitpoints, map::hitpoints, tile::img, map::index, TilePropClass::index, tile::index, MapEditorMainClass::lcurrentimg, MapEditorMainClass::lcurrentimgindex, MiniMapWinClass::lev0_image, MiniMapWinClass::lev1_image, MapEditorMainClass::lev1graphics, MapEditorMainClass::mapdrawing, mapdrawing_undo(), MapEditorMainClass::mapgraphics, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, MapEditorMainClass::mouse_pt, tile::name, redraw_map(), redraw_minimap(), MapEditorMainClass::save_flag, set_currentimg_props(), show_propwin(), MapEditorMainClass::startpointbtn, MapEditorMainClass::startptxfield, MapEditorMainClass::startptyfield, TILESIZE, timer_callback(), tile::walkable, map::walkable, and MapEditorMainClass::win.
Referenced by init_main_window().
void mapdrawing_coor | ( | Control * | , | |
int | , | |||
Point | ||||
) |
Definition at line 616 of file mapedit.c.
References MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentmaplevel, map::damage, MapEditorMainClass::damagefield, debug, prop_strings::first, get_prop_strings(), map::hitpoints, MapEditorMainClass::hitpointsfield, map::index, MapEditorMainClass::lcoor, MapEditorMainClass::ldamage, MapEditorMainClass::lhitpoints, MapEditorMainClass::ltcoor, prop_strings::second, prop_strings::third, TILESIZE, map::walkable, and MapEditorMainClass::walkablebox.
Referenced by init_main_window().
void mapdrawing_drag | ( | Control * | , | |
int | , | |||
Point | ||||
) |
Definition at line 595 of file mapedit.c.
References debug, MapEditorMainClass::drag_flag, MapEditorMainClass::drag_start_pt, and TILESIZE.
Referenced by init_main_window().
void mapdrawing_mouseup | ( | Control * | , | |
int | , | |||
Point | ||||
) |
Definition at line 510 of file mapedit.c.
References copy_rect_image(), MapEditorMainClass::ctile, MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentmaplevel, tile::damage, map::damage, debug2, MapEditorMainClass::drag_flag, MapEditorMainClass::drag_start_pt, dstring, tile::hitpoints, map::hitpoints, tile::img, map::index, tile::index, MiniMapWinClass::lev0_image, MapEditorMainClass::mapdrawing, MapEditorMainClass::mapgraphics, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, MapEditorMainClass::mouse_pt, redraw_map(), redraw_minimap(), MapEditorMainClass::save_flag, TILESIZE, tile::walkable, and map::walkable.
Referenced by init_main_window().
void mapdrawing_move | ( | Window * | , | |
unsigned | long | |||
) |
Definition at line 668 of file mapedit.c.
References MapEditorMainClass::ctile_topleft, debug, debug2, dstring, MapEditorMainClass::htilenum, MapEditorMainClass::mapdrawheight, MapEditorMainClass::mapdrawing, MapEditorMainClass::mapdrawtheight, MapEditorMainClass::mapdrawtwidth, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, redraw_map(), redraw_minimap(), and MapEditorMainClass::vtilenum.
Referenced by init_main_window(), and minimap_click().
void mapdrawing_undo | ( | Window * | , | |
unsigned | long | |||
) |
Definition at line 730 of file mapedit.c.
References MapEditorMainClass::bit, choose_map_level(), copy_rect_image(), MapEditorMainClass::ctile, map::damage, debug2, dstring, exit_prog(), MapEditorMainClass::help_item, map::hitpoints, tile::img, map::index, MiniMapWinClass::lev0_image, MapEditorMainClass::lev1, MiniMapWinClass::lev1_image, MapEditorMainClass::lev1graphics, load_tiles(), MapEditorMainClass::loadtiles_item, MapEditorMainClass::mapdrawing, MapEditorMainClass::mapgraphics, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, MapEditorMainClass::new_item, MapEditorMainClass::open_item, open_mapfile(), MapEditorMainClass::quit_item, redraw_map(), redraw_minimap(), MapEditorMainClass::save_item, save_mapfile(), show_grid(), show_helpwin(), show_mmapwin(), show_sizewin(), MapEditorMainClass::showgrid_item, MapEditorMainClass::showlev0btn, MapEditorMainClass::showlev1btn, MapEditorMainClass::showmergedbtn, TILESIZE, map::walkable, and MapEditorMainClass::win.
Referenced by init_main_window(), and mapdrawing_click().
void minimap_click | ( | Control * | , | |
int | , | |||
Point | ||||
) |
Definition at line 863 of file mapedit.c.
References MapEditorMainClass::ctile_topleft, MiniMapWinClass::frame, mapdrawing_move(), MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MiniMapWinClass::r, and MapEditorMainClass::win.
Referenced by init_minimap_window(), ok_sizewin(), and open_mapfile().
void minimap_coor | ( | Control * | , | |
int | , | |||
Point | ||||
) |
Definition at line 837 of file mapedit.c.
References debug2, dstring, MiniMapWinClass::frame, MiniMapWinClass::mmap, MiniMapWinClass::mmap_bit, MiniMapWinClass::mmap_graphics, and MiniMapWinClass::r.
Referenced by init_minimap_window(), ok_sizewin(), and open_mapfile().
void ok_propwin | ( | Control * | ) |
Definition at line 1739 of file mapedit.c.
References app, MapEditorMainClass::ctile_edit, MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentmaplevel, map::damage, tprops::damage, TilePropClass::damagefield, minmax::first, get_prop_strings(), get_tile_prop_minmax(), map::hitpoints, tprops::hitpoints, TilePropClass::hitpointsfield, TilePropClass::index, MapEditorMainClass::mapdrawing, redraw_map(), prop_strings::second, minmax::second, prop_strings::third, map::walkable, tprops::walkable, TilePropClass::walkablebox, which_tile_props(), and TilePropClass::win.
Referenced by init_prop_window().
void ok_sizewin | ( | Control * | ) |
Definition at line 1647 of file mapedit.c.
References app, MapEditorMainClass::bit, MapEditorMainClass::ctile_topleft, map::damage, MiniMapWinClass::frame, MapEditorMainClass::grid, MapEditorMainClass::gridgraphics, NewMapWinClass::heightfield, map::hitpoints, NewMapWinClass::iheight, map::index, NewMapWinClass::iwidth, MiniMapWinClass::lev0_image, MapEditorMainClass::lev1, MiniMapWinClass::lev1_image, MapEditorMainClass::lev1graphics, MapEditorMainClass::lmapsize, MapEditorMainClass::mapdrawheight, MapEditorMainClass::mapdrawing, MapEditorMainClass::mapdrawtheight, MapEditorMainClass::mapdrawtwidth, MapEditorMainClass::mapdrawwidth, MapEditorMainClass::mapgraphics, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MAXMAPHEIGHT, MAXMAPWIDTH, minimap_click(), minimap_coor(), MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, MiniMapWinClass::r, redraw_map(), redraw_minimap(), MiniMapWinClass::size_label, TILESIZE, map::walkable, NewMapWinClass::widthfield, MiniMapWinClass::win, NewMapWinClass::win, and MapEditorMainClass::win.
Referenced by init_size_window().
void open_mapfile | ( | MenuItem * | ) |
Definition at line 1006 of file mapedit.c.
References app, MapEditorMainClass::bit, MapEditorMainClass::char_start_pt, copy_rect_image(), MapEditorMainClass::ctile_topleft, map::damage, MapEditorMainClass::filename, MiniMapWinClass::frame, MapEditorMainClass::grid, MapEditorMainClass::gridgraphics, tprops::hitpoints, map::hitpoints, map::index, MiniMapWinClass::lev0_image, MapEditorMainClass::lev1, MiniMapWinClass::lev1_image, MapEditorMainClass::lev1graphics, MapEditorMainClass::lmapsize, load_tiles(), MapEditorMainClass::loadtiles_item, MapEditorMainClass::mapdrawheight, MapEditorMainClass::mapdrawing, MapEditorMainClass::mapdrawtheight, MapEditorMainClass::mapdrawtwidth, MapEditorMainClass::mapdrawwidth, MapEditorMainClass::mapgraphics, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MAXMAPHEIGHT, MAXMAPWIDTH, minimap_click(), minimap_coor(), MiniMapWinClass::mmap, MapEditorMainClass::mmap_item, openmapfile, MiniMapWinClass::r, redraw_map(), redraw_minimap(), MiniMapWinClass::size_label, MapEditorMainClass::startptxfield, MapEditorMainClass::startptyfield, TILESIZE, tprops::walkable, map::walkable, which_tile_props(), MiniMapWinClass::win, and MapEditorMainClass::win.
Referenced by init_main_window(), and mapdrawing_undo().
void redraw_map | ( | Control * | , | |
Graphics * | ||||
) |
Definition at line 881 of file mapedit.c.
References MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentmaplevel, MapEditorMainClass::gridgraphics, MapEditorMainClass::lev1graphics, MapEditorMainClass::mapdrawheight, MapEditorMainClass::mapdrawwidth, MapEditorMainClass::mapgraphics, MapEditorMainClass::showgrid_item, and TILESIZE.
Referenced by choose_map_level(), exit_helpwin(), exit_mmapwin(), exit_propwin(), exit_sizewin(), exit_tilewin(), init_main_window(), mapdrawing_click(), mapdrawing_mouseup(), mapdrawing_move(), mapdrawing_undo(), ok_propwin(), ok_sizewin(), open_mapfile(), and show_grid().
void redraw_minimap | ( | Control * | , | |
Graphics * | ||||
) |
Definition at line 914 of file mapedit.c.
References debug2, MiniMapWinClass::lev0_image, MiniMapWinClass::lev1_image, MiniMapWinClass::mmap_bit, MiniMapWinClass::mmap_graphics, MiniMapWinClass::r, and MiniMapWinClass::win.
Referenced by choose_map_level(), init_minimap_window(), mapdrawing_click(), mapdrawing_mouseup(), mapdrawing_move(), mapdrawing_undo(), ok_sizewin(), and open_mapfile().
void save_mapfile | ( | MenuItem * | ) |
Definition at line 1175 of file mapedit.c.
References app, MapEditorMainClass::char_start_pt, map::damage, tprops::damage, MapEditorMainClass::filename, map::hitpoints, tprops::hitpoints, map::index, MapEditorMainClass::mapheight, MapEditorMainClass::mapwidth, MapEditorMainClass::save_flag, savemapfile, map::walkable, tprops::walkable, and which_tile_props().
Referenced by exit_mainwin(), init_main_window(), and mapdrawing_undo().
void set_currentimg_props | ( | int | ) |
Definition at line 1532 of file mapedit.c.
References MapEditorMainClass::ctile, tile::damage, tprops::damage, tile::hitpoints, tprops::hitpoints, MapEditorMainClass::lcurrentprop, tile::walkable, tprops::walkable, and which_tile_props().
Referenced by choose_tile(), and mapdrawing_click().
void show_grid | ( | MenuItem * | ) |
Basically toggles the grid menu_item and calls the function to redraw the map.
Definition at line 1426 of file mapedit.c.
References MapEditorMainClass::mapdrawing, and redraw_map().
Referenced by init_main_window(), and mapdrawing_undo().
void show_helpwin | ( | MenuItem * | ) |
Definition at line 1270 of file mapedit.c.
References HelpWinClass::win.
Referenced by init_main_window(), and mapdrawing_undo().
void show_mmapwin | ( | MenuItem * | ) |
Definition at line 1000 of file mapedit.c.
References MiniMapWinClass::win.
Referenced by init_main_window(), and mapdrawing_undo().
void show_propwin | ( | ) |
Definition at line 971 of file mapedit.c.
References MapEditorMainClass::ctile_edit, MapEditorMainClass::ctile_topleft, MapEditorMainClass::currentmaplevel, map::damage, TilePropClass::damagefield, prop_strings::first, get_prop_strings(), map::hitpoints, TilePropClass::hitpointsfield, map::index, TilePropClass::ldamage, TilePropClass::lhitpoints, TilePropClass::ltileinfo, tile::name, prop_strings::second, prop_strings::third, map::walkable, TilePropClass::walkablebox, and TilePropClass::win.
Referenced by mapdrawing_click().
void show_sizewin | ( | MenuItem * | ) |
Definition at line 948 of file mapedit.c.
References app, map::index, MAXMAPHEIGHT, MAXMAPWIDTH, MapEditorMainClass::save_flag, and NewMapWinClass::win.
Referenced by init_main_window(), and mapdrawing_undo().
void show_tilewin | ( | MenuItem * | ) |
Definition at line 1259 of file mapedit.c.
References TileWinClass::win.
Referenced by init_main_window().
void timer_callback | ( | Timer * | t | ) |
If the clicktime timer is valid, delete it.
Disable the double click flag. This timer is used as a hack to find out when the mouse was double-clicked. We set the double-click flag on first mouse click and set the timer for 250ms. If the mouse clicks again before the timer expires (and calls this function), we consider it a double click.
Definition at line 1443 of file mapedit.c.
References clicktime, and MapEditorMainClass::double_click_flag.
Referenced by mapdrawing_click().
void view_tiles | ( | Control * | c | ) |
Display a set of 64 tiles in twin.
Called when one of the four 'display' buttons in the tilewin is pressed. We can have up to 256 different tiles, but only display them 64 at a time in tilewin. These display buttons indicate which 64 will be displayed. It will load the 64 image buttons with the correct images and index data from tilearray[index]
Definition at line 1460 of file mapedit.c.
References TileWinClass::first_btn, TileWinClass::fourth_btn, tile::img, TileWinClass::offset, TileWinClass::second_btn, TileWinClass::third_btn, TileWinClass::tile_btn, TileWinClass::tile_columns, TileWinClass::tile_label, and TileWinClass::tile_rows.
Referenced by init_tile_window().
void which_tile_props | ( | int | , | |
tprops * | ||||
) |
Given an index value, the walkable, hitpoints & damage properties for a tile will be looked up and saved in the tprops pointer.
Definition at line 1371 of file mapedit.c.
References BACKGROUND_BEGIN, BACKGROUND_END, tprops::damage, DOOR_BEGIN, DOOR_END, EMPTY_BEGIN, EMPTY_END, ENEMY_BEGIN, ENEMY_END, EXIT_BEGIN, EXIT_END, GENERATOR_BEGIN, GENERATOR_END, GOLD_BEGIN, GOLD_END, tprops::hitpoints, KEY_BEGIN, KEY_END, POWERUP_BEGIN, POWERUP_END, SCROLL_BEGIN, SCROLL_END, TELEPORTER_BEGIN, TELEPORTER_END, TRAPS_BEGIN, TRAPS_END, and tprops::walkable.
Referenced by get_prop_strings(), load_tiles(), ok_propwin(), open_mapfile(), save_mapfile(), and set_currentimg_props().