Commit Graph

96 Commits

Author SHA1 Message Date
76ccb66786 Beep beep 2014-12-11 00:47:04 -05:00
eb2fb485ac Don't create a new texture every time tiling is requested, though sadly this introduces a new issue 2014-12-11 00:15:26 -05:00
34be9a0233 Bring up Get Items dialog when retrieving stored items from the next scenario, so that you can pick and choose which items to keep.
Also some bugfixes and stuff:
- Fix specials sometimes being run twice in a row
- Holding Control while clicking Create also makes a debug party (as an alternative to holding Command)
- Fix "How Many" popup being non-dismissible
- Reduce loading time spent on checking for missing opcodes
2014-12-08 02:37:15 -05:00
5249c6eef7 Add a lot of stuff scraped from *i's version of the code, plus a couple of additional bits.
Adapted from *i:
- Show a confirm dialog when interrupting a special node sequence
- New monster special ability: call global special node (as an action, not on death)
- New item special ability: call global special node
- Check there's a monster death special before calling it (wasn't necessary before, might be now with the special queue changes)
- Queue specials that are triggered while another special is in progress, instead of ignoring them; they will be run after the current special in progress finishes.
- *i's version of petrification touch is currently active only for monster-on-monster combat; need to merge with my version for monster-on-pc combat.
- Pass party location to special in use special item context
- Fix set town visibility node (was checking wrong field and thus could not hide towns)
Special nodes:
- Town Hostile: change to Set Town Attitude
- Select PC node: option to select random PC
- Affect special nodes can now affect monsters
- Fix affect death node reviving non-existent PCs
- Affect Spells: Can remove spells, and can affect level 1-3 spells
- If Objects: Merged from If Barrels and If Crates
- If Species: Replaces If Cave Lore
- If Trait: Replaces If Woodsman
- If Statistic: Replaces If Enough Mage Lore
- Change Lighting: Can affect town's global lighting setting, player's light level, or both at once.
- Pointers! Actually, I'd already implemented the callbacks for setting and getting them, but they're now actually used, and the implementation has been tweaked a little.
- Campaign flags! Again, I'd already implemented them sorta, but I tweaked things and they ended up sort of halfway between the two implementations. Plus there's now a special node to set them.

Additional bits:
- Special queue now uses an std::queue instead of a basic array.
- Enum for town lighting levels
- Disease touch ability is now honoured for monster-on-monster combat
- See monster special context now passes the monster's location as the trigger location; also, removed the double-trigger from one circumstance.
- Along with the set town attitude change, there's now the possibility for making the town hostile to trigger a special node, which can cause the party to be slain.
- Select PC special node: option to select specific PC
- Spell IDs for use in shops and Affect Spell nodes have changed so that 0 is now the first level 1 spell, and so forth.
- add_string_to_buf can now auto-split the string over multiple lines, and the special node that uses it takes advantage of this
- Special node parser warns if a node type is missing a corresponding opcode
- Reserved "pointers" to access the special node's trigger location (this was *i's idea, but he never implemented it)
2014-12-08 01:08:30 -05:00
46c3c69bd9 Merge the XXX_BLOCK and SANCTIFY special nodes into a single, more versatile IS_CONTEXT node 2014-12-07 00:36:10 -05:00
bfdcfeab58 Strictify special node type enum 2014-12-06 22:28:09 -05:00
ea435825b7 Some basic documentation of the resource manager. It could probably be improved a lot. 2014-12-06 18:02:41 -05:00
56f73cb156 Lots of little tweaks and fixes to various things, mostly dialog stuff.
- LED groups now trigger their own click handler in addition to the clicked LED's click handler (provided the latter returns true). If the handler returns false, the click has no effect.
- LED groups now cancel the selection change if their focus handler returns false; this mimics the behaviour when an individual LED's focus handler returns false.
- Move the dialog getResult() definitions inline - since there's only two of them now that I'm using boost::any, having them in a separate file is pointless.
- Changed how the pict choice dialog returns its result - now it returns only whether the user clicked cancel and provides getters to obtain the number and type.
- Pict and string choice dialogs now hide the arrow buttons when there is only one page of options.
- Fix pict choice dialog always returning the initially selected value (similar to how the string choice dialog did before I fixed it)
- When passed an invalid starting selection, the pict choice dialog now always starts with the first icon selected
- Fix wrong bounds for several typs of custom graphics in dialogs
- Fix wrong /source/ bounds for custom 28x36 graphics /everywhere in the game/.
- Fix select PC graphic dialog having a second page with an invalid graphic that can be selected.
2014-12-05 23:48:07 -05:00
4db81f1403 Implementation of parsing for the map format (untested)
- Some stubs inserted for loading new-format scenario data
2014-12-05 00:50:17 -05:00
94d8717a0b Nuke as many warnings as possible, and several globals as well
- Warnings completely suppressed for the included TinyXML and gzstream libraries
- Parentheses warnings are now errors, since there were several that looked like bugs
- Ditto for dangling else warnings

