Commit graph

1729 commits

Author SHA1 Message Date
Filippos Karapetis
d74a9542fa SCI: Rename graphics/palette.* to graphics/palette16.*
This is to avoid file name inclusion clashes with graphics/palette.h
placed in common code, as uncovered by PR #6471

After discussing with @sluicebox, this is a simpler solution, where
only the offending palette.* files are renamed, without affecting
palette32.*, or introducing a sci prefix in files
2025-03-10 02:58:55 +02:00
Filippos Karapetis
d9e5a9eaa1 Revert "SCI: Rename graphics/palette*.* to graphics/scipalette*.*"
This reverts commit d3230461ea.

A simpler follow-up commit will be done instead
2025-03-10 02:53:24 +02:00
Filippos Karapetis
d3230461ea SCI: Rename graphics/palette*.* to graphics/scipalette*.*
This is to avoid file name inclusion clashes with graphics/palette.h
placed in common code, as uncovered by PR #6471
2025-03-09 16:31:35 +02:00
athrxx
d6e9afa272 SCI: (ECOQUEST2/Windows) - enable 16 colors mode
(version found on Sierra's School House Math CD)
2025-02-10 18:51:02 +01:00
athrxx
11874c25a6 SCI: fix hercules mode glitch
(only applies to the "cropped image" config that we don't use anyway)
2025-02-01 13:49:32 +01:00
Cameron Cawley
4e95dc1480 ENGINES: Use LiberationSans for subtitles instead of FreeSans 2025-01-30 23:08:04 +02:00
Le Philousophe
378d903649 SCI: Don't use deprecated primitives 2025-01-24 12:11:17 +01:00
athrxx
c51d719c11 SCI: (PEPPER/LB2/Windows) - add option for windows b/w cursors 2025-01-23 23:22:39 +01:00
athrxx
51d52b1680 SCI: (CGA/Hercules) - fix value clipping typo
(not relevant in practice, since we don't pass invalid arguments,
but it unnecessarily triggers the static analyzers)
2025-01-02 17:37:39 +01:00
athrxx
6e493b3ace SCI: (SCI01) - fix regression from PR 6328
(wrong version ranges, breaking transitions in SCI01 games)
2024-12-26 00:58:13 +01:00
athrxx
047f3fbfea SCI: cleanup and reorganize gfx drivers
gfxdrivers.cpp has become quite large. So I've now made a
separate file for each driver. I also separated the mode
validation and driver init code from the enigine and put
it into an extra file.
2024-12-24 13:15:37 +02:00
athrxx
3779f208ad SCI: (SQ4/CD/Windows) - make use of windows gfx drivers
SQ4/CD/Windows uses a simiar interpreter to the KQ6 one, minus the hires
graphics support. It has the same upscaling to 640x440 (or 320x220 for small
windows) and also support the same 16 colors mode.

Also removed some whitespace...

I have attached the SQ4 Windows variant to the gfx drivers I made for KQ6.
The 16 colors mode now requires the SCIWV.EXE executable, though. I had
hard coded the 512 bytes color pattern table for KQ6, since I thought it
would remain the only one necessary. But SQ4 has a different table. So I now
load them from the executable.

There might be more Windows games like that, I just currently don't know
about it (probably other SCI_VERSION_1_1 titles). Adding support would be
super easy. But it will not work right out of the box, since I explicitly check
the game IDs in customizeGuiOptions(), to avoid any nonsense to happen.
2024-12-21 18:33:13 +02:00
athrxx
db2eceb4b9 SCI: fix bug caused by PR 6319
I made a mistake in that PR by assuming that the
handles for the hires graphics would be unique. So
when removing an object from the drawing chain
I really only removed the first object. But in reality
they often have the same handle and the original
interpreter continues to go over the loop until all
of the same handle have been removed.

Also, the original checks for already existent draw
objects with the same x/y-coordinates.
2024-12-18 19:48:45 +01:00
D G Turner
200b3004cf SCI: Fix GCC Compiler Shadowing Warnings 2024-12-18 01:04:20 +00:00
athrxx
fdd1d1644c
SCI: (KQ6WinCD) - fix hires drawing glitches
(items 1- 3 from bug ticket no. 15594)

I have added redrawing functionality for the hires GFX from the
original interpreter. I guess the original only needed that code
to handle WM_PAINT messages (= full window redraw). It also
does actually call a redraw in kDisposeWindow, the same way I
implemented it here, to refresh the inventory. But that is really
only needed for the speech+text mode which isn't supported
in the original. Maybe they ditched the mode only after they
had already implemented that, who knows...

I have also improved the workaround for the out-of-bounds
portraits to catch the case from the bug ticket.

I added a check in kDisposeWindow. It isn't strictly necessary,
but it it makes the code easier to understand.

I also renamed a var that I had previously renamed in a way
that makes no sense. I had renamed it from `upscaledHiresRect'
to 'portraitRect' since it is neither upscaled nor hires (it is just a
lowres rect). But it isn't a portrait rect either. The portraits get
drawn elsewhere. It's more likely to be a picture frame, a GUI
control or an inventory item.
2024-12-17 16:43:45 +02:00
sluicebox
068fe4b885 SCI: Fix Menu display of F10 keyboard shortcut
Fixes bug #15557

Thanks to @ATMcashpoint for reporting this
2024-12-05 02:43:16 -08:00
D G Turner
b767aa2010 SCI: Fix Signed vs. Unsigned Comparison GCC Compiler Warning 2024-11-05 23:18:11 +00:00
Cameron Cawley
09ab1ddfb7 SCI: Speed up GfxScreen::scale2x() for 2bpp and 4bpp formats 2024-11-01 02:33:51 +02:00
Cameron Cawley
68f3c51f2b SCI: Support more pixel formats in GfxScreen::scale2x() 2024-11-01 02:33:51 +02:00
athrxx
9339b3b3c3 SCI: (KQ6/MAC) - icon bar colors in rgb render mode 2024-11-01 01:26:51 +01:00
sluicebox
915173612a SCI: Validate font character offsets
Handles buggy fonts in fan translations
2024-10-29 18:00:48 -07:00
sluicebox
2554549b41 SCI: Reduce variable scope 2024-10-17 14:47:43 -06:00
sluicebox
42cbbcd2df SCI: Fix Window destructor not running
CID 1403309
2024-10-16 13:58:15 -06:00
sluicebox
5a6470e3f2 SCI: Remove unused member 2024-10-15 13:31:34 -06:00
Eugene Sandulenko
4e3a2ee13f
SCI: Added missing override keyword 2024-10-12 16:16:53 +02:00
athrxx
1fefea04b7 SCI: (QFG/PC-98) - fix Japanese text color (regression)
I noticed that in the Meeps scene there was green
sjis text color. It is always supposed to be black. The
original interpreter can't do anything else. Same
for SCI1, although for different reasons. I think I broke
that when I fixed the PQ2 colors.
2024-10-11 14:43:57 +02:00
athrxx
389b51edbb SCI: (KQ6Win Gfx driver) - fix glitch when in rgb rendering mode 2024-10-10 01:09:06 +02:00
sluicebox
2c110fd12a SCI: Initialize various members
Coverity issues
2024-10-09 09:52:33 -06:00
athrxx
bf48bc41b3 SCI: (KQ6 Gfx driver) - fix monochrome mouse cursors in non-rgb rendering mode 2024-10-09 08:35:11 +03:00
athrxx
de32f308b4 SCI: remove GFX_SCREEN_MASK_DISPLAY
(and code sections guarded by it)

This was only used for the KQ6 Win hi-res code.
2024-10-09 08:35:11 +03:00
athrxx
2ec9c46373 SCI: replace workaround to clear hires portrait rects
As the GFX_SCREEN_MASK_DISPLAY flag is no longer
used, I have made a new workaround. Nowadays it
seems to be needed only for the mixed speech/text
mode (which didn't exist in the original game, but has
been added to ScummVM via script patches). The
problem is that the hires portrait frames will be drawn
at y = 5 in mixed speech/text mode. The window/port
rect starts at y=10, though. The engine is not meant to
update screen parts outside the port dimensions.

Another solution would be to improve the vertical
placement of the portraits with these patches, but
that seems to be more complicated.
2024-10-09 08:35:11 +03:00
athrxx
a4380b8e0b SCI: add appropriate render options for KQ6 Win 2024-10-09 08:35:11 +03:00
athrxx
c11193f35c COMMON: add Windows 16 colors render mode option 2024-10-09 08:35:11 +03:00
athrxx
5f66d7161a SCI: add 16 colors mode for KQ6 Win
The original interpreter supports that, although it is slightly
broken. It will show black boxes for the hires graphics, since
the mode isn't properly checked. I have fixed that here to
show the the lores graphics.
2024-10-09 08:35:11 +03:00
athrxx
70414a0b87 SCI: make upscaled gfx driver for KQ6 Windows
- The main purpose was to move more upscaling logic out of the engine
- This actually contains various precision fixes to the hires code. There
were some comments about being unsure what to. I think I managed to
fix all of these, although it shouldn't make a visible difference, since the
workarounds worked as intended.
- It does actually fix a very minor glitch: The portraits were vertically off
by one pixel. And the opening AVI video is probably also vertically fixed
by one pixel (although the video display in the original is not done very
well, anyway).
2024-10-09 08:35:11 +03:00
athrxx
6e59e0a1ac SCI: add some asserts to gfx drivers
(I have noticed that the (not really well supported) Mac SCI0 versions
with 480x300 pixels resolution may pass invalid (negative) withs or
heights)
2024-10-09 08:35:11 +03:00
sluicebox
7a4974a35c SCI: Improve KQ6 CD enable_high_resolution_graphics
- KQ6 CD DOS now delivers a DOS experience by default instead of Windows
- KQ6 CD Windows no longer offers an option that has no effect
2024-10-06 01:25:14 +03:00
Giovanni Cascione
29713de5cc SCI: fix RELEASE_BUILD tests 2024-09-23 23:29:21 +03:00
athrxx
39e8cf97ed SCI: remove unused var 2024-09-22 20:55:03 +02:00
athrxx
664c0b278a SCI: fix another part of bug no. 15375
(SCI: SQ4 Korean text not rendered after refactor)

This fixes the issue with kDisplay, basically in the
same way as it is done for the controls.
2024-09-21 12:41:58 +02:00
Filippos Karapetis
c4942be17f SCI: Replace NDEBUG define checks with RELEASE_BUILD 2024-09-20 19:05:29 +03:00
athrxx
fca2fc4eb6 SCI: fix bug no. 15375
(SQ4 Korean text not rendered after refactor)

This should get some testing if possible.

Also, it would be interesting to know if other
controls (icon, list, text edit) would also need
a similar solution.
2024-09-20 14:03:01 +02:00
sluicebox
0f753cbeea SCI: Fix memory leak in GfxMacFontManager 2024-09-18 12:40:59 -07:00
sluicebox
a8006eda16 SCI: Fix memory leaks in GfxMenu when restarting 2024-09-18 01:07:00 -07:00
Hubert Maier
7fd0c0f68f JANITORIAL: SCI: Fix typos 2024-09-16 01:58:56 +03:00
athrxx
7afa86e0f4 SCI: add setShakePos() function to gfx drivers
Currently the screen shakes will not be scaled to the driver's
screen resolution. This patch fixes that.

Now, this isn't exactly the original behaviour. The screen
shaking was a hardware feature that only EGA and VGA
adapters had. Therefore, the screen shake function is
only implemented in the drivers for these devices. For
all other graphics hardware the drivers have an empty
dummy function for the screen shake (at least from
what I have see). But we needn't be strict here, we can
shake everything...
2024-09-13 01:12:31 +03:00
athrxx
2f654d41be SCI: (PC-98) - fix hilite control color
The PC-98 targets all use the xoring method, like SCI0early.

Also, this does not only apply to the button control, but
also to the text and icon controls.
2024-08-14 15:30:04 +03:00
athrxx
aac43fb270 SCI: add missing delete[] 2024-08-10 11:44:24 +03:00
athrxx
dd3b15c365 SCI: fix horizontal alignment for some gfx drivers
Instead of the x/w arguments that we use, the original drivers
use x1/x2. I forgot to make the necessary adjustments.
2024-08-10 11:44:24 +03:00
athrxx
31a2c0349b SCI: (PQ2) - fix text colors
I noticed that the original PQ2 interpreter can have other text
colors than blue. It can also draw text in yellow and white. I don't
think that it gets used, but I'd rather just fix it, before I try to find
that out...
2024-08-10 11:44:24 +03:00