Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompute portal node graphs #4

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
170e43f
gamestate: Make component classes 'final'.
heinezen Sep 7, 2024
44952e5
doc: Change recommended entrypoint for Windows build.
heinezen Sep 7, 2024
81a0a55
Merge pull request #1689 from heinezen/fix/win_build_instructions
TheJJ Sep 8, 2024
380d2e9
Merge pull request #1687 from heinezen/feature/final_components
TheJJ Sep 8, 2024
c6db4fb
renderer: Update syntax of GlUniformBuffer to match that of GlUniform…
Sep 18, 2024
6256c66
renderer: Update syntax of GlUniformBuffer to match that of GlUniform…
EdvinLndh Sep 18, 2024
623554e
Added syntax changes to GlUniformBufferInput class.
EdvinLndh Sep 19, 2024
0c1a368
Merge branch 'uniform_syntax_change' of github.com:EdvinLndh/openage …
EdvinLndh Sep 19, 2024
de212cb
Changed uniforms attribute from unordered_map to vector
EdvinLndh Sep 22, 2024
66098ce
Merge pull request #1690 from EdvinLndh/uniform_syntax_change
heinezen Sep 22, 2024
b3a21a3
Update README.md
PRIYANKjakharia Oct 4, 2024
8bad4db
Update README.md
PRIYANKjakharia Oct 5, 2024
e8bf591
Update README.md
PRIYANKjakharia Oct 5, 2024
02d3242
Merge pull request #1694 from PRIYANKjakharia/patch-1
heinezen Oct 5, 2024
03c1592
renderer: Fix tex unit assignment for std::optional type.
heinezen Oct 5, 2024
fb88dfc
Merge pull request #1695 from heinezen/fix/texunit_binding
TheJJ Oct 6, 2024
ac2dbbd
buildsys: Remove unused imports.
heinezen Oct 11, 2024
ce1f7f8
buildsys: Deactivate _PyTraceback_Add import.
heinezen Oct 11, 2024
98908b0
buildsys: Add comments explaining why _PyTraceback_Add is no longer u…
heinezen Oct 12, 2024
a3df307
Merge pull request #1697 from heinezen/fix/py_traceback
TheJJ Oct 13, 2024
8d5629a
doc: Update macOS build instructions.
heinezen Oct 13, 2024
a66e08b
ci: Update macOS CI config.
heinezen Oct 14, 2024
656ce84
ci: Update versions of deprecated actions.
heinezen Oct 14, 2024
f9ec53b
renderer: Fix lock of resource reads in render entity.
heinezen Oct 1, 2024
cfd835f
renderer: Add RenderEntity base class for common methods.
heinezen Oct 3, 2024
d44f903
refactor: Shorten render entity class name in HUD render stage.
heinezen Oct 3, 2024
3f73385
refactor: Shorten render entity class name in Terrain render stage.
heinezen Oct 3, 2024
b3295e3
refactor: Shorten render entity class name in world render stage.
heinezen Oct 3, 2024
5e7a768
renderer: Return copies instead of referenced in terrain render enity.
heinezen Oct 3, 2024
8314b6c
renderer: Fix lock of resource reads in hud render entity.
heinezen Oct 3, 2024
3db8afd
Merge pull request #1698 from heinezen/fix/macos_arm
TheJJ Oct 18, 2024
a1fad1c
Merge pull request #1692 from heinezen/fix/render_entity_threadsafe
TheJJ Oct 31, 2024
00b7f4c
Merge pull request #1656 from heinezen/feature/gamestate-pathing
TheJJ Oct 31, 2024
535b6cb
etc: clang-format rule for preprocessor indentation.
heinezen Oct 31, 2024
3c47b65
refactor: Format cpp files with preprocessor code.
heinezen Oct 31, 2024
31f74ee
Merge pull request #1702 from heinezen/fx/clang_format_ppindent
TheJJ Nov 1, 2024
65d2f7a
coord: Make comparisons not ambiguous.
heinezen Oct 31, 2024
45a7dd5
Merge pull request #1703 from heinezen/fix/ambiguous_compare
TheJJ Nov 2, 2024
4f53084
includes DbgHelp.h after windows.h to prevent errors
jere8184 Nov 6, 2024
d023a2f
Merge pull request #1705 from jere8184/rearrange_dbghelp
TheJJ Nov 6, 2024
73f06b7
Renderer: Added camera boundaries to CameraManager and clamping to th…
EdvinLndh Sep 25, 2024
85918c9
Refactoring and documentation.
EdvinLndh Oct 18, 2024
b907a7d
Added constructor for CameraBoundaries.
EdvinLndh Oct 18, 2024
780949f
Struct refactoring
EdvinLndh Oct 20, 2024
1556502
Refactoring and cleanup
EdvinLndh Oct 24, 2024
0c129fb
Changed default minimum boundary to be largest negative value instead…
EdvinLndh Oct 24, 2024
59cee6a
Fixes for Y boundary
EdvinLndh Oct 31, 2024
af804e6
renderer: Create boundaries.cpp file for compilation checks.
heinezen Nov 7, 2024
179e1ad
renderer: Add method to change camera boundaries in cam manager.
heinezen Nov 7, 2024
6d6a2dd
renderer: Rename current hardcoded camera boundaries.
heinezen Nov 7, 2024
a3376ca
Include missing email for #1691
heinezen Nov 7, 2024
2170ff5
Merge pull request #1691 from EdvinLndh/add_camera_boundaries
heinezen Nov 7, 2024
28a3c95
Pathfinding: Precomputeportal nodes for A Star
jere8184 Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentGotoLabels: false
IndentPPDirectives: None
IndentPPDirectives: BeforeHash
IndentWidth: 4
IndentWrappedFunctionNames: false
# clang-format-16 InsertNewlineAtEOF: true
Expand Down
30 changes: 8 additions & 22 deletions .github/workflows/macosx-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
# https://docs.github.com/en/actions/reference/software-installed-on-github-hosted-runners
# we install stuff not already there
macos-build:
runs-on: macOS-latest
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -19,7 +19,7 @@ jobs:
string(TIMESTAMP current_date "%Y-%m-%d-%H:%M:%S" UTC)
message("timestamp=${current_date}" >> $GITHUB_OUTPUT)
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-deps
with:
path: |
Expand All @@ -29,7 +29,7 @@ jobs:
restore-keys: |
${{ runner.os }}-deps-
- name: Cache ccache dir
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-ccache
with:
path: ~/Library/Caches/ccache
Expand All @@ -40,26 +40,14 @@ jobs:
run: brew update-reset
- name: Brew update
run: brew update
- name: Install clang / LLVM 15.0.0
run: |
set -x
brew install --force wget
mkdir -p /tmp/clang
cd /tmp/clang
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0/clang+llvm-15.0.0-x86_64-apple-darwin.tar.xz -O clang-15.0.0.tar.xz
ls
tar -xvf clang-15.0.0.tar.xz -C ~
cd ~
mv clang+llvm-15.0.0-x86_64-apple-darwin clang-15.0.0
~/clang-15.0.0/bin/clang++ --version
- name: Brew install DeJaVu fonts
run: brew install --cask font-dejavu
- name: Remove python's 2to3 link so that 'brew link' does not fail
run: rm /usr/local/bin/2to3* && rm /usr/local/bin/idle3*
- name: Install environment helpers with homebrew
run: brew install --force ccache
- name: Install dependencies with homebrew
run: brew install --force libepoxy freetype fontconfig harfbuzz opus opusfile qt6 libogg libpng toml11 eigen
- name: Install LLVM with homebrew
run: brew install --force llvm
- name: Install openage dependencies with homebrew
run: brew install --force cmake python3 libepoxy freetype fontconfig harfbuzz opus opusfile qt6 libogg libpng toml11 eigen
- name: Install nyan dependencies with homebrew
run: brew install --force flex make
- name: Install python3 packages
Expand All @@ -68,9 +56,7 @@ jobs:
# numpy pulls gcc as dep? and pygments doesn't work.
run: pip3 install --upgrade --break-system-packages cython numpy mako lz4 pillow pygments setuptools toml
- name: Configure
run: |
CLANG_PATH="$HOME/clang-15.0.0/bin/clang++"
./configure --compiler="$CLANG_PATH" --mode=debug --ccache --download-nyan
run: ./configure --compiler="$(brew --prefix llvm)/bin/clang++" --mode=release --ccache --download-nyan
- name: Build
run: make -j$(sysctl -n hw.logicalcpu) VERBOSE=1
- name: Test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu-22.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
sudo docker save openage-devenv:latest | gzip > /tmp/staging/devenv.tar.gz
shell: bash
- name: Publish the Docker image
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devenv-image-compressed.tar.gz
path: '/tmp/staging/devenv.tar.gz'
Expand All @@ -32,7 +32,7 @@ jobs:
run: mkdir -p /tmp/image
shell: bash
- name: Download devenv image
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: devenv-image-compressed.tar.gz
path: '/tmp/image'
Expand All @@ -47,7 +47,7 @@ jobs:
mkdir -p /tmp/openage
tar -czvf /tmp/openage/openage-build.tar.gz ./build
- name: Publish build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openage-build.tar.gz
path: '/tmp/openage/openage-build.tar.gz'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows-server-2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
vswhere -latest
shell: pwsh
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
Expand Down Expand Up @@ -78,15 +78,15 @@ jobs:
python -m openage --add-dll-search-path $DLL_PATH --version
shell: pwsh
- name: Publish build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: build-files
path: './build'
if-no-files-found: error
retention-days: 30
- name: Publish packaged artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: package-files
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows-server-2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
vswhere -latest
shell: pwsh
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
Expand Down Expand Up @@ -78,15 +78,15 @@ jobs:
python -m openage --add-dll-search-path $DLL_PATH --version
shell: pwsh
- name: Publish build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: build-files
path: './build'
if-no-files-found: error
retention-days: 30
- name: Publish packaged artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: package-files
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Goals
-----

