Commit Graph
54 Commits
Author SHA1 Message Date
Kaloyan Chehlarski 4d5c4fcfcc NANCY: Rename graphics and cursor managers
Changed the names of the pointers to GraphicsManager
and CursorManager to be shorter, since they were
inconsistent with the rest of the managers, and typing
them out is a chore.
2024-02-11 00:41:29 +01:00
Kaloyan Chehlarski f3fee34f42 NANCY: Indent Autotext when wrapping
Replicating a bug in the original engine, where a value
from TBOX is used in all rendering, resulting in all wrapped
textlines appearing slightly indented inwards.
2024-01-30 23:13:12 +01:00
Kaloyan Chehlarski 56b48f6186 NANCY: Add GetEngineData macro
Added a macro that hides away the ugly casts whenever
an EngineData object is requested.
2023-10-12 12:42:28 +03:00
Kaloyan Chehlarski 4aa0727f95 NANCY: Reset textbox scrollbar when adding new line 2023-10-07 14:45:22 +03:00
Kaloyan Chehlarski 120160b6e4 NANCY: Implement Autotext
Implemented the Autotext record type, which is used for
text rendering (prior to its introduction in nancy6, all
in-game text was prerendered). Made relevant changes to
the Overlay and Hypertext classes to support it.
2023-09-23 21:59:40 +03:00
Kaloyan Chehlarski 09a21ad755 NANCY: Set correct default textbox font
Modified the Textbox code so the conversation font is no
longer the default, but rather has to be requested by
Conversation types. This fixes the nancy6 tutorial having
a blue highlighted text while explicitly needing red.
2023-09-20 16:16:22 +03:00
Kaloyan Chehlarski 3bbd8e6bb5 NANCY: Improve TBOX and FONT chunk reading
Fixed some incorrect assumptions about the data found
inside TBOX and FONT boot chunks. Made relevant changes
to HypertextParser to reflect the new data.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski fa522ff939 NANCY: Move hypertext handling outside Textbox
Added a separate class for handling hypertext (tagged
text used in conversations, etc) in preparation for the
addition of Autotext, which will also use it.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski b3c81e7074 NANCY: Auto-clear inventory item captions
Item "can't" sounds' captions get automatically cleared after
a certain time delay, which is now implemented.
2023-09-16 17:04:37 +03:00
Kaloyan Chehlarski b5efecf258 NANCY: Improve color text behavior
Fixed an issue where strings with invalid color markup
were being processed differently from the way the original
engine did, making some strings colored when they
shouldn't be. This fixes the nancy4 intro and some other
strings in the same game.
2023-09-09 12:49:30 +03:00
Kaloyan Chehlarski 03d4791ed2 NANCY: Implement standard way to access boot chunks
Previously, the NancyEngine class was responsible for
handling creation and destruction of many naked pointers
to engine data, which led to several instances of memory
leaks that needed to be fixed. These changes introduce a
standard way of handling that same data, similar to the
one already used by PuzzleData inside Scene. Unfortunately,
this does add the need for relevant data to be casted to
the proper type before it is handled.
2023-08-31 12:20:39 +03:00
Kaloyan Chehlarski c9c784c2fa NANCY: Clear textbox on every scene change
The previous design, where the textbox kept its contents
unless it was explicitly cleared, was probably a leftover
from the early days of the engine, though I honestly can't
remember.
2023-08-25 20:32:06 +03:00
Kaloyan Chehlarski 9754cc9b33 NANCY: Implement font id token in text
Added logic for the <f#> token introduced in nancy5,
which selects which font to use when rendering the string.

