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
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
Chris Taylor
acc595ba16
Make robot_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:51:00 +08:00
Chris Taylor
5322ce4a0f
Make editor_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:48:23 +08:00
Chris Taylor
dc7a288539
Make trigger_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:34:41 +08:00
Chris Taylor
06632e73e8
Make centers_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:15:31 +08:00
Kp
01f2932824
Pass grs_canvas &to window_create
2016-10-15 00:53:20 +00:00
Kp
c1d9c40931
Convert various valptridx accesses to use factory functions
2016-10-15 00:53:18 +00:00
Kp
c2e6f06b86
Use std::move to compact walls
2016-10-15 00:53:17 +00:00
Kp
6515308a59
Simplify loop iteration in copy_group_walls
2016-10-15 00:53:17 +00:00
Kp
a80ed36f0a
Use range_for/vsegptr for wall_restore_all
2016-10-15 00:53:16 +00:00
Chris Taylor
bc1c9ebd97
Merge branch 'unification/master' into allow_dialog_subclass
...
Conflicts:
common/arch/sdl/window.cpp - Remove unused EVENT_WINDOW_CLOSED and w_callback local var
common/ui/dialog.cpp - Remove unused EVENT_WINDOW_CLOSED
2016-10-10 14:40:11 +08:00
Kp
1d09ca32ad
Remove spurious 'u' after DXX_PRI_size_type uses
2016-10-08 18:02:34 +00:00
Chris Taylor
db665d8c33
Allow dcx::UI_DIALOG struct to be subclassed - step 2
...
Allow dcx::UI_DIALOG struct to be subclassed step 2. Make all the UI_DIALOG handlers return a window_event_result like everyone else.
2016-10-04 15:58:20 +08:00
Chris Taylor
60ac1eaad3
Replace delete dcx::window kludge with a better solution
...
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
kreatordxx
b87fcad332
Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
...
Allow window subclasses
2016-10-03 10:36:26 +08:00
Chris Taylor
87617e8ac9
Allow dcx::window struct to be subclassed - step 3
...
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Kp
f3865db4cb
Use implicit range of vtrgptr
2016-10-02 00:34:39 +00:00