* Fully authentic look and feel
* This can only be approximated, since the behaviour of the original game is mostly undocumented,
* This can only be approximated since the behavior of the original game is mostly undocumented,
and guessing/experimenting can only get you this close
* We will not implement useless artificial limitations (max 30 selectable units...)
* An easily-moddable content format: [**nyan** yet another notation](https://github.com/SFTtech/nyan)
Expand All @@ -79,7 +79,7 @@ Current State of the Project

**Important notice**: At the moment, "gameplay" is basically non-functional.
We're implementing the internal game simulation (how units even do anything) with simplicity and extensibility in mind, so we had to get rid of the temporary (but kind of working) previous version.
With these changes we can (finally) actually make use of our converted asset packs and our nyan API!
With these changes, we can (finally) actually make use of our converted asset packs and our nyan API!
We're working day and night to make gameplay return\*.
If you're interested, we wrote detailed explanations on our blog: [Part 1](https://blog.openage.dev/new-gamestate-2020.html), [Part 2](https://blog.openage.dev/engine-core-modules.html), [Monthly Devlog](https://blog.openage.dev/tag/news.html).

Expand All @@ -99,16 +99,16 @@ If you're interested, we wrote detailed explanations on our blog: [Part 1](https
Installation Packages
---------------------

There's many missing parts for an actually working game.
There are many missing parts for an actually working game.
So if you "just wanna play", [you'll be disappointed](#current-state-of-the-project), unfortunately.

We strongly recommend to build the program from source to get the latest, greatest and shiniest project state :)
We strongly recommend building the program from source to get the latest, greatest, and shiniest project state :)


