Commit Graph

184 Commits

Author SHA1 Message Date
3c3ed04ca7 Make the automap actually work
- Except that it's showing just black and white instead of the proper terrain pictures
- Fixed towns not initializing some flags, such as defy_mapping, causing them to be true when they shouldn't be
- Fix Ellipse shapes not being correctly positioned
2014-04-14 21:16:35 -04:00
121273bf57 Fix main window not receiving focus after leaving a file navigation dialog 2014-04-14 20:35:30 -04:00
441e0a5459 Fix text display while talking 2014-04-14 17:43:54 -04:00
a157c5358b Fix crash when talking to someone
- Also make a lot of talk stuff use std::string instead of char[]
2014-04-14 17:06:50 -04:00
db98f6245e Fixed first button in dialog without attached key being triggered by any unknown key 2014-04-14 17:03:05 -04:00
48f3335160 Fix "missing" Done button in PC info dialog
- Also fix wrong resource name - the pc-spell-info DITL was mistakenly named pc-info
2014-04-14 15:51:30 -04:00
7b194c26ba Fix mage/priest spell buttons in PC info dialog being labelled with the level of the skill 2014-04-14 15:51:30 -04:00
146eb5dd40 Fix crash when viewing PC spell list 2014-04-14 15:51:29 -04:00
8ecf76e758 Fix crash on viewing PC info 2014-04-14 15:51:29 -04:00
07140349a2 Fix white first character name and item charges being shown as boxes 2014-04-14 15:51:28 -04:00
854dae0576 Fix string dialogs attempting to play garbage sounds 2014-04-14 15:51:28 -04:00
1ce6c6cc94 Fixed crash when getting items and some other improper use of std::ostringstream 2014-04-14 15:51:27 -04:00
b68abf037d Slightly improved error messages in the dialog framework 2014-04-14 15:51:27 -04:00
a2ca0bf3b1 Catch exceptions and show an error dialog to the user 2014-04-14 15:51:27 -04:00
8a6d222083 Re-indent main() 2014-04-14 15:51:26 -04:00
b36c9778c6 Fix keyboard controls 2014-04-14 15:51:26 -04:00
fa551c8f43 Don't hide mouse cursor if it's outside the window 2014-04-14 15:51:26 -04:00
5f9be1cb6a Save help received to prefs file 2014-04-14 15:51:25 -04:00
45494d0c2e Fix some preferences having incorrect defaults and made all preferences save
- SDF preferences, which are also stored in the save file, are only saved if you're at the startup screen
- Also fixed a crash when saving prefs
2014-04-14 15:51:25 -04:00
a53c16c4a0 Skip startup music along with splash screen 2014-04-14 15:51:24 -04:00
0d53357955 Fix crash on seeing a monster 2014-04-14 15:51:24 -04:00
eeb5ca0f06 Rewrite prefs loading/saving to use Cocoa 2014-04-14 15:51:24 -04:00
a76755d961 Fix tip of the day setting not being saved 2014-04-14 13:55:54 -04:00
a641fdefc1 Fix preferences dialog not properly remembering settings 2014-04-14 13:55:53 -04:00
8d76aed26c Add preferences option to skip splash screen on startup 2014-04-14 13:55:52 -04:00
44044929cc Make custom 3-choice dialogs always have a default button 2014-04-14 13:55:51 -04:00
672d4b88d0 Address major lag issues
- Now waits for events instead of busy polling
- Changes the cursor on receiving a mouse move rather than before checking for an event
- Make cursor sword when it's out of window
- Temporarily disable unseen mask as it didn't work properly and was the main cause of the lag
- Don't reset text bar on every loop
2014-04-14 13:55:49 -04:00
0087731ddb Fix crash when quitting the game 2014-04-14 13:55:49 -04:00
2986ca80a8 Fix crash when adjusting the monster and spell menus 2014-04-14 13:55:48 -04:00
2a3b275259 Make everything display correctly on the main game screen 2014-04-14 13:55:48 -04:00
41c043ec27 Fix forgetting to initialize render textures and other minor things
- Removed now-unused render texture for the startup animation
- Don't place background after drawing buttons
- Fix conversion error in rectunion call
- A couple of TODO notes
2014-04-14 13:55:36 -04:00
904eb389c5 Fix custom dialogs having the wrong background and default text colours 2014-04-14 13:52:10 -04:00
dac305b1eb Fix custom dialogs attempting to check non-existent buttons 2014-04-14 13:52:10 -04:00
6b224145b2 Fix scrollbars being initialized with a garbage max value 2014-04-14 13:52:09 -04:00
5552dd9df8 Add sceondary offset method to Region class 2014-04-14 13:52:09 -04:00
5f6df4d76f Remove FlushAndPause() function 2014-04-14 13:52:08 -04:00
83a67395bb Remove create_clip_region() function 2014-04-14 13:52:08 -04:00
8e4e783df0 Sort most files alphabetically in the XCode project 2014-04-14 13:52:07 -04:00
9f5480ba8b Add methods to rectangle to get its corners as locations 2014-04-14 13:52:07 -04:00
7afaaf3a60 SFML doesn't like textures of size 0 2014-04-14 13:52:06 -04:00
9d6867d15b Suppress the superfluous "validates" messages from the xmllint output 2014-04-14 13:52:06 -04:00
a6a030052c Implement loading of .meg files using the Resource manager
- I extract pixel data from the resource without using QuickDraw
- Both resource-fork and data-fork .meg files work

