Skip to content

Commit

Permalink
Merge branch 'master' (3.6.1.11) into ags4
Browse files Browse the repository at this point in the history
# Conflicts:
#	CMakeLists.txt
#	Common/ac/characterinfo.cpp
#	Common/ac/gamesetupstruct.cpp
#	Common/ac/inventoryiteminfo.cpp
#	Common/ac/mousecursor.cpp
#	Common/ac/view.cpp
#	Common/ac/view.h
#	Common/core/def_version.h
#	Common/game/interactions.cpp
#	Common/game/interactions.h
#	Common/game/main_game_file.cpp
#	Editor/AGS.Editor/BuildTargets/BuildTargetDataFile.cs
#	Editor/AGS.Editor/DataFileWriter.cs
#	Editor/AGS.Editor/app.manifest
#	Editor/AGS.Types/Properties/AssemblyInfo.cs
#	Editor/AGS.Types/Settings.cs
#	Engine/ac/dynobj/cc_dynamicarray.cpp
#	Engine/ac/dynobj/dynobj_manager.h
#	Engine/ac/gamestate.cpp
#	Engine/ac/gamestate.h
#	Engine/ac/movelist.cpp
#	Engine/ac/movelist.h
#	Engine/ac/roomobject.cpp
#	Engine/ac/roomstatus.cpp
#	Engine/ac/roomstatus.h
#	Engine/game/savegame_components.cpp
#	Engine/game/savegame_v321.cpp
#	Engine/gfx/gfxdriverbase.h
#	Engine/main/config.cpp
#	Engine/media/audio/queuedaudioitem.cpp
#	Engine/platform/windows/acplwin.cpp
#	Engine/plugin/agsplugin.cpp
#	version.json
  • Loading branch information
AlanDrake committed Nov 2, 2023
2 parents 05d434f + 72ef911 commit e27ecb9
Show file tree
Hide file tree
Showing 91 changed files with 467 additions and 360 deletions.
2 changes: 2 additions & 0 deletions CMake/FetchGoogleTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ if(LINUX AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS
set(LINUX_OLD_GCC TRUE)
FetchContent_Declare(
googletest_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/google/googletest/archive/refs/tags/release-1.8.1.tar.gz
URL_HASH MD5=2e6fbeb6a91310a16efe181886c59596
)
else()
set(LINUX_OLD_GCC FALSE)
FetchContent_Declare(
googletest_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/google/googletest/archive/4ec4cd23f486bf70efcc5d2caa40f24368f752e3.tar.gz
URL_HASH MD5=b907483a9045a2edda15ee7d2a68aaa5
)
Expand Down
1 change: 1 addition & 0 deletions CMake/FetchOgg.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
ogg_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.xz
URL_HASH MD5=3178c98341559657a15b185bf5d700a5
)
Expand Down
1 change: 1 addition & 0 deletions CMake/FetchSDL2.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
sdl2_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.28.2.tar.gz
URL_HASH MD5=e00fe25102433d40d39ba67007a9fd2c
)
Expand Down
6 changes: 3 additions & 3 deletions CMake/FetchSDL_Sound.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FetchContent_Declare(
sdlsound_content
URL https://github.com/icculus/SDL_sound/archive/495e948b455af48eb45f75cccc060498f1e0e8a2.tar.gz
URL_HASH MD5=d743aee2e550dca3a96b14d41e78b530
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/icculus/SDL_sound/archive/1507be95c3605e4fd6a48ea4c527e4aa711a1566.tar.gz
URL_HASH MD5=f945a7330089d1c3490404b4f18fdffd
)