* For **Linux** check at [repology](https://repology.org/project/openage/versions) if your distribution has any packages available. Otherwise you need to build from source.
* For **Linux** check at [repology](https://repology.org/project/openage/versions) if your distribution has any packages available. Otherwise, you need to build from source.
We don't release `*.deb`, `*.rpm`, Flatpak, snap or AppImage packages yet.
* For **Windows** check our [release page](https://github.com/SFTtech/openage/releases) for the latest installer.
Otherwise, you need to build from source.
Otherwise, you need to build from the source.

* For **macOS** we currently don't have any packages, you need to build from source.

Expand Down Expand Up @@ -152,15 +152,15 @@ Contributing
You might ask yourself now "Sounds cool, but how do I participate
and ~~get famous~~ contribute useful features?".

Fortunately for you, there is a lot to do and we are very grateful for help.
Fortunately for you, there is a lot to do and we are very grateful for your help.

## Where do I start?

* **Check the issues** [labelled with `good first issue`](https://github.com/SFTtech/openage/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). These are tasks that you can start right away and don't require much previous knowledge.
* **Ask us** in the [chat](https://matrix.to/#/#sfttech:matrix.org). Someone there could need
help with something.
* You can also **take the initiative** and fix a bug you found, create an issue for discussion or
implement a feature that we never though of, but always wanted.
implement a feature that we never thought of, but always wanted.


## Ok, I found something. What now?
Expand All @@ -176,7 +176,7 @@ Fortunately for you, there is a lot to do and we are very grateful for help.
## How do I contribute my features/changes?

* Read the **[contributing guide](/doc/contributing.md)**.
* You can upload work in progress (WIP) versions or drafts of your contribution to get feedback or support.
* You can upload work-in-progress (WIP) versions or drafts of your contribution to get feedback or support.
* Tell us (again) when you want us to review your work.

## I want to help, but I'm not a programmer...
Expand Down
2 changes: 2 additions & 0 deletions copying.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ _the openage authors_ are:
| Haoyang Bi | AyiStar | ayistar à outlook dawt com |
| Michael Seibt | RoboSchmied | github à roboschmie dawt de |
| Nikhil Ghosh | NikhilGhosh75 | nghosh606 à gmail dawt com |
| Edvin Lindholm | EdvinLndh | edvinlndh à gmail dawt com |
| Jeremiah Morgan | jere8184 | jeremiahmorgan dawt bham à outlook dawt com |

If you're a first-time committer, add yourself to the above list. This is not
just for legal reasons, but also to keep an overview of all those nicknames.
Expand Down
28 changes: 20 additions & 8 deletions doc/build_instructions/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@

```
brew update-reset && brew update
brew tap homebrew/cask-fonts
brew install font-dejavu
brew install --cask font-dejavu
brew install cmake python3 libepoxy freetype fontconfig harfbuzz opus opusfile qt6 libogg libpng toml11 eigen
brew install llvm
pip3 install cython numpy mako lz4 pillow pygments toml

# optional, for documentation generation
brew install doxygen
pip3 install --upgrade --break-system-packages cython numpy mako lz4 pillow pygments setuptools toml
```

You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md) and its dependencies:
Expand All @@ -22,16 +18,32 @@ You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/buildi
brew install flex make
```

Optionally, for documentation generation:

```
brew install doxygen
```

## Clone the repository

```
git clone https://github.com/SFTtech/openage
cd openage
```

## Building

We advise against using the clang version that comes with macOS (Apple Clang) as it notoriously out of date and often causes compilation errors. Use homebrew's clang if you don't want any trouble. You can pass the path of homebrew clang to the openage `configure` script which will generate the CMake files for building:

```
# on Intel macOS, llvm is by default in /usr/local/Cellar/llvm/bin/
# on ARM macOS, llvm is by default in /opt/homebrew/Cellar/llvm/bin/
./configure --compiler="$(brew --prefix llvm)/bin/clang"" --download-nyan
```

Afterwards, trigger the build using `make`:

```
./configure --compiler=$(which clang++) --mode=release --download-nyan
make -j$(sysctl -n hw.ncpu)
```

Expand All @@ -40,7 +52,7 @@ make -j$(sysctl -n hw.ncpu)


## Running
`make run` or `./bin/run` launches the game. Try `./bin/run --help`!
`make run` or `cd bin && ./run` launches the game. Try `./run --help` if you don't know what to do!


## To create the documentation
Expand Down
2 changes: 1 addition & 1 deletion doc/build_instructions/windows_msvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _Note:_ If you want to download and build Nyan automatically add `-DDOWNLOAD_NYA
- If prebuilt QT6 was installed, the original location of QT6 DLLs is `<QT6 directory>\bin`.

- Now, to run the openage:
- Open a CMD window in `<openage directory>\build\` and run `python -m openage game`
- Open a CMD window in `<openage directory>\build\` and run `python -m openage main`
- Execute`<openage directory>\build\run.exe` every time after that and enjoy!

## Packaging
Expand Down
18 changes: 9 additions & 9 deletions libopenage/console/tests.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2014-2019 the openage authors. See copying.md for legal info.
// Copyright 2014-2024 the openage authors. See copying.md for legal info.

#include <vector>
#include <string>
#include <vector>

#ifdef _MSC_VER
#define STDOUT_FILENO 1
#define STDOUT_FILENO 1
#else
#include <unistd.h>
#include <unistd.h>
#endif
#include "../util/fds.h"
#include "../util/pty.h"
Expand All @@ -15,8 +15,8 @@
#include <cstdlib>
#include <fcntl.h>

#include "../log/log.h"
#include "../error/error.h"
#include "../log/log.h"

#include "buf.h"
#include "console.h"
Expand Down Expand Up @@ -51,7 +51,7 @@ void render() {


void interactive() {
#ifndef _WIN32
#ifndef _WIN32

console::Buf buf{{80, 25}, 1337, 80};
struct winsize ws;
Expand All @@ -75,7 +75,7 @@ void interactive() {
throw Error(MSG(err) << "execl(\"" << shell << "\", \"" << shell << "\", nullptr) failed: " << strerror(errno));
}
default:
//we are the parent
// we are the parent
break;
}

Expand Down Expand Up @@ -143,7 +143,7 @@ void interactive() {
ssize_t retval = read(ptyin.fd, rdbuf, rdbuf_size);
switch (retval) {
case -1:
switch(errno) {
switch (errno) {
case EIO:
loop = false;
break;
Expand Down Expand Up @@ -175,7 +175,7 @@ void interactive() {
// show cursor
termout.puts("\x1b[?25h");

#endif /* _WIN32 */
#endif /* _WIN32 */
}


Expand Down
16 changes: 4 additions & 12 deletions libopenage/coord/coord.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,8 @@ struct Coord${camelcase}Absolute {
return static_cast<Absolute &>(*this);
}

constexpr bool operator ==(const Absolute &other) const {
return ${formatted_members("(this->{0} == other.{0})", join_with=" && ")};
}

constexpr bool operator !=(const Absolute &other) const {
return !(*this == other);
friend constexpr bool operator ==(const Absolute &lhs, const Absolute &rhs) {
return ${formatted_members("(lhs.{0} == rhs.{0})", join_with=" && ")};
}
};

Expand Down Expand Up @@ -167,12 +163,8 @@ struct Coord${camelcase}Relative {
return static_cast<Relative &>(*this);
}

constexpr bool operator ==(const Relative &other) const {
return ${formatted_members("(this->{0} == other.{0})", join_with=" && ")};
}

constexpr bool operator !=(const Relative &other) const {
return !(*this == other);
friend constexpr bool operator ==(const Relative &lhs, const Relative &rhs) {
return ${formatted_members("(lhs.{0} == rhs.{0})", join_with=" && ")};
}
};

Expand Down
Loading