Commit Graph
79 Commits
Author SHA1 Message Date
Zvika Haramaty 34873d127f SCI32: Make RTL BiDi conversion direction hard coded
The default behaviour for `Common::convertBiDiString` is to use
BIDI_PAR_ON for direction, which means that it tries to guess to
paragraph language, and choose the direction according to it.

However, in SQ6 many (all?) texts begin with control characters,
which make that function to think that these are English texts,
and therefore it chooses LTR direction, and punctuations are wrongly
placed.

Since the call to the function is under `if` clause for RTL,
it's safe to hard code that direction.
2022-09-05 20:24:07 +03:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis 8a748f7e03 SCI: Add TTS support for SCI32 floppy games (QFG4, GK1, PQ4) 2021-12-24 02:57:27 +02:00
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
wonst719 e2415b59d6 SCI: Change Korean text detection method 2020-11-08 22:26:31 +02:00
wonst719 00bd552840 SCI: Korean code cleanup
- Move repeated message.map tests into ResourceManager::isKoreanMessageMap()
- Fix comments
- Fix formatting
- Remove unused codes
2020-11-08 22:26:31 +02:00
wonst719 36f02ab3b9 SCI: Add missing const to GfxText32 methods 2020-11-08 22:26:31 +02:00
wonst719 b7664c24dc SCI: Korean fan translation support 2020-11-08 22:26:31 +02:00
Walter van Niftrik 22593de73f SCI: Rename font.h/cpp to scifont.h/cpp
This avoids an issue with MSVC where if (non-SCI) "graphics/font.h" is
included through another include file from the SCI engine root, it finds
"sci/graphics/font.h" first and uses that instead.
2020-08-27 14:56:17 +02:00
Zvika Haramaty b4d40ed596 SCI: add support for Hebrew translation of Torin
- Detect fan made Hebrew translation of Torin's Passage
- Use BiDi algorithm in SCI engine
2020-05-19 12:32:58 +02:00
sluicebox 2df444cecb SCI32: Implement kInputText for PHANT2 easter eggs
Implements kInputText, which displays a black and white utility dialog
with a title and a text box in a fixed position using the system font.
The only known game that uses this is Phantasmagoria 2 for several
easter eggs, which now work. This was probably used by internal scripts
during game development.

kEditText and kInputText share a function in Sierra's interpreter for
processing events, so that code has been factored out and placed in
GfxControls32::processEditEvent().

GfxText32 can now measure text pixel height as SSCI did by identifying
the tallest character height in the current text, which the newly added
titled font bitmap code requires.

Fixes bug #10570
2020-01-25 18:11:57 -08:00
Colin Snover c7c5f28bdb SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
2017-10-06 22:56:26 -05:00
Colin Snover a2c8674252 SCI32: Clean up GfxText32
* Rewrap comments to 80 columns
* Clarify comments where possible
2017-10-06 22:11:02 -05:00
Colin Snover ede7976ede SCI32: Fix bad kPointSize implementation
Fixes text scaling gone mad in Phant2.
2017-04-22 19:25:20 -05:00
Colin Snover 739047f887 SCI32: Always reinit GfxText32 statics on game startup
Fixes bad scaling of text when switching between games with
different script resolutions.
2017-03-30 19:46:27 -05:00
Colin Snover 4c942758c0 SCI32: Use built-in system font as default font for GfxText32
Fixes the non-interactive Lighthouse demo.
2017-03-30 19:46:27 -05:00
Colin Snover 6412b32386 SCI32: Fix incorrect parsing of empty |f| text escape code
This sequence is used in Hoyle5 when viewing the rules for a game.
2016-12-19 14:46:46 -06:00
Colin Snover e4b8820762 SCI32: Fix incorrect text width calculation of non-ASCII strings
Fixes Trac#9639.
2016-11-02 21:45:44 -05:00
Colin Snover 40444b0aeb SCI32: Clarify some identifiers
transparentColor -> skipColor
displace -> origin
scaledWidth -> xResolution
scaledHeight -> yResolution
2016-10-09 11:21:46 -05:00
Colin Snover 84d8ac4c38 SCI32: Fix buffer overflow when drawing border to a tiny text bitmap 2016-09-29 19:39:16 -05:00
Colin Snover bfbbee8697 SCI32: Fix rendering of non-ASCII characters 2016-08-28 19:33:21 -05:00
Colin Snover 2071196f42 SCI32: Add bitmap segment and remove GC option from hunk segment 2016-08-01 10:37:14 -05:00
Colin Snover 4a637d65c3 SCI32: Enable optional explicit memory management of hunk entries
Bitmaps in ScrollWindow and Robot code are managed by the kernel
and not by game scripts, although they must be able to be
referenced through a reg_t. To prevent incorrect GC of bitmaps
that are in use but not referenced by any game script, explicit
memory management of hunk entries can be enabled.
2016-08-01 10:37:14 -05:00
Colin Snover d6d0e00dc5 SCI32: Expose a draw buffer on BitmapResource objects
Most of the time, we get a bitmap to draw on it. Exposing a buffer
avoids consumers having to create their own all the time, and
encourages use of common drawing code exposed by the buffer.
2016-06-21 16:11:43 -05:00
Colin Snover 820e6b8bd3 SCI32: Fixes to GfxText32
1. Inline borderSize constant in createFontBitmap for consistency
2. Fix "DrawTextBox GetLongest=0" warning to only appear in games
   that actually had this check (SQ6 and MGDX)