FetchContent_GetProperties(sdlsound_content)
Expand All @@ -22,5 +23,4 @@ if(NOT sdlsound_content)
add_library(sdl2_sound-interface INTERFACE)
target_link_libraries(sdl2_sound-interface INTERFACE SDL2_sound-static)
add_library(SDL2_sound::SDL2_sound ALIAS sdl2_sound-interface)
target_link_libraries(SDL2_sound-static ${SDL2_LIBRARIES})
endif()
1 change: 1 addition & 0 deletions CMake/FetchTheora.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
theora_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/xiph/theora/archive/7180717276af1ebc7da15c83162d6c5d6203aabf.tar.gz
URL_HASH MD5=5f1c0b5efdec0f9621bc59ba89e6652b
)
Expand Down
1 change: 1 addition & 0 deletions CMake/FetchVorbis.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
vorbis_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.xz
URL_HASH MD5=50902641d358135f06a8392e61c9ac77
)
Expand Down
4 changes: 4 additions & 0 deletions CMake/c_flag_overrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ if(MSVC)
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /DNDEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /DNDEBUG")
endif()

if(MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
endif ()
6 changes: 5 additions & 1 deletion CMake/cxx_flag_overrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /DNDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /DNDEBUG")
endif()
endif()

if(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
endif ()
47 changes: 36 additions & 11 deletions Changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Editor:
pre-3.2 game projects, and will generate a script with a String array, moving global messages
texts there.
- For script's tabs added a context menu command for opening this script's location.
- In General Settings moved few properties to different groups for better consistency.
- Added "Scale Character sprite offsets" property to General Settings. This property refers to
scaling of Character.z and sprite offsets added by LockViewOffset script command.
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure
Expand All @@ -157,10 +158,6 @@ Editor:
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed Project Explorer's folders collapsing after certain user actions, such as dragging
items or renaming things.
- Fixed GUI editor could display selection rectangle from a different GUI editor pane,
if two or more are displayed on screen at the same time.
- Fixed Script editor not marking "autoptr" and "builtin" as keywords.
- Fixed Script editor not applying color theme to character literals.
- Fixed Editor could miss some of the files when cleaning up old compiled files after the
Game's Filename property is changed.

Expand Down Expand Up @@ -188,6 +185,10 @@ Engine:
- Significant performance improvement to scripts. Script running speed restored to a level
close to AGS 3.2.1. Testing few "script-heavy" games showed fps raise by up to 30-40%
compared with 3.6.0 engine.
- Improved performance of String objects in script. For instance, appending a character to
a String is now roughly x2 times faster, *sequential* iteration of String.Chars[] in Unicode
mode is about x12 (!) times faster (Strings in ASCII mode have relatively less improvement,
because they have been faster than Unicode mode already).
- Improved performance when creating, deleting and manipulating Overlays; allows the game
to have thousands of those with much less slowing down.
- Improved performance when updating and deleting dynamic sprites, and notifying any objects
Expand Down Expand Up @@ -226,7 +227,6 @@ Engine:
printing a warning. This is also consistent with backwards-compatble SetObjectFrame() behavior.
- Changed Object.SetView() to not play a frame's sound, which could lead to a duplicated sound
play if Object.Animate is run right after.
- Fixed buttons on a non-clickable GUI were still changing to "mouse over" graphic under cursor.
- Text Overlays internal images are now registered as dynamic sprites, and their IDs may be
read from Overlay.Graphic. This lets find out their sizes using Game.SpriteWidth/SpriteHeight
and optionally draw them somewhere using DrawingSurface.DrawImage.
Expand All @@ -237,8 +237,6 @@ Engine:
- Deprecated in-game "console", as practically useless.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated
"cachemax" in "misc") and "texture_cache_size".
- Fixed engine failing to startup sometimes if controller device subsystem failed to init
(it should not init at all in this version, as we do not support joysticks yet).
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed speechlines were adjusting their Y position while trying to not overlap GUIs even when
these GUIs are completely offscreen.
Expand All @@ -249,10 +247,6 @@ Engine:
- Fixed script behavior in case a local variable was assigned a value without being initialized
with a zero memory by compiler's intruction beforehand. This is not a problem with the standard
compiler, but technically could be an issue with any custom implementation.
- Fixed "Before fade-in" event could be called recursively under some peculiar conditions
(this is a regression since 3.6.0).
- Fixed button click not registered if it has been made not visible and visible again during a
single game frame (this is a regression since 3.6.0).

Engine Plugin API:
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens)
Expand All @@ -279,6 +273,37 @@ WinSetup:
- Added options for setting texture cache and sound cache size.