Related changes:
- The custom graphics textures are now wrapped in a custom class
- bmp images are loaded if a meg is not found

Incidental changes:
- Various TODO notes
- Fix cScenario::spec_strs skipping several strings and potentially fetching out-of-bound entries
- oopsError now uses string streams instead of sprintf
2014-04-14 13:52:05 -04:00
4db8a0943b Convert legacy structs and endian-swapping routines to use exact-width types
- This because I discovered my compiler makes the long 8 bytes instead of 4
2014-04-14 13:52:04 -04:00
68c8ef7ba7 Import the TinyXML dependency into the repository 2014-04-14 13:52:03 -04:00
57abf3ab68 Make the XML validation phase check against the schema, and fixed all the errors it found 2014-04-14 13:52:03 -04:00
1b72d25d52 Replace DialogXML DTD with an XSD schema 2014-04-14 13:52:03 -04:00
c413d292a9 Tear out most of the legacy code in the game - see below for details
(PC Editor and Scenario Editor are unaffected by this commit.)

Things removed:
- All references to Carbon and QuickDraw are gone.
- No more Resource Manager; the game no longer relies on old resource files at all
- The old dialog framework (from dlogtool.c, functions usually prefixed with cd_) is no longer used.
- Files that weren't being compiled
- Boost libraries that are now in the C++ library (function, shared_ptr)
- Obsolete build settings

Replacement dependencies:
- Boost Filesystem replaces references to things like FSSpec
- SFML replaces all the QuickDraw code and most window management
- Cocoa replaces AppleEvent management, menu management, and some window management
- I wrote a resource manager interface to mimick the important aspects of the behaviour of the Mac Resource Manager
- I had to rewrite some functions that QuickDraw provided natively, such as clipping regions; not all of these are tested

Things added:
- Every referenced dialog has been converted from a DITL resource into the new XML-based dialog format.
- All referenced STR# resources have been extracted into simple text files
- Now compiles against Mac OSX 10.7 SDK and libc++
- The first item in the Help menu opens the docs on Sylae's website
- It seems all the constants for soundtool vanished somewhere, so I added them back from the original Mac source

