Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ __pycache__
/.cache

# root dir run script
/run
/run.cpp
/run.html
/openage
/openage.cpp
/openage.html

# CMake in-source builds
/DartConfiguration.tcl
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ endif()
# documentation generation

# create documentation
doxygen_configure(libopenage/ openage/ doc/ README.md)
doxygen_configure(libopenage/ engine/ doc/ README.md)


##################################################
Expand Down Expand Up @@ -251,10 +251,10 @@ target_compile_options(pyext_libopenage INTERFACE
target_link_libraries(pyext_libopenage INTERFACE libopenage)
set(PYEXT_LINK_LIBRARY pyext_libopenage)

configure_file(run.py.in run.py)
add_cython_modules(EMBED NOINSTALL ${CMAKE_CURRENT_BINARY_DIR}/run.py)
add_py_modules(BININSTALL ${CMAKE_CURRENT_BINARY_DIR}/run.py AS openage)
add_subdirectory(openage/)
configure_file(openage.py.in openage.py)
add_cython_modules(EMBED NOINSTALL ${CMAKE_CURRENT_BINARY_DIR}/openage.py)
add_py_modules(BININSTALL ${CMAKE_CURRENT_BINARY_DIR}/openage.py AS openage)
add_subdirectory(engine/)

python_finalize()

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ install: $(BUILDDIR)

.PHONY: run
run: build
cd $(BUILDDIR) && ./run game
cd $(BUILDDIR) && ./openage game

.PHONY: test
test: tests checkfast

.PHONY: tests
tests: build
cd $(BUILDDIR) && ./run test -a
cd $(BUILDDIR) && ./openage test -a

.PHONY: build
build: $(BUILDDIR)
Expand Down Expand Up @@ -109,7 +109,7 @@ cleanbuilddirs: cleaninsourcebuild
@echo cleaning build directories
rm -rf .bin
@echo cleaning cmake-time generated code
rm -f Doxyfile py/openage/config.py libopenage/config.h libopenage/config.cpp
rm -f Doxyfile py/engine/config.py libopenage/config.h libopenage/config.cpp

.PHONY: mrproper
mrproper: cleanbuilddirs
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Quickstart
```

* **I compiled everything. Now how do I run it?**
* Execute `./bin/run`.
* Execute `./bin/openage`.
* [The convert script](/doc/media_convert.md) will transform original assets into openage formats, which are a lot saner and more moddable.
* Use your brain and react to the things you'll see.

Expand All @@ -139,7 +139,7 @@ Quickstart

All of those are features, not bugs.

To turn them off, use `./bin/run --dont-segfault --no-errors --dont-eat-dog`.
To turn them off, use `./bin/openage --dont-segfault --no-errors --dont-eat-dog`.


If this still does not help, try our [troubleshooting guide](/doc/troubleshooting.md), the [contact section](#contact)
Expand Down
2 changes: 1 addition & 1 deletion buildsystem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

Modules in the 'buildsystem' package are not intended to be installed
with openage, or used from outside the build process; otherwise, they
would be in the 'openage' package.
would be in the 'engine' package.
"""
12 changes: 6 additions & 6 deletions buildsystem/codecompliance/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,24 @@ def find_all_issues(args, check_files=None):

if args.pystyle:
from .pystyle import find_issues
yield from find_issues(check_files, ('openage', 'buildsystem'))
yield from find_issues(check_files, ('engine', 'buildsystem'))

if args.cython:
from buildsystem.codecompliance.cython import find_issues
yield from find_issues(check_files, ('openage',))
yield from find_issues(check_files, ('engine',))

if args.cppstyle:
from .cppstyle import find_issues
yield from find_issues(check_files, ('libopenage',))

if args.pylint:
from .pylint import find_issues
yield from find_issues(check_files, ('openage', 'buildsystem'))
yield from find_issues(check_files, ('engine', 'buildsystem'))

if args.textfiles:
from .textfiles import find_issues
yield from find_issues(
('openage', 'libopenage', 'buildsystem', 'doc', 'legal'),
('engine', 'libopenage', 'buildsystem', 'doc', 'legal'),
('.pxd', '.pyx', '.pxi', '.py',
'.h', '.cpp', '.template',
'', '.txt', '.md', '.conf',
Expand All @@ -257,12 +257,12 @@ def find_all_issues(args, check_files=None):
if args.legal:
from .legal import find_issues
yield from find_issues(check_files,
('openage', 'buildsystem', 'libopenage'),
('engine', 'buildsystem', 'libopenage'),
args.test_git_change_years)

if args.filemodes:
from .modes import find_issues
yield from find_issues(check_files, ('openage', 'buildsystem',
yield from find_issues(check_files, ('engine', 'buildsystem',
'libopenage'))


Expand Down
2 changes: 1 addition & 1 deletion buildsystem/codecompliance/textfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_issues(dirnames, exts):
# TODO all this for now, until someone fixes the codegen.
continue

if filename.startswith('openage/') and filename.endswith('.cpp'):
if filename.startswith('engine/') and filename.endswith('.cpp'):
# allow issues for Cython-generated files.
continue

Expand Down
2 changes: 1 addition & 1 deletion buildsystem/codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function(codegen_run)
COMMAND "${CMAKE_COMMAND}" -E touch "${CODEGEN_TIMEFILE}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS ${CODEGEN_DEPENDS}
COMMENT "openage.codegen: generating c++ code"
COMMENT "engine.codegen: generating c++ code"
)

add_custom_target(codegen
Expand Down
2 changes: 1 addition & 1 deletion buildsystem/templates/ExternalFetch.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# in the configure phase.
# -> in the configure phase, run cmake again to download the project.
#
# this is the file used to tell the nested cmake run what to do.
# this is the file used to tell the nested cmake openage what to do.

cmake_minimum_required(VERSION 3.6)

Expand Down
2 changes: 1 addition & 1 deletion doc/build_instructions/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ make -j$(sysctl -n hw.ncpu)


## Running
`make run` or `./bin/run` launches the game. Try `./bin/run --help`!
`make openage` or `./bin/openage` launches the game. Try `./bin/openage --help`!


## To create the documentation
Expand Down
2 changes: 1 addition & 1 deletion doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Make sure you have all the dependencies installed.
- configure: `CC=/path/to/downloaded-llvm/bin/clang CXX=/path/to/downloaded-llvm/bin/clang++ LD=/path/to/downloaded-llvm/bin/ld64.lld ./configure --download-nyan`
- a small build hint for later: use your freaking cores with the -j option later `make -j$(sysctl -n hw.ncpu)`
- `make` generates and builds everything
- `make run` or `bin/run` launches the game. Try `bin/run --help`!
- `make openage` or `bin/openage` launches the game. Try `bin/openage --help`!
- `make test` runs the built-in tests.


Expand Down
8 changes: 4 additions & 4 deletions doc/buildsystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Components
The buildsystem is pretty sophisticated because *openage* consists of C++
code, generated C++ code, generated Cython code and Python code. All C++
parts are packed in `libopenage`, the Python stuff is in the `openage`
python package. We generate code with the `openage.codegen` Python
python package. We generate code with the `engine.codegen` Python
package.


Expand All @@ -29,8 +29,8 @@ Procedure

Steps in building openage:

- generate `openage/config.py` and `libopenage/config.{h, cpp}` from their `*.in` template files, which contain install prefix and version info
- run `openage.codegen` (Python module) to generate C++ source files (recipe: `codegen`)
- generate `engine/config.py` and `libopenage/config.{h, cpp}` from their `*.in` template files, which contain install prefix and version info
- run `engine.codegen` (Python module) to generate C++ source files (recipe: `codegen`)
- generate `.pxd` Cython extension declaration files from annotated `.h` files (recipe: `pxdgen`)
- build and link `libopenage.so` (recipe: `openage`)
- build Cython extension modules (generate cpp files and compile them, via `buildsystem.cythonize`) (recipe: `cython`); those link against libopenage.
Expand Down Expand Up @@ -116,7 +116,7 @@ codegen

Provides the function `codegen_run`, which

- at cmake-time, runs the openage.codegen python module to obtain a list of sources it will generate
- at cmake-time, runs the engine.codegen python module to obtain a list of sources it will generate
- at build time, actually generates the sources and writes them to the source directory where necessary

It sets the variable `CODEGEN_TARGET_TUS`, containing a list of created `cpp` files. That variable is designed to be used in a call to `add_sources(openage GENERATED ${CODEGEN_TARGET_TUS})`.
Expand Down
18 changes: 9 additions & 9 deletions doc/code/pyinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pxdgen(example.h)

The function is now available from Cython. To make it available for pure-python modules, write a wrapper:

`openage/foo.pyx`
`engine/foo.pyx`

``` cython
from libopenage.foo cimport foo as c_foo
Expand All @@ -172,10 +172,10 @@ def foo(int arg0, str arg1):
return c_foo(arg0, arg1)
```

`openage/bar.py`
`engine/bar.py`

``` python
from openage.foo import foo
from engine.foo import foo

print(foo(10, "test"))
```
Expand Down Expand Up @@ -278,7 +278,7 @@ it allows *binding arguments* and makes sure that the pointer is properly initia

We will call this pure-Python function from C++:

`openage/bar.py`
`engine/bar.py`

``` python
def bar(arg0, arg1):
Expand Down Expand Up @@ -314,7 +314,7 @@ extern OAAPI PyIfFunc<float, int, std::string> bar;
Wrap the python function in a `cdef` function, and define a method `setup()`,
which binds the `cdef` function to the PyIfFunc object.

`openage/foo.pyx`
`engine/foo.pyx`

``` cython
from libopenage.foo cimport bar as c_bar
Expand All @@ -333,13 +333,13 @@ arguments are bound (this is needed because Cython currently doesn't support var

Add a call to `openage.foo.setup()` to `openage.cppinterface.setup.setup`.

`openage/pyinterface/setup.pyx`
`engine/pyinterface/setup.pyx`

``` python
def setup():
# (...)

from openage.foo import setup
from engine.foo import setup
setup()

# (...)
Expand All @@ -363,11 +363,11 @@ Real-life examples
------------------

* For code that wraps a C++ class for Python, see:
* `openage/cabextract/lzxd.pyx`
* `engine/cabextract/lzxd.pyx`
* `libopenage/util/lzxd.h`
* For code that wraps a Python class for C++, see:
* `libopenage/util/fslike/path.h`
* `openage/util/fslike/cpp.pyx`
* `engine/util/fslike/cpp.pyx`
* Search for `.pyx` files in the repo


Expand Down
20 changes: 10 additions & 10 deletions doc/code/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Tests run without user interaction to check for errors automatically.
All tests are run automatically by [Kevin](https://github.com/SFTtech/kevin/) for pullrequests.


You can invoke them with `bin/run test -a` or `make test`
You can invoke them with `bin/openage test -a` or `make test`

Have a look at `bin/run test --help` for further options.
Have a look at `bin/openage test --help` for further options.


You are encouraged to write tests for all your contributions, as well as other components that currently lack testing.
Expand All @@ -33,9 +33,9 @@ In addition to testing, openage supports _demos_:
As opposed to tests, demos are run manually and individually by the user.
They usually produce lots of output on stdout or may even be interactive. Python demos even accept an `argv` parameter.

All tests must be registered in `openage/testing/testlist.py` (else the game won't know about them).
All tests must be registered in `engine/testing/testlist.py` (else the game won't know about them).

Also see `bin/run test --help`.
Also see `bin/openage test --help`.

## Adding new tests

Expand All @@ -45,7 +45,7 @@ C++ tests are simple `void()` functions somewhere in the `openage` namespace.

They shall return on success, and raise `openage::testing::TestError` on failure.

They shall not be declared in a header file; instead, add them to `openage/testing/testlist.py`.
They shall not be declared in a header file; instead, add them to `engine/testing/testlist.py`.

The header `libopenage/testing/testing.h` provides `TestError` and some convenience macros:

Expand Down Expand Up @@ -77,15 +77,15 @@ Python tests are simple argument-less functions somewhere in the `openage` packa

They shall return `None` on success, and raise `openage.testing.testing.TestError` on failure.

Add their names to `openage/testing/testlist.py`.
Add their names to `engine/testing/testlist.py`.

The module `openage.testing.testing` provides `TestError` and some convenience functions:

- `assert_value(<expr>, expected)`
checks whether expr == expected, and raises `TestError` if not.
- `assert_raises(expected_exception_type)`
a context guard that verifies that the named exception occurs inside;
consult the example in `openage/testing/testing.py`.
consult the example in `engine/testing/testing.py`.

You may define tests in `.pyx` files.

Expand All @@ -107,7 +107,7 @@ def test_prime():

They defined in function and module docstrings, are extremely lightweight and also serve as documentation.

Simply add the name of a Python module to `openage/testing/testlist.py`, and all doctests in that module will run.
Simply add the name of a Python module to `engine/testing/testlist.py`, and all doctests in that module will run.

Example doctest for a function:

Expand All @@ -126,7 +126,7 @@ def is_prime(p):

### C++ demos

Technically, those are very much like `C++` tests. In fact, the only difference to tests is the section in `openage/testing/testlist.py` where they are declared.
Technically, those are very much like `C++` tests. In fact, the only difference to tests is the section in `engine/testing/testlist.py` where they are declared.

C++ demos don't support `argv`; if you want that, make it a Python demo in a `.pyx` file and do the argparsing in Python; the Python demo function can then easily call any C++ function using the Python interface.

Expand All @@ -135,7 +135,7 @@ C++ demos don't support `argv`; if you want that, make it a Python demo in a `.p

Similar to Python tests, but have one argument, `argv`. Pass arguments in the invocation:

bin/run test -d prime_demo 100
bin/openage test -d prime_demo 100

Example demo:

Expand Down
2 changes: 1 addition & 1 deletion doc/convert/convert_single_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Standalone WAVs (Age of Empires 2: HD Edition):
python3 -m openage convert-file ~/games/aoe2/resources/123.wav /tmp/rofl.opus
```

Have a look at `openage/convert/singlefile.py`, this is also a simple API demo
Have a look at `engine/convert/singlefile.py`, this is also a simple API demo
for how to interact with the aoe files.


Expand Down
2 changes: 1 addition & 1 deletion doc/convert/nyan.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ by parsing the original data.

## Gamedata conversion

`openage/convert/value_object/read/media/datfile/` specifies the format of the `.dat` from various games.
`engine/convert/value_object/read/media/datfile/` specifies the format of the `.dat` from various games.
8 changes: 4 additions & 4 deletions doc/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ gdb -ex 'set breakpoint pending on' -ex 'b openage::run_game' -ex run --args run
The game will be paused at the start of the function run_game() located in `libopenage/main.cpp`

#### Note:
The `run` executable is a compiled version of `run.py` that also embeds the interpreter.
The game is intended to be run by `run.py` but it is much easier to debug the `./run` file
The `openage` executable is a compiled version of `openage.py` that also embeds the interpreter.
The game is intended to be run by `openage.py` but it is much easier to debug the `./openage` file

### GDBGUI

Expand All @@ -36,7 +36,7 @@ sudo pip3 install gdbgui --upgrade
```
Then
```
gdbgui ./run
gdbgui ./openage
```
The gdbgui web page will be at `http://127.0.0.1:5000`
Use the command `run` in the GDB prompt to start debugging
Use the command `openage` in the GDB prompt to start debugging
Loading