3. "Fix" implementation of getTextSize for SCI2.1early, which
   gave lines with word wrap disabled a height of 0
4. Add inlining hints to some methods in BitmapResource that were
   missing them for some reason
2016-06-21 08:17:28 -05:00
Willem Jan PalenstijnandColin Snover ab864ba366 SCI32: Implement kScrollWindow
These should be all the actually used subfunctions.

Co-authored-by: Colin Snover <github.com@zetafleet.com>
2016-06-21 08:14:12 -05:00
Willem Jan Palenstijn 94328f0ec8 SCI32: Make GfxText32::_scaledWidth/Height statics
They were global in SSCI. This way secondary GfxText32 instances
(such as in ScrollWindow) use the correct scaling.
2016-06-21 08:14:12 -05:00
Willem Jan Palenstijn c4b41f5d7c SCI32: Fix drawText on consecutive control codes 2016-06-21 08:14:11 -05:00
Willem Jan Palenstijn 97c11e7d5f SCI32: Fix getTextWidth on consecutive control codes 2016-06-21 08:14:11 -05:00
Colin Snover 0c708ddcf7 SCI32: Simplify default text width equation 2016-05-28 10:31:23 -05:00
Eugene Sandulenko 986f4bbbf6 SCI: Explicit type conversion. Avoids warnings on number of compilers. 2016-05-28 17:11:49 +02:00
Colin Snover c8019487f9 SCI32: Remove unused titled text bitmap code
Titled text bitmaps do not appear to be used by any game scripts.
They seem to only be used by the error manager in SSCI, but
ScummVM has its own error handling, so we don’t need this
implementation.
2016-05-28 09:14:33 -05:00
Colin Snover 22097018bb SCI32: Implement GfxText32::getTextCount 2016-03-10 20:07:36 -06:00
Colin Snover 73eea88939 SCI32: Move in-memory bitmap read/write into its own class 2016-03-07 20:51:06 -06:00
Colin Snover 266a9fdd25 SCI32: Implement variable size frame drawing 2016-03-06 21:34:44 -06:00
Colin Snover 1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Colin Snover 445980f010 SCI32: Fix misidentification of createFontBitmap(CelInfo &) 2016-03-03 21:29:53 -06:00
Colin Snover 9a280d3965 SCI32: Add all kBitmap signatures
Not all SCI2.1late/SCI3 function signatures are fully known yet,
but all subops are now represented in the kernel tables.
2016-03-03 20:31:10 -06:00
Colin Snover f397a73138 SCI32: Fix text size calculation scaling to match SCI
The previous code works correctly only for ratios like 2:1 that
do not generate remainders.
2016-03-01 09:39:57 -06:00
Colin Snover 3e5adc33a8 SCI32: Non-titled text bitmap implementation
This implementation is not 100% engine accurate, but it is
more accurate than what was there, and hopefully the differences
between this and the engine code are merely cosmetic.

The known (intentional) differences are:

1. Uses ScummVM rects inside the engine code, converting to/from
   SCI rects on the kernel edges and when scaling
2. Fewer side effects when performing operations that *should*
   have been pure from the start (like text dimension calculation).
   Still not side-effect-free, but at least things like colours
   and alignment do not need to be reset every time a measurement
   is taken, unlike in the actual engine.

Editor controls and some other kBitmap code are temporarily
disabled as a result of changes to GfxText32 until they can be
updated to be engine-accurate.
2016-02-28 21:48:56 -06:00
Filippos Karapetis 5151ad4d9f SCI: Remove another GK1-related hack 2016-02-27 14:40:33 +02:00
Colin Snover 20ccad80bf SCI: WIP GfxText32 code
This at least prevents SQ6 from crashing when going into the
introduction
2016-02-18 13:18:02 -06:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis ea42605297 SCI: Remove multibyte character processing code from SCI32
There are no Japanese/PC-98 SCI32 games, so this code is not needed
2012-06-20 10:55:24 +03:00
Filippos Karapetis 221ee34926 SCI: Don't attempt to draw line feed characters in SCI32
Fixes junk in the about dialogs in PQ4
2012-06-20 04:28:59 +03:00
Filippos Karapetis 66af2cf1d7 SCI: Handle translucent text planes
Fixes the incorrect flood fill in the Rada Drums screen in GK1
2012-06-09 12:13:48 +03:00
Filippos Karapetis de3f6a19ed SCI: Initial implementation of kScrollWindow, used in some SCI21 games
This is used in LSL6 hires and SQ6. This initial implementation is hackish
and only works in SQ6 (nothing is shown in LSL6)
2012-06-07 11:27:59 +03:00
Filippos Karapetis 6b38731d39 SCI: Implement savegame deletion functionality in SCI32
This is based on two kernel functions, kMakeSaveCatName and
kMakeSaveFileName
2012-05-14 11:04:58 +03:00
Matthew Hoops b71dffafbe SCI: Fix GK1 Mac text positioning
A regression from the text bitmap code addition
2012-03-08 10:07:58 -05:00
Filippos Karapetis 099b2e9249 SCI: Properly handle negative coordinates in drawTextBitmap()
This fixes occasional crashes when going to the map in GK1. Many thanks
to digitall for finding this through Valgrind
2012-01-15 23:00:23 +02:00