Commit graph

2785 commits

Author SHA1 Message Date
Matthew Jimenez
f73b9b0c48 ULTIMA8: Add config settings for walk and run thresholds 2024-04-30 07:16:55 -05:00
Matthew Jimenez
2a0c90e7dd ULTIMA8: Clean up engine initialize / deinitialize 2024-04-26 22:28:16 -05:00
Matthew Jimenez
983580ce7a ULTIMA8: Clean up graphics startup 2024-04-26 18:37:04 -05:00
PushmePullyu
cd85aaef62 ULTIMA: NUVIE: Do not ignore "search" parameter in NuvieFileList::open()
Also correct search patterns at all call sites.
2024-04-24 20:46:00 -07:00
PushmePullyu
05724bef55 ULTIMA: NUVIE: Make NuvieFileList::open() use SearchMan
Fixes #14960
"The nuvie feature 'Use Custom Actor Tiles' is non functional"
2024-04-24 20:46:00 -07:00
PushmePullyu
0963ca6ba6 ULTIMA: Simplify UltimaDataArchive::listMembers 2024-04-24 20:46:00 -07:00
PushmePullyu
f053d9c6ce ULTIMA: Rework UltimaDataArchive::listMatchingMembers
This makes sure patterns are correctly matched against the modified/
public path of each archive member.
2024-04-24 20:46:00 -07:00
PushmePullyu
c28022ff41 ULTIMA: Implement UltimaDataArchiveMember::isDirectory() 2024-04-24 20:46:00 -07:00
PushmePullyu
fc4cf9f573 ULTIMA: Implement UltimaDataArchive::isPathDirectory() 2024-04-24 20:46:00 -07:00
PushmePullyu
078b882da0 ULTIMA: Fix UltimaDataArchiveMember::getFileName() infinite recursion 2024-04-24 20:46:00 -07:00
PushmePullyu
472f322660 ULTIMA: Implement UltimaDataArchiveProxy::isPathDirectory() 2024-04-24 20:46:00 -07:00
PushmePullyu
f171351ac4 ULTIMA: Implement UltimaDataArchiveProxy::listMembers() 2024-04-24 20:46:00 -07:00
PushmePullyu
9f6ed97a85 ULTIMA: Implement UltimaDataArchiveProxy::listMatchingMembers() 2024-04-24 20:46:00 -07:00
Matthew Jimenez
9c52f89077 ULTIMA8: Fix Ultima8Engine::setVideoMode command.
New width and height are not persisted, but this can be used for testing.
2024-04-24 21:37:40 -05:00
Matthew Jimenez
e165cd228f ULTIMA8: Replace create secondary render surface with a constructor 2024-04-24 18:19:49 -05:00
Matthew Jimenez
a67dba439b UTLIMA8: Move graphics initialization up to engine 2024-04-24 18:19:49 -05:00
Matthew Jimenez
fdb63c2127 ULTIMA8: Remove unused gamma correction tables 2024-04-24 18:19:49 -05:00
Cameron Cawley
1acd4afedf ULTIMA4: Support pixel formats other than RGB565 2024-04-25 01:04:23 +02:00
Matthew Jimenez
c6a121b112 ULTIMA8: Remove FileSystem singleton class.
All file access now directly uses Common::File.
2024-04-01 20:22:53 -05:00
Matthew Jimenez
04cc2a954d ULTIMA8: Initialize paths with "data" fallback directory. 2024-04-01 20:22:53 -05:00
Matthew Jimenez
ee5ebec7ca IMAGE: Remove palette start from image decoder.
The palette start value was always zero, adding complexity without benefit.
2024-03-31 23:16:59 +03:00
Matthew Jimenez
67c76493e3 ULTIMA8: FIx return values of minimap sampling 2024-03-28 07:49:20 -05:00
Matthew Jimenez
3ca064ca77 ULTIMA8: Crop black sections of minimap.
Generating the full map can bloat the save file. This change should reduce the size to only relevant data
2024-03-27 22:12:00 -05:00
Matthew Jimenez
50c01c7495 ULTIMA8: Convert minimap to clut8 format
This reduces savefile size, allows for faster blit, and palette transformations work on the minimap gump. Fixes issue #14851
2024-03-27 21:23:02 -05:00
Matthew Jimenez
39e448d542 ULTIMA8: Use palette colors for minimap gump.
The untransformed palette is used for now as the minimap sufaces do not use the game palette yet.
2024-03-27 21:23:02 -05:00
Matthew Jimenez
e53d58d970 ULTIMA8: Use palette entries for crusader health and energy.
These were using calculated transformations on each paint before.
2024-03-27 21:23:01 -05:00
Matthew Jimenez
74e0a8ad98 ULTIMA8: Use palette entries for mini stats.
This allows for palette transformations and is a partial fix for issue #14851
2024-03-27 21:23:00 -05:00
Matthew Jimenez
7946001da0 ULTIMA8: Make ultima8 palette inherit from graphics palette 2024-03-24 20:42:49 -05:00
Matthew Jimenez
a9a8192ff7 ULTIMA8: Mark palette pointers as const 2024-03-24 14:52:58 -05:00
Matthew Jimenez
2909deb550 ULTIMA8: Move PalTransforms to a separate header 2024-03-24 14:52:58 -05:00
Matthew Jimenez
771dc751db GRAPHICS: Switch ManagedSurface to use Palette class 2024-03-18 21:06:04 +02:00
PushmePullyu
e807f89573 ULTIMA: NUVIE: Fix Wizard Eye keyboard control
Disable keymapper during Wizard Eye (spell and crystal ball effect)
so it can be controlled via the cursor keys again.

