这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6e0204e
gamestate: move old state to new folder
TheJJ Nov 1, 2018
60b2435
main: duplicate renderer demo as first step
TheJJ Nov 3, 2018
5ef672f
fslike: improve file-not-found message for c++ api
TheJJ Dec 23, 2018
e37a80e
game: render funny red quad
TheJJ Jan 27, 2019
54bcc30
etc: update valgrind suppressions
TheJJ Feb 9, 2019
8edc6da
pxdgen: minor fixes
TheJJ Feb 9, 2019
68919c8
config: extract game version to prevent rebuilds on git commit
TheJJ Feb 9, 2019
7a5dd29
towards graphical pong
TheJJ Feb 16, 2019
50e3344
pong: render moving ball
TheJJ Feb 16, 2019
e69e5c2
event/loop: pretty-print event target name
TheJJ Feb 17, 2019
919cd25
pong: show paddles
TheJJ Feb 18, 2019
8a5aa03
event: aicontroller must emit idle event when doing nothing
TheJJ Feb 26, 2019
9d39759
advanced pong ai that predicts hit points
TheJJ Feb 26, 2019
b0e7e85
event: remove unused eventfilter class
TheJJ Feb 27, 2019
5d3f321
event: rename EventTarget->EventEntity and EventClass->EventHandler
TheJJ Feb 28, 2019
4e4cca5
gitignore: add ccls-cache for c++ completion
TheJJ Feb 28, 2019
6305848
pong: fix initial fetch of window size
TheJJ Mar 2, 2019
bf09ae9
pong: let reflections depend on area size
TheJJ Mar 2, 2019
e7d9f80
update some copyright years
TheJJ Mar 2, 2019
7d772b2
buildsystem: clarify missing header guard message
TheJJ Mar 27, 2019
a15e6e4
curve: add segmented curve
TheJJ Mar 30, 2019
446c24b
pong: use segmented curve for pong ball
TheJJ Mar 31, 2019
676072f
pong: configure ball color through nyan
TheJJ Oct 12, 2019
bb2d192
gitignore: ag now uses .ignore files
TheJJ Nov 23, 2019
7ba24f6
curve: remove leftover error.h include
TheJJ Dec 22, 2019
e1df8de
fixup! renderer: minimise state changes
TheJJ Dec 22, 2019
1877e22
fix: rename broken #include and update copyright dates.
heinezen Mar 30, 2021
93be8c5
fix: clang build
heinezen Mar 31, 2021
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ __pycache__
/.bin
/build
/deps
/.ccls-cache

# root dir run script
/run
Expand All @@ -56,7 +57,7 @@ perf.data*
.gdb_history

# code search
/.agignore
/.ignore
/.globalrc
/GPATH
/GRTAGS
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ set(CYTHON_MIN_VERSION 0.25)

# CMake policies
foreach(pol
CMP0074 # use <pkg>_ROOT vars in find_package()
CMP0067 # honor language standard in try_compile()
CMP0071 # enable automoc for generated files
CMP0072 # prefers GLVND by default FindOpenGL
Expand Down
30 changes: 30 additions & 0 deletions assets/nyan/pong.nyan
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
PongGame():
ball : Ball
player1 : Player
player2 : Player

Ball():
Color():
r : int = 0
g : int = 200
b : int = 0
color : Color = Color

Player():
lifes : int = 3
size : int = 200

GameTest(PongGame):
ball = Ball
player1 = Player
player2 = Player

LeftColor<Ball.Color>():
r = 0
g = 20
b = 230

RightColor<Ball.Color>():
r = 180
g = 40
b = 0
4 changes: 2 additions & 2 deletions buildsystem/codecompliance/headerguards.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2014-2020 the openage authors. See copying.md for legal info.
# Copyright 2014-2021 the openage authors. See copying.md for legal info.

"""
Verifies the guard macros of all C++ header files.
Expand Down Expand Up @@ -45,7 +45,7 @@ def find_issues(dirname):

match = GUARD_RE.match(data)
if not match:
raise HeaderIssue("No valid header guard found")
raise HeaderIssue("No valid header guard found (e.g. #pragma once)")

except HeaderIssue as exc:
yield (f"header guard issue in {fname}", exc.args[0], None)
6 changes: 3 additions & 3 deletions buildsystem/pxdgen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015-2020 the openage authors. See copying.md for legal info.
# Copyright 2015-2021 the openage authors. See copying.md for legal info.

"""
Auto-generates PXD files from annotated C++ headers.
Expand Down Expand Up @@ -334,7 +334,7 @@ def postprocess_annotation_line(self, annotation):
Post-processes each individual annotation line, applying hacks and
testing it, etc.

See openage/pyinterface/hacks.h for documentation on the individual
See libopenage/pyinterface/hacks.h for documentation on the individual
hacks.
"""
annotation = annotation.rstrip()
Expand Down Expand Up @@ -383,7 +383,7 @@ def generate(self, pxdfile, ignore_timestamps=False, print_warnings=True):
outfile.write(result)

if print_warnings and self.warnings:
print("\x1b[33;1mWARNING\x1b[m pxdgen[" + self.filename + "]:")
print("\x1b[33;1mWARNING\x1b[m pxdgen[%s]:" % self.filename)
for warning in self.warnings:
print(warning)

Expand Down
3 changes: 1 addition & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2013-2020 the openage authors. See copying.md for legal info.
# Copyright 2013-2021 the openage authors. See copying.md for legal info.

"""
openage autocancer-like cmake frontend.
Expand Down Expand Up @@ -290,7 +290,6 @@ def invoke_cmake(args, bindir, defines, options):

invocation.append(raw_cmake_arg)

invocation.append('--')
invocation.append(project_root)

# look for traces of an in-source build
Expand Down
50 changes: 30 additions & 20 deletions etc/valgrind-python.supp
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
#
# This is a valgrind suppression file that should be used
# when running Python with valgrind.
# This is a valgrind suppression file that should be used when using valgrind.
#
# It was taken from the cpython project and adapted for openage.
# Upstream URL is: https://raw.githubusercontent.com/python/cpython/master/Misc/valgrind-python.supp
#
#
# Here's an example of running valgrind:
#
# cd python/dist/src
# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
# cd openage/bin/
# PYTHONMALLOC=malloc valgrind --tool=memcheck --suppressions=../etc/valgrind-python.supp \
# python3 -m openage test -a
#
# python can be compiled with --with-valgrind to enhance the experience
# Python can be compiled with --with-valgrind to enhance the valgrind experience:
# valgrind presence is detected and python memory is allocated more valgrind-friendly then.
#
# Python 3.6 supports PYTHONMALLOC=malloc environment var to force malloc()

#
# Disable the suppressions for _PyObject_Free and _PyObject_Realloc below by comment
# if valgrind shall complain about python memory leaks.
#
# See cpython/Misc/README.valgrind for more information
#
# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Addr4
fun:Py_ADDRESS_IN_RANGE
fun:address_in_range
}

