mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Compare commits
5 commits
7389ddf783
...
6fdcd68172
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fdcd68172 | ||
|
|
e4f4030a5e | ||
|
|
2fb6347125 | ||
|
|
7aa756f6a4 | ||
|
|
e712601602 |
12 changed files with 49 additions and 42 deletions
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
lfscheck:
|
lfscheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Fetch the base branch
|
- name: Fetch the base branch
|
||||||
run: git fetch origin ${{ env.BASE_SHA }}
|
run: git fetch origin ${{ env.BASE_SHA }}
|
||||||
|
|
@ -24,27 +24,14 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GIT_LFS_SKIP_SMUDGE: "1"
|
GIT_LFS_SKIP_SMUDGE: "1"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v7
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
- name: Add remote fork origin for LFS
|
- name: Add remote fork origin for LFS
|
||||||
run: |
|
run: |
|
||||||
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
|
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
|
||||||
git remote add ${{ gitea.actor }} https://gitea.wildfiregames.com/${PR_REPO}.git
|
git remote add ${{ gitea.actor }} https://gitea.wildfiregames.com/${PR_REPO}.git
|
||||||
- name: Workaround for authentication problem with LFS
|
|
||||||
# https://gitea.com/gitea/act_runner/issues/164
|
|
||||||
run: |
|
|
||||||
git config --local \
|
|
||||||
http.${{ gitea.server_url }}/${{ gitea.repository }}.git/info/lfs/objects/.extraheader ''
|
|
||||||
|
|
||||||
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
|
|
||||||
EXTRAHEADER="$(git config --get --local http.${{ gitea.server_url }}/.extraheader)"
|
|
||||||
git config --local \
|
|
||||||
http.${{ gitea.server_url }}/${PR_REPO}.git/info/lfs/objects/batch.extraheader \
|
|
||||||
'${EXTRAHEADER}'
|
|
||||||
git config --local \
|
|
||||||
http.${{ gitea.server_url }}/${PR_REPO}.git/info/lfs/objects/.extraheader ''
|
|
||||||
- name: Download necessary LFS assets
|
- name: Download necessary LFS assets
|
||||||
shell: sh {0}
|
shell: sh {0}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
cppcheck:
|
cppcheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
# cache only works for items in workspace, so configure apt to allow for caching.
|
# cache only works for items in workspace, so configure apt to allow for caching.
|
||||||
- name: Setup apt cache locations
|
- name: Setup apt cache locations
|
||||||
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
|
|
||||||
- name: Cache apt pkg db and and deb files
|
- name: Cache apt pkg db and and deb files
|
||||||
id: apt-cache
|
id: apt-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v6
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
apt-cache
|
apt-cache
|
||||||
|
|
@ -49,11 +49,11 @@ jobs:
|
||||||
copyright:
|
copyright:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 100
|
fetch-depth: 100
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v7
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
|
||||||
|
|
@ -66,10 +66,10 @@ jobs:
|
||||||
jenkinsfiles:
|
jenkinsfiles:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ echo "Building cpp-httplib..."
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fetch
|
# fetch
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ done
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fetch
|
# fetch
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ done
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fetch
|
# fetch
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ done
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fetch
|
# fetch
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ done
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fetch
|
# fetch
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ echo "Building SpiderMonkey..."
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OS="${OS:=$(uname -s)}"
|
OS="${OS:=$(uname -s)}"
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ done
|
||||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
echo "Skipping - already built (use --force-rebuild to override)"
|
echo "Skipping - already built (use --force-rebuild to override)"
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
rm -f .already-built
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fetch
|
# fetch
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,6 @@ CGame::CGame(bool replayLog, const SimulationDebugOptions debugOptions):
|
||||||
m_SimRate(1.0f),
|
m_SimRate(1.0f),
|
||||||
m_PlayerID(-1),
|
m_PlayerID(-1),
|
||||||
m_ViewedPlayerID(-1),
|
m_ViewedPlayerID(-1),
|
||||||
m_IsSavedGame(false),
|
|
||||||
m_IsVisualReplay(false),
|
m_IsVisualReplay(false),
|
||||||
m_ReplayStream(NULL)
|
m_ReplayStream(NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -224,7 +223,7 @@ void CGame::RegisterInit(const JS::HandleValue attribs, const std::string& saved
|
||||||
const Script::Interface& scriptInterface = m_Simulation2->GetScriptInterface();
|
const Script::Interface& scriptInterface = m_Simulation2->GetScriptInterface();
|
||||||
Script::Request rq(scriptInterface);
|
Script::Request rq(scriptInterface);
|
||||||
|
|
||||||
m_IsSavedGame = !savedState.empty();
|
const bool isSavedGame{!savedState.empty()};
|
||||||
|
|
||||||
m_Simulation2->SetInitAttributes(attribs);
|
m_Simulation2->SetInitAttributes(attribs);
|
||||||
|
|
||||||
|
|
@ -285,7 +284,7 @@ void CGame::RegisterInit(const JS::HandleValue attribs, const std::string& saved
|
||||||
co_return g_Renderer.GetSceneRenderer().GetWaterManager().LoadWaterTextures();
|
co_return g_Renderer.GetSceneRenderer().GetWaterManager().LoadWaterTextures();
|
||||||
}, L"LoadWaterTextures", 80);
|
}, L"LoadWaterTextures", 80);
|
||||||
|
|
||||||
if (m_IsSavedGame)
|
if (isSavedGame)
|
||||||
PS::Loader::Register(std::bind_front(
|
PS::Loader::Register(std::bind_front(
|
||||||
[](CGame* game, const std::string& state) -> PS::Loader::Task
|
[](CGame* game, const std::string& state) -> PS::Loader::Task
|
||||||
{
|
{
|
||||||
|
|
@ -298,13 +297,32 @@ void CGame::RegisterInit(const JS::HandleValue attribs, const std::string& saved
|
||||||
co_return game->LoadVisualReplayData();
|
co_return game->LoadVisualReplayData();
|
||||||
}, this), L"Loading visual replay data", 1000);
|
}, this), L"Loading visual replay data", 1000);
|
||||||
|
|
||||||
|
// Call the script function InitGame only for new games, not saved games
|
||||||
|
if (!isSavedGame)
|
||||||
|
{
|
||||||
|
// Perform some simulation initializations (replace skirmish entities, explore territories, etc.)
|
||||||
|
// that needs to be done before setting up the AI and shouldn't be done in Atlas
|
||||||
|
if (!g_AtlasGameLoop->running)
|
||||||
|
{
|
||||||
|
PS::Loader::Register(std::bind_front([](CGame* game) -> PS::Loader::Task
|
||||||
|
{
|
||||||
|
game->m_Simulation2->PreInitGame();
|
||||||
|
co_return 0;
|
||||||
|
}, this), L"PreInitGame", 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
PS::Loader::Register(std::bind_front([](CGame* game) -> PS::Loader::Task
|
||||||
|
{
|
||||||
|
game->m_Simulation2->InitGame();
|
||||||
|
co_return 0;
|
||||||
|
}, this), L"InitGame", 4000);
|
||||||
|
}
|
||||||
|
|
||||||
PS::Loader::EndRegistering();
|
PS::Loader::EndRegistering();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CGame::LoadInitialState(const std::string& savedState)
|
int CGame::LoadInitialState(const std::string& savedState)
|
||||||
{
|
{
|
||||||
ENSURE(m_IsSavedGame);
|
|
||||||
|
|
||||||
std::stringstream stream(savedState);
|
std::stringstream stream(savedState);
|
||||||
|
|
||||||
bool ok = m_Simulation2->DeserializeState(stream);
|
bool ok = m_Simulation2->DeserializeState(stream);
|
||||||
|
|
@ -324,17 +342,6 @@ int CGame::LoadInitialState(const std::string& savedState)
|
||||||
**/
|
**/
|
||||||
PSRETURN CGame::ReallyStartGame()
|
PSRETURN CGame::ReallyStartGame()
|
||||||
{
|
{
|
||||||
// Call the script function InitGame only for new games, not saved games
|
|
||||||
if (!m_IsSavedGame)
|
|
||||||
{
|
|
||||||
// Perform some simulation initializations (replace skirmish entities, explore territories, etc.)
|
|
||||||
// that needs to be done before setting up the AI and shouldn't be done in Atlas
|
|
||||||
if (!g_AtlasGameLoop->running)
|
|
||||||
m_Simulation2->PreInitGame();
|
|
||||||
|
|
||||||
m_Simulation2->InitGame();
|
|
||||||
}
|
|
||||||
|
|
||||||
// We need to do an initial Interpolate call to set up all the models etc,
|
// We need to do an initial Interpolate call to set up all the models etc,
|
||||||
// because Update might never interpolate (e.g. if the game starts paused)
|
// because Update might never interpolate (e.g. if the game starts paused)
|
||||||
// and we could end up rendering before having set up any models (so they'd
|
// and we could end up rendering before having set up any models (so they'd
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2025 Wildfire Games.
|
/* Copyright (C) 2026 Wildfire Games.
|
||||||
* This file is part of 0 A.D.
|
* This file is part of 0 A.D.
|
||||||
*
|
*
|
||||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||||
|
|
@ -226,7 +226,6 @@ private:
|
||||||
std::vector<CColor> m_PlayerColors;
|
std::vector<CColor> m_PlayerColors;
|
||||||
|
|
||||||
int LoadInitialState(const std::string& savedState);
|
int LoadInitialState(const std::string& savedState);
|
||||||
bool m_IsSavedGame; // true if loading a saved game; false for a new game
|
|
||||||
|
|
||||||
bool m_CheatsEnabled;
|
bool m_CheatsEnabled;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ unknownMacro:source/lib/sysdep/os/win/wfirmware.cpp
|
||||||
unknownMacro:source/lib/sysdep/os/win/wposix/wutsname.cpp
|
unknownMacro:source/lib/sysdep/os/win/wposix/wutsname.cpp
|
||||||
unknownMacro:source/ps/CStr.cpp
|
unknownMacro:source/ps/CStr.cpp
|
||||||
|
|
||||||
uninitvar:source/ps/Game.cpp:246
|
uninitvar:source/ps/Game.cpp
|
||||||
uninitvar:source/ps/scripting/JSInterface_SavedGame.cpp:149
|
uninitvar:source/ps/scripting/JSInterface_SavedGame.cpp
|
||||||
|
|
||||||
danglingLifetime:source/renderer/backend/gl/Device.cpp
|
danglingLifetime:source/renderer/backend/gl/Device.cpp
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue