Commit graph

604 commits

Author SHA1 Message Date
Kp cdb193c053 Use unsigned for sides/verts in more places 2017-02-19 19:33:38 +00:00
Kp 0f00cf51b0 Make segment vertices unsigned 2017-02-19 19:33:37 +00:00
Kp 0d5d2e77a8 Pass canvas to g3_check_and_draw_poly 2017-02-11 21:42:42 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp 590a025a89 Pass canvas to g3_start_frame 2017-02-11 21:42:34 +00:00
Kp 80e7ade6a1 Pass canvas to g3_draw_sphere 2017-02-11 21:42:33 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp d1657ba269 Make canvas an explicit argument to gr_uprintf
Previously, a macro implied *grd_curcanv as the canvas.  Pass the canvas
explicitly so that callers can choose the canvas to use.
2017-02-11 21:42:32 +00:00
Kp 3fb0367423 Use range_for in duplicate_group 2017-02-11 21:42:31 +00:00
Kp 1a3d89aecf Use vsegptridx in editor group functions 2017-02-11 21:42:31 +00:00
Chris Taylor e9b0ca9a83 Don't decrement trigger in remove_trigger_num if it's trigger_none
Fixes a crash when loading a level with redundant triggers and editor enabled, e.g. Passion of Death.
2017-01-30 11:08:58 +08:00
Chris Taylor 30b5ef7c73 Create robot_create function and use it 4x
Contains 2 calls - to obj_create and init_ai_object. For safety reasons and tidiness compared to using obj_create directly. The call to init_ai_object in recreate_thief was already redundant.
2017-01-22 17:56:50 +08:00
Kp 6da2b446f5 Use range_for in editor/group.cpp 2017-01-21 19:05:42 +00:00
kreatordxx f590ec45c6 Merge pull request #298 from dxx-rebirth/no_game_wind_close
Remove calls to window_close(Game_wind)
2017-01-09 09:32:24 +08:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +00:00
Kp 1ef6b9d5bc Pass font to gr_get_string_size 2017-01-08 22:31:59 +00:00
Kp 0480ba8030 Pass canvas to gr_string(int,int,const char*,int,int) 2017-01-08 22:31:59 +00:00
Chris Taylor b7c41a0d98 Remove calls to window_close(Game_wind) within close_editor
These are redundant. Will remove all cases of window_close(Game_wind) - it's safer for the handler to return window_event_result::close.
2017-01-08 21:03:41 +08:00
Kp 22e364e030 Pass canvas to gr_clear_canvas 2017-01-01 00:45:45 +00:00
Kp 0905aefa0a Pass canvas to gr_rect 2017-01-01 00:45:45 +00:00
Kp c3c4ab8e3e Pass canvas to gr_box 2017-01-01 00:45:44 +00:00
Kp 08d0aa9b59 Pass canvas to gr_bitmap 2016-12-29 03:27:13 +00:00
Kp 6ab3b18657 Pass canvas to gr_ubitmap 2016-12-29 03:27:12 +00:00
Kp 1fa5aef9ac Pass canvas to gr_line 2016-12-29 03:27:10 +00:00
Kp ef06aa089a Pass canvas to gr_pixel 2016-12-29 03:27:09 +00:00
Kp b3809266a3 Use enumerate in more loops 2016-12-11 01:56:44 +00:00
Kp 1f434f98ad Use valptridx for ActiveDoors 2016-12-10 17:51:08 +00:00
Kp f8cc32a4af Merge pull #272 into master 2016-11-26 22:51:49 +00:00
Kp ac5ccf0c08 Pass active_door &to wall_close_door_num 2016-11-26 22:51:48 +00:00
Chris Taylor bf6eb99d7a When switching to the editor in a game, use a proper saved game
This preserves virtually all game information, including active fire. The saved game 'gamesave.sge' can also be loaded with File->Restore Game State. The level can still be saved as usual (but it warns the user if there's an unsaved game state). This functionality may be useful for testing (or cheating! ;) )
2016-11-21 15:22:11 +08:00
Chris Taylor 2995cb628c Never set Current_level_num to 0
This will be required when proper game state editing is implemented. Also remove hacks that check Current_level_num == 0.
2016-11-21 15:22:11 +08:00
Chris Taylor a06316f11e Fix crash when pressing Meta key (or Command key for Macs) in editor 2016-11-15 17:20:35 +08:00
Chris Taylor cc3f35649f Change all occurrences of "Couldn't" to "Could not" for consistency ("Could not" is more common and wins).
Not touching TXT_COULDNT because it's stored separately in hog file.
2016-11-13 13:27:18 +08:00
Chris Taylor 9183bba508 Change pads local var in init_editor to static to save on space for 64 bit systems 2016-11-13 13:09:31 +08:00
Chris Taylor 7dd21e7564 Use wallptridx in wall_dialog_handler, removing need for separate index variable 'wd' 2016-11-13 13:04:00 +08:00
Chris Taylor 5f19a3cba9 Remove redundant checks and initialisations recently added for editor 2016-11-13 12:44:53 +08:00
Chris Taylor 6757d89238 Fix crash in editor when trying to unlink a door that isn't linked 2016-11-12 17:30:36 +08:00
Chris Taylor eeb3303b95 Fix crash in editor when trying to link wall with no Markedsegp 2016-11-12 17:28:26 +08:00
Chris Taylor 95fcee9474 Fix crash when removing a wall in the editor
Only update wall_num if != wall_none.
2016-11-12 17:19:38 +08:00
Chris Taylor 4568bbae11 Don't crash when building segment bridge in editor the wrong way
Check if there is Markedsegp and replacing an Assert with a LevelError.
2016-11-12 16:41:54 +08:00
Chris Taylor ac52a30214 Fix spurious exploding wall and crash when playing a level loaded with the editor
When File->'Play in 320x200' is chosen, use StartNewGame(Current_level_num). For now use create_new_mission and Current_level_num = 1 every time. Also remove the now redundant hacks GM_EDITOR and editor_reset_stuff_on_level.
2016-11-12 15:38:38 +08:00
Chris Taylor ac438f4cc2 Allow the user to carry on as usual if any of the editor files are missing (i.e. before editor was loaded).
If a game was playing, continue playing. If it was in the main menu, return to the main menu. (If all files are put in place the editor can load again.)
2016-11-11 16:09:57 +08:00
Chris Taylor b8b19baa92 Make sure wall dialog and hostage dialog close properly
When responding to EVENT_WINDOW_CLOSE, set MainWindow to nullptr - fixing multiple issues with these dialogs including the inability to re-open them and a crash on exiting the editor.
2016-11-11 16:09:57 +08:00
Chris Taylor 396f1e47f0 Do Wall Dialog now works with no wall selected 2016-11-11 16:09:57 +08:00
Chris Taylor d41146bcbd Set default object index for object dialog
This prevents the Object Editor from crashing when no object is selected (Cur_object_index == object_none).
2016-11-11 16:09:57 +08:00
Chris Taylor 143ed30fee Merging in unification/master, resolving conflict in similar/main/kmatrix.cpp 2016-11-06 14:20:18 +08:00
Kp 5a69c09ec2 Move fuelcen_activate special assignment up
One caller uses fuelcen_activate when segp->special != station_type.
Every other caller passes the type that was already on the segment.
Move the assignment into the one caller that needs it, then remove the
argument.
2016-10-29 23:16:17 +00:00
Chris Taylor bd3078b672 Make wall_dialog_handler return window_event_result::close instead of closing itself
This ensures the event system will know what's going on. Also remove the 'likely' branch prediction macro from close_wall_window because close_wall_window will only be called outside of the wall dialog's handler (to open a different dialog or close the editor).
2016-10-27 18:07:57 +08:00
Chris Taylor fd3e60be54 Make object_dialog_handler return window_event_result::close instead of closing itself
This ensures the event system will know what's going on.
2016-10-27 17:52:50 +08:00