VERSION 3.6.0 - Patch 6, November 2023

Editor:
- Fixed GUI editor could display selection rectangle from a different GUI editor pane,
if two or more are displayed on screen at the same time.
- Fixed "autoptr" and "builtin" keywords not colored as valid keywords in the script editor.
- Fixed character literals in a script editor having wrong colors when a Color Theme is applied.

Engine:
- Made String.Chars and Length properties work faster in ASCII mode.
- Issue a warning when blocking Display or Say commands are called during fade-out.
- Fixed engine failing to startup sometimes if controller device subsystem failed to init
(it should not init at all in this version, as we do not support joysticks yet).
- Fixed "Before fade-in" event could be called recursively under some peculiar conditions
(regression since 3.6.0).
- Fixed buttons on a non-clickable GUI were still changing to "mouse over" graphic under cursor.
- Fixed button click not registered if it has been made not visible and visible again during a
single game frame (regression since 3.6.0).
- Fixed TextWindow borders drawn behind the rightmost corner pieces, which may be seen if the
edge sprites are half-transparent.
- Fixed a brief black screen flash occuring right after the video playback ends
(regression since 3.6.0).
- Fixed engine refusing to load legacy saves if the audio clip count does not match
(number of audio clips should not affect saves).

WinSetup:
- Added an option to disable "smooth scaled sprites" setting.
- Added an option to disable language selection.
- Made filter names in "disabled" section treated in case insensitive way.


VERSION 3.6.0 - Patch 5, September 2023

Editor:
Expand Down
8 changes: 4 additions & 4 deletions Common/ac/inventoryiteminfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ using namespace AGS::Common;
void InventoryItemInfo::ReadFromFile(Stream *in)
{
in->Read(name, 25);
in->Seek(3); // aligment padding to int32
in->Seek(3); // alignment padding to int32
pic = in->ReadInt32();
cursorPic = in->ReadInt32();
hotx = in->ReadInt32();
hoty = in->ReadInt32();
in->ReadArrayOfInt32(reserved, 5);
flags = in->ReadInt8();
in->Seek(3); // aligment padding to int32
in->Seek(3); // alignment padding to int32
}

void InventoryItemInfo::WriteToFile(Stream *out)
{
out->Write(name, 25);
out->WriteByteCount(0, 3); // aligment padding to int32
out->WriteByteCount(0, 3); // alignment padding to int32
out->WriteInt32(pic);
out->WriteInt32(cursorPic);
out->WriteInt32(hotx);
out->WriteInt32(hoty);
out->WriteArrayOfInt32(reserved, 5);
out->WriteInt8(flags);
out->WriteByteCount(0, 3); // aligment padding to int32
out->WriteByteCount(0, 3); // alignment padding to int32
}

void InventoryItemInfo::ReadFromSavegame(Stream *in)
Expand Down
4 changes: 2 additions & 2 deletions Common/ac/mousecursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void MouseCursor::ReadFromFile(Stream *in)
view = in->ReadInt16();
in->Read(name, 10);
flags = in->ReadInt8();
in->Seek(3); // aligment padding to int32
in->Seek(3); // alignment padding to int32
}

void MouseCursor::WriteToFile(Stream *out)
Expand All @@ -36,7 +36,7 @@ void MouseCursor::WriteToFile(Stream *out)
out->WriteInt16(view);
out->Write(name, 10);
out->WriteInt8(flags);
out->WriteByteCount(0, 3); // aligment padding to int32
out->WriteByteCount(0, 3); // alignment padding to int32
}