This was a regression introduced in
12a47d956e
"Add support for ScummVM keymapper".
2024-02-23 18:59:27 -10:00
PushmePullyu
702ddabdec ULTIMA: NUVIE: Lock input to spellbook when looking at it
Undo the lock in Events::endAction().

Allows navigating the book using the cursor keys in new-style.
2024-02-23 18:59:27 -10:00
PushmePullyu
e2a9b6be4d ULTIMA: NUVIE: Fix loss of focus when dragging SpellViewGump 2024-02-23 18:59:27 -10:00
PushmePullyu
46221f1dbd ULTIMA: NUVIE: Fix enchant crash during spell selection
SpellViewGump and SpellView:
When handling a MouseDown event, do not call target_spell() if
event_mode is set, as Events expects us to select a spell in that case.

Prevents calling Events::target_spell() with callback_target set to
nullptr and subsequentially crashing the game.

To reproduce:

1. Start/load a game

2. Acquire a spellbook (obj num 57)

3. Acquire a staff (obj num 78)

4. Enable cheats (CTRL+c)

5. Enable unlimited casting (ALT+w)

6. (C)ast enchant

7. Select the staff as target

8. When prompted to select a spell, press LMB somewhere on the map
 instead
2024-02-23 18:59:27 -10:00
PushmePullyu
382abb7dad ULTIMA: NUVIE: Fix SpellViewGump deleting self/crashing on RMB
Close spellbook in cancelAction when resuming magic.

Additionally, as a precaution, do not propagate RMB events
from SpellViewGump to DraggableView.

On an RMB-down event, SpellViewGump::MouseDown() calls
Events::close_spellbook(), which uses cancelAction() to actually
close the spellbook.

However, this skipped doing so if Magic::is_waiting_to_resume() was
true.

In that case, the still open SpellViewGump received the RMB-up event,
which lead to it getting closed and deleted from
DraggableView::MouseUp().

This resulted in a crash, since the book's SpellViewGump is not
expected to be deleted during gameplay.

To reproduce:

1. Start/load a game in enhanced-mode

2. Acquire a spellbook (obj num 57)

3. Acquire a staff (obj num 78)

4. Enable cheats (CTRL+c)

5. Enable unlimited casting (ALT+w)

6. (C)ast enchant

7. Select the staff as target

8. When prompted to select a spell, press RMB instead
2024-02-23 18:59:27 -10:00
PushmePullyu
696aea82e6 ULTIMA: NUVIE: Fix crash when selecting spell to enchant with
When casting enchant in new-style mode, after selecting an object
to enchant, the spellbook is opened to choose a spell.

