Group platform files into their own directory

This commit is contained in:
Tamás Bálint Misius 2023-01-27 17:31:40 +01:00
parent 694bc8eb0f
commit 159d0eb4b7
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
33 changed files with 81 additions and 78 deletions

View File

@ -7,7 +7,7 @@
#include "client/SaveFile.h"
#include "client/SaveInfo.h"
#include "client/http/RequestManager.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "simulation/SaveRenderer.h"
#include "common/tpt-rand.h"

View File

@ -1,6 +1,6 @@
#include "PowderToySDL.h"
#include "graphics/Graphics.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "common/tpt-rand.h"
#include "gui/font/FontEditor.h"
#include "gui/interface/Engine.h"

View File

@ -6,7 +6,7 @@
#include "gui/interface/Engine.h"
#include "client/GameSave.h"
#include "simulation/Simulation.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include <ctime>
#include <iostream>
#include <fstream>

View File

@ -4,7 +4,7 @@
#include "Config.h"
#include "gui/interface/Engine.h"
#include "graphics/Graphics.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include <iostream>
int desktopWidth = 1280;

View File

@ -8,7 +8,7 @@
#include "client/SaveFile.h"
#include "client/SaveInfo.h"
#include "client/UserInfo.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "common/String.h"
#include "graphics/Graphics.h"
#include "prefs/Prefs.h"

View File

@ -1,6 +1,6 @@
#include "SaveFile.h"
#include "GameSave.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
SaveFile::SaveFile(SaveFile & save):
gameSave(NULL),

View File

@ -1,60 +1,7 @@
common_files += files(
'Platform.cpp',
'String.cpp',
'tpt-rand.cpp',
'tpt-thread-local.cpp',
)
can_install_enforce_no = false
set_window_icon = false
path_sep_char = '/'
if host_platform == 'windows'
path_sep_char = '\\\\'
common_files += files(
'PlatformWindows.cpp',
)
elif host_platform == 'darwin'
can_install_enforce_no = true
common_files += files(
'PlatformDarwin.cpp',
'PlatformPosix.cpp',
)
elif host_platform == 'android'
can_install_enforce_no = true
common_files += files(
'PlatformAndroid.cpp',
'PlatformPosix.cpp',
)
elif host_platform == 'linux'
# TODO: again, this is more like "posix" than "linux"
set_window_icon = true
common_files += files(
'PlatformLinux.cpp',
'PlatformPosix.cpp',
)
else
can_install_enforce_no = true
common_files += files(
'PlatformNull.cpp',
'PlatformPosix.cpp',
)
endif
conf_data.set('SET_WINDOW_ICON', set_window_icon ? 'true' : 'false')
conf_data.set('PATH_SEP_CHAR', path_sep_char)
can_install = get_option('can_install')
if can_install == 'auto'
can_install = 'yes_check'
if is_debug
can_install = 'yes'
endif
if can_install_enforce_no
can_install = 'no'
endif
endif
if can_install != 'no' and can_install_enforce_no
error('cannot provide install support, configure with -Dcan_install=no to fix this error')
endif
conf_data.set('CAN_INSTALL', can_install != 'no' ? 'true' : 'false')
conf_data.set('INSTALL_CHECK', can_install == 'yes_check' ? 'true' : 'false')
subdir('platform')

View File

@ -1,6 +1,6 @@
#include "Platform.h"
#include "resource.h"
#include "tpt-rand.h"
#include "common/tpt-rand.h"
#include "Config.h"
#include <memory>
#include <list>

View File