Other changes:
- Updated to XCode 4(?) project format
- Added the xcschemes created by XCode 4; I'm not sure how important these are, but they seem like they might be important
- Added document on converting dialogs to the XML format.
- Make string formatting mismatches into errors instead of warnings
- Disable error limit
- Graphics sheets that previously used masking now have alpha transparency
- Converted all graphics sheets to 8-bit PNG
- Trimmed white border from intro image
- Converted dialogs in the resource file have their resource name set to the name of the XML file of the converted version
- Referenced string resources in the resource file have their resource name set to the name of the text file of the extracted version
- Add the black-and-white patterns from the PAT resources to the pixpats.png; at least one of them is used somewhere in the game
- Recreated the menu.xib as a Cocoa xib file instead of a Carbon xib file
- Disable GNU C++ extensions; maybe this'll make it easier to compile with cl.exe later
- Add marks to the enormous handle_action function to make it easier to navigate\
- A build step to validate the XML dialogs using xmllint (doesn't quite work properly yet but does at least catch dialogs that are not well-formed)- Fix a lot of warnings about assigning string constants to non-const char pointers
- Fixed the file and application icons (which had somehow become corrupted at some point)
- Lots of additional functions in the custom location and rectangle classes, including implicit conversion to and from SFML rects and vectors; also they now store coordinates as int instead of char
- A new enum for encounter note types
- Much tweaking of the encounter note recording mechanisms
- To ease porting, I added a simple function that converts from classic Mac ticks (about 1/60 of a second) to the SFML time type
- Python script to convert STR# resources to txt files, replacing newlines with vertical bars
- Extracted the Mac font (Dungeon Bold) from the resource file and also added the Windows font (MaidenWord)

XML Dialog Framework changes:
- Remove the static initialization object in favour of manually calling cDialog::init()
- {set,get}Format() no longer used for colour; there's a dedicated {set,get}Colour() instead
- draw() methods unprotected in the control classes so that controls can be drawn in the main window
- There's no longer a friend relationship between the dialogs and the controls
- Fixed buttons duplicating the "depressed" boolean
- Buttons now properly offset the label for tiny and push buttons, and for LEDs
- Buttons no longer assume that either none or both of "width" and "height" are given in the XML
- Add {get,set}BtnType() to cButton
- cLedGroup now overrides handleClick(), which has also been made virtual; this was necessary for LEDs within a group to properly hilite while being clicked
- Add addChoice() to cLedGroup to insert additional LED choices
- Moved the key enums and cKey to a separate file
- Add a method to get a control's attached key
- Add methods to get and set a control's rect and position
- Controls can now directly take a window as a parent rather than a dialog
- Add addLabelFor() method to cDialog which adds a static text control as a label for another control
- Remove hack for storing a dialog result of arbitrary type in favour of boost::any
- Add method to get default text colour for a dialog
- Add method to get a dialog's rect
- Add method to add the same event handler to multiple controls in a dialog
- Add concept of default button to dialogs
- Add enum for text field type (currently either number or text)
- Implement the text field without use of native controls, including somewhat decent text input and a flashing insertion point
- cPict no longer stores references to every sheet; it fetches them as needed from the resource manager
- The many draw functions in cPict are no longer static, since they need to access the window containing the pict (before they could only be static due to QuickDraw's global state)
- Add setPict() without a type argument to change the graphic without changing the type, which is a common operation
- Add a scrollbar control; the specifics aren't implemented yet
- Change signature of the record callback for cStrDlog; it will no longer be passed the strings
- Publicize the no-button constructor of cChoiceDlog; it'll assume "okay" is the only button
- Add operator-> to cPictChoice for accessing the underlying dialog
- Add constructor to cPictChoice that takes a starting and ending pic num
- Remove err parameter from giveError
- Many more keys handled, plus support for catching copy, paste, cut, and select all keyboard shortcuts
- Text input fields take priority, overriding any other keyboard shortcuts in the dialog, but they never catch help (F1), escape, or enter
- Some changes to the format itself:
-> keys go in the "def-key" attribute, but modifiers go in "key-mod"
-> "clickable" is no longer a recognized attribute
-> "title" is now a recognized text size (18pt, even larger than "large" at 12pt)
-> "defbtn" attribute on the root element
2014-04-14 13:52:01 -04:00
b02902770c Well, at present the Windows code for the actual game almost compiles. The current goal is to undo all the things that Ormus did to make this job difficult.
Basically, remove as many as possible of the dependencies of the source files in the tools and classes folders on source files not in those folders.
(With the exception that files in the classes folder may depend on files in the tools folder.)

In this commit, several changes were made.
- Project file modified, may need further modification.
- Many files renamed to match the Mac version.
- #include statements for system headers changed to use <> instead of "" (some already did, but many didn't).
- xxx.h headers replaced with cxxx headers where appropriate.
- Most sound-related variables moved from globvars.cpp to soundvars.cpp.
- The files originally named graphutil and gutils have been merged.
- Changed TRUE/FALSE to true/false.
- Changed exlsound to soundtool and mostly removed dependencies on the main game files; the exception is that it still uses mainPtr (which probably can't be helped)
  and print_nums (which should probably be incorporated into the MessageBox string).
- Possibly other things that were forgotten.

For some reason this commit also includes changes recently committed into the branch for osx.

git-svn-id: http://openexile.googlecode.com/svn/trunk@121 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-08-03 19:00:23 +00:00
9bbfc01c5d - Removed the ViewDlog target (since it's deprecated by the new dialog engine)
- Renamed some things for shorter filenames
- Moved the license into the doc folder
- Cleaned up the project internal hierarchy so that it knows of the external file hierarchy (This should reduce the steps needed to fix bad references when a name is changed.)

git-svn-id: http://openexile.googlecode.com/svn/trunk@112 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-07-13 17:26:40 +00:00
1ebab2d72d Several Mac bug fixes, most of which are untested (but are known to work in the Windows version)
- Added code to the special queue handling which runs the queued specials as if they had happened at the time the special was queue, rather than when it's actually run.
- Fixed bug in which horses would enter lava while outdoors, but not in town.
- Fixed bug that sometimes occurred when a PC is killed by backlash while attempting to move away from a monster.
- Fixed checking for the wrong ability in handle_disease().
- Fixed bug in which asking about "name" would not show the Name response while talking. Instead, asking about "nama" would show that response.
- Added a response to "buy" and "bye".
- Removed the check in destroy_an_item() which gave rocks the top priorite to be destroyed. They still have high priority due to a value below 3, and besides this function will eventually be deprecated.
- Added a check to Absorb Spells monsters to avoid overflow of the monster's health.
- If you call add_string_to_buf with an empty string, it now does nothing.
- Changed cItemRec::type_flag to unsigned short, since it's supposed to be able to range up to 1000.
- Added flag to the scenario structure to disable the automatic doubling of hit points with high level parties.
- Fixed bug in which starting combat in dense forest results in a swap arena instead of a forest arena. (This was never noticed because dense forest is usually impassable.)
- Fixed bug with triggering combat on a walkway space (if in cave, a grass arena was created and vice versa)
- Extended the conversion code to account for arenas on animated terrain.
I also started to rework the way Split Party works, only to decide that I didn't want to do it that way. As a result, I haven't written code to convert
split party data from old saved game files, yet.
- The old SDF_ constants related to party splitting are now gone.
- Several member functions are added to cParty to fulfill the function of the constants
- Altered the way an Affect PC node will decide which PC to affect. If the party is split and only one PC is present, it affects that PC. Otherwise, it affects the chosen PC, even if the party is split.

git-svn-id: http://openexile.googlecode.com/svn/trunk@111 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-07-13 15:53:33 +00:00