{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Value4
fun:Py_ADDRESS_IN_RANGE
fun:address_in_range
}

{
ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
Memcheck:Value8
fun:Py_ADDRESS_IN_RANGE
fun:address_in_range
}

{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:Py_ADDRESS_IN_RANGE
fun:address_in_range
}

#
Expand Down Expand Up @@ -123,61 +133,61 @@
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Addr4
fun:PyObject_Free
fun:_PyObject_Free
}

{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Value4
fun:PyObject_Free
fun:_PyObject_Free
}

{
ADDRESS_IN_RANGE/Use of uninitialised value of size 8
Memcheck:Addr8
fun:PyObject_Free
fun:_PyObject_Free
}

{
ADDRESS_IN_RANGE/Use of uninitialised value of size 8
Memcheck:Value8
fun:PyObject_Free
fun:_PyObject_Free
}

{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:PyObject_Free
fun:_PyObject_Free
}

{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Addr4
fun:PyObject_Realloc
fun:_PyObject_Realloc
}

{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Value4
fun:PyObject_Realloc
fun:_PyObject_Realloc
}

{
ADDRESS_IN_RANGE/Use of uninitialised value of size 8
Memcheck:Addr8
fun:PyObject_Realloc
fun:_PyObject_Realloc
}

{
ADDRESS_IN_RANGE/Use of uninitialised value of size 8
Memcheck:Value8
fun:PyObject_Realloc
fun:_PyObject_Realloc
}

{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:PyObject_Realloc
fun:_PyObject_Realloc
}

###
Expand Down
16 changes: 11 additions & 5 deletions libopenage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ endif()
# ncurses support
if(WANT_NCURSES)
set(CURSES_NEED_NCURSES TRUE)
set(CURSES_NEED_WIDE TRUE)
find_package(Curses)
endif()

if(WANT_NCURSES AND CURSES_FOUND)
have_config_option(ncurses NCURSES true)
target_include_directories(libopenage PRIVATE ${Curses_INCLUDE_DIRS})
target_include_directories(libopenage PRIVATE ${CURSES_INCLUDE_DIRS})
target_link_libraries(libopenage PRIVATE ${CURSES_LIBRARIES})
else()
have_config_option(ncurses NCURSES false)
Expand Down Expand Up @@ -235,6 +236,8 @@ get_config_option_string()

configure_file(config.h.in config.h)
configure_file(config.cpp.in config.cpp)
configure_file(version.h.in version.h)
configure_file(version.cpp.in version.cpp)

configure_file(
"${CMAKE_SOURCE_DIR}/openage/config.py.in"
Expand Down Expand Up @@ -325,6 +328,7 @@ add_sources(libopenage
screenshot.cpp
texture.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.cpp
${CMAKE_CURRENT_BINARY_DIR}/version.cpp
${CODEGEN_SCU_FILE}
)

Expand All @@ -340,19 +344,21 @@ add_subdirectory("coord")
add_subdirectory("curve")
add_subdirectory("cvar")
add_subdirectory("datastructure")
add_subdirectory("event")
add_subdirectory("gui")
add_subdirectory("error")
add_subdirectory("event")
add_subdirectory("gamestate")
add_subdirectory("gui")
add_subdirectory("input")
add_subdirectory("log")
add_subdirectory("job")
add_subdirectory("log")
add_subdirectory("main")
add_subdirectory("pathfinding")
add_subdirectory("presenter")
add_subdirectory("pyinterface")
add_subdirectory("renderer")
add_subdirectory("rng")
add_subdirectory("simulation")
add_subdirectory("shader")
add_subdirectory("simulation")
add_subdirectory("terrain")
add_subdirectory("testing")
add_subdirectory("unit")
Expand Down
5 changes: 4 additions & 1 deletion libopenage/curve/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
add_sources(libopenage
base_curve.cpp
continuous.cpp
curve.cpp
discrete.cpp
interpolated.cpp
iterator.cpp
keyframe.cpp
keyframe_container.cpp
map.cpp
map_filter_iterator.cpp
queue.cpp
queue_filter_iterator.cpp
value_container.cpp
segmented.cpp
)

add_subdirectory("tests")
7 changes: 7 additions & 0 deletions libopenage/curve/base_curve.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2017-2019 the openage authors. See copying.md for legal info.

#include "base_curve.h"

namespace openage::curve {

} // openage::curve
Loading