Some of these warnings were actually bugs:
- Town wandering monsters would have never spawned, because the code to do so was accidentally nested within a check for overall_mode == MODE_OUTDOORS
---> boe.monster.cpp, lines 105-137
- Monster's behaviour with respect to elemental fields did not correctly depend on their immunities (this is the same precedence issue Sylae messed up fixing in the Windows code)
---> boe.monsters.cpp, lines 345-359
- Display of damage blocked by armour appeared to be incorrect (needs verification)
---> boe.newgraph.cpp, line 1079
- Three-choice dialogs probably weren't dealing with unusual button types correctly, though that's a minor point since they aren't expected to use such buttons
2014-12-04 12:44:17 -05:00
47fc23928c Strictify status types enum 2014-12-03 23:18:12 -05:00
efa552a366 Don't use CoreFoundation to check machine's endianness 2014-12-03 18:04:33 -05:00
7a2a0f93d3 Finally, a working parser!
--> At least, it parses the sample file correctly

- I reverted the choice of using a skip parser, because it was failing and I couldn't figure out why. This means there's a lot of *ws where whitespace can go.
- Grammar rearranged a little
2014-12-03 05:03:10 -05:00
62f2259fb9 Hacked at it until the parser stopped crashing.
It now seems even uglier than before.
And it still doesn't actually work.
2014-12-03 05:01:06 -05:00
c119ffc242 More little grammar simplifications 2014-12-02 22:23:31 -05:00
e51cdb5c1d Simplify grammar a bit by specifying a skip parser 2014-12-02 20:56:10 -05:00
1b97c6557b Finish up most of the semantic action type stuff
- The parser does not work at present; it does at least compile and link, though
2014-12-02 20:48:31 -05:00
9da92fb904 I'm thinking allowing names here might be a bad idea 2014-12-02 18:44:38 -05:00
4a68a5b293 Unminify the semantic actions 2014-12-02 18:33:51 -05:00
5fe8b28b2e Doing the opcodes as a symbol table seems better 2014-12-02 18:30:25 -05:00
d1a8db9b70 Sample nodes file, more semantic actions
- Note: This parser is still untested.
2014-12-02 17:07:39 -05:00
01f0a62160 Define a grammar for special node definition files 2014-12-02 15:59:38 -05:00
03c64ebd7b Eliminate use of __attribute__
Ideally this would be standard C++, but here I've settled for things that should be supported by both clang and VS/cl.exe:
- Deprecated attribute retained, but now uses __declspec syntax
- Packed attribute replaced with pragma pack, except one instance where it unnecessary
- Aligned attribute replaced with explicit padding bytes inserted in the structs where needed
- Unused attribute simply removed (though where possible, the unused entities were also removed)
2014-12-02 15:54:50 -05:00
d900c7edef Enumify terrain blockage and generalize the line of sight function
This should probably be two separate commits, but they're tangled together and I don't want to spend the effort to disentangle them.
2014-12-01 19:50:19 -05:00
3fa0a26ec3 no message 2014-12-01 02:01:24 -05:00
70696dc42f Text fields now support multiline editing! 2014-12-01 01:20:28 -05:00
6c0fc58bf1 Rewrite the conversation rendering and interaction engine
- The only functional change is that clickable words are now red
2014-11-30 20:38:21 -05:00
3f857cc568 Seperate the logic of calculating where to draw the text from the code that actually draws it 2014-11-29 21:12:06 -05:00
84f2e7b831 Refactor out currently-minor code duplication in text drawing routine 2014-11-29 19:48:36 -05:00
a9ea0a114c Make text drawing mode a strict enum 2014-11-29 19:41:54 -05:00
1cdc7ddb7c Misc bits 2014-11-29 03:21:28 -05:00
41c3396aa3 Tear out most of the legacy code in the scenario editor - see below for details
- All Carbon code is gone
- Many dialogs converted; some are still left unimplemented since they still need to be converted
- Menus converted to a xib file
- The giant arrays specifying the configuration of the special node dialog for each special node type have been replaced with maps and sets.

