[Scummvm-git-logs] scummvm branch-2-6 -> c6cd23db9a7067c501d1f0735933b397c6e75bfc
ccawley2011
noreply at scummvm.org
Sun Jun 19 21:33:34 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4321dd5fd1 GLK: ADRIFT: Avoid internal compiler error on RISC OS with -O3
21c410bff3 ULTIMA8: Avoid internal compiler error on RISC OS with -O2 and -mfpu=vfp
c6cd23db9a RISCOS: Increase the optimization level
Commit: 4321dd5fd1ded057a9b8788320842a338416e42d
https://github.com/scummvm/scummvm/commit/4321dd5fd1ded057a9b8788320842a338416e42d
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2022-06-19T22:32:55+01:00
Commit Message:
GLK: ADRIFT: Avoid internal compiler error on RISC OS with -O3
Changed paths:
engines/glk/adrift/sctafpar.cpp
diff --git a/engines/glk/adrift/sctafpar.cpp b/engines/glk/adrift/sctafpar.cpp
index 552b9abd866..7aa01502016 100644
--- a/engines/glk/adrift/sctafpar.cpp
+++ b/engines/glk/adrift/sctafpar.cpp
@@ -503,7 +503,7 @@ static void parse_push_key(sc_vartype_t vt_key, sc_char type) {
sc_fatal("parse_push_key: stack overrun\n");
/* Push the key, and its associated type. */
- parse_vt_key[parse_depth] = vt_key;
+ memcpy(parse_vt_key + parse_depth, &vt_key, sizeof(vt_key));
parse_format[parse_depth] = type;
parse_depth++;
}
Commit: 21c410bff3d93e38a4c6963a8e79eb63005087e4
https://github.com/scummvm/scummvm/commit/21c410bff3d93e38a4c6963a8e79eb63005087e4
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2022-06-19T22:33:02+01:00
Commit Message:
ULTIMA8: Avoid internal compiler error on RISC OS with -O2 and -mfpu=vfp
Changed paths:
engines/ultima/ultima8/graphics/fonts/tt_font.cpp
engines/ultima/ultima8/graphics/fonts/tt_font.h
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
index c3faf0742df..7ac15eb9256 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
@@ -118,6 +118,76 @@ void TTFont::getTextSize(const Std::string &text,
}
+void TTFont::addTextBorder(Graphics::ManagedSurface &textSurf, uint32 *texBuf, const Ultima::Ultima8::Rect &dims, int32 resultWidth, int32 resultHeight, uint32 borderColor) {
+ uint8 bA, bR, bG, bB;
+ _PF_RGBA.colorToARGB(borderColor, bA, bR, bG, bB);
+
+ int sqrSize = _borderSize * _borderSize;
+ int sqrEdge = (_borderSize + 1) * (_borderSize + 1);
+
+ for (int y = 0; y < textSurf.h; y++) {
+ const byte* surfrow = (const byte*)textSurf.getBasePtr(0, y);
+
+ for (int x = 0; x < textSurf.w; x++) {
+ if (_antiAliased) {
+ uint32 sColor = *((const uint32 *)(surfrow + x * 4));
+ uint8 sR, sG, sB, sA;
+ _PF_RGBA.colorToARGB(sColor, sA, sR, sG, sB);
+
+ if (sA == 0x00)
+ continue;
+
+ for (int dx = -_borderSize; dx <= _borderSize; dx++) {
+ for (int dy = -_borderSize; dy <= _borderSize; dy++) {
+ int tx = dims.left + x + _borderSize + dx;
+ int ty = dims.top + y + _borderSize + dy;
+ if (tx >= 0 && tx < resultWidth && ty >= 0 && ty < resultHeight) {
+ uint32 dColor = texBuf[ty * resultWidth + tx];
+ if (borderColor != dColor) {
+ int sqrDist = (dx * dx) + (dy * dy);
+ if (sqrDist < sqrSize) {
+ texBuf[ty * resultWidth + tx] = borderColor;
+ }
+ else if (sqrDist < sqrEdge) {
+ // Blend border color at source intensity with destination
+ uint8 dA, dR, dG, dB;
+ _PF_RGBA.colorToARGB(dColor, dA, dR, dG, dB);
+
+ double bAlpha = (double)bA / 255.0;
+ double sAlpha = (double)sA / 255.0;
+ double dAlpha = (double)dA / 255.0;
+ dAlpha *= (1.0 - sAlpha);
+
+ dR = static_cast<uint8>((bR * sAlpha + dR * dAlpha) / (sAlpha + dAlpha));
+ dG = static_cast<uint8>((bG * sAlpha + dG * dAlpha) / (sAlpha + dAlpha));
+ dB = static_cast<uint8>((bB * sAlpha + dB * dAlpha) / (sAlpha + dAlpha));
+ dA = static_cast<uint8>(255. * bAlpha * (sAlpha + dAlpha));
+
+ texBuf[ty * resultWidth + tx] = _PF_RGBA.ARGBToColor(dA, dR, dG, dB);
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (surfrow[x] == 1) {
+ for (int dx = -_borderSize; dx <= _borderSize; dx++) {
+ for (int dy = -_borderSize; dy <= _borderSize; dy++) {
+ int tx = dims.left + x + _borderSize + dx;
+ int ty = dims.top + y + _borderSize + dy;
+ if (tx >= 0 && tx < resultWidth && ty >= 0 && ty < resultHeight) {
+ int sqrDist = (dx * dx) + (dy * dy);
+ if (sqrDist < sqrEdge) {
+ texBuf[ty * resultWidth + tx] = borderColor;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
RenderedText *TTFont::renderText(const Std::string &text, unsigned int &remaining,
int32 width, int32 height, TextAlign align, bool u8specials,
Std::string::size_type cursor) {
@@ -161,73 +231,7 @@ RenderedText *TTFont::renderText(const Std::string &text, unsigned int &remainin
// Add border within radius. Pixels on the edge are alpha blended if antialiased
if (_borderSize > 0) {
- uint8 bA, bR, bG, bB;
- _PF_RGBA.colorToARGB(borderColor, bA, bR, bG, bB);
-
- int sqrSize = _borderSize * _borderSize;
- int sqrEdge = (_borderSize + 1) * (_borderSize + 1);
-
- for (int y = 0; y < textSurf.h; y++) {
- const byte* surfrow = (const byte*)textSurf.getBasePtr(0, y);
-
- for (int x = 0; x < textSurf.w; x++) {
- if (_antiAliased) {
- uint32 sColor = *((const uint32 *)(surfrow + x * 4));
- uint8 sR, sG, sB, sA;
- _PF_RGBA.colorToARGB(sColor, sA, sR, sG, sB);
-
- if (sA == 0x00)
- continue;
-
- for (int dx = -_borderSize; dx <= _borderSize; dx++) {
- for (int dy = -_borderSize; dy <= _borderSize; dy++) {
- int tx = iter->_dims.left + x + _borderSize + dx;
- int ty = iter->_dims.top + y + _borderSize + dy;
- if (tx >= 0 && tx < resultWidth && ty >= 0 && ty < resultHeight) {
- uint32 dColor = texBuf[ty * resultWidth + tx];
- if (borderColor != dColor) {
- int sqrDist = (dx * dx) + (dy * dy);
- if (sqrDist < sqrSize) {
- texBuf[ty * resultWidth + tx] = borderColor;
- }
- else if (sqrDist < sqrEdge) {
- // Blend border color at source intensity with destination
- uint8 dA, dR, dG, dB;
- _PF_RGBA.colorToARGB(dColor, dA, dR, dG, dB);
-
- double bAlpha = (double)bA / 255.0;
- double sAlpha = (double)sA / 255.0;
- double dAlpha = (double)dA / 255.0;
- dAlpha *= (1.0 - sAlpha);
-
- dR = static_cast<uint8>((bR * sAlpha + dR * dAlpha) / (sAlpha + dAlpha));
- dG = static_cast<uint8>((bG * sAlpha + dG * dAlpha) / (sAlpha + dAlpha));
- dB = static_cast<uint8>((bB * sAlpha + dB * dAlpha) / (sAlpha + dAlpha));
- dA = static_cast<uint8>(255. * bAlpha * (sAlpha + dAlpha));
-
- texBuf[ty * resultWidth + tx] = _PF_RGBA.ARGBToColor(dA, dR, dG, dB);
- }
- }
- }
- }
- }
- }
- else if (surfrow[x] == 1) {
- for (int dx = -_borderSize; dx <= _borderSize; dx++) {
- for (int dy = -_borderSize; dy <= _borderSize; dy++) {
- int tx = iter->_dims.left + x + _borderSize + dx;
- int ty = iter->_dims.top + y + _borderSize + dy;
- if (tx >= 0 && tx < resultWidth && ty >= 0 && ty < resultHeight) {
- int sqrDist = (dx * dx) + (dy * dy);
- if (sqrDist < sqrEdge) {
- texBuf[ty * resultWidth + tx] = borderColor;
- }
- }
- }
- }
- }
- }
- }
+ addTextBorder(textSurf, texBuf, iter->_dims, resultWidth, resultHeight, borderColor);
}
// render the text surface into our texture buffer
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.h b/engines/ultima/ultima8/graphics/fonts/tt_font.h
index ba863a0b37d..0d48eeb1138 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.h
@@ -65,6 +65,8 @@ protected:
Graphics::PixelFormat _PF_RGBA;
uint16 _bullet;
+
+ void addTextBorder(Graphics::ManagedSurface &textSurf, uint32 *texBuf, const Ultima::Ultima8::Rect &dims, int32 resultWidth, int32 resultHeight, uint32 borderColor);
};
} // End of namespace Ultima8
Commit: c6cd23db9a7067c501d1f0735933b397c6e75bfc
https://github.com/scummvm/scummvm/commit/c6cd23db9a7067c501d1f0735933b397c6e75bfc
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2022-06-19T22:33:10+01:00
Commit Message:
RISCOS: Increase the optimization level
Changed paths:
configure
diff --git a/configure b/configure
index 42ec4ec1561..a89aebc3cb8 100755
--- a/configure
+++ b/configure
@@ -3104,7 +3104,7 @@ EOF
riscos)
define_in_config_if_yes yes 'RISCOS'
append_var LDFLAGS "-static"
- _optimization_level=-O2
+ _optimization_level=-O3
_port_mk="backends/platform/sdl/riscos/riscos.mk"
_pandoc=yes
_sdlconfig=sdl-config
@@ -3199,8 +3199,6 @@ if test -n "$_host"; then
arm-linux|arm*-linux-gnueabi|arm-*-linux)
;;
arm-vfp-riscos)
- # -O2 causes internal compiler error on VFP only with gcc 4.7
- _optimization_level=-O1
append_var LDFLAGS "-L$GCCSDK_INSTALL_ENV/vfp/lib"
append_var PLUGIN_LDFLAGS "-L$GCCSDK_INSTALL_ENV/vfp/lib"
append_var CXXFLAGS "-isystem $GCCSDK_INSTALL_ENV/vfp/include"
More information about the Scummvm-git-logs
mailing list