void MouseCursor::ReadFromSavegame(Stream *in, int cmp_ver)
Expand Down
6 changes: 6 additions & 0 deletions Common/core/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@
#error "Unknown platform"
#endif

#if defined(__MINGW32__)
#define AGS_PLATFORM_WINDOWS_MINGW (1)
#else
#define AGS_PLATFORM_WINDOWS_MINGW (0)
#endif

#if defined(_DEBUG)
#define AGS_PLATFORM_DEBUG (1)
#elif ! defined(NDEBUG)
Expand Down
2 changes: 1 addition & 1 deletion Editor/AGS.Editor/AGSEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ public void WriteConfigFile(string configFilePath, bool resetFile = true)

sections["graphics"]["filter"] = _game.DefaultSetup.GraphicsFilter;
sections["graphics"]["vsync"] = _game.DefaultSetup.VSync ? "1" : "0";
sections["misc"]["antialias"] = _game.DefaultSetup.AAScaledSprites ? "1" : "0";
sections["graphics"]["antialias"] = _game.DefaultSetup.AAScaledSprites ? "1" : "0";
bool render_at_screenres = _game.Settings.RenderAtScreenResolution == RenderAtScreenResolution.UserDefined ?
_game.DefaultSetup.RenderAtScreenResolution : _game.Settings.RenderAtScreenResolution == RenderAtScreenResolution.True;
sections["graphics"]["render_at_screenres"] = render_at_screenres ? "1" : "0";
Expand Down
4 changes: 2 additions & 2 deletions Editor/AGS.Editor/BuildTargets/BuildTargetDataFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ private void CreateAudioVOXFile(bool forceRebuild)

public override bool Build(CompileMessages errors, bool forceRebuild)
{
if (!base.Build(errors, forceRebuild))
return false;
if (!base.Build(errors, forceRebuild))
return false;
if (!DataFileWriter.SaveThisGameToFile(AGSEditor.COMPILED_DTA_FILE_NAME, Factory.AGSEditor.CurrentGame, errors))
{
return false;
Expand Down
4 changes: 3 additions & 1 deletion Editor/AGS.Editor/GUI/LogPanel.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Editor/AGS.Editor/GUI/LogPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,29 @@ private void logTextBox_VScroll(object sender, EventArgs e)
_glue = IsScrollAtBottom();
}
}

private void LoadColorTheme(ColorTheme t)
{

t.SetColor("log-panel/background", c => BackColor = c);
t.SetColor("log-panel/splitter", c => splitContainer.BackColor = c);
t.SetColor("log-panel/background", c => logTextBox.BackColor = c);
t.SetColor("log-panel/foreground", c => logTextBox.ForeColor = c);
t.PropertyGridHelper(propertyGrid, "log-panel/grid");
if (t.Has("tool-bar"))
{
t.SetColor("tool-bar/background", c => toolStrip.BackColor = c);
toolStrip.Renderer = t.GetToolStripRenderer("tool-bar");
}
}

private void LogPanel_Load(object sender, EventArgs e)
{
if (!DesignMode)
{
Hacks.SetRichTextBoxMargins(logTextBox, 12, 12);
Factory.GUIController.ColorThemes.Apply(LoadColorTheme);
}
}
}
}
11 changes: 11 additions & 0 deletions Editor/AGS.Editor/Hacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public static class Hacks
private const int EM_REPLACESEL = 0x00C2;
private const int EM_GETSCROLLPOS = WM_USER + 221;
private const int EM_SETSCROLLPOS = WM_USER + 222;
private const int EM_SETMARGINS = 0xD3;
private const int EC_LEFTMARGIN = 0x1;
private const int EC_RIGHTMARGIN = 0x2;
// TreeView messages
private const int TV_FIRST = 0x1100;
private const int TVM_GETEDITCONTROL = (TV_FIRST + 15);
Expand Down Expand Up @@ -89,6 +92,14 @@ public static void ReplaceSelectedText(this RichTextBox rtb, int at, int length,
Marshal.FreeHGlobal(strPtr);
}

