[Scummvm-git-logs] scummvm master -> ca70e9c618067a69846d279c09cabcda366a9a96
criezy
noreply at scummvm.org
Sat Jun 18 23:47:50 UTC 2022
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9619169132 AGS: Use 100 as a default animation volume, as it's relative anyway
b948d94ce2 AGS: Implemented dialog_options_close callback
a7017efb7b AGS: Added event eEventEnterRoomAfterFadein
ca70e9c618 AGS: Updated build version (3.6.0.27)
Commit: 96191691326439b1bd94424f0deb4a78fc431048
https://github.com/scummvm/scummvm/commit/96191691326439b1bd94424f0deb4a78fc431048
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-06-19T00:46:56+01:00
Commit Message:
AGS: Use 100 as a default animation volume, as it's relative anyway
>From upstream 90a60fffd5f010e957a53721f860997835216308
Also includes upstream 951f60c4dc25aa1d4320f595e01b048b53f6bf5f
Changed paths:
engines/ags/engine/ac/button.cpp
engines/ags/engine/ac/character.cpp
engines/ags/engine/ac/character.h
engines/ags/engine/ac/character_extras.h
engines/ags/engine/ac/global_object.cpp
engines/ags/engine/ac/global_object.h
engines/ags/engine/ac/object.cpp
engines/ags/engine/ac/view_frame.cpp
engines/ags/engine/ac/view_frame.h
diff --git a/engines/ags/engine/ac/button.cpp b/engines/ags/engine/ac/button.cpp
index 207d41767f6..befc3ecb0e3 100644
--- a/engines/ags/engine/ac/button.cpp
+++ b/engines/ags/engine/ac/button.cpp
@@ -56,7 +56,7 @@ void UpdateButtonState(const AnimatingGUIButton &abtn) {
}
void Button_AnimateEx(GUIButton *butt, int view, int loop, int speed,
- int repeat, int blocking, int direction, int sframe, int volume = -1) {
+ int repeat, int blocking, int direction, int sframe, int volume = 100) {
int guin = butt->ParentId;
int objn = butt->Id;
@@ -83,7 +83,7 @@ void Button_AnimateEx(GUIButton *butt, int view, int loop, int speed,
if ((direction < 0) || (direction > 1))
quit("!AnimateButton: invalid direction");
- volume = std::min(volume, 100); // NOTE: negative volume means use defaults
+ volume = Math::Clamp(volume, 0, 100);
// if it's already animating, stop it
FindAndRemoveButtonAnimation(guin, objn);
diff --git a/engines/ags/engine/ac/character.cpp b/engines/ags/engine/ac/character.cpp
index 5a58beffe5e..10edab3af67 100644
--- a/engines/ags/engine/ac/character.cpp
+++ b/engines/ags/engine/ac/character.cpp
@@ -154,7 +154,7 @@ void Character_AddWaypoint(CharacterInfo *chaa, int x, int y) {
}
void Character_AnimateEx(CharacterInfo *chaa, int loop, int delay, int repeat,
- int blocking, int direction, int sframe, int volume = -1) {
+ int blocking, int direction, int sframe, int volume = 100) {
if (direction == FORWARDS)
direction = 0;
else if (direction == BACKWARDS)
@@ -2064,7 +2064,7 @@ void animate_character(CharacterInfo *chap, int loopn, int sppd, int rept,
}
chap->frame = sframe;
chap->wait = sppd + _GP(views)[chap->view].loops[loopn].frames[chap->frame].speed;
- _GP(charextra)[chap->index_id].cur_anim_volume = std::min(100, volume);
+ _GP(charextra)[chap->index_id].cur_anim_volume = Math::Clamp(volume, 0, 100);
CheckViewFrameForCharacter(chap);
}
@@ -2072,7 +2072,7 @@ void animate_character(CharacterInfo *chap, int loopn, int sppd, int rept,
void stop_character_anim(CharacterInfo *chap) { // TODO: may expand with resetting more properties,
// but have to be careful to not break logic somewhere
chap->animating = 0;
- _GP(charextra)[chap->index_id].cur_anim_volume = -1;
+ _GP(charextra)[chap->index_id].cur_anim_volume = 100;
}
void CheckViewFrameForCharacter(CharacterInfo * chi) {
diff --git a/engines/ags/engine/ac/character.h b/engines/ags/engine/ac/character.h
index 6b36281e414..f9b701f5ea5 100644
--- a/engines/ags/engine/ac/character.h
+++ b/engines/ags/engine/ac/character.h
@@ -177,7 +177,7 @@ class Bitmap;
using namespace AGS; // FIXME later
void animate_character(CharacterInfo *chap, int loopn, int sppd, int rept,
- int noidleoverride = 0, int direction = 0, int sframe = 0, int volume = -1);
+ int noidleoverride = 0, int direction = 0, int sframe = 0, int volume = 100);
// Clears up animation parameters
void stop_character_anim(CharacterInfo *chap);
void walk_character(int chac, int tox, int toy, int ignwal, bool autoWalkAnims);
diff --git a/engines/ags/engine/ac/character_extras.h b/engines/ags/engine/ac/character_extras.h
index 6f3cb72376c..f728c1e8cec 100644
--- a/engines/ags/engine/ac/character_extras.h
+++ b/engines/ags/engine/ac/character_extras.h
@@ -54,8 +54,8 @@ struct CharacterExtras {
int8 process_idle_this_time = 0;
int8 slow_move_counter = 0;
short animwait = 0;
- int anim_volume = -1; // default animation volume (-1 use clip default)
- int cur_anim_volume = -1; // current animation sound volume (-1 = default)
+ int anim_volume = 100; // default animation volume (relative factor)
+ int cur_anim_volume = 100; // current animation sound volume (relative factor)
void ReadFromSavegame(Shared::Stream *in, int save_ver);
void WriteToSavegame(Shared::Stream *out);
diff --git a/engines/ags/engine/ac/global_object.cpp b/engines/ags/engine/ac/global_object.cpp
index 71b063aef2b..bd9e0457427 100644
--- a/engines/ags/engine/ac/global_object.cpp
+++ b/engines/ags/engine/ac/global_object.cpp
@@ -258,7 +258,7 @@ void AnimateObjectImpl(int obn, int loopn, int spdd, int rept, int direction, in
_G(objs)[obn].num = Math::InRangeOrDef<uint16_t>(pic, 0);
if (pic > UINT16_MAX)
debug_script_warn("Warning: object's (id %d) sprite %d is outside of internal range (%d), reset to 0", obn, pic, UINT16_MAX);
- _G(objs)[obn].anim_volume = std::min(volume, 100); // NOTE: negative volume means use defaults
+ _G(objs)[obn].anim_volume = Math::Clamp(volume, 0, 100);
CheckViewFrame(_G(objs)[obn].view, loopn, _G(objs)[obn].frame, _G(objs)[obn].anim_volume);
if (blocking)
diff --git a/engines/ags/engine/ac/global_object.h b/engines/ags/engine/ac/global_object.h
index 394d2f67ea7..eeef60e207f 100644
--- a/engines/ags/engine/ac/global_object.h
+++ b/engines/ags/engine/ac/global_object.h
@@ -50,7 +50,7 @@ void SetObjectBaseline(int obn, int basel);
int GetObjectBaseline(int obn);
void AnimateObjectEx(int obn, int loopn, int spdd, int rept, int direction, int blocking);
void AnimateObject(int obn, int loopn, int spdd, int rept);
-void AnimateObjectImpl(int obn, int loopn, int spdd, int rept, int direction, int blocking, int sframe, int volume = -1);
+void AnimateObjectImpl(int obn, int loopn, int spdd, int rept, int direction, int blocking, int sframe, int volume = 100);
void MergeObject(int obn);
void StopObjectMoving(int objj);
void ObjectOff(int obn);
diff --git a/engines/ags/engine/ac/object.cpp b/engines/ags/engine/ac/object.cpp
index ee8206d063b..c75029826d9 100644
--- a/engines/ags/engine/ac/object.cpp
+++ b/engines/ags/engine/ac/object.cpp
@@ -121,7 +121,7 @@ int Object_GetBaseline(ScriptObject *objj) {
}
void Object_AnimateEx(ScriptObject *objj, int loop, int delay, int repeat,
- int blocking, int direction, int sframe, int volume = -1) {
+ int blocking, int direction, int sframe, int volume = 100) {
if (direction == FORWARDS)
direction = 0;
else if (direction == BACKWARDS)
diff --git a/engines/ags/engine/ac/view_frame.cpp b/engines/ags/engine/ac/view_frame.cpp
index e8b3161d950..6cd0333a1c9 100644
--- a/engines/ags/engine/ac/view_frame.cpp
+++ b/engines/ags/engine/ac/view_frame.cpp
@@ -29,6 +29,7 @@
#include "ags/engine/ac/draw.h"
#include "ags/shared/ac/game_version.h"
#include "ags/engine/media/audio/audio_system.h"
+#include "ags/shared/util/math.h"
#include "ags/shared/debugging/out.h"
#include "ags/engine/script/script_api.h"
#include "ags/engine/script/script_runtime.h"
@@ -36,8 +37,7 @@
namespace AGS3 {
-using AGS::Shared::Bitmap;
-using AGS::Shared::Graphics;
+using namespace AGS::Shared;
int ViewFrame_GetFlipped(ScriptViewFrame *svf) {
if (_GP(views)[svf->view].loops[svf->loop].frames[svf->frame].flags & VFLG_FLIPSPRITE)
@@ -140,7 +140,7 @@ void CheckViewFrame(int view, int loop, int frame, int sound_volume) {
}
}
if (channel && (sound_volume >= 0)) {
- sound_volume = std::min(sound_volume, 100);
+ sound_volume = Math::Clamp(sound_volume, 0, 100);
auto *ch = AudioChans::GetChannel(channel->id);
if (ch)
ch->set_volume100(ch->get_volume100() * sound_volume / 100);
diff --git a/engines/ags/engine/ac/view_frame.h b/engines/ags/engine/ac/view_frame.h
index 29f63e3ee60..9b8df0177a7 100644
--- a/engines/ags/engine/ac/view_frame.h
+++ b/engines/ags/engine/ac/view_frame.h
@@ -51,8 +51,9 @@ int ViewFrame_GetLoop(ScriptViewFrame *svf);
int ViewFrame_GetFrame(ScriptViewFrame *svf);
void precache_view(int view);
-// Handle the new animation frame (play linked sounds, etc)
-void CheckViewFrame(int view, int loop, int frame, int sound_volume = -1);
+// Handle the new animation frame (play linked sounds, etc);
+ // sound_volume is an optional relative factor, -1 means not use
+ void CheckViewFrame(int view, int loop, int frame, int sound_volume = -1);
// draws a view frame, flipped if appropriate
void DrawViewFrame(Shared::Bitmap *ds, const ViewFrame *vframe, int x, int y, bool alpha_blend = false);
Commit: b948d94ce2a4bc1f4bc0a0620473515dfec7eb8d
https://github.com/scummvm/scummvm/commit/b948d94ce2a4bc1f4bc0a0620473515dfec7eb8d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-06-19T00:46:56+01:00
Commit Message:
AGS: Implemented dialog_options_close callback
>From upstream 88cb130d1063bf5268bbcae29ffaae37324f5a30
Changed paths:
engines/ags/engine/ac/dialog.cpp
engines/ags/engine/ac/game.cpp
engines/ags/engine/game/game_init.cpp
engines/ags/globals.cpp
engines/ags/globals.h
diff --git a/engines/ags/engine/ac/dialog.cpp b/engines/ags/engine/ac/dialog.cpp
index 1981f2d8c2c..09c0927356e 100644
--- a/engines/ags/engine/ac/dialog.cpp
+++ b/engines/ags/engine/ac/dialog.cpp
@@ -593,6 +593,12 @@ void DialogOptions::Show() {
Redraw();
while (Run() && !SHOULD_QUIT) {}
+
+ // Close custom dialog options
+ if (usingCustomRendering) {
+ _GP(runDialogOptionCloseFunc).params[0].SetDynamicObject(&_GP(ccDialogOptionsRendering), &_GP(ccDialogOptionsRendering));
+ run_function_on_non_blocking_thread(&_GP(runDialogOptionCloseFunc));
+ }
}
void DialogOptions::Redraw() {
diff --git a/engines/ags/engine/ac/game.cpp b/engines/ags/engine/ac/game.cpp
index 2120a2e093a..48f3e6459d8 100644
--- a/engines/ags/engine/ac/game.cpp
+++ b/engines/ags/engine/ac/game.cpp
@@ -409,6 +409,7 @@ void unload_game_file() {
_GP(runDialogOptionKeyPressHandlerFunc).moduleHasFunction.resize(0);
_GP(runDialogOptionTextInputHandlerFunc).moduleHasFunction.resize(0);
_GP(runDialogOptionRepExecFunc).moduleHasFunction.resize(0);
+ _GP(runDialogOptionCloseFunc).moduleHasFunction.resize(0);
_G(numScriptModules) = 0;
_GP(views).clear();
diff --git a/engines/ags/engine/game/game_init.cpp b/engines/ags/engine/game/game_init.cpp
index 313fe477ae8..98c362f2495 100644
--- a/engines/ags/engine/game/game_init.cpp
+++ b/engines/ags/engine/game/game_init.cpp
@@ -322,6 +322,7 @@ void AllocScriptModules() {
_GP(runDialogOptionKeyPressHandlerFunc).moduleHasFunction.resize(_G(numScriptModules), true);
_GP(runDialogOptionTextInputHandlerFunc).moduleHasFunction.resize(_G(numScriptModules), true);
_GP(runDialogOptionRepExecFunc).moduleHasFunction.resize(_G(numScriptModules), true);
+ _GP(runDialogOptionCloseFunc).moduleHasFunction.resize(_G(numScriptModules), true);
for (auto &val : _GP(moduleRepExecAddr)) {
val.Invalidate();
}
diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index 7917dd43ded..73a1a66604a 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -351,6 +351,7 @@ Globals::Globals() {
_runDialogOptionKeyPressHandlerFunc = new NonBlockingScriptFunction("dialog_options_key_press", 3);
_runDialogOptionTextInputHandlerFunc = new NonBlockingScriptFunction("dialog_options_text_input", 2);
_runDialogOptionRepExecFunc = new NonBlockingScriptFunction("dialog_options_repexec", 1);
+ _runDialogOptionCloseFunc = new NonBlockingScriptFunction("dialog_options_close", 1);
_scsystem = new ScriptSystem();
_scriptModules = new std::vector<PScript>();
_moduleInst = new std::vector<ccInstance *>();
@@ -598,6 +599,7 @@ Globals::~Globals() {
delete _runDialogOptionKeyPressHandlerFunc;
delete _runDialogOptionTextInputHandlerFunc;
delete _runDialogOptionRepExecFunc;
+ delete _runDialogOptionCloseFunc;
delete _scsystem;
delete _scriptModules;
delete _moduleInst;
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index 982f4dbc695..75320606f92 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -1261,6 +1261,7 @@ public:
NonBlockingScriptFunction *_runDialogOptionKeyPressHandlerFunc;
NonBlockingScriptFunction *_runDialogOptionTextInputHandlerFunc;
NonBlockingScriptFunction *_runDialogOptionRepExecFunc;
+ NonBlockingScriptFunction *_runDialogOptionCloseFunc;
ScriptSystem *_scsystem;
Commit: a7017efb7b62f501c0faa0142c99e1931c3c4129
https://github.com/scummvm/scummvm/commit/a7017efb7b62f501c0faa0142c99e1931c3c4129
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-06-19T00:46:56+01:00
Commit Message:
AGS: Added event eEventEnterRoomAfterFadein
>From upstream 98312a3929df381604d3879aae61a0c3c15d9ca6
Changed paths:
engines/ags/engine/ac/event.cpp
engines/ags/engine/ac/event.h
diff --git a/engines/ags/engine/ac/event.cpp b/engines/ags/engine/ac/event.cpp
index 4af03f3977a..56a149355cd 100644
--- a/engines/ags/engine/ac/event.cpp
+++ b/engines/ags/engine/ac/event.cpp
@@ -170,6 +170,8 @@ void process_event(const EventHappened *evp) {
if (evp->data3 == EVROM_BEFOREFADEIN) {
_G(in_enters_screen)++;
run_on_event(GE_ENTER_ROOM, RuntimeScriptValue().SetInt32(_G(displayed_room)));
+ } else if (evp->data3 == EVROM_AFTERFADEIN) {
+ run_on_event(GE_ENTER_ROOM_AFTERFADE, RuntimeScriptValue().SetInt32(_G(displayed_room)));
}
//Debug::Printf("Running room interaction, event %d", evp->data3);
}
diff --git a/engines/ags/engine/ac/event.h b/engines/ags/engine/ac/event.h
index 7ca68941ded..87966341c82 100644
--- a/engines/ags/engine/ac/event.h
+++ b/engines/ags/engine/ac/event.h
@@ -30,13 +30,14 @@ namespace AGS3 {
// parameters to run_on_event
#define GE_LEAVE_ROOM 1
#define GE_ENTER_ROOM 2
-#define GE_MAN_DIES 3
+//#define GE_MAN_DIES 3 // ancient obsolete event
#define GE_GOT_SCORE 4
#define GE_GUI_MOUSEDOWN 5
#define GE_GUI_MOUSEUP 6
#define GE_ADD_INV 7
#define GE_LOSE_INV 8
#define GE_RESTORE_GAME 9
+#define GE_ENTER_ROOM_AFTERFADE 10
// Game event types:
// common script callback
Commit: ca70e9c618067a69846d279c09cabcda366a9a96
https://github.com/scummvm/scummvm/commit/ca70e9c618067a69846d279c09cabcda366a9a96
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-06-19T00:46:56+01:00
Commit Message:
AGS: Updated build version (3.6.0.27)
>From upstream 9d5e422251075b270c0a8a59b63916f81b3a9ea2
Changed paths:
engines/ags/shared/core/def_version.h
diff --git a/engines/ags/shared/core/def_version.h b/engines/ags/shared/core/def_version.h
index 904e9d293f5..41de73a167a 100644
--- a/engines/ags/shared/core/def_version.h
+++ b/engines/ags/shared/core/def_version.h
@@ -22,9 +22,9 @@
#ifndef AGS_SHARED_CORE_DEFVERSION_H
#define AGS_SHARED_CORE_DEFVERSION_H
-#define ACI_VERSION_STR "3.6.0.26"
+#define ACI_VERSION_STR "3.6.0.27"
#if defined (RC_INVOKED) // for MSVC resource compiler
-#define ACI_VERSION_MSRC_DEF 3.6.0.26
+#define ACI_VERSION_MSRC_DEF 3.6.0.27
#endif
#define SPECIAL_VERSION ""
More information about the Scummvm-git-logs
mailing list