[Scummvm-git-logs] scummvm master -> 77bab4753b6133d48b9237e19d7d62806ce8f13f
dreammaster
dreammaster at scummvm.org
Sun Mar 7 03:46:19 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:
1e7cce8c12 AGS: Move graphics_mode.cpp globals to Globals
34c86ce1a1 AGS: Removal of commented out includes
77bab4753b AGS: Read legacy resolution config & detect upscale mode
Commit: 1e7cce8c1226c9591223f07de7c9cf9d04711fbc
https://github.com/scummvm/scummvm/commit/1e7cce8c1226c9591223f07de7c9cf9d04711fbc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-06T19:42:57-08:00
Commit Message:
AGS: Move graphics_mode.cpp globals to Globals
Changed paths:
engines/ags/engine/device/mousew32.cpp
engines/ags/engine/main/graphics_mode.cpp
engines/ags/engine/main/graphics_mode.h
engines/ags/globals.cpp
engines/ags/globals.h
diff --git a/engines/ags/engine/device/mousew32.cpp b/engines/ags/engine/device/mousew32.cpp
index e3f6af0518..8467bf5f0d 100644
--- a/engines/ags/engine/device/mousew32.cpp
+++ b/engines/ags/engine/device/mousew32.cpp
@@ -283,23 +283,23 @@ int minstalled() {
}
void Mouse::AdjustPosition(int &x, int &y) {
- x = GameScaling.X.UnScalePt(x) - _GP(play).GetMainViewport().Left;
- y = GameScaling.Y.UnScalePt(y) - _GP(play).GetMainViewport().Top;
+ x = _GP(GameScaling).X.UnScalePt(x) - _GP(play).GetMainViewport().Left;
+ y = _GP(GameScaling).Y.UnScalePt(y) - _GP(play).GetMainViewport().Top;
}
void Mouse::SetGraphicArea() {
- Rect dst_r = GameScaling.ScaleRange(_GP(play).GetMainViewport());
+ Rect dst_r = _GP(GameScaling).ScaleRange(_GP(play).GetMainViewport());
mgraphconfine(dst_r.Left, dst_r.Top, dst_r.Right, dst_r.Bottom);
}
void Mouse::SetMoveLimit(const Rect &r) {
Rect src_r = OffsetRect(r, _GP(play).GetMainViewport().GetLT());
- Rect dst_r = GameScaling.ScaleRange(src_r);
+ Rect dst_r = _GP(GameScaling).ScaleRange(src_r);
msetcursorlimit(dst_r.Left, dst_r.Top, dst_r.Right, dst_r.Bottom);
}
void Mouse::SetPosition(const Point p) {
- msetgraphpos(GameScaling.X.ScalePt(p.X + _GP(play).GetMainViewport().Left), GameScaling.Y.ScalePt(p.Y + _GP(play).GetMainViewport().Top));
+ msetgraphpos(_GP(GameScaling).X.ScalePt(p.X + _GP(play).GetMainViewport().Left), _GP(GameScaling).Y.ScalePt(p.Y + _GP(play).GetMainViewport().Top));
}
bool Mouse::IsLockedToWindow() {
diff --git a/engines/ags/engine/main/graphics_mode.cpp b/engines/ags/engine/main/graphics_mode.cpp
index f568f4f412..3293b0814b 100644
--- a/engines/ags/engine/main/graphics_mode.cpp
+++ b/engines/ags/engine/main/graphics_mode.cpp
@@ -54,20 +54,6 @@ extern int proper_exit;
extern AGSPlatformDriver *platform;
extern IGraphicsDriver *gfxDriver;
-
-IGfxDriverFactory *GfxFactory = nullptr;
-
-// Last saved fullscreen and windowed configs; they are used when switching
-// between between fullscreen and windowed modes at runtime.
-// If particular mode is modified, e.g. by script command, related config should be overwritten.
-ActiveDisplaySetting SavedFullscreenSetting;
-ActiveDisplaySetting SavedWindowedSetting;
-// Current frame scaling setup
-GameFrameSetup CurFrameSetup;
-// The game-to-screen transformation
-PlaneScaling GameScaling;
-
-
GameFrameSetup::GameFrameSetup()
: ScaleDef(kFrame_IntScale)
, ScaleFactor(1) {
@@ -108,13 +94,13 @@ Size get_max_display_size(bool windowed) {
}
bool create_gfx_driver(const String &gfx_driver_id) {
- GfxFactory = GetGfxDriverFactory(gfx_driver_id);
- if (!GfxFactory) {
+ _G(GfxFactory) = GetGfxDriverFactory(gfx_driver_id);
+ if (!_G(GfxFactory)) {
Debug::Printf(kDbgMsg_Error, "Failed to initialize %s graphics factory. Error: %s", gfx_driver_id.GetCStr(), get_allegro_error());
return false;
}
Debug::Printf("Using graphics factory: %s", gfx_driver_id.GetCStr());
- gfxDriver = GfxFactory->GetDriver();
+ gfxDriver = _G(GfxFactory)->GetDriver();
if (!gfxDriver) {
Debug::Printf(kDbgMsg_Error, "Failed to create graphics driver. Error: %s", get_allegro_error());
return false;
@@ -127,7 +113,7 @@ bool create_gfx_driver(const String &gfx_driver_id) {
bool graphics_mode_set_filter_any(const GfxFilterSetup &setup) {
Debug::Printf("Requested gfx filter: %s", setup.UserRequest.GetCStr());
if (!graphics_mode_set_filter(setup.ID)) {
- String def_filter = GfxFactory->GetDefaultFilterID();
+ String def_filter = _G(GfxFactory)->GetDefaultFilterID();
if (def_filter.CompareNoCase(setup.ID) == 0)
return false;
Debug::Printf(kDbgMsg_Error, "Failed to apply gfx filter: %s; will try to use factory default filter '%s' instead",
@@ -135,7 +121,7 @@ bool graphics_mode_set_filter_any(const GfxFilterSetup &setup) {
if (!graphics_mode_set_filter(def_filter))
return false;
}
- Debug::Printf("Using gfx filter: %s", GfxFactory->GetDriver()->GetGraphicsFilter()->GetInfo().Id.GetCStr());
+ Debug::Printf("Using gfx filter: %s", _G(GfxFactory)->GetDriver()->GetGraphicsFilter()->GetInfo().Id.GetCStr());
return true;
}
@@ -499,7 +485,7 @@ bool graphics_mode_init_any(const Size game_size, const ScreenSetup &setup, cons
}
ActiveDisplaySetting graphics_mode_get_last_setting(bool windowed) {
- return windowed ? SavedWindowedSetting : SavedFullscreenSetting;
+ return windowed ? _GP(SavedWindowedSetting) : _GP(SavedFullscreenSetting);
}
bool graphics_mode_update_render_frame();
@@ -549,9 +535,9 @@ bool graphics_mode_set_dm(const DisplayMode &dm) {
DisplayMode rdm = gfxDriver->GetDisplayMode();
if (rdm.Windowed)
- SavedWindowedSetting.Dm = rdm;
+ _GP(SavedWindowedSetting).Dm = rdm;
else
- SavedFullscreenSetting.Dm = rdm;
+ _GP(SavedFullscreenSetting).Dm = rdm;
Debug::Printf("Succeeded. Using gfx mode %d x %d (%d-bit) %s",
rdm.Width, rdm.Height, rdm.ColorDepth, rdm.Windowed ? "windowed" : "fullscreen");
return true;
@@ -564,7 +550,7 @@ bool graphics_mode_update_render_frame() {
DisplayMode dm = gfxDriver->GetDisplayMode();
Size screen_size = Size(dm.Width, dm.Height);
Size native_size = gfxDriver->GetNativeSize();
- Size frame_size = set_game_frame_after_screen_size(native_size, screen_size, CurFrameSetup);
+ Size frame_size = set_game_frame_after_screen_size(native_size, screen_size, _GP(CurFrameSetup));
Rect render_frame = CenterInRect(RectWH(screen_size), RectWH(frame_size));
if (!gfxDriver->SetRenderFrame(render_frame)) {
@@ -578,7 +564,7 @@ bool graphics_mode_update_render_frame() {
Debug::Printf("Render frame set, render dest (%d, %d, %d, %d : %d x %d)",
dst_rect.Left, dst_rect.Top, dst_rect.Right, dst_rect.Bottom, dst_rect.GetWidth(), dst_rect.GetHeight());
// init game scaling transformation
- GameScaling.Init(native_size, gfxDriver->GetRenderDestination());
+ _GP(GameScaling).Init(native_size, gfxDriver->GetRenderDestination());
return true;
}
@@ -594,27 +580,27 @@ bool graphics_mode_set_native_size(const Size &native_size) {
}
GameFrameSetup graphics_mode_get_render_frame() {
- return CurFrameSetup;
+ return _GP(CurFrameSetup);
}
bool graphics_mode_set_render_frame(const GameFrameSetup &frame_setup) {
if (!frame_setup.IsValid())
return false;
- CurFrameSetup = frame_setup;
+ _GP(CurFrameSetup) = frame_setup;
if (gfxDriver->GetDisplayMode().Windowed)
- SavedWindowedSetting.FrameSetup = frame_setup;
+ _GP(SavedWindowedSetting).FrameSetup = frame_setup;
else
- SavedFullscreenSetting.FrameSetup = frame_setup;
+ _GP(SavedFullscreenSetting).FrameSetup = frame_setup;
graphics_mode_update_render_frame();
return true;
}
bool graphics_mode_set_filter(const String &filter_id) {
- if (!GfxFactory)
+ if (!_G(GfxFactory))
return false;
String filter_error;
- PGfxFilter filter = GfxFactory->SetFilter(filter_id, filter_error);
+ PGfxFilter filter = _G(GfxFactory)->SetFilter(filter_id, filter_error);
if (!filter) {
Debug::Printf(kDbgMsg_Error, "Unable to set graphics filter '%s'. Error: %s", filter_id.GetCStr(), filter_error.GetCStr());
return false;
@@ -626,9 +612,9 @@ bool graphics_mode_set_filter(const String &filter_id) {
}
void graphics_mode_shutdown() {
- if (GfxFactory)
- GfxFactory->Shutdown();
- GfxFactory = nullptr;
+ if (_G(GfxFactory))
+ _G(GfxFactory)->Shutdown();
+ _G(GfxFactory) = nullptr;
gfxDriver = nullptr;
// Tell Allegro that we are no longer in graphics mode
diff --git a/engines/ags/engine/main/graphics_mode.h b/engines/ags/engine/main/graphics_mode.h
index 0576b90f70..192f269196 100644
--- a/engines/ags/engine/main/graphics_mode.h
+++ b/engines/ags/engine/main/graphics_mode.h
@@ -38,19 +38,13 @@ String make_scaling_factor_string(uint32_t scaling);
namespace AGS {
namespace Engine {
class IGfxModeList;
-}
-}
+} // namespace Engine
+} // namespace AGS
+
bool find_nearest_supported_mode(const AGS::Engine::IGfxModeList &modes, const Size &wanted_size,
const int color_depth, const Size *ratio_reference, const Size *upper_bound,
AGS::Engine::DisplayMode &dm, int *mode_index = nullptr);
-
-// The game-to-screen transformation
-// TODO: this is only required for low-level mouse processing;
-// when possible, move to mouse "manager" object, and assign at gfxmode init
-extern AGS::Engine::PlaneScaling GameScaling;
-
-
// Filter configuration
struct GfxFilterSetup {
String ID; // internal filter ID
diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index bd88af5f74..574be23846 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -68,6 +68,7 @@
#include "ags/engine/debugging/debugger.h"
#include "ags/engine/debugging/logfile.h"
#include "ags/engine/debugging/messagebuffer.h"
+#include "ags/engine/main/graphics_mode.h"
#include "ags/engine/media/audio/ambientsound.h"
#include "ags/engine/media/audio/audiodefines.h"
#include "ags/engine/script/cc_instance.h"
@@ -159,6 +160,12 @@ Globals::Globals() {
// global_dialog.cpp globals
_last_in_dialog_request_script_pos = new ScriptPosition();
+ // graphics_mode.cpp globals
+ _SavedFullscreenSetting = new ActiveDisplaySetting();
+ _SavedWindowedSetting = new ActiveDisplaySetting();
+ _CurFrameSetup = new GameFrameSetup();
+ _GameScaling = new AGS::Engine::PlaneScaling();
+
// guibutton.cpp globals
_guibuts = new std::vector<AGS::Shared::GUIButton>();
@@ -288,6 +295,12 @@ Globals::~Globals() {
// global_dialog.cpp globals
delete _last_in_dialog_request_script_pos;
+ // graphics_mode.cpp globals
+ delete _SavedFullscreenSetting;
+ delete _SavedWindowedSetting;
+ delete _CurFrameSetup;
+ delete _GameScaling;
+
// guibutton.cpp globals
delete _guibuts;
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index c193302e54..2166acfd70 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -59,8 +59,10 @@ class RoomStruct;
namespace Engine {
class ConsoleOutputTarget;
+class IGfxDriverFactory;
class LogFile;
class MessageBuffer;
+struct PlaneScaling;
} // namespace Engine
} // namespace AGS
@@ -71,6 +73,7 @@ class SpriteCache;
class TTFFontRenderer;
class WFNFontRenderer;
+struct ActiveDisplaySetting;
struct AmbientSound;
struct CCAudioChannel;
struct CCAudioClip;
@@ -86,6 +89,7 @@ struct CCRegion;
struct CharacterCache;
struct DirtyRects;
struct ExecutingScript;
+struct GameFrameSetup;
struct GameSetup;
struct GameSetupStruct;
struct GameState;
@@ -340,6 +344,25 @@ public:
/**@}*/
+ /**
+ * \defgroup graphics_mode globals
+ * @{
+ */
+
+ AGS::Engine::IGfxDriverFactory *_GfxFactory = nullptr;
+
+ // Last saved fullscreen and windowed configs; they are used when switching
+ // between between fullscreen and windowed modes at runtime.
+ // If particular mode is modified, e.g. by script command, related config should be overwritten.
+ ActiveDisplaySetting *_SavedFullscreenSetting;
+ ActiveDisplaySetting *_SavedWindowedSetting;
+ // Current frame scaling setup
+ GameFrameSetup *_CurFrameSetup;
+ // The game-to-screen transformation
+ AGS::Engine::PlaneScaling *_GameScaling;
+
+ /**@}*/
+
/**
* \defgroup guibutton globals
* @{
Commit: 34c86ce1a1d799d9f6051482b3e6ecef5cbc508b
https://github.com/scummvm/scummvm/commit/34c86ce1a1d799d9f6051482b3e6ecef5cbc508b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-06T19:43:13-08:00
Commit Message:
AGS: Removal of commented out includes
Changed paths:
engines/ags/engine/ac/datetime.cpp
engines/ags/engine/ac/dynobj/cc_agsdynamicobject.cpp
engines/ags/engine/ac/dynobj/cc_dynamicarray.cpp
engines/ags/engine/ac/dynobj/cc_dynamicobject.cpp
engines/ags/engine/ac/dynobj/cc_serializer.cpp
engines/ags/engine/ac/dynobj/managedobjectpool.cpp
engines/ags/engine/ac/dynobj/scriptdict.h
engines/ags/engine/ac/dynobj/scriptstring.cpp
engines/ags/engine/ac/global_datetime.cpp
engines/ags/engine/ac/global_file.cpp
engines/ags/engine/ac/global_game.cpp
engines/ags/engine/ac/global_string.cpp
engines/ags/engine/ac/global_translation.cpp
engines/ags/engine/ac/gui.cpp
engines/ags/engine/ac/math.cpp
engines/ags/engine/ac/roomstatus.cpp
engines/ags/engine/ac/screenoverlay.h
engines/ags/engine/ac/statobj/agsstaticobject.cpp
engines/ags/engine/ac/statobj/staticarray.cpp
engines/ags/engine/ac/string.cpp
engines/ags/engine/ac/string.h
engines/ags/engine/debugging/filebasedagsdebugger.cpp
engines/ags/engine/debugging/logfile.cpp
engines/ags/engine/gui/cscidialog.cpp
engines/ags/engine/gui/mylistbox.cpp
engines/ags/engine/gui/mypushbutton.cpp
engines/ags/engine/platform/linux/acpllnx.cpp
engines/ags/engine/script/executingscript.cpp
engines/ags/engine/script/runtimescriptvalue.cpp
engines/ags/engine/script/script_api.cpp
engines/ags/engine/script/script_api.h
engines/ags/engine/script/script_engine.cpp
engines/ags/shared/ac/characterinfo.cpp
engines/ags/shared/ac/dialogtopic.h
engines/ags/shared/ac/interfacebutton.h
engines/ags/shared/ac/interfaceelement.h
engines/ags/shared/ac/mousecursor.h
engines/ags/shared/ac/view.cpp
engines/ags/shared/ac/wordsdictionary.cpp
engines/ags/shared/core/types.h
engines/ags/shared/debugging/assert.h
engines/ags/shared/debugging/debugmanager.cpp
engines/ags/shared/game/interactions.cpp
engines/ags/shared/script/cc_script.cpp
engines/ags/shared/util/geometry.cpp
engines/ags/shared/util/inifile.cpp
engines/ags/shared/util/lzw.cpp
engines/ags/shared/util/memory.h
engines/ags/shared/util/misc.cpp
engines/ags/shared/util/string.h
engines/ags/shared/util/string_utils.cpp
engines/ags/shared/util/textstreamwriter.cpp
engines/ags/shared/util/version.cpp
diff --git a/engines/ags/engine/ac/datetime.cpp b/engines/ags/engine/ac/datetime.cpp
index fd07d3050a..fea7a76180 100644
--- a/engines/ags/engine/ac/datetime.cpp
+++ b/engines/ags/engine/ac/datetime.cpp
@@ -20,11 +20,9 @@
*
*/
-//include <time.h>
#include "ags/engine/ac/datetime.h"
#include "ags/engine/platform/base/agsplatformdriver.h"
#include "ags/engine/script/runtimescriptvalue.h"
-
#include "ags/shared/debugging/out.h"
#include "ags/engine/script/script_api.h"
#include "ags/engine/script/script_runtime.h"
diff --git a/engines/ags/engine/ac/dynobj/cc_agsdynamicobject.cpp b/engines/ags/engine/ac/dynobj/cc_agsdynamicobject.cpp
index e711ba3963..43faf81a56 100644
--- a/engines/ags/engine/ac/dynobj/cc_agsdynamicobject.cpp
+++ b/engines/ags/engine/ac/dynobj/cc_agsdynamicobject.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/core/types.h"
#include "ags/engine/ac/dynobj/cc_agsdynamicobject.h"
#include "ags/shared/ac/common.h" // quit()
diff --git a/engines/ags/engine/ac/dynobj/cc_dynamicarray.cpp b/engines/ags/engine/ac/dynobj/cc_dynamicarray.cpp
index 0d12ddb439..8e63e6d895 100644
--- a/engines/ags/engine/ac/dynobj/cc_dynamicarray.cpp
+++ b/engines/ags/engine/ac/dynobj/cc_dynamicarray.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/ac/dynobj/cc_dynamicarray.h"
namespace AGS3 {
diff --git a/engines/ags/engine/ac/dynobj/cc_dynamicobject.cpp b/engines/ags/engine/ac/dynobj/cc_dynamicobject.cpp
index 2cc89cc3b8..1c8074c9fb 100644
--- a/engines/ags/engine/ac/dynobj/cc_dynamicobject.cpp
+++ b/engines/ags/engine/ac/dynobj/cc_dynamicobject.cpp
@@ -36,8 +36,6 @@
//#define DEBUG_MANAGED_OBJECTS
-//include <stdlib.h>
-//include <string.h>
#include "ags/engine/ac/dynobj/cc_dynamicobject.h"
#include "ags/engine/ac/dynobj/managedobjectpool.h"
#include "ags/shared/debugging/out.h"
diff --git a/engines/ags/engine/ac/dynobj/cc_serializer.cpp b/engines/ags/engine/ac/dynobj/cc_serializer.cpp
index 7140e1919c..290708434b 100644
--- a/engines/ags/engine/ac/dynobj/cc_serializer.cpp
+++ b/engines/ags/engine/ac/dynobj/cc_serializer.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/ac/dynobj/cc_serializer.h"
#include "ags/engine/ac/dynobj/all_dynamicclasses.h"
#include "ags/engine/ac/dynobj/all_scriptclasses.h"
diff --git a/engines/ags/engine/ac/dynobj/managedobjectpool.cpp b/engines/ags/engine/ac/dynobj/managedobjectpool.cpp
index 5185cfbb53..79fad80b3a 100644
--- a/engines/ags/engine/ac/dynobj/managedobjectpool.cpp
+++ b/engines/ags/engine/ac/dynobj/managedobjectpool.cpp
@@ -21,7 +21,6 @@
*/
#include "ags/lib/std/vector.h"
-//include <string.h>
#include "ags/engine/ac/dynobj/managedobjectpool.h"
#include "ags/engine/ac/dynobj/cc_dynamicarray.h" // globalDynamicArray, constants
#include "ags/shared/debugging/out.h"
diff --git a/engines/ags/engine/ac/dynobj/scriptdict.h b/engines/ags/engine/ac/dynobj/scriptdict.h
index 5b642a0381..797e053cf1 100644
--- a/engines/ags/engine/ac/dynobj/scriptdict.h
+++ b/engines/ags/engine/ac/dynobj/scriptdict.h
@@ -36,7 +36,6 @@
#ifndef AGS_ENGINE_AC_DYNOBJ_SCRIPTDICT_H
#define AGS_ENGINE_AC_DYNOBJ_SCRIPTDICT_H
-//include <string.h>
#include "ags/lib/std/map.h"
#include "ags/engine/ac/dynobj/cc_agsdynamicobject.h"
#include "ags/shared/util/string.h"
diff --git a/engines/ags/engine/ac/dynobj/scriptstring.cpp b/engines/ags/engine/ac/dynobj/scriptstring.cpp
index 695f94bfb6..b9bafcd446 100644
--- a/engines/ags/engine/ac/dynobj/scriptstring.cpp
+++ b/engines/ags/engine/ac/dynobj/scriptstring.cpp
@@ -22,8 +22,6 @@
#include "ags/engine/ac/dynobj/scriptstring.h"
#include "ags/engine/ac/string.h"
-//include <stdlib.h>
-//include <string.h>
namespace AGS3 {
diff --git a/engines/ags/engine/ac/global_datetime.cpp b/engines/ags/engine/ac/global_datetime.cpp
index 6e45f02f0e..585feb3a23 100644
--- a/engines/ags/engine/ac/global_datetime.cpp
+++ b/engines/ags/engine/ac/global_datetime.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <time.h>
#include "ags/engine/ac/global_datetime.h"
#include "ags/engine/ac/datetime.h"
#include "ags/shared/ac/common.h"
diff --git a/engines/ags/engine/ac/global_file.cpp b/engines/ags/engine/ac/global_file.cpp
index 56eb016c02..ed05d06175 100644
--- a/engines/ags/engine/ac/global_file.cpp
+++ b/engines/ags/engine/ac/global_file.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/ac/global_file.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/file.h"
diff --git a/engines/ags/engine/ac/global_game.cpp b/engines/ags/engine/ac/global_game.cpp
index 61f8621cb2..fd98556805 100644
--- a/engines/ags/engine/ac/global_game.cpp
+++ b/engines/ags/engine/ac/global_game.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <math.h>
-
#include "ags/shared/core/platform.h"
#include "ags/shared/ac/audiocliptype.h"
#include "ags/shared/util/path.h"
diff --git a/engines/ags/engine/ac/global_string.cpp b/engines/ags/engine/ac/global_string.cpp
index 3bd4c2c515..347e03cd2c 100644
--- a/engines/ags/engine/ac/global_string.cpp
+++ b/engines/ags/engine/ac/global_string.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/global_string.h"
#include "ags/engine/ac/global_translation.h"
diff --git a/engines/ags/engine/ac/global_translation.cpp b/engines/ags/engine/ac/global_translation.cpp
index 33f7322094..d37c24ee31 100644
--- a/engines/ags/engine/ac/global_translation.cpp
+++ b/engines/ags/engine/ac/global_translation.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/display.h"
#include "ags/engine/ac/gamestate.h"
diff --git a/engines/ags/engine/ac/gui.cpp b/engines/ags/engine/ac/gui.cpp
index 5e8db0d8b7..61ae7c1c33 100644
--- a/engines/ags/engine/ac/gui.cpp
+++ b/engines/ags/engine/ac/gui.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <cstdio>
#include "ags/engine/ac/gui.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/draw.h"
diff --git a/engines/ags/engine/ac/math.cpp b/engines/ags/engine/ac/math.cpp
index 2709b632cd..76168b9284 100644
--- a/engines/ags/engine/ac/math.cpp
+++ b/engines/ags/engine/ac/math.cpp
@@ -20,11 +20,9 @@
*
*/
-//include <cmath>
#include "ags/engine/ac/math.h"
#include "ags/shared/ac/common.h" // quit
#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"
diff --git a/engines/ags/engine/ac/roomstatus.cpp b/engines/ags/engine/ac/roomstatus.cpp
index 3fde08a7e8..cfac9f940c 100644
--- a/engines/ags/engine/ac/roomstatus.cpp
+++ b/engines/ags/engine/ac/roomstatus.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <string.h> // memset
-//include <stdlib.h> // free
#include "ags/shared/ac/common.h"
#include "ags/shared/ac/game_version.h"
#include "ags/engine/ac/roomstatus.h"
diff --git a/engines/ags/engine/ac/screenoverlay.h b/engines/ags/engine/ac/screenoverlay.h
index 97787c34ba..c20fb52684 100644
--- a/engines/ags/engine/ac/screenoverlay.h
+++ b/engines/ags/engine/ac/screenoverlay.h
@@ -23,7 +23,6 @@
#ifndef AGS_ENGINE_AC_SCREENOVERLAY_H
#define AGS_ENGINE_AC_SCREENOVERLAY_H
-//include <stdint.h>
#include "ags/shared/core/types.h"
namespace AGS3 {
diff --git a/engines/ags/engine/ac/statobj/agsstaticobject.cpp b/engines/ags/engine/ac/statobj/agsstaticobject.cpp
index 5e7ff1e6c2..9420dc0824 100644
--- a/engines/ags/engine/ac/statobj/agsstaticobject.cpp
+++ b/engines/ags/engine/ac/statobj/agsstaticobject.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/ac/statobj/agsstaticobject.h"
#include "ags/engine/ac/game.h"
#include "ags/engine/ac/gamestate.h"
diff --git a/engines/ags/engine/ac/statobj/staticarray.cpp b/engines/ags/engine/ac/statobj/staticarray.cpp
index dd02d047cf..5c3d0bbce7 100644
--- a/engines/ags/engine/ac/statobj/staticarray.cpp
+++ b/engines/ags/engine/ac/statobj/staticarray.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/ac/statobj/staticarray.h"
#include "ags/engine/ac/dynobj/cc_dynamicobject.h"
diff --git a/engines/ags/engine/ac/string.cpp b/engines/ags/engine/ac/string.cpp
index 9ddc04f6ba..ef8eab32f3 100644
--- a/engines/ags/engine/ac/string.cpp
+++ b/engines/ags/engine/ac/string.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <cstdio>
#include "ags/engine/ac/string.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/display.h"
diff --git a/engines/ags/engine/ac/string.h b/engines/ags/engine/ac/string.h
index df911864a1..4300803a95 100644
--- a/engines/ags/engine/ac/string.h
+++ b/engines/ags/engine/ac/string.h
@@ -23,7 +23,6 @@
#ifndef AGS_ENGINE_AC_STRING_H
#define AGS_ENGINE_AC_STRING_H
-//include <stdarg.h>
#include "ags/engine/ac/dynobj/cc_dynamicobject.h"
namespace AGS3 {
diff --git a/engines/ags/engine/debugging/filebasedagsdebugger.cpp b/engines/ags/engine/debugging/filebasedagsdebugger.cpp
index 3975ffd3ab..501998aa2a 100644
--- a/engines/ags/engine/debugging/filebasedagsdebugger.cpp
+++ b/engines/ags/engine/debugging/filebasedagsdebugger.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <cstdio>
#include "ags/engine/debugging/filebasedagsdebugger.h"
#include "ags/engine/ac/file.h" // filelength()
#include "ags/shared/util/stream.h"
diff --git a/engines/ags/engine/debugging/logfile.cpp b/engines/ags/engine/debugging/logfile.cpp
index 2117fae27c..372ae1430f 100644
--- a/engines/ags/engine/debugging/logfile.cpp
+++ b/engines/ags/engine/debugging/logfile.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/debugging/logfile.h"
#include "ags/shared/util/file.h"
#include "ags/shared/util/stream.h"
diff --git a/engines/ags/engine/gui/cscidialog.cpp b/engines/ags/engine/gui/cscidialog.cpp
index beb648fdb6..68d7d18edf 100644
--- a/engines/ags/engine/gui/cscidialog.cpp
+++ b/engines/ags/engine/gui/cscidialog.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <cctype>
#include "ags/shared/util/wgt2allg.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/draw.h"
diff --git a/engines/ags/engine/gui/mylistbox.cpp b/engines/ags/engine/gui/mylistbox.cpp
index edf4f1f314..f70581c982 100644
--- a/engines/ags/engine/gui/mylistbox.cpp
+++ b/engines/ags/engine/gui/mylistbox.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/util/wgt2allg.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/gamesetup.h"
diff --git a/engines/ags/engine/gui/mypushbutton.cpp b/engines/ags/engine/gui/mypushbutton.cpp
index 5fca6779a3..1ee5860875 100644
--- a/engines/ags/engine/gui/mypushbutton.cpp
+++ b/engines/ags/engine/gui/mypushbutton.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/util/wgt2allg.h"
#include "ags/shared/ac/common.h"
#include "ags/engine/ac/mouse.h"
diff --git a/engines/ags/engine/platform/linux/acpllnx.cpp b/engines/ags/engine/platform/linux/acpllnx.cpp
index 62c70f8f6a..aad731b52d 100644
--- a/engines/ags/engine/platform/linux/acpllnx.cpp
+++ b/engines/ags/engine/platform/linux/acpllnx.cpp
@@ -27,11 +27,6 @@
// ********* LINUX PLACEHOLDER DRIVER *********
-//include <stdio.h>
-//include <xalleg.h>
-//include <libcda.h>
-//include <pwd.h>
-//include <sys/stat.h>
#include "ags/lib/allegro.h"
#include "ags/engine/ac/runtime_defines.h"
#include "ags/engine/gfx/gfxdefines.h"
diff --git a/engines/ags/engine/script/executingscript.cpp b/engines/ags/engine/script/executingscript.cpp
index 2924a0b8ed..c0a71760cc 100644
--- a/engines/ags/engine/script/executingscript.cpp
+++ b/engines/ags/engine/script/executingscript.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/engine/script/executingscript.h"
#include "ags/engine/debugging/debug_log.h"
#include "ags/engine/debugging/debugger.h"
diff --git a/engines/ags/engine/script/runtimescriptvalue.cpp b/engines/ags/engine/script/runtimescriptvalue.cpp
index 5a943734f1..a42b76089d 100644
--- a/engines/ags/engine/script/runtimescriptvalue.cpp
+++ b/engines/ags/engine/script/runtimescriptvalue.cpp
@@ -26,8 +26,6 @@
#include "ags/engine/ac/statobj/staticobject.h"
#include "ags/shared/util/memory.h"
-//include <string.h> // for memcpy()
-
namespace AGS3 {
using namespace AGS::Shared;
diff --git a/engines/ags/engine/script/script_api.cpp b/engines/ags/engine/script/script_api.cpp
index ecf8192db5..51cdeda52b 100644
--- a/engines/ags/engine/script/script_api.cpp
+++ b/engines/ags/engine/script/script_api.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <stdio.h>
-//include <string.h>
#include "ags/shared/ac/game_version.h"
#include "ags/shared/script/cc_error.h"
#include "ags/engine/script/runtimescriptvalue.h"
diff --git a/engines/ags/engine/script/script_api.h b/engines/ags/engine/script/script_api.h
index 15c129c889..1a314ec771 100644
--- a/engines/ags/engine/script/script_api.h
+++ b/engines/ags/engine/script/script_api.h
@@ -30,7 +30,6 @@
#ifndef AGS_ENGINE_SCRIPT_SCRIPTAPI_H
#define AGS_ENGINE_SCRIPT_SCRIPTAPI_H
-//include <stdarg.h>
#include "ags/shared/core/types.h"
#include "ags/engine/ac/runtime_defines.h"
#include "ags/engine/ac/statobj/agsstaticobject.h"
diff --git a/engines/ags/engine/script/script_engine.cpp b/engines/ags/engine/script/script_engine.cpp
index fdbe1fc56a..23ec48e8de 100644
--- a/engines/ags/engine/script/script_engine.cpp
+++ b/engines/ags/engine/script/script_engine.cpp
@@ -31,7 +31,6 @@
//
//=============================================================================
-//include <stdlib.h>
#include "ags/engine/script/cc_instance.h"
#include "ags/shared/script/cc_error.h"
#include "ags/shared/util/file.h"
diff --git a/engines/ags/shared/ac/characterinfo.cpp b/engines/ags/shared/ac/characterinfo.cpp
index dcc8eeca3e..f2793fa2fe 100644
--- a/engines/ags/shared/ac/characterinfo.cpp
+++ b/engines/ags/shared/ac/characterinfo.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/ac/characterinfo.h"
#include "ags/shared/util/stream.h"
diff --git a/engines/ags/shared/ac/dialogtopic.h b/engines/ags/shared/ac/dialogtopic.h
index 3831b3f1e0..cf416b9ed8 100644
--- a/engines/ags/shared/ac/dialogtopic.h
+++ b/engines/ags/shared/ac/dialogtopic.h
@@ -62,6 +62,7 @@ using namespace AGS; // FIXME later
#define DCMD_ENDSCRIPT 0xff
#define DCHAR_NARRATOR 999
#define DCHAR_PLAYER 998
+
struct DialogTopic {
char optionnames[MAXTOPICOPTIONS][150];
int32_t optionflags[MAXTOPICOPTIONS];
diff --git a/engines/ags/shared/ac/interfacebutton.h b/engines/ags/shared/ac/interfacebutton.h
index ab599b5912..78e5c44a2c 100644
--- a/engines/ags/shared/ac/interfacebutton.h
+++ b/engines/ags/shared/ac/interfacebutton.h
@@ -28,6 +28,7 @@ namespace AGS3 {
#define MAXBUTTON 20
#define IBFLG_ENABLED 1
#define IBFLG_INVBOX 2
+
struct InterfaceButton {
int x, y, pic, overpic, pushpic, leftclick;
int rightclick; // if inv, then leftclick = wid, rightclick = hit
diff --git a/engines/ags/shared/ac/interfaceelement.h b/engines/ags/shared/ac/interfaceelement.h
index a07a316cbf..320442d72f 100644
--- a/engines/ags/shared/ac/interfaceelement.h
+++ b/engines/ags/shared/ac/interfaceelement.h
@@ -43,21 +43,6 @@ struct InterfaceElement {
InterfaceElement();
};
-/*struct InterfaceStyle {
-int playareax1,playareay1,playareax2,playareay2; // where the game takes place
-int vtextxp,vtextyp;
-char vtext[40];
-int numbuttons,popupbuttons;
-InterfaceButton button[MAXBUTTON];
-int invx1,invy1,invx2,invy2; // set invx1=-1 for Sierra-style inventory
-InterfaceStyle() { // sierra interface
-playareax1=0; playareay1=13; playareax2=319; playareay2=199;
-vtextxp=160; vtextyp=2; strcpy(vtext,"@SCORETEXT@$r at GAMENAME@");
-invx1=-1; numbuttons=2; popupbuttons=1;
-button[0].set(0,13,3,-1,0);
-}
-};*/
-
} // namespace AGS3
#endif
diff --git a/engines/ags/shared/ac/mousecursor.h b/engines/ags/shared/ac/mousecursor.h
index 9e42fa0ea0..f34fc27247 100644
--- a/engines/ags/shared/ac/mousecursor.h
+++ b/engines/ags/shared/ac/mousecursor.h
@@ -37,6 +37,7 @@ using namespace AGS; // FIXME later
#define MCF_DISABLED 2
#define MCF_STANDARD 4
#define MCF_HOTSPOT 8 // only animate when over hotspot
+
// this struct is also in the plugin header file
struct MouseCursor {
int pic;
diff --git a/engines/ags/shared/ac/view.cpp b/engines/ags/shared/ac/view.cpp
index 886e4c4859..917931de06 100644
--- a/engines/ags/shared/ac/view.cpp
+++ b/engines/ags/shared/ac/view.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/ac/view.h"
#include "ags/shared/util/alignedstream.h"
diff --git a/engines/ags/shared/ac/wordsdictionary.cpp b/engines/ags/shared/ac/wordsdictionary.cpp
index a73f247a93..44991caff1 100644
--- a/engines/ags/shared/ac/wordsdictionary.cpp
+++ b/engines/ags/shared/ac/wordsdictionary.cpp
@@ -21,7 +21,6 @@
*/
#include "ags/lib/std/algorithm.h"
-//include <string.h>
#include "ags/shared/ac/wordsdictionary.h"
#include "ags/shared/util/stream.h"
#include "ags/shared/util/string_compat.h"
diff --git a/engines/ags/shared/core/types.h b/engines/ags/shared/core/types.h
index e52edbc888..5b20dc66ee 100644
--- a/engines/ags/shared/core/types.h
+++ b/engines/ags/shared/core/types.h
@@ -30,10 +30,6 @@
#define AGS_SHARED_CORE_TYPES_H
#include "common/scummsys.h"
-//include <stddef.h>
-//include <stdint.h>
-//include <stdlib.h> // for size_t
-//include <limits.h> // for _WORDSIZE
namespace AGS3 {
diff --git a/engines/ags/shared/debugging/assert.h b/engines/ags/shared/debugging/assert.h
index 805ca9082e..22d812bc2d 100644
--- a/engines/ags/shared/debugging/assert.h
+++ b/engines/ags/shared/debugging/assert.h
@@ -29,6 +29,4 @@
#ifndef AGS_SHARED_DEBUGGING_ASSERT_H
#define AGS_SHARED_DEBUGGING_ASSERT_H
-//include <assert.h>
-
#endif
diff --git a/engines/ags/shared/debugging/debugmanager.cpp b/engines/ags/shared/debugging/debugmanager.cpp
index ad804dfef2..28b76a7985 100644
--- a/engines/ags/shared/debugging/debugmanager.cpp
+++ b/engines/ags/shared/debugging/debugmanager.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <stdarg.h>
#include "ags/shared/debugging/debugmanager.h"
#include "ags/shared/util/string_types.h"
#include "ags/globals.h"
diff --git a/engines/ags/shared/game/interactions.cpp b/engines/ags/shared/game/interactions.cpp
index f76071c5cb..7ed8723387 100644
--- a/engines/ags/shared/game/interactions.cpp
+++ b/engines/ags/shared/game/interactions.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <string.h>
#include "ags/shared/ac/common.h" // quit
#include "ags/shared/game/interactions.h"
#include "ags/shared/util/alignedstream.h"
diff --git a/engines/ags/shared/script/cc_script.cpp b/engines/ags/shared/script/cc_script.cpp
index 3e638d3d15..5a0411651b 100644
--- a/engines/ags/shared/script/cc_script.cpp
+++ b/engines/ags/shared/script/cc_script.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <stdlib.h>
-//include <string.h>
#include "ags/shared/script/cc_error.h"
#include "ags/shared/script/cc_script.h"
#include "ags/shared/script/script_common.h"
diff --git a/engines/ags/shared/util/geometry.cpp b/engines/ags/shared/util/geometry.cpp
index 8059f9f5bd..693c4b26d6 100644
--- a/engines/ags/shared/util/geometry.cpp
+++ b/engines/ags/shared/util/geometry.cpp
@@ -23,7 +23,6 @@
#include "ags/shared/util/geometry.h"
#include "ags/lib/std/algorithm.h"
#include "ags/lib/std/algorithm.h"
-//include <cmath>
namespace AGS3 {
diff --git a/engines/ags/shared/util/inifile.cpp b/engines/ags/shared/util/inifile.cpp
index 23dfb25622..6628407d01 100644
--- a/engines/ags/shared/util/inifile.cpp
+++ b/engines/ags/shared/util/inifile.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <cctype>
-//include <string.h>
#include "ags/shared/util/inifile.h"
#include "ags/shared/util/textstreamreader.h"
#include "ags/shared/util/textstreamwriter.h"
diff --git a/engines/ags/shared/util/lzw.cpp b/engines/ags/shared/util/lzw.cpp
index b93ec36cb4..4428d0013d 100644
--- a/engines/ags/shared/util/lzw.cpp
+++ b/engines/ags/shared/util/lzw.cpp
@@ -26,7 +26,6 @@
//
//=============================================================================
-//include <stdlib.h>
#include "ags/shared/ac/common.h" // quit
#include "ags/shared/util/stream.h"
diff --git a/engines/ags/shared/util/memory.h b/engines/ags/shared/util/memory.h
index b5cd1c1aed..f7bcd2d26b 100644
--- a/engines/ags/shared/util/memory.h
+++ b/engines/ags/shared/util/memory.h
@@ -29,7 +29,6 @@
#ifndef AGS_SHARED_UTIL_MEMORY_H
#define AGS_SHARED_UTIL_MEMORY_H
-//include <string.h>
#include "ags/shared/util/bbop.h"
#include "ags/shared/util/math.h"
#include "common/textconsole.h"
diff --git a/engines/ags/shared/util/misc.cpp b/engines/ags/shared/util/misc.cpp
index f499d29794..d82ffee28f 100644
--- a/engines/ags/shared/util/misc.cpp
+++ b/engines/ags/shared/util/misc.cpp
@@ -51,10 +51,6 @@
#include "ags/shared/core/platform.h"
-//include <stdio.h>
-//include <sys/types.h>
-//include <sys/stat.h>
-//include <string.h>
#if !AGS_PLATFORM_OS_WINDOWS
//include <dirent.h>
#endif
diff --git a/engines/ags/shared/util/string.h b/engines/ags/shared/util/string.h
index c492112d00..f0c415d9ae 100644
--- a/engines/ags/shared/util/string.h
+++ b/engines/ags/shared/util/string.h
@@ -46,7 +46,6 @@
#ifndef AGS_SHARED_UTIL_STRING_H
#define AGS_SHARED_UTIL_STRING_H
-//include <stdarg.h>
#include "ags/lib/std/vector.h"
#include "ags/shared/core/platform.h"
#include "ags/shared/core/types.h"
diff --git a/engines/ags/shared/util/string_utils.cpp b/engines/ags/shared/util/string_utils.cpp
index 17ee27e2f1..0bc146dcdd 100644
--- a/engines/ags/shared/util/string_utils.cpp
+++ b/engines/ags/shared/util/string_utils.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <errno.h>
-//include <string.h>
#include "ags/shared/core/platform.h"
#include "ags/shared/util/math.h"
#include "ags/shared/util/string_utils.h"
diff --git a/engines/ags/shared/util/textstreamwriter.cpp b/engines/ags/shared/util/textstreamwriter.cpp
index fe2ffad380..8494fc6286 100644
--- a/engines/ags/shared/util/textstreamwriter.cpp
+++ b/engines/ags/shared/util/textstreamwriter.cpp
@@ -20,8 +20,6 @@
*
*/
-//include <stdarg.h>
-//include <stdio.h> // sprintf
#include "ags/shared/core/platform.h"
#include "ags/shared/util/textstreamwriter.h"
#include "ags/shared/util/stream.h"
diff --git a/engines/ags/shared/util/version.cpp b/engines/ags/shared/util/version.cpp
index 1685d50291..c04b329dfc 100644
--- a/engines/ags/shared/util/version.cpp
+++ b/engines/ags/shared/util/version.cpp
@@ -20,7 +20,6 @@
*
*/
-//include <ctype.h>
#include "ags/shared/util/version.h"
namespace AGS3 {
Commit: 77bab4753b6133d48b9237e19d7d62806ce8f13f
https://github.com/scummvm/scummvm/commit/77bab4753b6133d48b9237e19d7d62806ce8f13f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-06T19:43:28-08:00
Commit Message:
AGS: Read legacy resolution config & detect upscale mode
Changed paths:
engines/ags/engine/main/config.cpp
diff --git a/engines/ags/engine/main/config.cpp b/engines/ags/engine/main/config.cpp
index f40bd26e28..698441097f 100644
--- a/engines/ags/engine/main/config.cpp
+++ b/engines/ags/engine/main/config.cpp
@@ -262,6 +262,14 @@ void read_game_data_location(const ConfigTree &cfg) {
}
void read_legacy_graphics_config(const ConfigTree &cfg) {
+ // Pre-3.* game resolution setup
+ int default_res = INIreadint(cfg, "misc", "defaultres", 0);
+ int screen_res = INIreadint(cfg, "misc", "screenres", 0);
+ if ((default_res == kGameResolution_320x200 ||
+ default_res == kGameResolution_320x240) && screen_res > 0) {
+ _GP(usetup).override_upscale = true; // run low-res game in high-res mode
+ }
+
_GP(usetup).Screen.DisplayMode.Windowed = INIreadint(cfg, "misc", "windowed") > 0;
_GP(usetup).Screen.DriverID = INIreadstring(cfg, "misc", "gfxdriver", _GP(usetup).Screen.DriverID);
@@ -427,7 +435,7 @@ void apply_config(const ConfigTree &cfg) {
} else if (override_os.CompareNoCase("mac") == 0) {
_GP(usetup).override_script_os = eOS_Mac;
}
- _GP(usetup).override_upscale = INIreadint(cfg, "override", "upscale") > 0;
+ _GP(usetup).override_upscale = INIreadint(cfg, "override", "upscale", _GP(usetup).override_upscale) > 0;
}
// Apply logging configuration
More information about the Scummvm-git-logs
mailing list