/// <summary>
/// Sets RichTextBox's margins
/// </summary>
public static void SetRichTextBoxMargins(this RichTextBox rtb, int left, int right)
{
SendMessage(rtb.Handle, EM_SETMARGINS, (EC_LEFTMARGIN | EC_RIGHTMARGIN), (IntPtr)(right * 0x10000 + left));
}

// Hack to get around the fact that the BeforeLabelEdit event provides no way to
// let you change the text they're about to edit
public static void SetTreeViewEditText(TreeView tree, string myText)
Expand Down
2 changes: 1 addition & 1 deletion Editor/AGS.Editor/Panes/ViewPreview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private void previewPanel_Paint(object sender, PaintEventArgs e)
Size spriteSize = Utilities.GetSizeSpriteWillBeRenderedInGame(spriteNum);
if (_autoFrameFill)
{
spriteSize = MathExtra.SafeScale(spriteSize, previewPanel.ClientSize.Height / spriteSize.Height);
spriteSize = MathExtra.SafeScale(spriteSize, (float)previewPanel.ClientSize.Height / spriteSize.Height);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Editor/AGS.Editor/Resources/agsdefns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ builtin struct Game {
#endif
#ifdef SCRIPT_API_v361
/// Resets all of the "DoOnceOnly" token states
import static bool ResetDoOnceOnly();
import static void ResetDoOnceOnly();
#endif
};
Expand Down
2 changes: 1 addition & 1 deletion Editor/AGS.Types/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace AGS.Types
public class Version
{
public static readonly bool IS_BETA_VERSION = true;
public const string AGS_EDITOR_DATE = "October 2023";
public const string AGS_EDITOR_DATE = "November 2023";
public const string AGS_EDITOR_FRIENDLY_VERSION = "4.0.0";
public const string AGS_EDITOR_VERSION = "4.00.00.00";
public const string AGS_EDITOR_COPYRIGHT = "Copyright © 2006-2011 Chris Jones and 2011-2023 others.";
Expand Down
2 changes: 1 addition & 1 deletion Editor/AGS.Types/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ public void FromXml(XmlNode node)
[DisplayName("Render sprites at screen resolution")]
[Description("When drawing zoomed character and object sprites, AGS will take advantage of higher runtime resolution to give scaled images more detail, than it would be possible if the game was displayed in its native resolution. The effect is stronger for low-res games. Keep disabled for pixel-perfect output. Currently supported only by Direct3D and OpenGL renderers.")]
[DefaultValue(RenderAtScreenResolution.UserDefined)]
[Category("(Basic properties)")]
[Category("Visual")]
[TypeConverter(typeof(EnumTypeConverter))]
public RenderAtScreenResolution RenderAtScreenResolution
{
Expand Down
2 changes: 0 additions & 2 deletions Engine/ac/audioclip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ ScriptAudioChannel* AudioClip_PlayOnChannel(ScriptAudioClip *clip, int chan, int
#include "script/script_api.h"
#include "script/script_runtime.h"

extern ScriptString myScriptStringImpl;

ScriptAudioClip *AudioClip_GetByName(const char *name)
{
return static_cast<ScriptAudioClip*>(ccGetScriptObjectAddress(name, ccDynamicAudioClip.GetType()));
Expand Down
2 changes: 0 additions & 2 deletions Engine/ac/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ void Button_SetTextAlignment(GUIButton *butt, int align)
#include "script/script_runtime.h"
#include "ac/dynobj/scriptstring.h"

extern ScriptString myScriptStringImpl;

// void | GUIButton *butt, int view, int loop, int speed, int repeat
RuntimeScriptValue Sc_Button_Animate4(void *self, const RuntimeScriptValue *params, int32_t param_count)
{
Expand Down
Loading

0 comments on commit e27ecb9

Please sign in to comment.