Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'development' into pathfinding-nav-optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Nov 9, 2023
2 parents 9c8d891 + b1f49a9 commit f6fb161
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 129 deletions.
2 changes: 1 addition & 1 deletion Activities/GameActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ void GameActivity::Update()
viewOffset *= -1;
}

m_LandingZone[player].m_Y = prevHeight + ((g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10) - prevHeight, true) * 0.2);
m_LandingZone[player].m_Y = prevHeight + ((g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10, true) - prevHeight) * 0.2);

// Set the view to a little above the LZ position
Vector viewTarget(m_LandingZone[player].m_X, m_LandingZone[player].m_Y - viewOffset);
Expand Down
1 change: 1 addition & 0 deletions Lua/LuaBindingRegisterDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace RTE {
#define RegisterLuaBindingsOfAbstractType(OWNINGSCOPE, TYPE) \
luabind::def((std::string("To") + std::string(#TYPE)).c_str(), (TYPE *(*)(Entity *))&LuaAdaptersEntityCast::To##TYPE), \
luabind::def((std::string("To") + std::string(#TYPE)).c_str(), (const TYPE *(*)(const Entity *))&LuaAdaptersEntityCast::ToConst##TYPE), \
luabind::def((std::string("Is") + std::string(#TYPE)).c_str(), (bool(*)(const Entity *))&LuaAdaptersEntityCast::Is##TYPE), \
OWNINGSCOPE::Register##TYPE##LuaBindings()

/// <summary>
Expand Down
11 changes: 9 additions & 2 deletions Managers/MovableMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,21 @@ void MovableMan::PurgeAllMOs()
{
for (std::deque<Actor*>::iterator itr = m_Actors.begin(); itr != m_Actors.end(); ++itr) {
(*itr)->DestroyScriptState();
delete (*itr);
}
for (std::deque<MovableObject*>::iterator itr = m_Items.begin(); itr != m_Items.end(); ++itr) {
(*itr)->DestroyScriptState();
delete (*itr);
}
for (std::deque<MovableObject*>::iterator itr = m_Particles.begin(); itr != m_Particles.end(); ++itr) {
(*itr)->DestroyScriptState();
}

for (std::deque<Actor*>::iterator itr = m_Actors.begin(); itr != m_Actors.end(); ++itr) {
delete (*itr);
}
for (std::deque<MovableObject*>::iterator itr = m_Items.begin(); itr != m_Items.end(); ++itr) {
delete (*itr);
}
for (std::deque<MovableObject*>::iterator itr = m_Particles.begin(); itr != m_Particles.end(); ++itr) {
delete (*itr);
}

Expand Down
2 changes: 1 addition & 1 deletion Managers/SceneMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,7 @@ Vector SceneMan::MovePointToGround(const Vector &from, int maxAltitude, int accu
{
// Todo, instead of a nograv area maybe best to tag certain areas as NoGrav. As otherwise it's tricky to keep track of when things are removed
if (m_pCurrentScene) {
Scene::Area* noGravArea = m_pCurrentScene->GetArea("NoGravityArea");
Scene::Area* noGravArea = m_pCurrentScene->GetOptionalArea("NoGravityArea");
if (noGravArea && noGravArea->IsInside(from)) {
return from;
}
Expand Down
16 changes: 8 additions & 8 deletions RTEA.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16
# Visual Studio Version 17
VisualStudioVersion = 17.7.34018.315
MinimumVisualStudioVersion = 16.0
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTEA", "RTEA.vcxproj", "{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}"
EndProject
Expand All @@ -14,8 +14,8 @@ Global
Debug Release|x86 = Debug Release|x86
Final|x64 = Final|x64
Final|x86 = Final|x86
Tracy|x64 = Tracy|x64
Tracy|x86 = Tracy|x86
Profiling|x64 = Profiling|x64
Profiling|x86 = Profiling|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Debug Full|x64.ActiveCfg = Debug Full|x64
Expand All @@ -34,10 +34,10 @@ Global
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Final|x64.Build.0 = Final|x64
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Final|x86.ActiveCfg = Final|Win32
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Final|x86.Build.0 = Final|Win32
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Tracy|x64.ActiveCfg = Tracy|x64
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Tracy|x64.Build.0 = Tracy|x64
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Tracy|x86.ActiveCfg = Tracy|Win32
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Tracy|x86.Build.0 = Tracy|Win32
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Profiling|x64.ActiveCfg = Profiling|x64
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Profiling|x64.Build.0 = Profiling|x64
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Profiling|x86.ActiveCfg = Profiling|Win32
{A58C9DD7-8BC7-48DA-9E04-04D04F582BE3}.Profiling|x86.Build.0 = Profiling|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
156 changes: 80 additions & 76 deletions RTEA.vcxproj

Large diffs are not rendered by default.

75 changes: 38 additions & 37 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,6 @@ project('Cortex-Command-Community-Project', ['cpp','c'], subproject_dir: 'extern

compiler = meson.get_compiler('cpp')
deps=[]
if host_machine.system() in ['linux','darwin']
deps = [
dependency(['sdl2']),
dependency('flac'),
dependency('minizip'),
dependency('luajit'),
dependency('threads'),
dependency('liblz4'),
dependency('libpng'),
dependency(['lua', 'lua54', 'lua5.4','lua-5.4', 'lua53', 'lua-5.3', 'lua5.3','lua52', 'lua5.2', 'lua-5.2', 'lua51', 'lua5.1', 'lua-5.1']),
dependency('tbb'),
dependency('gl')
]
if host_machine.system() == 'linux'
deps += dependency('SDL2_image')
endif
elif host_machine.system() == 'windows'
sdl2 = subproject('SDL2-2.26.3')
sdl2_dep = dependency('sdl2')
luajit = subproject('LuaJIT-2.1')
luajit_dep = dependency('luajit')
zlib = subproject('zlib-ng-2.1.3')
zlib_dep = dependency('zlib')
minizip = subproject('minizip-ng-4.0.0')
minizip_dep = dependency('minizip')
libpng = subproject('libpng-1.6.40')
libpng_dep = dependency('libpng')
# Windows Libraries
opengl = compiler.find_library('opengl32')
deps += [sdl2_dep, luajit_dep, zlib_dep, minizip_dep, libpng_dep, opengl]
endif

elfname = 'CortexCommand'
build_rpath = ''
Expand Down Expand Up @@ -71,10 +40,6 @@ if compiler.get_argument_syntax()== 'gcc' # used for gcc compatible compilers
link_args += ['-Wl,--enable-new-dtags'] # Set RUNPATH instead of RPATH
endif

if host_machine.system()=='darwin'
deps += dependency('appleframeworks', modules: ['foundation'])
endif

# Set preprocessor flags and cpp arguments according to build options
buildtype_debug = get_option('debug')
if buildtype_debug
Expand Down Expand Up @@ -157,8 +122,8 @@ endif
if get_option('tracy_enable')
add_global_arguments('-DTRACY_ENABLE', language:'cpp')
endif
if get_option('tracy_callstack')
add_global_arguments('-DTRACY_CALLSTACK=10', language:'cpp')
if get_option('tracy_callstack') > 0
add_global_arguments('-DTRACY_CALLSTACK='+get_option('tracy_callstack').to_string(), language:'cpp')
endif
if get_option('tracy_on_demand')
add_global_arguments('-DTRACY_ON_DEMAND', language:'cpp')
Expand All @@ -169,6 +134,42 @@ if get_option('tracy_debuginfod')
endif

#### Platform Common External Libraries ####
if host_machine.system() in ['linux','darwin']
deps += [
dependency(['sdl2']),
dependency('flac'),
dependency('minizip'),
dependency('luajit'),
dependency('threads'),
dependency('liblz4'),
dependency('libpng'),
dependency(['lua', 'lua54', 'lua5.4','lua-5.4', 'lua53', 'lua-5.3', 'lua5.3','lua52', 'lua5.2', 'lua-5.2', 'lua51', 'lua5.1', 'lua-5.1']),
dependency('tbb'),
dependency('gl')
]
if host_machine.system() == 'linux'
deps += dependency('SDL2_image')
endif
if host_machine.system()=='darwin'
deps += dependency('appleframeworks', modules: ['foundation'])
endif
elif host_machine.system() == 'windows'
sdl2 = subproject('SDL2-2.26.3')
sdl2_dep = dependency('sdl2')
luajit = subproject('LuaJIT-2.1')
luajit_dep = dependency('luajit')
zlib = subproject('zlib-ng-2.1.3')
zlib_dep = dependency('zlib')
minizip = subproject('minizip-ng-4.0.0')
minizip_dep = dependency('minizip')
libpng = subproject('libpng-1.6.40')
libpng_dep = dependency('libpng')
# Windows Libraries
opengl = compiler.find_library('opengl32')
deps += [sdl2_dep, luajit_dep, zlib_dep, minizip_dep, libpng_dep, opengl]
endif


external_objects = []
external_libs = []
subdir('external')
Expand Down
8 changes: 4 additions & 4 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option('install_runner', type: 'boolean', value: true, description: 'Whether to
option('sane_warnings', type: 'boolean', value: false, description: 'Disable certain warnings, that are reasonably safe to ignore, though we should fix them at some point.')
option('use_prebuilt_libraries', type: 'boolean', value: true, description: 'On windows use the prebuilt libraries')

option('tracy_enable', type: 'boolean', value: false, description: 'Enable Tracy Profiler')
option('tracy_callstack', type : 'boolean', value : false, description : 'Enfore callstack collection for tracy regions')
option('tracy_on_demand', type : 'boolean', value : false, description : 'On-demand profiling')
option('tracy_debuginfod', type : 'boolean', value : false, description : 'Enable debuginfod support')
option('tracy_enable', type: 'boolean', value: true, description: 'Enable Tracy Profiler')
option('tracy_callstack', type : 'integer', value : 0, description : 'Enfore callstack collection for tracy regions')
option('tracy_on_demand', type : 'boolean', value : true, description : 'On-demand profiling')
option('tracy_debuginfod', type : 'boolean', value : false, description : 'Enable debuginfod support')

0 comments on commit f6fb161

Please sign in to comment.