[Scummvm-git-logs] scummvm master -> 4500cc845196da606c0d477a115663eda34e55f9
mduggan
mgithub at guarana.org
Sun May 23 07:23:46 UTC 2021
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:
b9ddaf64f2 ULTIMA8: Remove some dead code
c74ae95508 ULTIMA8: Avoid confman call on every animation
4500cc8451 ULTIMA8: Fix int16 casts in 32 bit usecode operands
Commit: b9ddaf64f2fcfa725baa33cc8360a3c433a0286a
https://github.com/scummvm/scummvm/commit/b9ddaf64f2fcfa725baa33cc8360a3c433a0286a
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-23T16:23:17+09:00
Commit Message:
ULTIMA8: Remove some dead code
Code that has been #if 0 for a long time, and some default setting for Crusader
which is not used.
Changed paths:
engines/ultima/ultima8/games/remorse_game.cpp
engines/ultima/ultima8/graphics/xform_blend.cpp
diff --git a/engines/ultima/ultima8/games/remorse_game.cpp b/engines/ultima/ultima8/games/remorse_game.cpp
index 3586986088..b4ee824347 100644
--- a/engines/ultima/ultima8/games/remorse_game.cpp
+++ b/engines/ultima/ultima8/games/remorse_game.cpp
@@ -44,12 +44,6 @@ namespace Ultima {
namespace Ultima8 {
RemorseGame::RemorseGame() : Game() {
- // Set some defaults for gameplay-related settings
- ConfMan.registerDefault("endgame", true);
- ConfMan.registerDefault("footsteps", true);
- ConfMan.registerDefault("talkspeed", 96);
- ConfMan.registerDefault("subtitles", true);
- ConfMan.registerDefault("speech_mute", false);
}
RemorseGame::~RemorseGame() {
@@ -59,7 +53,7 @@ RemorseGame::~RemorseGame() {
static bool loadPalette(const char *path, PaletteManager::PalIndex index) {
Common::SeekableReadStream *pf = FileSystem::get_instance()->ReadFile(path);
if (!pf) {
- perr << "Unable to load static/*.pal." << Std::endl;
+ perr << "Unable to load " << path << Std::endl;
return false;
}
@@ -120,23 +114,20 @@ bool RemorseGame::startGame() {
ObjectManager::get_instance()->assignActorObjId(actor, 1);
- if (GAME_IS_REMORSE) {
- // Some useful points to warp into for testing..
- actor->setLocation(0, 0, 0); // Map 1 (mission 1)
- //actor->setLocation(60716, 59400, 16); // Map 1 (mission 1)
- //actor->setLocation(42493, 26621, 16); // Map 2 (mission 1 / level 4)
- //actor->setLocation(34302, 32254, 16); // Map 3 (mission 2)
- //actor->setLocation(34813, 33789, 16); // Map 4
- //actor->setLocation(37373, 30205, 16); // Map 5
- //actor->setLocation(37373, 30205, 16); // Map 6
- //actor->setLocation(35070, 26142, 96); // Map 7
- //actor->setLocation(29693, 32253, 0); // Map 8 - unfinished area?
- //actor->setLocation(2046, 2046, 0); // Map 9
- //actor->setLocation(14845, 6141, 0); // Map 22 - debugging map
- //actor->setLocation(34302, 32254, 16); // Map 40 (Rebel base)
- } else {
- actor->setLocation(58174, 56606, 16);
- }
+ actor->setLocation(0, 0, 0); // Map 1 (mission 1)
+
+ // Some useful points to warp into for testing No Remorse
+ //actor->setLocation(60716, 59400, 16); // Map 1 (mission 1)
+ //actor->setLocation(42493, 26621, 16); // Map 2 (mission 1 / level 4)
+ //actor->setLocation(34302, 32254, 16); // Map 3 (mission 2)
+ //actor->setLocation(34813, 33789, 16); // Map 4
+ //actor->setLocation(37373, 30205, 16); // Map 5
+ //actor->setLocation(37373, 30205, 16); // Map 6
+ //actor->setLocation(35070, 26142, 96); // Map 7
+ //actor->setLocation(29693, 32253, 0); // Map 8 - unfinished area?
+ //actor->setLocation(2046, 2046, 0); // Map 9
+ //actor->setLocation(14845, 6141, 0); // Map 22 - debugging map
+ //actor->setLocation(34302, 32254, 16); // Map 40 (Rebel base)
World::get_instance()->switchMap(0);
diff --git a/engines/ultima/ultima8/graphics/xform_blend.cpp b/engines/ultima/ultima8/graphics/xform_blend.cpp
index ff07761924..38642802d6 100644
--- a/engines/ultima/ultima8/graphics/xform_blend.cpp
+++ b/engines/ultima/ultima8/graphics/xform_blend.cpp
@@ -65,134 +65,5 @@ const uint8 CruXFormPal[1024] = {
0, 0, 0, 0
};
-#if 0
-//
-// XFORM Blend Funcs
-//
-
-// BlendFunc is always glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-
-#define XFORM_BLEND_FUNC(ra,ga,ba,a) { \
- r*=255-a; \
- g*=255-a; \
- b*=255-a; \
- r+=ra*255; \
- g+=ga*255; \
- b+=ba*255; }
-
-//
-// Colour 8 (green->dark grey)
-//
-// xform_palette[32] = 48;
-// xform_palette[33] = 48;
-// xform_palette[34] = 48;
-// xform_palette[35] = 80;
-//
-// dest*175 + {48,48,48}
-//
-uint32 P_FASTCALL U8xformCol8(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(48, 48, 48, 80);
- return PACK_RGB16(r, g, b);
-}
-
-// Adjust 9 (black->vdark grey)
-// xform_palette[36] = 24;
-// xform_palette[37] = 24;
-// xform_palette[38] = 24;
-// xform_palette[39] = 80;
-uint32 P_FASTCALL U8xformCol9(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(24, 24, 24, 80);
- return PACK_RGB16(r, g, b);
-}
-
-// Adjust 9 (yellow)
-// xform_palette[40] = 64;
-// xform_palette[41] = 64;
-// xform_palette[42] = 24;
-// xform_palette[43] = 64;
-uint32 P_FASTCALL U8xformCol10(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(64, 64, 24, 64);
- return PACK_RGB16(r, g, b);
-}
-
-// Adjust 11 (white->grey)
-// xform_palette[44] = 80;
-// xform_palette[45] = 80;
-// xform_palette[46] = 80;
-// xform_palette[47] = 80;
-uint32 P_FASTCALL U8xformCol11(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(80, 80, 80, 80);
- return PACK_RGB16(r, g, b);
-}
-
-// Adjust 12 (red->orange)
-// xform_palette[48] = 180;
-// xform_palette[49] = 90;
-// xform_palette[50] = 0;
-// xform_palette[51] = 80;
-uint32 P_FASTCALL U8xformCol12(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(180, 90, 0, 80);
- if (r > 65535) r = 65535;
- if (g > 65535) g = 65535;
- return PACK_RGB16(r, g, b);
-}
-
-// 13 (blue) just need alpha modified
-// xform_palette[52] = 0;
-// xform_palette[53] = 0;
-// xform_palette[54] = 252;
-// xform_palette[55] = 40;
-uint32 P_FASTCALL U8xformCol13(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(0, 0, 252, 40);
- if (b > 65535) b = 65535;
- return PACK_RGB16(r, g, b);
-}
-
-// 14 (blue) just need alpha modified
-// xform_palette[56] = 0;
-// xform_palette[57] = 0;
-// xform_palette[58] = 104;
-// xform_palette[59] = 40;
-uint32 P_FASTCALL U8xformCol14(uint32 col) {
- static uint32 r, g, b;
- UNPACK_RGB8(col, r, g, b);
- XFORM_BLEND_FUNC(0, 0, 104, 40);
- if (b > 65535) b = 65535;
- return PACK_RGB16(r, g, b);
-}
-
-const xformBlendFuncType U8XFormFuncs[256] = {
- 0, // 0
- 0, // 1
- 0, // 2
- 0, // 3
- 0, // 4
- 0, // 5
- 0, // 6
- 0, // 7
- static_cast<xformBlendFuncType>(&U8xformCol8), // 8 (green->dark grey)
- static_cast<xformBlendFuncType>(&U8xformCol9), // 9 (black->vdark grey)
- static_cast<xformBlendFuncType>(&U8xformCol10), // 10 (yellow)
- static_cast<xformBlendFuncType>(&U8xformCol11), // 11 (white->grey)
- static_cast<xformBlendFuncType>(&U8xformCol12), // 12 (red->orange)
- static_cast<xformBlendFuncType>(&U8xformCol13), // 13 (blue)
- static_cast<xformBlendFuncType>(&U8xformCol14), // 14 (blue)
- 0 // 15
-};
-
-#endif
-
} // End of namespace Ultima8
} // End of namespace Ultima
Commit: c74ae95508e3351b9b2e4f172872d48521ece798
https://github.com/scummvm/scummvm/commit/c74ae95508e3351b9b2e4f172872d48521ece798
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-23T16:23:17+09:00
Commit Message:
ULTIMA8: Avoid confman call on every animation
Changed paths:
engines/ultima/ultima8/ultima8.h
engines/ultima/ultima8/world/actors/actor_anim_process.cpp
diff --git a/engines/ultima/ultima8/ultima8.h b/engines/ultima/ultima8/ultima8.h
index 8a915f453e..e8d24992e6 100644
--- a/engines/ultima/ultima8/ultima8.h
+++ b/engines/ultima/ultima8/ultima8.h
@@ -376,6 +376,10 @@ public:
_hasCheated = true;
}
Gump *getMenuGump() const;
+
+ bool isInterpolationEnabled() const {
+ return _interpolate;
+ }
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/world/actors/actor_anim_process.cpp b/engines/ultima/ultima8/world/actors/actor_anim_process.cpp
index 1fe4955903..048e640e8b 100644
--- a/engines/ultima/ultima8/world/actors/actor_anim_process.cpp
+++ b/engines/ultima/ultima8/world/actors/actor_anim_process.cpp
@@ -82,7 +82,7 @@ bool ActorAnimProcess::init() {
_animAborted = false;
_attackedSomething = false;
- _interpolate = ConfMan.getBool("interpolate");
+ _interpolate = Ultima8Engine::get_instance()->isInterpolationEnabled();
Actor *actor = getActor(_itemNum);
assert(actor);
Commit: 4500cc845196da606c0d477a115663eda34e55f9
https://github.com/scummvm/scummvm/commit/4500cc845196da606c0d477a115663eda34e55f9
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-23T16:23:17+09:00
Commit Message:
ULTIMA8: Fix int16 casts in 32 bit usecode operands
These opcodes are all unused in Ultima8, so this bug probably only affects
Crusader games.
Changed paths:
engines/ultima/ultima8/usecode/uc_machine.cpp
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index ea1f222214..cf634043de 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -619,8 +619,8 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x1D:
// 1D
// subtract two 32 bit integers
- si32a = static_cast<int16>(p->_stack.pop4());
- si32b = static_cast<int16>(p->_stack.pop4());
+ si32a = static_cast<int32>(p->_stack.pop4());
+ si32b = static_cast<int32>(p->_stack.pop4());
p->_stack.push4(static_cast<uint32>(si32b - si32a));
LOGPF(("sub long\n"));
break;
@@ -637,8 +637,8 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x1F:
// 1F
// multiply two 32 bit integers
- si32a = static_cast<int16>(p->_stack.pop4());
- si32b = static_cast<int16>(p->_stack.pop4());
+ si32a = static_cast<int32>(p->_stack.pop4());
+ si32b = static_cast<int32>(p->_stack.pop4());
p->_stack.push4(static_cast<uint32>(si32a * si32b));
LOGPF(("mul long\n"));
break;
@@ -660,8 +660,8 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x21:
// 21
// divide two 32 bit integers
- si32a = static_cast<int16>(p->_stack.pop4());
- si32b = static_cast<int16>(p->_stack.pop4());
+ si32a = static_cast<int32>(p->_stack.pop4());
+ si32b = static_cast<int32>(p->_stack.pop4());
if (si32a != 0) {
p->_stack.push4(static_cast<uint32>(si32b / si32a));
} else {
@@ -689,8 +689,8 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x23:
// 23
// 32 bit mod
- si32a = static_cast<int16>(p->_stack.pop4());
- si32b = static_cast<int16>(p->_stack.pop4());
+ si32a = static_cast<int32>(p->_stack.pop4());
+ si32b = static_cast<int32>(p->_stack.pop4());
if (si32a != 0) {
p->_stack.push4(static_cast<uint32>(si32b % si32a));
} else {
@@ -939,8 +939,8 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x37:
// 37
// 32 bit not-equal (only used in Crusader)
- si32a = static_cast<int16>(p->_stack.pop4());
- si32b = static_cast<int16>(p->_stack.pop4());
+ si32a = static_cast<int32>(p->_stack.pop4());
+ si32b = static_cast<int32>(p->_stack.pop4());
if (si32a != si32b) {
p->_stack.push2(1);
} else {
More information about the Scummvm-git-logs
mailing list