Changes to dialogs:
- pict choice dialog can now show picts of differing types; this was required for picking a monster graphic, as monsters of all sizes need to be shown in the same dialog
- string choice dialog can set the title, and properly shows the currently selected string
- LEDs now accept font format
- Fixed LED group's calculation of its rect
- Fixed LED group crashing if it has no selection
- Tabbing between text fields now works
- Fix display of larger monster graphics in dialogs
- Fix the script element content showing in the browser preview
2014-07-12 22:13:27 -04:00
a4430cdf5a Fix spellcasting and dynamic menus
- Spell targeting line and array draws nicely, though not the same as the original
- Fix targeting falsely complaining about being off the edge of town
- Monster info dialog works properly; attacks now display correctly
- Fix dialogs always showing the wrong terrain or monster graphic
- Spell menus, monster menus, and PC editor item menus all work
- Spellcasting dialog now chooses the correct spell
- Fix out-of-place LED in spellcasting dialog
2014-04-22 02:06:31 -04:00
446bb1550d Some more tweaks to cursor handling
- Fix cursor turning into a sword during universe shifts
- Hide cursor along with menubar during splash screen
- Add watch cursor, used during splash screen
- Properly restore cursor after a dialog
- Use sword cursor for dialogs
- Show ibeam cursor in dialog text fields
- Move everything cursor-related out of graphtool
2014-04-21 13:47:52 -04:00
84192cd52f Finally bring cursors into the resource manager framework
- Hotspots are still hardcoded, unfortunately
- Obscuring the cursor when using the keyboard now works properly
2014-04-21 04:05:55 -04:00
002ee640da Remove the global TextStyle; this should fix some of the textual glitches 2014-04-21 01:49:07 -04:00
f9a21dd068 Fix up the pick custom scenario dialog 2014-04-20 23:55:01 -04:00
ed4558f805 Replace the soundtool arrays with more compact sets/maps 2014-04-20 23:41:45 -04:00
c13c0cf589 Sorting includes (tools directory) 2014-04-20 23:22:57 -04:00
4cf1c5a8f6 Fix a plethora of bugs and crashes when loading new savegames; loading now works, though with a few glitches still 2014-04-20 17:43:16 -04:00
3a0f1ad7f5 Finish up the bulk of the loading implementation, with some tweaks to saving to make sure it all matches 2014-04-20 15:46:53 -04:00
0c0450f4fe Set up the main logic for loading saved games 2014-04-20 02:23:51 -04:00
277dd6c208 Get progDir from argv[0] instead of using CoreFoundation 2014-04-20 00:47:43 -04:00
60d1ce3be9 Initial setup for saving game states
(code may or may not compile at this point)
2014-04-19 22:47:38 -04:00
3f54c63193 Import new dependency into repository: gzstream 2014-04-19 22:28:21 -04:00
6f040e2c56 Turns out we never actually need to check which window is in front 2014-04-19 09:01:13 -04:00
19c2b37464 Remove redundant scissor disable and include conditional for OpenGL header
- Because Apple puts it in a different place than every other platform
2014-04-19 08:50:42 -04:00
4f741b440f Fix walkway and wall trims; not sure why shore frills don't also work 2014-04-18 16:59:33 -04:00
55c3f83d22 Fix light masks for dark towns 2014-04-18 01:26:05 -04:00
dca3c3c18f Really fix the talking crash this time, I'm pretty sure 2014-04-18 01:19:13 -04:00