Commit graph

56 commits

Author SHA1 Message Date
zicodxx e3a21dce5e Fixed some non-critical compiler warnings; Now compiling with -std=c99 -pedantic and fixed warnings (except for editor build) caused by this 2012-05-14 12:20:27 +02:00
Chris Taylor 7b9f0f8d17 Rename MessageBox to ui_messagebox to avoid a conflict with Windows' MessageBox 2012-04-17 16:02:32 +08:00
Chris Taylor 36aeba165a Reset the player object for the editor, since demo playback mucks it up 2012-04-17 15:11:49 +08:00
Chris Taylor fa76bc657e Make a new mission when making a new mine to avoid a crash when testing it straight from the editor and winning, only create a new mine if a mission isn't loaded, if it thinks it needs to use Cursegp to fix the player object make sure Cursegp is initialised, remove key command for ToggleDrawAllSegments since add segment now has ctrl-A 2012-04-16 16:53:32 +08:00
Chris Taylor ee9f1b33db Avoid crashes when clicking on close box with a center, switch, object or wall editing dialog open; also when playing a level, going to the editor, going back to the game then dying 2012-04-16 14:41:26 +08:00
Chris Taylor ad5549793f Make movement in the editor's game screen use the player controls, make that movement more like the automap and resolve some likely conflicting key commands 2012-04-16 13:26:14 +08:00
Chris Taylor e1eaf7cc65 Clicking on mine elements in the editor now works in ogl 2012-04-15 13:43:41 +08:00
Chris Taylor 1d05b49978 Set edge_list_size to Num_segments*12 to avoid crashes in the editor with certain third party levels 2012-04-15 09:32:04 +08:00
Chris Taylor 8b22237d4e Set the correct palette for the editor 2012-04-14 18:28:07 +08:00
Chris Taylor b80b863f49 Fix bugs switching between game and editor and back: make sure ModeFlag is set to 0 before it has any chance to show an alert message, fixing a crash; allow OBJ_NONE in Assert; make Game_wind invisible when loading editor in case we show an alert; call mouse_flush() in ui_init() to fix mouse issues 2012-04-14 17:41:50 +08:00
Chris Taylor ef6e5180db Delete-E while playing a level now works properly - it closes Game_wind and sets Cursegp if necessary when going to the editor 2012-04-14 15:06:12 +08:00
Chris Taylor 1e77cbdf30 Fix crash when loading a level in the editor 2012-04-14 13:28:30 +08:00
Chris Taylor 7aa618b266 Draw the object rotation velocity, file browser and MessageBox dialogs properly 2012-04-11 10:52:19 +08:00
Chris Taylor 7ef1431885 Editor exits cleanly when clicking the close box, no more redundant gr_uscanline call in gl_urect for ogl (an initial attempt to fix the previous bug) 2012-04-09 20:40:55 +08:00
Chris Taylor 418e6ab674 Fix all remaining known editor drawing issues. In ogl: get the texture previews to draw, get userbox borders to draw in the right location, properly underline characters in the menus, draw all the borders properly (i.e. no gap), no scaling fonts. Software render: draw userbox borders again. Both: clear the whole status bar, clear to the right edge of the screen. 2012-04-09 17:28:44 +08:00
Chris Taylor 8a437a759c Get the clock, 'keypad' info, texture choosing page and object choosing page to draw (latter two just show black squares for ogl) 2012-04-09 10:12:58 +08:00
Chris Taylor 09a37b623a Make the editor draw the same for the non-ogl build as the ogl build, since I just made it draw the grey background over everything in the last commit. If you want to see what it's *supposed* to look like, go to yesterday's commit :P 2012-03-31 20:11:39 +08:00
Chris Taylor 00245bccdc Make the main stuff (gadgets, two viewers) draw for the editor in ogl, still more tweaking required 2012-03-31 18:35:06 +08:00
Chris Taylor 2d8c86eaf1 Make all drawing in the editor single buffered, since the whole screen is double buffered. Fixes crash - but only shows a black screen and the menu for ogl 2012-03-31 12:27:10 +08:00
Chris Taylor ea454664d0 Draw in response to EVENT_UI_DIALOG_DRAW, uncomment medlisp_update_screen call and use gr_box instead of gr_rect in some places. You can now see what you're doing 2012-03-24 17:18:03 +08:00
Chris Taylor 05722dec97 Remove all remaining uses of Function_mode, checking for the existence of EditorWindow where necessary instead 2012-03-19 14:08:25 +08:00
Chris Taylor 15a6a81176 The editor now falls back to the main event loop in inferno.c, File->Exit now works as intended and get closer to making the editor and game work together 2012-03-19 13:48:35 +08:00
Chris Taylor b94d8f127e Remove redundant ui_event_process and duplicate mouse.c in ui/. All editor input is now event-based. 2012-03-18 18:04:16 +08:00
Chris Taylor 6983a906a3 Make editor_handler into a proper callback, iron some problems out. Seems to draw a different bunch of stuff now (still erroneous) 2012-03-18 16:01:53 +08:00
Chris Taylor f98753fa38 Do a bit of a tidy up for the editor, dump code from editor() within the loop into new editor_handler() 2012-03-18 12:11:55 +08:00
Chris Taylor c960c868f3 Make do_wall_window into a proper callback. Only one dialog left - the main one. 2012-03-17 21:33:59 +08:00
Chris Taylor 303a9f6858 Make do_robot_window and do_object_window into proper callbacks, doing both in the same commit because of global recycling 2012-03-17 19:42:08 +08:00
Chris Taylor 6ceb7d560f Make do_trigger_window into a proper callback 2012-03-17 17:38:21 +08:00
Chris Taylor 46a816572d Make do_hostage_window into a proper callback (seems to be unused for now) 2012-03-17 16:38:45 +08:00
Chris Taylor 45415324c3 Make do_centers_window into a proper callback, iron out some problems that have become apparent 2012-03-12 10:31:48 +08:00
Chris Taylor 6068bf961d All gadgets now send events 2012-03-03 20:12:25 +08:00
Chris Taylor e05a2d3483 Actually add editor data files and make sure DXX can find them 2012-03-03 16:02:16 +08:00
Chris Taylor 1c6ecbece0 Make editor menubar and associated menus into windows; either remove or make event-based all the B1_* macros 2011-12-31 17:10:40 +08:00
Chris Taylor b15bbb982d Fix crash on exit for non-Linux, when it tries to show an editor warning (unfreed blocks) but doesn't have the images to render it 2011-11-05 17:23:20 +08:00
Chris Taylor 87c8c25580 Move calls to ui_dialog_do_gadgets to the dialog event handler, making sure ui_event_handler gets called beforehand 2011-10-09 20:30:31 +08:00
zicodxx fb775b35c3 Fixed set but unused variables 2011-09-27 01:31:17 +02:00
zicodxx 4fcfe5618c changed variables and pointer carrying vertex indexes from short to int to handle levels with over 900 segments properly 2011-06-30 12:23:38 +02:00
zicodxx dcc964817e Got rid of cfile code: Renamed cfile-functions to use PHYSFSX-naming convention, Replaced cfile-macros with proper PHYSFS(X) calls; Introduced PHYSFSX_exists() which can check case-sensitive or case-insensitive to give more flexibility with game content 2011-06-01 09:59:51 +02:00
zicodxx 6fe57317cc Like in BigEndian builds do netmisc_calc_checksum() only with expected items of segment/side struct to prevent different checksums in case these structs change; Fixed several issues when building with editor; Fixed compiler warning regarding set but unused variable 2011-05-22 19:54:44 +02:00
zicodxx 609bd15fd1 Since current approach to improve wall collisions prevented the player to enter segments which basically are too small for the player ship, added simple bumping function via object_intersects_wall(); Also when validating segments check for segment degeneration outside the editor build, too and set flag in segment structure for all different purposes but right now helps us to disable bumping when encountering degenerated segments and not break such levels 2011-05-04 02:15:07 +02:00
Chris Taylor 45930e9afe Rename ui/window.c to ui/dialog.c to avoid confusion with arch/sdl/window.c, also rename UI_WINDOW to UI_DIALOG, rename all associated functions, constants, parameters, local variables etc too; make a window when making a UI_DIALOG (does nothing yet) 2011-01-17 22:41:05 +08:00
Chris Taylor 2bd3385abd For editor, replace use of ui_mega_process() with event_process(), with the editor's own default event handler; add EVENT_MOUSE_MOVED event with event_mouse_get_delta() accessor; add event_key_get() to replace ugly casting; rename mouse_get_button() with event_mouse_get_button() to keep with name convention; only send idle events when there are no input events so editor still works properly (or the same anyway); add and use event_send() function for input events (including idle) 2011-01-13 12:36:19 +08:00
Chris Taylor 54fea43e07 Make the keypad info display into a window 2010-12-28 12:27:34 +08:00
Chris Taylor 0557c8bb43 Copy lots of editor stuff from d2x-rebirth to d1x-rebirth, getting it to work on Mac OS X 2010-12-24 12:26:24 +08:00
zicodxx ffc73ed4f2 Introduced new data type fix64 to be used for new timers which can last 4462756 years instead of 9 hours; Introduced new timer functions to update and query program time; Used new timer all over the program except GameTime (which comes next) 2010-12-11 00:18:03 +01:00
Chris Taylor be82a68e77 Add support for OS native error/warning boxes, only implemented for Mac for now 2010-11-28 20:02:38 +08:00
zicodxx ac92d9c971 Patching together editor so it compiles again (while still not running); Implemented PhysFS for file accessing for editor- and debugging-related code 2010-08-19 13:32:33 +00:00
zicodxx a172315d4a Implemented Console-style game logging system to print graphics, to stdout and gamelog.txt; Added structure to keep values for descent.cfg; Added aspect and Texture Filtering to descent.cfg; Removed mono code - printing important stuff over console; Removed some obsolete or very common defines; Code cleanup and small fixes 2008-04-06 20:23:28 +00:00
zicodxx d9e23370f9 Implemented PhysFS support; Implemended D2X memory functions; Code cleanups 2008-01-23 17:25:09 +00:00
md2211 d393f32eed * Removed executable flag on most files
* Reverted value of SOUND_MAX_VOLUME
2007-09-21 19:06:05 +00:00