Commit Graph
330 Commits
Author SHA1 Message Date
Walter Agazzi 117cb3efba AGS: Add sanity check for 8bpp games
Prevents assertion in Snow Problem/The Crimson Diamond
2024-05-13 20:10:50 +02:00
Kaloyan Chehlarski fe5c2068aa AGS: Fix 2bpp tinted blitting with AVX2 optimizations
Tinted blitting was completely broken on the 2bpp AVX2
path, due to the code ignoring the boundary in the
middle of the wide registers. This change fixes the vertical
striping produced by the original code, and removes some
unnecessary operations that were being performed for
every group of pixels.
2024-05-06 21:52:03 +02:00
Matthew Jimenez 5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
Cameron Cawley 5f04021a5c AGS: Use emmintrin.h for SSE2 intrinsics 2024-01-09 10:12:45 +02:00
Kaloyan Chehlarski 283bfd228d AGS: Fix ASAN crashes in SIMD blit paths
All optimized blitting paths exhibit similar overreading
behavior, due to the flawed design of (almost) always
loading a full 128/256-bit line, and discarding overread
pixels afterwards. This commit patches up the code so the
overreads never happen, albeit at the cost of a few
memcpys at the end of every line of pixels.
2023-12-02 16:43:09 +01:00
Kaloyan Chehlarski 56377af2ae AGS: Fix tinting in SSE path, 4bpp
The code for tinting in the SSE path was incorrect, and
produced blue tinting in multiple games (bugtracker #14634)
2023-12-01 23:03:07 +02:00
Kaloyan Chehlarski 6c21737f50 AGS: Properly pre-flip surface when blitting
Fixed an error in the arguments when pre-flipping a
blit prior to blitting.
2023-11-23 01:07:15 +02:00
Kaloyan Chehlarski 6208f8807e AGS: Properly pre-scale surface before blit
Fixed two different errors that were causing scaled blitting
to read out of bounds.
2023-11-23 00:44:19 +02:00
Kaloyan Chehlarski 1acc57e15c AGS: Fix 4bpp->2bpp conversion in AVX2 path
This fixes the broken text outlines in Maniac Mansion Deluxe
2023-11-19 18:49:32 +02:00
Kaloyan Chehlarski ee38b13fd3 AGS: Disable optimized blit stretching and flipping
The CPU extension optimized paths do not work properly
when scaling or flipping the image. Fixing this needs a lot
of work, so for now we pre-stretch and pre-flip as a
workaround.
2023-11-19 00:01:58 +01:00
Kaloyan Chehlarski e10081f29b AGS: Re-add include guard for NEON path cpp file
This was mistakenly removed previously, but it seems that
without it the iOS backend breaks.
2023-10-16 13:23:04 +03:00
Kaloyan Chehlarski 33a1b1738b AGS: Don't skip drawing last line in optimized blit paths
Fixed an oversight in the code which would result in scaled
blits skipping the last line.
2023-10-16 13:23:04 +03:00
Kaloyan Chehlarski 5b29081355 AGS: Apply clipping fix to 2bpp optimized blitting
The issue that produced crashes when blitting beyond the
bottom-right edge of the screen was previously fixed,
but only for cases involving a 4bpp surface. The fix has
now been extended to the 2bpp functions as well.
2023-10-14 14:27:55 +03:00
Kaloyan Chehlarski 18a34cb7af AGS: Fix AVX2 scaled blitting
Scaled blitting in the AVX2 path would immediately crash
ScummVM, due to a couple of incorrect increments inside
a for-loop; this has now been fixed.
2023-10-14 14:27:54 +03:00
Kaloyan Chehlarski d6d65273c0 AGS: Allow usage of AVX2 optimized blit path
The previous design of the optimized paths used the same
name for the dummy class used to access BITMAP's private
members. On machines that support AVX2 this meant that
the SSE2 path would shadow the AVX2 one, and make it
inaccessible unless the configure script specifically
disabled SSE2 extensions.
The dummy class has now been split into three, one
for each of the optimization paths; those dummy classes
now contain all of the internal functions to avoid potential
name clashes; and finally, all the internal functions have
been marked as static.
2023-10-14 14:27:54 +03:00
Kaloyan Chehlarski 5214d921c4 AGS: Fix edge case in Allegro optimized blit clipping
This fixes a (literal) edge case that was introduced in the last
attempt at fixing the clipping issues that would crash
ScummVM when a sprite is drawn at the bottom right of
the screen. In particular, the specific Y value that would
result in only one row of the sprite being off screen no
longer produces a crash.
2023-10-14 14:27:54 +03:00
Kaloyan Chehlarski b902f61b3f AGS: Fix AVX2 blitting
The AVX2 path was previously completely broken, as all
blitting produced an alternating pattern of 4 correctly
blitted colors, followed by 4 black pixels. The intrinsics used
in the pixel drawing code have been changed so this is no
longer the case.
2023-10-12 12:42:28 +03:00
Kaloyan Chehlarski 1c34e1c614 AGS: Fix for surface blitting-related crashes
This is a second attempt at fixing the crashes that pop up
when attempting to blit past the bottom-right corner of a
surface. The previous commit caused a bunch of surfaces
to not blit their last row, and introduced more drawing
errors in scrolling scenes. Also, made sure the size check in
AVX2 code is 8 bytes everywhere, as this was also likely to
cause issues.
2023-10-07 23:32:11 +03:00
Kaloyan Chehlarski 8fc73a36a6 Revert "AGS: Fix blitting-related crash"
This reverts commit e2720d39f3.
The changes were based on a wrong assumption on where
the issue actually lies, and introduced a new problem:
some surfaces' bottom rows were getting entirely skipped.
2023-10-07 23:32:11 +03:00
Kaloyan Chehlarski d542838664 Revert "AGS: Fix clipping issue in blitting code"
This reverts commit 90beb8887e.
The changes were based on a wrong assumption on
where the issue lies, and also introduced even buggier
behavior in scrolling scenes.
2023-10-07 23:32:10 +03:00
Kaloyan Chehlarski 7f84df864d AGS: Fix incorrect format check in generic blitting code
This fixes a bunch of errors in 5 Days a Stranger (and all other
games with 16-bit surfaces), including leaked memory and
incorrectly displayed text.
2023-10-07 23:32:10 +03:00
Kaloyan Chehlarski e2720d39f3 AGS: Fix blitting-related crash
Fixed an off-by-one error in the non-scaling blit code, which
would result in an attempt to draw to one row beyond the
bounds of the dest surface (affects only the optimized paths).
2023-10-07 14:45:31 +03:00
Kaloyan Chehlarski 90beb8887e AGS: Fix clipping issue in blitting code
Fixed a clipping issue that would crash ScummVM when
attempting to blit to a surface with a negative dest x
(affecting both the optimized and non-optimized paths).
2023-10-07 14:45:22 +03:00
Eugene Sandulenko 94755eb838 BUILD: MACOS: Fix building with NEON enabled 2023-09-03 22:47:00 +02:00
Walter Agazzi 7279c8a540 AGS: Freetype: Trim include paths 2023-09-03 22:27:43 +02:00
Walter Agazzi 85db570098 AGS: Freetype: Remove unused variable 2023-09-03 22:27:43 +02:00
Walter Agazzi 4a33374939 AGS: Freetype: Use scummvm logging in autohint debug functions
These two functions are not actually used, but still nice to have
2023-09-03 22:27:43 +02:00
Walter Agazzi ccf816a83a AGS: Freetype: Use scummvm debug logging 2023-09-03 22:27:43 +02:00
Walter Agazzi c08d7492c4 AGS: Freetype: Remove unneeded debugging directives 2023-09-03 22:27:43 +02:00
Walter Agazzi 1d7b009638 AGS: Freetype: Remove newline from warnings 2023-09-03 22:27:43 +02:00
Walter Agazzi 1698b26bcb AGS: Freetype: remove unneeded files 2023-09-03 22:27:43 +02:00
Walter Agazzi d2e445fc49 AGS: Freetype: apply autohinting in alfont glyph loader 2023-09-03 22:27:43 +02:00
Walter Agazzi cee11c1b99 AGS: Freetype: Update alfont and enable compilation 2023-09-03 22:27:43 +02:00
Walter Agazzi cc168a16dd AGS: Freetype: Disable uncompilable code in ahhint 2023-09-03 22:27:43 +02:00
Walter Agazzi 4843b18fb2 AGS: Freetype: Use FT_Memory in ah_hinter_new 2023-09-03 22:27:43 +02:00
Walter Agazzi a0211934db AGS: Freetype: Fix headers/declarations ahhint 2023-09-03 22:27:43 +02:00
Walter Agazzi b318122139 AGS: Freetype: Fix headers/declarations ahglyph 2023-09-03 22:27:43 +02:00
Walter Agazzi 35b82f7c8f AGS: Freetype: Cleanup ahglyph/ahhint/ahloader headers 2023-09-03 22:27:43 +02:00
Walter Agazzi 7b39ad094a AGS: Freetype: Fix includes in ahtypes 2023-09-03 22:27:43 +02:00
Walter Agazzi 5ea6b4c048 AGS: Freetype: Fix includes/declarations in ahangles / ahglobal 2023-09-03 22:27:43 +02:00
Walter Agazzi c2ee3b8b34 AGS: Freetype: Add required FT_SubGlyph type to ftgloadr 2023-09-03 22:27:43 +02:00
Walter Agazzi 365e74d51f AGS: Freetype: Clean up ftgloadr.h/cpp 2023-09-03 22:27:43 +02:00
Walter Agazzi 4c020ac290 AGS: Freetype: Add minimal fterrors and cleanup ftutil 2023-09-03 22:27:43 +02:00
Walter Agazzi 63fd2b928a AGS: Import glyph loader and some helpers from freetype2.1.3 2023-09-03 22:27:43 +02:00
Walter Agazzi e4548cf1d7 AGS: Import autohinter module from freetype2.1.3 2023-09-03 22:27:43 +02:00
Lars Sundström db192eed39 AGS: Add SCUMMVM_NEON prepreocessor flag to surface_neon.cpp
The surface_neon.cpp file is only added to the project if the flag
SCUMMVM_NEON is defined. However some backends, e.g. iOS, adds the
definition of SCUMMVM_NEON in create_project so the file can be
added to the project during configuration.
The same backend can then unset the definition due to changing
build target, the iOS simulator in this example, which runs can
run on x86_64 hosts which doesn't support NEON.

Since the project still include the source file it will be compiled.
Make sure to not build the file if not SCUMMVM_NEON is defined at
compile time.
2023-09-03 22:26:37 +02:00
Le Philousophe 22b629eeaa AGS: Fix build
vceqq_f32 must be used when comparing float32x4_t
2023-08-30 13:38:13 +02:00
Wyatt Radkiewicz 487512b60f AGS: GRAPHICS: Fix NEON compiling errors on switch 2023-08-30 09:22:05 +03:00
Wyatt Radkiewicz c925852209 AGS: GRAPHICS: Remove a32/a64 specific NEON code 2023-08-30 00:17:00 +02:00
Wyatt Radkiewicz 2c8c449001 AGS: GRAPHICS: Only use 32bit fp math for NEON
Change argbBlendSIMD to only use 32bit floating point math when
compiling for armv7 or under.
2023-08-29 21:51:36 +02:00