[Scummvm-git-logs] scummvm master -> 33bf5fd7390a37338324ed172cd6ef5a6f333f5e
dreammaster
dreammaster at scummvm.org
Wed Aug 18 04:34:02 UTC 2021
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ebfc246cc0 AGS: Moved "placeonwalkable" compat hack to a better place
d90cb0d203 AGS: Removed excessive headers containing random group of includes
93396cdcc1 AGS: Fix formatting of delete[] calls
895c8d22c1 AGS: implemented readonly Overlay.Width and Height
e2e4a0d93d AGS: AudioClip.PlayOnChannel() errors on unsupported channel
33bf5fd739 AGS: Updated build version (3.6.0.7)
Commit: ebfc246cc026daff7f13f2ab37c09857d04d66ab
https://github.com/scummvm/scummvm/commit/ebfc246cc026daff7f13f2ab37c09857d04d66ab
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-17T21:31:56-07:00
Commit Message:
AGS: Moved "placeonwalkable" compat hack to a better place
>From upstream b6c39a32a3a90ae018199fb9574879643d1b4eed
Changed paths:
engines/ags/engine/ac/global_room.cpp
engines/ags/engine/ac/room.cpp
engines/ags/globals.h
diff --git a/engines/ags/engine/ac/global_room.cpp b/engines/ags/engine/ac/global_room.cpp
index 94cb027351..b1f8fd83a8 100644
--- a/engines/ags/engine/ac/global_room.cpp
+++ b/engines/ags/engine/ac/global_room.cpp
@@ -108,13 +108,21 @@ void NewRoom(int nrnum) {
_G(inv_screen_newroom) = nrnum;
return;
} else if ((_G(inside_script) == 0) & (_G(in_graph_script) == 0)) {
+ // Compatibility: old games had a *possibly unintentional* effect:
+ // if a character was walking, and a "change room" is called
+ // *NOT* from a script, but by some other trigger,
+ // they ended up forced to a walkable area in the next room.
+ if (_G(loaded_game_file_version) < kGameVersion_300) {
+ _G(new_room_placeonwalkable) = is_char_walking_ndirect(_G(playerchar));
+ }
+
new_room(nrnum, _G(playerchar));
return;
} else if (_G(inside_script)) {
_G(curscript)->queue_action(ePSANewRoom, nrnum, "NewRoom");
// we might be within a MoveCharacterBlocking -- the room
// change should abort it
- if ((_G(playerchar)->walking > 0) && (_G(playerchar)->walking < TURNING_AROUND)) {
+ if (is_char_walking_ndirect(_G(playerchar))) {
// nasty hack - make sure it doesn't move the character
// to a walkable area
_G(mls)[_G(playerchar)->walking].direct = 1;
diff --git a/engines/ags/engine/ac/room.cpp b/engines/ags/engine/ac/room.cpp
index 3cba8064a7..f4afc2c235 100644
--- a/engines/ags/engine/ac/room.cpp
+++ b/engines/ags/engine/ac/room.cpp
@@ -693,7 +693,6 @@ void load_new_room(int newnum, CharacterInfo *forchar) {
_G(rgb_map) = &_GP(rgb_table);
}
_G(our_eip) = 211;
- bool place_on_walkable = false;
if (forchar != nullptr) {
// if it's not a Restore Game
@@ -714,14 +713,6 @@ void load_new_room(int newnum, CharacterInfo *forchar) {
forchar->prevroom = forchar->room;
forchar->room = newnum;
- // Compatibility: old games had a *possibly unintentional* effect:
- // if a character was moving when "change room" function is called,
- // they ended up forced to a walkable area in the next room.
- if (_G(loaded_game_file_version) < kGameVersion_300) {
- if (is_char_walking_ndirect(forchar))
- place_on_walkable = true;
- }
-
// only stop moving if it's a new room, not a restore game
for (cc = 0; cc < _GP(game).numcharacters; cc++)
StopMoving(cc);
@@ -745,14 +736,17 @@ void load_new_room(int newnum, CharacterInfo *forchar) {
if ((_G(new_room_x) != SCR_NO_VALUE) && (forchar != nullptr)) {
forchar->x = _G(new_room_x);
forchar->y = _G(new_room_y);
- if (place_on_walkable)
+ if (_G(new_room_placeonwalkable))
Character_PlaceOnWalkableArea(forchar);
if (_G(new_room_loop) != SCR_NO_VALUE)
forchar->loop = _G(new_room_loop);
}
- _G(new_room_x) = SCR_NO_VALUE;
+
+ // reset new_room instructions
+ _G(new_room_x) = _G(new_room_y) = SCR_NO_VALUE;
_G(new_room_loop) = SCR_NO_VALUE;
+ _G(new_room_placeonwalkable) = false;
if ((_G(new_room_pos) > 0) & (forchar != nullptr)) {
if (_G(new_room_pos) >= 4000) {
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index 04b6635430..2f50ffaa12 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -768,6 +768,7 @@ public:
int _gameHasBeenRestored = 0;
int _oldeip = 0;
int _game_update_suspend = 0;
+ bool _new_room_placeonwalkable = false;
/**@}*/
Commit: d90cb0d203bc6aacd2b7568eb8e35e3fe35aa3bd
https://github.com/scummvm/scummvm/commit/d90cb0d203bc6aacd2b7568eb8e35e3fe35aa3bd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-17T21:31:56-07:00
Commit Message:
AGS: Removed excessive headers containing random group of includes
>From upstream 9e5149457a4638694fb1366b3fa59b08816f522c
Changed paths:
R engines/ags/engine/main/main_defines_ex.h
R engines/ags/engine/main/main_header.h
engines/ags/ags.cpp
engines/ags/engine/ac/character_info_engine.cpp
engines/ags/engine/ac/runtime_defines.h
engines/ags/engine/main/config.cpp
engines/ags/engine/main/engine.cpp
engines/ags/engine/main/game_file.cpp
engines/ags/engine/main/game_run.cpp
engines/ags/engine/main/game_start.cpp
engines/ags/engine/main/main.cpp
engines/ags/engine/main/quit.cpp
engines/ags/engine/main/update.cpp
diff --git a/engines/ags/ags.cpp b/engines/ags/ags.cpp
index 691e0f43a2..0bd378fe70 100644
--- a/engines/ags/ags.cpp
+++ b/engines/ags/ags.cpp
@@ -51,7 +51,6 @@
#include "ags/engine/game/savegame.h"
#include "ags/engine/main/config.h"
#include "ags/engine/main/engine.h"
-#include "ags/engine/main/main_header.h"
#include "ags/engine/main/main.h"
#include "ags/engine/main/quit.h"
#include "ags/engine/platform/base/ags_platform_driver.h"
diff --git a/engines/ags/engine/ac/character_info_engine.cpp b/engines/ags/engine/ac/character_info_engine.cpp
index d17e129f51..85eafafc9e 100644
--- a/engines/ags/engine/ac/character_info_engine.cpp
+++ b/engines/ags/engine/ac/character_info_engine.cpp
@@ -31,7 +31,6 @@
#include "ags/engine/ac/view_frame.h"
#include "ags/engine/debugging/debug_log.h"
#include "ags/shared/game/room_struct.h"
-#include "ags/engine/main/main_defines_ex.h" // RETURN_CONTINUE
#include "ags/engine/main/update.h"
#include "ags/engine/media/audio/audio_system.h"
#include "ags/ags.h"
diff --git a/engines/ags/engine/ac/runtime_defines.h b/engines/ags/engine/ac/runtime_defines.h
index cb29b9ba5d..a84f3c70e3 100644
--- a/engines/ags/engine/ac/runtime_defines.h
+++ b/engines/ags/engine/ac/runtime_defines.h
@@ -161,6 +161,8 @@ const int LegacyRoomVolumeFactor = 30;
#define MAX_OPEN_SCRIPT_FILES 10
+#define RETURN_CONTINUE 1
+
} // namespace AGS3
#endif
diff --git a/engines/ags/engine/main/config.cpp b/engines/ags/engine/main/config.cpp
index b92e9a5b4d..c20a139ef4 100644
--- a/engines/ags/engine/main/config.cpp
+++ b/engines/ags/engine/main/config.cpp
@@ -23,8 +23,6 @@
//
// Game configuration
//
-//include <ctype.h> // toupper
-#include "ags/shared/core/platform.h"
#include "ags/engine/ac/game_setup.h"
#include "ags/shared/ac/game_setup_struct.h"
#include "ags/engine/ac/game_state.h"
@@ -32,17 +30,18 @@
#include "ags/engine/ac/path_helper.h"
#include "ags/shared/ac/sprite_cache.h"
#include "ags/engine/ac/system.h"
+#include "ags/shared/core/platform.h"
#include "ags/engine/debugging/debugger.h"
#include "ags/engine/debugging/debug_log.h"
-#include "ags/engine/main/main_header.h"
+#include "ags/engine/device/mouse_w32.h"
#include "ags/engine/main/config.h"
+#include "ags/engine/media/audio/audio_system.h"
#include "ags/engine/platform/base/ags_platform_driver.h"
#include "ags/shared/util/directory.h"
#include "ags/shared/util/ini_util.h"
#include "ags/shared/util/text_stream_reader.h"
#include "ags/shared/util/path.h"
#include "ags/shared/util/string_utils.h"
-#include "ags/engine/media/audio/audio_system.h"
#include "common/config-manager.h"
namespace AGS3 {
diff --git a/engines/ags/engine/main/engine.cpp b/engines/ags/engine/main/engine.cpp
index 27c1f26417..d1eb3d5168 100644
--- a/engines/ags/engine/main/engine.cpp
+++ b/engines/ags/engine/main/engine.cpp
@@ -25,14 +25,7 @@
//
#include "ags/shared/core/platform.h"
-
-//include <errno.h>
-#if AGS_PLATFORM_OS_WINDOWS
-//include <process.h> // _spawnl
-#endif
#include "ags/lib/allegro.h" // allegro_install and _exit
-
-#include "ags/engine/main/main_header.h"
#include "ags/engine/ac/asset_helper.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/character.h"
@@ -49,6 +42,7 @@
#include "ags/engine/ac/lip_sync.h"
#include "ags/engine/ac/object_cache.h"
#include "ags/engine/ac/path_helper.h"
+#include "ags/engine/ac/route_finder.h"
#include "ags/engine/ac/sys_events.h"
#include "ags/engine/ac/room_status.h"
#include "ags/engine/ac/speech.h"
@@ -61,6 +55,7 @@
#include "ags/engine/debugging/debug_log.h"
#include "ags/engine/debugging/debugger.h"
#include "ags/shared/debugging/out.h"
+#include "ags/engine/device/mouse_w32.h"
#include "ags/shared/font/ags_font_renderer.h"
#include "ags/shared/font/fonts.h"
#include "ags/shared/gfx/image.h"
@@ -79,6 +74,7 @@
#include "ags/shared/util/directory.h"
#include "ags/shared/util/error.h"
#include "ags/shared/util/path.h"
+#include "ags/shared/util/string_utils.h"
#include "ags/ags.h"
#include "ags/globals.h"
diff --git a/engines/ags/engine/main/game_file.cpp b/engines/ags/engine/main/game_file.cpp
index 3ad68abbba..cc1cbb87d9 100644
--- a/engines/ags/engine/main/game_file.cpp
+++ b/engines/ags/engine/main/game_file.cpp
@@ -24,34 +24,33 @@
// Game data file management
//
-#include "ags/engine/main/main_header.h"
-#include "ags/engine/main/game_file.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/character.h"
#include "ags/engine/ac/character_cache.h"
#include "ags/shared/ac/dialog_topic.h"
#include "ags/engine/ac/draw.h"
#include "ags/engine/ac/game.h"
+#include "ags/engine/ac/game_setup.h"
#include "ags/shared/ac/game_setup_struct.h"
#include "ags/engine/ac/game_state.h"
#include "ags/shared/ac/game_struct_defines.h"
#include "ags/engine/ac/gui.h"
#include "ags/engine/ac/view_frame.h"
+#include "ags/shared/core/asset_manager.h"
#include "ags/engine/debugging/debug_log.h"
#include "ags/shared/debugging/out.h"
+#include "ags/engine/game/game_init.h"
+#include "ags/shared/game/main_game_file.h"
+#include "ags/shared/gfx/bitmap.h"
+#include "ags/engine/gfx/blender.h"
#include "ags/shared/gui/gui_label.h"
#include "ags/engine/main/main.h"
#include "ags/engine/platform/base/ags_platform_driver.h"
-#include "ags/shared/util/stream.h"
-#include "ags/shared/gfx/bitmap.h"
-#include "ags/engine/gfx/blender.h"
-#include "ags/shared/core/asset_manager.h"
+#include "ags/shared/script/cc_error.h"
+#include "ags/engine/script/script.h"
#include "ags/shared/util/aligned_stream.h"
+#include "ags/shared/util/stream.h"
#include "ags/shared/util/text_stream_reader.h"
-#include "ags/engine/ac/game_setup.h"
-#include "ags/shared/game/main_game_file.h"
-#include "ags/engine/game/game_init.h"
-#include "ags/engine/script/script.h"
#include "ags/globals.h"
namespace AGS3 {
diff --git a/engines/ags/engine/main/game_run.cpp b/engines/ags/engine/main/game_run.cpp
index 6054dd0f27..382d941a02 100644
--- a/engines/ags/engine/main/game_run.cpp
+++ b/engines/ags/engine/main/game_run.cpp
@@ -25,6 +25,7 @@
//
#include "ags/lib/std/limits.h"
+#include "ags/engine/ac/button.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/character_extras.h"
#include "ags/shared/ac/character_info.h"
@@ -44,27 +45,27 @@
#include "ags/shared/ac/keycode.h"
#include "ags/engine/ac/mouse.h"
#include "ags/engine/ac/overlay.h"
+#include "ags/shared/ac/sprite_cache.h"
#include "ags/engine/ac/sys_events.h"
#include "ags/engine/ac/room.h"
#include "ags/engine/ac/room_object.h"
#include "ags/engine/ac/room_status.h"
#include "ags/engine/debugging/debugger.h"
#include "ags/engine/debugging/debug_log.h"
+#include "ags/engine/device/mouse_w32.h"
+#include "ags/engine/gui/animating_gui_button.h"
#include "ags/shared/gui/gui_inv.h"
#include "ags/shared/gui/gui_main.h"
#include "ags/shared/gui/gui_textbox.h"
-#include "ags/engine/main/main_header.h"
#include "ags/engine/main/engine.h"
#include "ags/engine/main/game_run.h"
#include "ags/engine/main/update.h"
+#include "ags/engine/media/audio/audio_system.h"
+#include "ags/engine/platform/base/ags_platform_driver.h"
#include "ags/plugins/ags_plugin.h"
#include "ags/plugins/plugin_engine.h"
#include "ags/engine/script/script.h"
-#include "ags/shared/ac/sprite_cache.h"
-#include "ags/engine/media/audio/audio_system.h"
-#include "ags/engine/platform/base/ags_platform_driver.h"
-#include "ags/engine/ac/timer.h"
-#include "ags/shared/ac/keycode.h"
+#include "ags/engine/script/script_runtime.h"
#include "ags/events.h"
#include "ags/globals.h"
diff --git a/engines/ags/engine/main/game_start.cpp b/engines/ags/engine/main/game_start.cpp
index a0bf38b5bc..8d867a6ec1 100644
--- a/engines/ags/engine/main/game_start.cpp
+++ b/engines/ags/engine/main/game_start.cpp
@@ -33,15 +33,16 @@
#include "ags/engine/ac/mouse.h"
#include "ags/engine/ac/room.h"
#include "ags/engine/ac/screen.h"
+#include "ags/engine/ac/timer.h"
#include "ags/engine/debugging/debug_log.h"
#include "ags/engine/debugging/debugger.h"
#include "ags/shared/debugging/out.h"
-#include "ags/engine/main/main_header.h"
+#include "ags/engine/device/mouse_w32.h"
#include "ags/engine/main/game_run.h"
#include "ags/engine/main/game_start.h"
-#include "ags/engine/script/script.h"
#include "ags/engine/media/audio/audio_system.h"
-#include "ags/engine/ac/timer.h"
+#include "ags/engine/script/script_runtime.h"
+#include "ags/engine/script/script.h"
#include "ags/ags.h"
#include "ags/globals.h"
diff --git a/engines/ags/engine/main/main.cpp b/engines/ags/engine/main/main.cpp
index 20465c447a..e4da577678 100644
--- a/engines/ags/engine/main/main.cpp
+++ b/engines/ags/engine/main/main.cpp
@@ -33,7 +33,6 @@
#include "ags/shared/debugging/out.h"
#include "ags/engine/main/config.h"
#include "ags/engine/main/engine.h"
-#include "ags/engine/main/main_header.h"
#include "ags/engine/main/main.h"
#include "ags/engine/platform/base/ags_platform_driver.h"
#include "ags/engine/platform/base/sys_main.h"
diff --git a/engines/ags/engine/main/main_defines_ex.h b/engines/ags/engine/main/main_defines_ex.h
deleted file mode 100644
index 389613f402..0000000000
--- a/engines/ags/engine/main/main_defines_ex.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef AGS_ENGINE_MAIN_MAIN_DEFINES_EX_H
-#define AGS_ENGINE_MAIN_MAIN_DEFINES_EX_H
-
-#define RETURN_CONTINUE 1
-
-#endif
diff --git a/engines/ags/engine/main/main_header.h b/engines/ags/engine/main/main_header.h
deleted file mode 100644
index 074fcb91f0..0000000000
--- a/engines/ags/engine/main/main_header.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef AGS_ENGINE_MAIN_MAIN_HEADER_H
-#define AGS_ENGINE_MAIN_MAIN_HEADER_H
-
-#include "ags/shared/core/platform.h"
-#include "ags/engine/main/main_defines_ex.h"
-#include "ags/engine/ac/math.h"
-#include "ags/engine/script/script_runtime.h"
-#include "ags/engine/gui/animating_gui_button.h"
-#include "ags/shared/gui/gui_button.h"
-#include "ags/engine/gfx/gfxfilter.h"
-#include "ags/shared/util/string_utils.h"
-#include "ags/engine/device/mouse_w32.h"
-#include "ags/engine/ac/route_finder.h"
-#include "ags/shared/script/cc_error.h"
-
-// include last since we affect windows includes
-#include "ags/engine/ac/file.h"
-
-#if AGS_PLATFORM_OS_ANDROID
-//include <sys/stat.h>
-//include <android/log.h>
-
-namespace AGS3 {
-extern "C" void selectLatestSavegame();
-extern bool psp_load_latest_savegame;
-} // namespace AGS3
-#endif
-
-#endif
diff --git a/engines/ags/engine/main/quit.cpp b/engines/ags/engine/main/quit.cpp
index 8174a232af..9785efcff1 100644
--- a/engines/ags/engine/main/quit.cpp
+++ b/engines/ags/engine/main/quit.cpp
@@ -30,6 +30,7 @@
#include "ags/shared/ac/game_setup_struct.h"
#include "ags/engine/ac/game_state.h"
#include "ags/engine/ac/room_status.h"
+#include "ags/engine/ac/route_finder.h"
#include "ags/engine/ac/translation.h"
#include "ags/engine/debugging/ags_editor_debugger.h"
#include "ags/engine/debugging/debug_log.h"
@@ -39,7 +40,6 @@
#include "ags/engine/main/config.h"
#include "ags/engine/main/engine.h"
#include "ags/engine/main/main.h"
-#include "ags/engine/main/main_header.h"
#include "ags/engine/main/quit.h"
#include "ags/shared/ac/sprite_cache.h"
#include "ags/engine/gfx/graphics_driver.h"
diff --git a/engines/ags/engine/main/update.cpp b/engines/ags/engine/main/update.cpp
index 88b4911cdd..da2735fda7 100644
--- a/engines/ags/engine/main/update.cpp
+++ b/engines/ags/engine/main/update.cpp
@@ -37,7 +37,6 @@
#include "ags/engine/ac/sys_events.h"
#include "ags/engine/ac/room_object.h"
#include "ags/engine/ac/room_status.h"
-#include "ags/engine/main/main_header.h"
#include "ags/engine/main/update.h"
#include "ags/engine/ac/screen_overlay.h"
#include "ags/engine/ac/view_frame.h"
Commit: 93396cdcc15345b881a7a57769700e071e52d146
https://github.com/scummvm/scummvm/commit/93396cdcc15345b881a7a57769700e071e52d146
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-17T21:31:56-07:00
Commit Message:
AGS: Fix formatting of delete[] calls
Changed paths:
engines/ags/console.cpp
engines/ags/engine/script/cc_instance.cpp
engines/ags/plugins/ags_blend/ags_blend.cpp
engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
engines/ags/plugins/ags_pal_render/raycast.cpp
engines/ags/shared/util/string_utils.cpp
diff --git a/engines/ags/console.cpp b/engines/ags/console.cpp
index 3366a8722c..bb257e752a 100644
--- a/engines/ags/console.cpp
+++ b/engines/ags/console.cpp
@@ -239,7 +239,7 @@ bool AGSConsole::Cmd_dumpSprite(int argc, const char **argv) {
}
}
Image::writePNG(df, sprite->GetAllegroBitmap()->getSurface().rawSurface(), palette);
- delete [] palette;
+ delete[] palette;
}
return true;
diff --git a/engines/ags/engine/script/cc_instance.cpp b/engines/ags/engine/script/cc_instance.cpp
index 0a5f00591b..1f00d17ddb 100644
--- a/engines/ags/engine/script/cc_instance.cpp
+++ b/engines/ags/engine/script/cc_instance.cpp
@@ -1470,16 +1470,16 @@ void ccInstance::Free() {
code = nullptr;
strings = nullptr;
- delete [] stack;
- delete [] stackdata;
- delete [] exports;
+ delete[] stack;
+ delete[] stackdata;
+ delete[] exports;
stack = nullptr;
stackdata = nullptr;
exports = nullptr;
if ((flags & INSTF_SHAREDATA) == 0) {
- delete [] resolved_imports;
- delete [] code_fixups;
+ delete[] resolved_imports;
+ delete[] code_fixups;
}
resolved_imports = nullptr;
code_fixups = nullptr;
diff --git a/engines/ags/plugins/ags_blend/ags_blend.cpp b/engines/ags/plugins/ags_blend/ags_blend.cpp
index 9ccd6f5b73..90a22962e3 100644
--- a/engines/ags/plugins/ags_blend/ags_blend.cpp
+++ b/engines/ags/plugins/ags_blend/ags_blend.cpp
@@ -348,9 +348,9 @@ void AGSBlend::Blur(ScriptMethodParams ¶ms) {
}
}
- delete [] Pixels;
- delete [] Dest;
- delete [] Temp;
+ delete[] Pixels;
+ delete[] Dest;
+ delete[] Temp;
_engine->ReleaseBitmapSurface(src);
delete srclongbuffer;
delete srccharbuffer;
diff --git a/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp b/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
index a795cafcdc..cd7f66e7f6 100644
--- a/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
+++ b/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
@@ -1354,7 +1354,7 @@ int DrawReflections(int id, int charobj = 0) {
j = 0;
}
- delete [] obst;
+ delete[] obst;
if (scaled == true)engine->FreeBitmap(charsprite2);
engine->ReleaseBitmapSurface(charsprite);
//engine->ReleaseBitmapSurface (virtsc);
@@ -1770,7 +1770,7 @@ int64 AGSPalRender::AGS_EngineOnEvent(int event, NumberPtr data) {
engine->ReleaseBitmapSurface(virtsc);
engine->FreeBitmap(rcolormap);
engine->FreeBitmap(ralphamap);
- delete [] reflectionmap;
+ delete[] reflectionmap;
}
int i = 0;
if (LensOption.draw == 1 && LensOption.level == 0) DrawLens(LensOption.x, LensOption.y);
diff --git a/engines/ags/plugins/ags_pal_render/raycast.cpp b/engines/ags/plugins/ags_pal_render/raycast.cpp
index 023da8a2fc..0e0569f81c 100644
--- a/engines/ags/plugins/ags_pal_render/raycast.cpp
+++ b/engines/ags/plugins/ags_pal_render/raycast.cpp
@@ -1385,17 +1385,17 @@ void AGSPalRender::Raycast_Render(ScriptMethodParams ¶ms) {
void AGSPalRender::QuitCleanup(ScriptMethodParams &) {
if (!rendering) {
for (int i = 0; i < S_WIDTH; ++i) {
- if (transcolorbuffer[i])delete [] transcolorbuffer[i];
- if (transalphabuffer[i])delete [] transalphabuffer[i];
- if (transzbuffer[i])delete [] transzbuffer[i];
- if (ZBuffer[i]) delete [] ZBuffer[i];
+ if (transcolorbuffer[i])delete[] transcolorbuffer[i];
+ if (transalphabuffer[i])delete[] transalphabuffer[i];
+ if (transzbuffer[i])delete[] transzbuffer[i];
+ if (ZBuffer[i]) delete[] ZBuffer[i];
}
- if (transcolorbuffer) delete [] transcolorbuffer;
- if (transalphabuffer) delete [] transalphabuffer;
- if (transzbuffer) delete [] transzbuffer;
- if (ZBuffer) delete [] ZBuffer;
- if (transwallblendmode) delete [] transwallblendmode;
- if (interactionmap) delete [] interactionmap;
+ if (transcolorbuffer) delete[] transcolorbuffer;
+ if (transalphabuffer) delete[] transalphabuffer;
+ if (transzbuffer) delete[] transzbuffer;
+ if (ZBuffer) delete[] ZBuffer;
+ if (transwallblendmode) delete[] transwallblendmode;
+ if (interactionmap) delete[] interactionmap;
}
}
diff --git a/engines/ags/shared/util/string_utils.cpp b/engines/ags/shared/util/string_utils.cpp
index db972a42e9..4637fdc9c0 100644
--- a/engines/ags/shared/util/string_utils.cpp
+++ b/engines/ags/shared/util/string_utils.cpp
@@ -92,7 +92,7 @@ String StrUtil::Unescape(const String &s) {
}
*pb = 0;
String dst(buf);
- delete [] buf;
+ delete[] buf;
return dst;
}
Commit: 895c8d22c1ac95dcf7f356c44d1703534d6e7dff
https://github.com/scummvm/scummvm/commit/895c8d22c1ac95dcf7f356c44d1703534d6e7dff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-17T21:31:56-07:00
Commit Message:
AGS: implemented readonly Overlay.Width and Height
>From upstream a75f02dcbc694450c15d93a273e6885eb9037447
Changed paths:
engines/ags/engine/ac/overlay.cpp
diff --git a/engines/ags/engine/ac/overlay.cpp b/engines/ags/engine/ac/overlay.cpp
index cc858967dd..6f6551483e 100644
--- a/engines/ags/engine/ac/overlay.cpp
+++ b/engines/ags/engine/ac/overlay.cpp
@@ -103,6 +103,20 @@ void Overlay_SetY(ScriptOverlay *scover, int newy) {
_G(screenover)[ovri].y = data_to_game_coord(newy);
}
+int Overlay_GetWidth(ScriptOverlay *scover) {
+ int ovri = find_overlay_of_type(scover->overlayId);
+ if (ovri < 0)
+ quit("!invalid overlay ID specified");
+ return game_to_data_coord(_G(screenover)[ovri].pic->GetWidth());
+}
+
+int Overlay_GetHeight(ScriptOverlay *scover) {
+ int ovri = find_overlay_of_type(scover->overlayId);
+ if (ovri < 0)
+ quit("!invalid overlay ID specified");
+ return game_to_data_coord(_G(screenover)[ovri].pic->GetHeight());
+}
+
int Overlay_GetValid(ScriptOverlay *scover) {
if (scover->overlayId == -1)
return 0;
@@ -372,6 +386,14 @@ RuntimeScriptValue Sc_Overlay_SetY(void *self, const RuntimeScriptValue *params,
API_OBJCALL_VOID_PINT(ScriptOverlay, Overlay_SetY);
}
+RuntimeScriptValue Sc_Overlay_GetWidth(void *self, const RuntimeScriptValue *params, int32_t param_count) {
+ API_OBJCALL_INT(ScriptOverlay, Overlay_GetWidth);
+}
+
+RuntimeScriptValue Sc_Overlay_GetHeight(void *self, const RuntimeScriptValue *params, int32_t param_count) {
+ API_OBJCALL_INT(ScriptOverlay, Overlay_GetHeight);
+}
+
//=============================================================================
//
// Exclusive API for Plugins
@@ -395,6 +417,8 @@ void RegisterOverlayAPI() {
ccAddExternalObjectFunction("Overlay::set_X", Sc_Overlay_SetX);
ccAddExternalObjectFunction("Overlay::get_Y", Sc_Overlay_GetY);
ccAddExternalObjectFunction("Overlay::set_Y", Sc_Overlay_SetY);
+ ccAddExternalObjectFunction("Overlay::get_Width", Sc_Overlay_GetWidth);
+ ccAddExternalObjectFunction("Overlay::get_Height", Sc_Overlay_GetHeight);
}
} // namespace AGS3
Commit: e2e4a0d93d57007d3500e3bb954b46804715613f
https://github.com/scummvm/scummvm/commit/e2e4a0d93d57007d3500e3bb954b46804715613f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-17T21:31:57-07:00
Commit Message:
AGS: AudioClip.PlayOnChannel() errors on unsupported channel
>From upstream d70d3d9a6fd4cd74cab1d1bcb9143c57e27dc3d0
Changed paths:
engines/ags/engine/ac/audio_clip.cpp
engines/ags/engine/ac/audio_clip.h
diff --git a/engines/ags/engine/ac/audio_clip.cpp b/engines/ags/engine/ac/audio_clip.cpp
index f6cc8e6a22..085068f815 100644
--- a/engines/ags/engine/ac/audio_clip.cpp
+++ b/engines/ags/engine/ac/audio_clip.cpp
@@ -20,17 +20,14 @@
*
*/
+#include "ags/engine/media/audio/audio_system.h"
#include "ags/engine/ac/asset_helper.h"
#include "ags/engine/ac/audio_clip.h"
#include "ags/engine/ac/audio_channel.h"
+#include "ags/shared/ac/common.h"
#include "ags/shared/ac/game_setup_struct.h"
-#include "ags/engine/script/runtime_script_value.h"
#include "ags/engine/ac/dynobj/cc_audio_channel.h"
-#include "ags/engine/media/audio/audio_system.h"
-
-#include "ags/shared/debugging/out.h"
-#include "ags/engine/script/script_api.h"
-#include "ags/engine/script/script_runtime.h"
+#include "ags/engine/script/runtime_script_value.h"
#include "ags/globals.h"
namespace AGS3 {
@@ -75,6 +72,16 @@ ScriptAudioChannel *AudioClip_PlayQueued(ScriptAudioClip *clip, int priority, in
return sc_ch;
}
+ScriptAudioChannel *AudioClip_PlayOnChannel(ScriptAudioClip *clip, int chan, int priority, int repeat) {
+ if (chan < 1 || chan >= MAX_SOUND_CHANNELS)
+ quitprintf("!AudioClip.PlayOnChannel: invalid channel %d, the range is %d - %d", chan, 1, MAX_SOUND_CHANNELS - 1);
+ if (priority == SCR_NO_VALUE)
+ priority = clip->defaultPriority;
+ if (repeat == SCR_NO_VALUE)
+ repeat = clip->defaultRepeat;
+ return play_audio_clip_on_channel(chan, clip, priority, repeat, 0);
+}
+
//=============================================================================
//
// Script API Functions
@@ -120,10 +127,15 @@ RuntimeScriptValue Sc_AudioClip_PlayQueued(void *self, const RuntimeScriptValue
API_OBJCALL_OBJ_PINT2(ScriptAudioClip, ScriptAudioChannel, _GP(ccDynamicAudio), AudioClip_PlayQueued);
}
+RuntimeScriptValue Sc_AudioClip_PlayOnChannel(void *self, const RuntimeScriptValue *params, int32_t param_count) {
+ API_OBJCALL_OBJ_PINT3(ScriptAudioClip, ScriptAudioChannel, _GP(ccDynamicAudio), AudioClip_PlayOnChannel);
+}
+
void RegisterAudioClipAPI() {
ccAddExternalObjectFunction("AudioClip::Play^2", Sc_AudioClip_Play);
ccAddExternalObjectFunction("AudioClip::PlayFrom^3", Sc_AudioClip_PlayFrom);
ccAddExternalObjectFunction("AudioClip::PlayQueued^2", Sc_AudioClip_PlayQueued);
+ ccAddExternalObjectFunction("AudioClip::PlayOnChannel^3", Sc_AudioClip_PlayOnChannel);
ccAddExternalObjectFunction("AudioClip::Stop^0", Sc_AudioClip_Stop);
ccAddExternalObjectFunction("AudioClip::get_ID", Sc_AudioClip_GetID);
ccAddExternalObjectFunction("AudioClip::get_FileType", Sc_AudioClip_GetFileType);
diff --git a/engines/ags/engine/ac/audio_clip.h b/engines/ags/engine/ac/audio_clip.h
index 898f1513a0..11a420dc34 100644
--- a/engines/ags/engine/ac/audio_clip.h
+++ b/engines/ags/engine/ac/audio_clip.h
@@ -35,6 +35,7 @@ void AudioClip_Stop(ScriptAudioClip *clip);
ScriptAudioChannel *AudioClip_Play(ScriptAudioClip *clip, int priority, int repeat);
ScriptAudioChannel *AudioClip_PlayFrom(ScriptAudioClip *clip, int position, int priority, int repeat);
ScriptAudioChannel *AudioClip_PlayQueued(ScriptAudioClip *clip, int priority, int repeat);
+ScriptAudioChannel *AudioClip_PlayOnChannel(ScriptAudioClip *clip, int chan, int priority, int repeat);
} // namespace AGS3
Commit: 33bf5fd7390a37338324ed172cd6ef5a6f333f5e
https://github.com/scummvm/scummvm/commit/33bf5fd7390a37338324ed172cd6ef5a6f333f5e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-17T21:31:58-07:00
Commit Message:
AGS: Updated build version (3.6.0.7)
>From upstream bcf598aa4ea6de69a84505b7c844f7bdcf44596b
Changed paths:
engines/ags/ags.h
diff --git a/engines/ags/ags.h b/engines/ags/ags.h
index 7ea9774a3b..707626a4a1 100644
--- a/engines/ags/ags.h
+++ b/engines/ags/ags.h
@@ -50,8 +50,8 @@ namespace AGS {
* @brief Engine to run Adventure Game Studio games.
*/
-/* Synced up to upstream: 3.6.0.6
- * f33e064cd148c6a709ccbf25a5fd4939272a7814
+/* Synced up to upstream: 3.6.0.7
+ * bcf598aa4ea6de69a84505b7c844f7bdcf44596b
*/
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 200
More information about the Scummvm-git-logs
mailing list