While the book was open, walking and other actions were still
possible. This could lead to crashes, e.g. when pressing c to cast
instead of selecting a spell.

To prevent this, lock input to the spellbook's SpellViewGump and
unlock it again in endAction().
2024-02-23 18:59:27 -10:00
PushmePullyu
a609f91a6e ULTIMA: NUVIE: Fix widgets deleting self in event handler
Do not delete widgets marked for deletion in GUI::AddWidget, so it
can safely be used from widget event handlers.

Fixes the following crashes in enhanced mode:

Using the look action on a spellbook in inventory eventually causes
a call to Events::look(Obj *obj) from ContainerWidget::try_click().

For spellbooks, look() then calls view_manager->close_all_gumps().
This closes all open gumps and marks them for deletion, including
the inventory ContainerWidget.

When the spellbook gump gets added via addWidget, this executes
the deletion.

Once control returns to ContainerWidget::try_click(), the
ContainerWidget has been deleted and the game will crash when it
tries to assign to member variable ready_obj.

A similar crash happens when selecting a staff in inventory
as the target for the enchant spell.

Fixes #14957
2024-02-23 18:59:27 -10:00
PushmePullyu
816d1c6d8c ULTIMA: NUVIE: Fix KEYINPUT_MODE keymapper regression
Disable the keymapper when entering KEYINPUT_MODE and restore
its previous state when changing mode.

Makes Events::key_redirect() work again.

The key_redirect method should cause all keyboard input to be
sent to a callback, but it was broken since commit
12a47d956e
 "Add support for ScummVM keymapper".

This caused problems with spellcasting:

1. Keymapper-bound actions (including movement) were still
 possible while the spellbook was open

2. Spell syllables whose keys were bound via the keymapper
 could not be entered.

Fixes #14959
2024-02-23 18:59:27 -10:00
PushmePullyu
e485255cc2 ULTIMA: NUVIE: Fix delete VS free 2024-02-17 13:10:46 -10:00
PushmePullyu
8f8b02e63f ULTIMA: NUVIE: Fix memory leak 2024-02-17 13:10:46 -10:00
PushmePullyu
704ca3c493 ULTIMA: NUVIE: Fix delete[] VS free 2024-02-17 13:10:46 -10:00
PushmePullyu
e37d96aa19 ULTIMA: NUVIE: Hide menu in save thumbnails 2024-02-17 13:10:46 -10:00
PushmePullyu
6ca26ec1db ULTIMA: NUVIE: Prevent moving some containers into containers on map 2024-02-17 13:10:46 -10:00
PushmePullyu
159b2084df ULTIMA: NUVIE: Fix softlock on drop to impassable location with actor
Remove unnecessary check. Prevents infnite pause mode when dropping
an object onto an actor that is at an impassable location.

To reproduce:

1. Start/load a game in non-enhanced mode

2. Get Sherry in your party

3. Drop a chest onto Sherry

4. Drop an item onto the chest
2024-02-17 13:10:46 -10:00
PushmePullyu
37502f406d ULTIMA: NUVIE: Allow pushing objects onto passable actors
Also display correct message when push is blocked.
2024-02-17 13:10:46 -10:00
PushmePullyu
37db6d1730 ULTIMA: NUVIE: Allow dropping objects onto passable actors 2024-02-17 13:10:46 -10:00
PushmePullyu
b9206fce97 ULTIMA: NUVIE: Fix Sherry blocking/being blocked during party move
Ultima 6 does not consider party members to be blocking when the party
is following the player. It avoids stacking them via the is_contiguous()
check instead, which also has an exception for Sherry the mouse.
2024-02-17 13:10:46 -10:00
PushmePullyu
7cd99686af ULTIMA: NUVIE: Do not swap positions with party when moving as Sherry
The regression was introduced with the recent actor passability
changes.
2024-02-17 13:10:46 -10:00
PushmePullyu
593472a252 ULTIMA: NUVIE: Only bump one party member on player move
If there are more party members on the destination tile, ignore them.
2024-02-17 13:10:46 -10:00