@ -0,0 +1,56 @@
common_files += files(
'Common.cpp',
)
can_install_enforce_no = false
set_window_icon = false
path_sep_char = '/'
if host_platform == 'windows'
path_sep_char = '\\\\'
common_files += files(
'Windows.cpp',
)
elif host_platform == 'darwin'
can_install_enforce_no = true
common_files += files(
'Darwin.cpp',
'Posix.cpp',
)
elif host_platform == 'android'
can_install_enforce_no = true
common_files += files(
'Android.cpp',
'Posix.cpp',
)
elif host_platform == 'linux'
# TODO: again, this is more like "posix" than "linux"
set_window_icon = true
common_files += files(
'Linux.cpp',
'Posix.cpp',
)
else
can_install_enforce_no = true
common_files += files(
'Null.cpp',
'Posix.cpp',
)
endif
conf_data.set('SET_WINDOW_ICON', set_window_icon ? 'true' : 'false')
conf_data.set('PATH_SEP_CHAR', path_sep_char)
can_install = get_option('can_install')
if can_install == 'auto'
can_install = 'yes_check'
if is_debug
can_install = 'yes'
endif
if can_install_enforce_no
can_install = 'no'
endif
endif
if can_install != 'no' and can_install_enforce_no
error('cannot provide install support, configure with -Dcan_install=no to fix this error')
endif
conf_data.set('CAN_INSTALL', can_install != 'no' ? 'true' : 'false')
conf_data.set('INSTALL_CHECK', can_install == 'yes_check' ? 'true' : 'false')

View File

@ -1,5 +1,5 @@
#include "Graphics.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "FontReader.h"
#include "resampler/resampler.h"
#include "SimulationConfig.h"

View File

@ -2,7 +2,7 @@
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "gui/Style.h"
#include "tasks/Task.h"

View File

@ -18,7 +18,7 @@
#include "prefs/GlobalPrefs.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "debug/DebugInfo.h"
#include "debug/DebugLines.h"
#include "debug/DebugParts.h"

View File

@ -16,7 +16,7 @@
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "client/SaveInfo.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Renderer.h"
#include "simulation/Air.h"
#include "simulation/GOLString.h"

View File

@ -17,7 +17,7 @@
#include "client/SaveInfo.h"
#include "client/SaveFile.h"
#include "client/Client.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "gui/Style.h"

View File

@ -1,7 +1,7 @@
#include "Engine.h"
#include "PowderToySDL.h"
#include "Window.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include <cmath>

View File

@ -1,6 +1,6 @@
#include "RichLabel.h"
#include "Colour.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/FontReader.h"
#include "graphics/Graphics.h"
#include "gui/interface/Component.h"

View File

@ -1,7 +1,7 @@
#include "Textbox.h"
#include "Format.h"
#include "PowderToySDL.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/FontReader.h"
#include "graphics/Graphics.h"
#include "gui/interface/Engine.h"

View File

@ -2,7 +2,7 @@
#include "Format.h"
#include "OptionsController.h"
#include "OptionsModel.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "gui/Style.h"

View File

@ -5,7 +5,7 @@
#include "PreviewView.h"
#include "client/Client.h"
#include "client/SaveInfo.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "gui/dialogues/ErrorMessage.h"
#include "gui/dialogues/InformationMessage.h"
#include "gui/login/LoginController.h"

View File

@ -1,6 +1,6 @@
#include "ProfileActivity.h"
#include "client/Client.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "gui/Style.h"
#include "gui/interface/AvatarButton.h"
#include "gui/interface/Button.h"

View File

@ -3,7 +3,7 @@
#include "client/Client.h"
#include "client/GameSave.h"
#include "client/ThumbnailRendererTask.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "gui/Style.h"

View File

@ -5,7 +5,7 @@
#include "SearchView.h"
#include "client/Client.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "common/tpt-minmax.h"
#include "graphics/Graphics.h"
#include "tasks/Task.h"

View File

@ -2,7 +2,7 @@
#include "client/http/Request.h"
#include "prefs/GlobalPrefs.h"
#include "client/Client.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "tasks/Task.h"
#include "tasks/TaskWindow.h"
#include "gui/dialogues/ConfirmPrompt.h"

View File

@ -4,7 +4,7 @@
#include "LuaSmartRef.h"
#include "PowderToySDL.h"
#include "prefs/GlobalPrefs.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "simulation/ElementCommon.h"

View File

@ -24,7 +24,7 @@
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "client/SaveInfo.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "simulation/Air.h"

View File

@ -1,5 +1,5 @@
#include "Prefs.h"
#include "common/Platform.h"
#include "common/platform/Platform.h"
#include "common/tpt-rand.h"
#include <fstream>
#include <iostream>