Rewrote the hypertext handling to use StringTokenizer.
This makes the addition of new tokens much easier, while
also ensuring unimplemented tokens no longer crash the
engine.
2023-08-25 20:32:06 +03:00
Kaloyan Chehlarski 913fff22bf NANCY: Fix crash in nancy4's intro
Fixed a crash caused by a malformed string where a color
end token is present without a corresponding color begin one.
2023-08-08 12:13:06 +03:00
Eugene Sandulenko f94464ecb1 NANCY: JANITORIAL: Remove trailing spaces 2023-08-07 10:47:50 +02:00
Kaloyan Chehlarski 16ed90c477 NANCY: Fix textbox color edge case
Fixed an edge case where color wouldn't get toggled
correctly in the textbox drawing function. This fixes the
lose game dialogue when unhooking the chandelier
in nancy3.
2023-07-13 18:13:57 +03:00
Kaloyan Chehlarski 88d8864871 NANCY: Don't expect color end tag in text
Fixed a crash that resulted from the expectation that
a color begin token is always matched with a color end token
inside textbox text.
2023-07-13 18:13:57 +03:00
Kaloyan Chehlarski e28b303c74 NANCY: Fix drawing of color text in textbox
Fixed an issue with counting the number of drawn characters
in the textbox which resulted in color text sometimes being
cut early.
2023-05-12 12:42:32 +03:00
Kaloyan Chehlarski 09e5cefea3 NANCY: Rewrite textbox drawing code
Rewrote drawTextbox() to be much cleaner and to support
some edge cases in nancy3 which would previously crash
the engine.
2023-05-11 14:28:55 +03:00
Kaloyan Chehlarski dff9cbe272 NANCY: Use correct values for nancy3's flags
Nancy3 did away with earlier versions of the engine's usage
of 1 and 2 as false/true values. This commit adds two
new values to NancyEngine: _true and _false, which hold
the correct values used by different versions of the engine.
2023-05-10 16:57:33 +03:00
Kaloyan Chehlarski 01de81a7d7 NANCY: Implement RiddlePuzzle
Implemented the RiddlePuzzle action record, where
the player has to type in the answers to several riddles.
2023-04-19 15:02:29 +03:00
Kaloyan Chehlarski b612dbe0b0 NANCY: Fix crash when loading game
Fixed a crash when loading a game directly from the launcher.
2023-04-15 14:46:21 +03:00
Kaloyan Chehlarski a67dbb9e09 NANCY: Implement textbox hover highlighting
Added highlighting to hovered response text in nancy2's
textbox.
2023-04-14 22:39:10 +03:00
Kaloyan Chehlarski 9e25e1c7a0 NANCY: Don't assume the end line token is last
Fixed the incorrect assumption that the <o> token is the last
thng to appear in a text line, since nancy2's dialogue has
newline tokens at the end instead.
2023-04-14 22:39:09 +03:00
Kaloyan Chehlarski 802d66782b NANCY: Implement inventory box ornaments 2023-04-06 18:17:15 +03:00
Kaloyan Chehlarski e0f74000ef NANCY: Implement structs for some BOOT chunks
Boot chunks BSUM, VIEW, INV, and TBOX are now read only at startup,
and their data is kept permanently inside NancyEngine. This removes the
need for the chunks to be read by multiple classes and always kept
in memory.
2023-03-30 20:21:36 +03:00
Kaloyan Chehlarski 0945613bd8 NANCY: Wrap color text
Added wrapping to colored text, which fixes the player speech in the
Russian variant of nancy1 not being displayed fully.
2023-03-30 20:21:33 +03:00
Kaloyan Chehlarski 3f6cc5ec9c NANCY: Don't cut off text in The Vampire Diaries
The calculations for getting the inner height of the textbox have been
tweaked to get results closer to the original engine. This fixes an issue
in The Vampire Diaries where longer text would get cut off at the end.
2023-03-15 18:25:00 +02:00
Kaloyan Chehlarski 8190f09acc NANCY: Fix incorrect hotspots in textbox
Fixed a wrong calculation for the height of textbox response hotspots
which could result in incorrect dialogue choices being made.
2023-03-07 21:19:22 +02:00
Kaloyan Chehlarski 8e69d52ce3 NANCY: The Vampire Diaries scrollbar visual fixes
Scrollbars in The Vampire Diaries are now drawn one pixel to the left
so they are in the exact spot as the original engine. Also, the textbox
scrollbar now correctly overlaps the inventory box curtains.
2023-02-25 19:37:23 +02:00
Kaloyan Chehlarski 78df65e416 NANCY: Simplify and improve graphics code
Rewrote GraphicsManager::draw() to be simpler and more correct,
eliminating the need for RenderObjects to know what they're
overlapping at creation.  This comes at the cost of slightly increased
redraw, but that can be reduced fairly easily if needed.
2023-02-25 19:37:23 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko 57517dbe21 NANCY: Fix MSVC warning 2021-07-01 01:35:58 +02:00
Kaloyan Chehlarski 8760d9b54c NANCY: Better fix for broken text lines in The Vampire Diaries
The check for broken text lines has been improved and now fixes at least one more bad string in The Vampire Diaries.
2021-05-18 00:44:19 +03:00
Kaloyan Chehlarski 6abc61edf7 NANCY: Render text in The Vampire Diaries
Text in TVD is now rendered in the textbox, and should be
pixel-accurate to the original engine.
2021-04-29 15:59:00 +03:00
fracturehill 54d6de7b57 NANCY: Make text rendering pixel-perfect
Made changes to the Textbox and Font classes so the text rendering in nancy1 looks exactly the same as it does in the original engine.
2021-04-17 15:09:18 +03:00
fracturehill a29cdd43c0 NANCY: Make RenderObject non-abstract
Made RenderObject non-abstract so it can be used in some simple cases without the need for subclassing.
2021-04-15 15:12:00 +03:00
fracturehill f255542672 NANCY: Scrollbar fixes
Changed the UI::Scrollbar class so it doesn't require subclassing and added functionality for horizontal scrollbars. Fixed the textbox and inventory box scrollbars so their lowest point is consistent with the original engine's.
2021-04-15 15:11:59 +03:00
fracturehill 85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +03:00
fracturehill ff078328bc NANCY: Includes cleanup
Cleaned up the engine's #includes. Also moved the NancyEngine::GameState enum to commontypes.h and renamed it to NancyState.
2021-03-26 01:17:07 +02:00
fracturehill 1907b5f741 NANCY: Remove static members of GraphicsManager
Made GraphicsManager's static members non-static.
2021-03-24 17:20:46 +01:00
fracturehill 56c005ef2c NANCY: Mark functions and iterators as const
Added the const keyword to several auto & iterators inside for loops, as well as to a number of class member functions.
2021-03-24 17:20:46 +01:00
fracturehill e9adea4c4e NANCY: Formatting fixes
Almost every file in the engine code was using spaces instead of tabs, which is now fixed. Also added some missing spaces in a couple of files.
2021-03-24 17:20:46 +01:00
fracturehill 6728c96e68 NANCY: Add underscore to class member names
Fixed many instances of class member names not beginning with an underscore.
2021-03-24 17:20:46 +01:00
fracturehill 6be4617e26 NANCY: Make Textbox::getInnerHeight() const
Textbox::getInnerHeight() makes no changes to its class so it has now been properly marked as const.
2021-03-24 17:20:46 +01:00
fracturehill a286a287f2 NANCY: Replace NanEngine macro
Replaced the nonstandard NanEngine macro with a proper pointer to the current NancyEngine instance.
2021-03-24 17:20:46 +01:00
fracturehill 7220797ca4 NANCY: Remove redundancy in transparency handling
Removed the BlitType enum and getBlitType() method from RenderObject, and replaced them with setTransparent(). This was done to reduce redundant code, since ManagedSurface can already pick between a transparent and regular blit depending on whether the provided source surface has a transparent color set. Also added the correct transparent color for The Vampire Diaries, and the transparent color for nancy1 now gets calculated on the fly.
2021-03-24 17:20:46 +01:00
fracturehill 8fccf950fe NANCY: Initialize additional surfaces with screen format
Changed surfaces in the textbox and inventory box so they are now initialized with the screen pixel format instead of the one used inside images. With this change The Vampire Diaries no longer fails a particular assert in the ManagedSurface blitting code, and can now boot successfully.
2021-03-24 17:20:46 +01:00
fracturehill 5440559918 NANCY: Add support for 8-bit color
Added generic methods for getting the pixel format and transparent color. Also added a method for loading an image directly into a ManagedSurface, which also loads the palette and lets The Vampire Diaries logo display properly.
2021-03-24 17:20:46 +01:00
fracturehill 20f432f8d3 NANCY: Engine refactor
Made all states (Scene, Credits, Help, etc.) singletons, as well as subclasses of a common State parent with a proper state switching API. Moved the OnPause virtual function from RenderObject to ActionRecord and hooked it into the state switching code. Also got rid of the NancyEngine pointer that got passed around between most classes, and replaced it with several convenience macros. As a result of these changes action records that render to the viewport no longer disappear after opening the menu, and state changes feel snappier.
2021-03-24 17:20:46 +01:00