Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated scripts & README, small fixes ...

- updated scripts
- updated README
  • Loading branch information...
commit cc4172e7d1e3f2dee55196243363beb8d6c59b8f 1 parent 6cc6d73
@ducakar authored
View
8 CMakeLists.txt
@@ -6,7 +6,7 @@ project(openzone)
# Configuration options.
#
-set(OZ_VERSION 0.3.91)
+set(OZ_VERSION 0.3.92)
option(OZ_ALLOCATOR "Overload new/delete with diagnostics and allocations tracking." OFF)
option(OZ_SIMD "Use SIMD implementation of linear algebra classes." OFF)
@@ -209,9 +209,9 @@ mark_as_advanced(OZ_HOSTNAME)
add_subdirectory(src)
# This is to show these files in Qt Creator.
-file(GLOB miscFiles AUTHORS COPYING *.md *.sh)
-file(GLOB_RECURSE dataFiles data/*.json data/*.lua data/*.vert data/*.frag)
-add_custom_target(dataFiles SOURCES ${miscFiles} ${dataFiles})
+file(GLOB docFiles AUTHORS COPYING *.md)
+file(GLOB_RECURSE dataFiles data/*.txt data/*.json data/*.lua data/*.vert data/*.frag)
+add_custom_target(dataFiles SOURCES ${docFiles} ${dataFiles})
#
# Data files.
View
68 README.md
@@ -19,20 +19,22 @@ Native Client ports. Android port in still under development. See `cmake/*.Toolc
for all supported platforms/toolchains.
GCC >= 4.8 and LLVM/Clang >= 3.3 are the only supported compilers.
+### Dependencies ###
+
Development packages of the following libraries are required to build OpenZone from source:
- ALSA (Linux only)
-- libGL or libGLES2
- libpng
- libvorbis
- Lua or LuaJIT
- openal-soft
-- PhysicsFS 2.0 or 2.1/dev
+- OpenGL or OpenGL ES
+- PhysicsFS
- SDL2
- SDL2_ttf
- zlib
-If you want to build the tools too (`OZ_TOOLS` option) you also need:
+If you want to build the tools (`OZ_TOOLS` option) you also need:
- Assimp
- FreeImage
@@ -47,21 +49,37 @@ The following development tools are required:
- MinGW-w64 (optional, for building Windows-i686 and Windows-x86_64 ports)
- NaCl SDK (optional, for building PNaCl port)
+### Quick Build Instructions ###
+
+Clone the repository:
+
+ git clone --recursive https://github.com/ducakar/openzone.git
+ cd openzone
+
You can then use generic steps for building CMake projects:
- mkdir build
- cd build
+ mkdir -p build && cd build
cmake ..
make
+ cd ..
+
+And then compile the game data:
+
+ ./build/src/tools/ozBuild -CAZ data/oz_base
+ ./build/src/tools/ozBuild -CAZ data/oz_main
+ ./build/src/tools/ozBuild -CAZ data/oz_missions
+
+After that the game is prepared for a test run:
-Use `cmake-gui` instead of `cmake` for a user-friendly GUI where you can configure build options.
+ ./build/src/tools/openzone -p .
+
+### Long Build Instructions ###
For building all supported configurations you can use `ports.sh` and `build.sh` scripts. `ports.sh`
(see Tools section) downloads and builds all required libraries for NaCl and Android platforms
(NaCL SDK and Android SDK + NDK are required for this, of course), while `build.sh` builds OpenZone
for all platforms. You can change variables at top of both scripts to change the list of enabled
-platforms and whether you want to make debug or a release build. You will also need to fix paths to
-SDKs in those two scripts and in `cmake/*.Toolchain.cmake` files.
+platforms and whether you want to make debug or a release build.
Build scripts use Ninja as low-level build system instead of Make which is the default for CMake.
@@ -81,14 +99,14 @@ You may also want to adjust several options when configuring CMake build system:
- `OZ_SIMD`: Enable SIMD-specific implementation (SSE1 & ARM NEON) of linear algebra classes (Vec3,
Vec4, Point, Plane, Quat, Mat3, Mat4). Currently it yields ~15% worse performance than the generic
implementation since `Vec3` and `Point` become longer (4 floats v. 3 floats) and there are plenty
- of accesses to vector components in the code, as it hasn't been written with SIMD in mind.
+ of accesses to vector components in the code.
`OFF` by default.
- `OZ_GL_ES`: Use OpenGL ES 2.0 instead of OpenGL 2.1.
`OFF` by default, forced to `ON` on Android and NaCl.
-- `OZ_LUAJIT`: Use LuaJIT instead of official Lua library. Lua scripts execute significantly faster
- but there are some weird issues with LuaJIT not initialising sometimes.
+- `OZ_LUAJIT`: Use LuaJIT instead of the official Lua library. Lua scripts execute much faster but
+ LuaJIT is written in assembler and supported only on x86 desktop platforms.
`OFF` by default.
- `OZ_NONFREE`: Enable support for building textures using S3 texture compression. Requires
@@ -96,8 +114,9 @@ You may also want to adjust several options when configuring CMake build system:
`OFF` by default.
- `OZ_TOOLS`: Build tools required for building game data (see the next section).
+ `OFF` by default.
-- `OZ_TESTS`: Build liboz unittest and various experimantal executables used as a playground when
+- `OZ_TESTS`: Build liboz unittest and various experimental executables used as a playground when
developing OpenZone. You don't need this.
`OFF` by default.
@@ -181,8 +200,8 @@ into `openzone-pa.wav` file.
### `clean-blanks.sh` ###
-Cleans up trailing blanks, duplicated empty lines and missing newlines at the end of file for most
-files in the source tree.
+Cleans up trailing blanks, duplicated empty lines and missing newlines at the end of files in the
+source tree.
### `count.sh` ###
@@ -195,7 +214,12 @@ Runs cppcheck tool for static code analysis. Output is written into `cppcheck.lo
### `data-cleanup.sh <datasrc_dir>` ###
-Cleans up temporary, intermediate and backup files from a source game data directory.
+Cleans up temporary, intermediate and backup files from a game source data directory.
+
+### `gen-manifest.sh` ###
+
+Writes `share/openzone/manifest.json` file that contains list of game packeges together with their
+timestamps. Needed by NaCl to update cached game packages.
### `gettext-internal.sh <data_dir>` ###
@@ -218,7 +242,7 @@ The following commands may be given (`build` is assumed if none):
- `clean`: Delete directories for all platforms.
- (none): Copy libraries for selected platforms into corresponding directories.
-### `nacl.sh [run | debug | finalise | translate]` ###
+### `nacl.sh [run | debug | finalise]` ###
Linux-x86_64-Clang client is launched by default. <options> are passed to the client command line.
`NACL_SDK_ROOT` environment variable must be set to use this script.
@@ -231,7 +255,6 @@ The following alternative launches are available:
- `debug`: starts gdb and connets it to a running Chromium instance with a NaCl module pending for
debugging.
- `finalise`: runs `pnacl-finalize` to finalise openzone PNaCl pexe executable.
-- `translate`: translates openzone PNaCl pexe to host machine architecture's nexe.
### `package.sh {src | data | datasrc | bundle}` ###
@@ -242,8 +265,8 @@ One of the following commands must be given:
`share/openzone` directory are included.
- `datasrc`: Create source data archive `openzone-datasrc-<version>.tar.xz`. All source data
packages found in `data` directory are included.
-- `bundle`: Create a 7zip archive that contains Linux-x86_64, Linux-i686 and Windows-i686
- standalone builds and compiled game data packages found in `share/openzone`.
+- `bundle`: Create a 7zip archive that contains Linux-x86_64, Linux-i686 and Windows-i686 standalone
+ builds and compiled game data packages found in `share/openzone`.
### `ports.sh [clean | buildclean | fetch]` ###
@@ -264,14 +287,13 @@ The following commands may be given (`build` is assumed if none):
Proxy script for invoking `q3map2` BSP compiler from GtkRadiant in with appropriate parameters to
compile a BSP structures for OpenZone.
-### `run.sh [wine] [<openzoneOptions>]` ###
+### `run.sh [wine | wine64] [<openzoneOptions>]` ###
Linux-x86_64-Clang client is launched by default. <options> are passed to the client command line.
-`NACL_SDK_ROOT` environment variable must be set to use this script.
-
The following alternative launches are available:
-- `wine`: Installs the standalone Windows port into `build/Windows-test` and launches it via Wine.
+- `wine`: Installs and launches standalone Windows i686 port via Wine.
+- `wine64`: Installs and launches standalone Windows x86-64 port via Wine.
Documentation
-------------
View
2  build.sh
@@ -3,7 +3,7 @@
# build.sh [clean | conf] [<platform>]
#
# This script configures and/or builds OpenZone in the `build` directory for a specified platform or
-# all supported platforms uncommented in the beginning of this script if `<platform>` parameter is
+# all supported platforms uncommented in the beginning of this script if `<platform>` parameter is
# omitted. `ANDROID_NDK` and `NACL_SDK_ROOT` environment variables must be set for Android and NaCl
# builds respectively.
#
View
7 clean-blanks.sh
@@ -2,15 +2,16 @@
#
# clean-blanks.sh
#
-# Cleans up trailing blanks, duplicated empty lines and missing newlines at the end of file for most
-# files in the source tree.
+# Cleans up trailing blanks, duplicated empty lines and missing newlines at the end of files in the
+# source tree.
#
# We want to remove duplicated blank lines and blank lines at the end of a file (in Unix means).
# The latter cannot be directly performed by sed, so we add additional two blank lines at the end of
# each file, remove duplicated blank lines and then remove the last (always blank) line.
#
-files=`git ls-files | egrep -v '^doc/licences/|^etc/include/|^etc/android-project/|\.patch$|\.po$'`
+files=`git ls-files | egrep -v '^doc/licences/|^etc/include/|^etc/android-project/|^data|\.patch$'`
+files="$files `find data -name '*.lua' -o -name '*.vert' -o -name '*.frag'`"
for file in $files; do
# Add two blank lines to the end of each file.
2  data
@@ -1 +1 @@
-Subproject commit c70470aab658f962f271c8b88894b28791ee63ec
+Subproject commit 923ac4762f1447f1e7b14289ad56ec7078cfaaf1
View
2  data-cleanup.sh
@@ -2,7 +2,7 @@
#
# data-cleanup.sh <datasrc_dir>
#
-# Cleans up temporary, intermediate and backup files from a source game data directory.
+# Cleans up temporary, intermediate and backup files from a game source data directory.
#
if [[ -z $1 ]]; then
View
5 doc/Doxyfile
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "OpenZone"
-PROJECT_NUMBER = "0.3.91"
+PROJECT_NUMBER = "0.3.92"
PROJECT_BRIEF = "Simple cross-platform FPS/RTS game engine"
PROJECT_LOGO =
OUTPUT_DIRECTORY = doc/doxygen
@@ -112,8 +112,7 @@ WARN_LOGFILE =
INPUT = src/ozCore \
src/ozEngine \
src/ozFactory \
- src/common \
- src/tools
+ src/common
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.hh \
*.dox
View
5 doc/Doxyfile.liboz
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "liboz"
-PROJECT_NUMBER = "0.3.91"
+PROJECT_NUMBER = "0.3.92"
PROJECT_BRIEF = "OpenZone Core Library & OpenZone Dynamics Library"
PROJECT_LOGO =
OUTPUT_DIRECTORY = doc/doxygen.liboz
@@ -110,9 +110,6 @@ WARN_LOGFILE =
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src/ozCore \
- src/ozDynamics \
- src/ozDynamics/collision \
- src/ozDynamics/physics \
src/ozEngine \
src/ozFactory
INPUT_ENCODING = UTF-8
View
4 doc/PREBERI.html
@@ -9,7 +9,7 @@
<body>
<h1 class="centre">OpenZone</h1>
-<p class="centre"><b>različica <!--OZ_VERSION-->0.3.91</b></p>
+<p class="centre"><b>različica <!--OZ_VERSION-->0.3.92</b></p>
<div class="centre">
<a href="http://ducakar.github.io/openzone/">http://ducakar.github.io/openzone/</a>
</div>
@@ -359,7 +359,7 @@ <h1 class="centre">OpenZone</h1>
<h4>Nastavitvene spremenljivke</h4>
<table class="settings">
<tr>
- <th>_version [string] "<!--OZ_VERSION-->0.3.91"</th>
+ <th>_version [string] "<!--OZ_VERSION-->0.3.92"</th>
</tr>
<tr>
<td>
View
4 doc/README.html
@@ -9,7 +9,7 @@
<body>
<h1 class="centre">OpenZone</h1>
-<p class="centre"><b>version <!--OZ_VERSION-->0.3.91</b></p>
+<p class="centre"><b>version <!--OZ_VERSION-->0.3.92</b></p>
<div class="centre">
<a href="http://ducakar.github.io/openzone/">http://ducakar.github.io/openzone/</a>
</div>
@@ -358,7 +358,7 @@ <h1 class="centre">OpenZone</h1>
<h4>Configuration variables</h4>
<table class="settings">
<tr>
- <th>_version [string] "<!--OZ_VERSION-->0.3.91"</th>
+ <th>_version [string] "<!--OZ_VERSION-->0.3.92"</th>
</tr>
<tr>
<td>
View
2  etc/PKGBUILD
@@ -2,7 +2,7 @@
pkgbase=openzone
pkgname=('liboz' 'openzone' 'openzone-data')
-pkgver=0.3.91
+pkgver=0.3.92
pkgrel=1
url="http://ducakar.github.com/openzone/"
license=('GPL3')
View
2  etc/PKGBUILD.aur
@@ -1,7 +1,7 @@
# Maintainer: Davorin Učakar <davorin.ucakar@gmail.com>
pkgname=openzone
-pkgver=0.3.91
+pkgver=0.3.92
pkgrel=1
pkgdesc='Simple cross-platform FPS/RTS game engine'
url="http://ducakar.github.com/openzone/"
View
2  etc/openzone.spec
@@ -1,5 +1,5 @@
Name: openzone
-Version: 0.3.91
+Version: 0.3.92
Release: 1%{?dist}
Summary: Simple cross-platform FPS/RTS game engine
Group: Amusements/Games
View
16 gettext-internal.sh
@@ -6,19 +6,9 @@
# `<data_dir>/lingua/<data_dir_basename>.pot`.
#
-if [[ -z $1 ]]; then
- echo "Usage: $0 <data_dir>"
- exit
-fi
+outFile="data/oz_base/lingua/internal.pot"
-if [[ ! -d $1 ]]; then
- echo "Directory $1 does not exist."
- exit
-fi
+echo "Extracting strings to $outFile"
-outFile="$1/lingua/`basename $1`.pot"
-
-echo "Appending extracted strings to $outFile"
-
-echo '' >> "$outFile"
+echo '' > "$outFile"
xgettext --omit-header -C -s -kOZ_GETTEXT -o - src/*/*.{hh,cc} src/*/*/*.{hh,cc} >> "$outFile"
View
19 nacl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# nacl.sh [run | debug | finalise | translate]
+# nacl.sh [run | debug | finalise]
#
# Linux-x86_64-Clang client is launched by default. <options> are passed to the client command line.
# `NACL_SDK_ROOT` environment variable must be set to use this script.
@@ -13,7 +13,6 @@
# - `debug`: starts gdb and connets it to a running Chromium instance with a NaCl module pending for
# debugging.
# - `finalise`: runs `pnacl-finalize` to finalise openzone PNaCl pexe executable.
-# - `translate`: translates openzone PNaCl pexe to host machine architecture's nexe.
#
if [[ `uname -m` == x86_64 ]]; then
@@ -56,19 +55,6 @@ debug()
build/PNaCl/src/tools/openzone.${arch}.nexe
}
-finalise()
-{
- echo Finalising ...
- "$pnaclPath/pnacl-finalize" build/PNaCl/src/tools/openzone.pexe
-}
-
-translate()
-{
- echo Translating ...
- "$pnaclPath/pnacl-translate" --allow-llvm-bitcode-input build/PNaCl/src/tools/openzone.pexe \
- -arch $arch -o build/PNaCl/src/tools/openzone.${arch}.nexe
-}
-
case $1 in
run)
run
@@ -79,7 +65,4 @@ case $1 in
finalise)
finalise
;;
- translate)
- translate
- ;;
esac
View
6 run.sh
@@ -1,13 +1,13 @@
#!/bin/sh
#
-# run.sh [wine]
+# run.sh [wine | wine64] [<openzoneOptions>]
#
# Linux-x86_64-Clang client is launched by default. <options> are passed to the client command line.
-# `NACL_SDK_ROOT` environment variable must be set to use this script.
#
# The following alternative launches are available:
#
-# - `wine`: Installs the standalone Windows port into `build/Windows-test` and launches it via Wine.
+# - `wine`: Installs and launches standalone Windows i686 port via Wine.
+# - `wine64`: Installs and launches standalone Windows x86-64 port via Wine.
#
arch=i686
View
2  src/client/BuildInfo.hh
@@ -25,6 +25,8 @@
#pragma once
+#include <client/common.hh>
+
namespace oz
{
View
1  src/client/Network.cc
@@ -58,7 +58,6 @@ void Network::disconnect()
void Network::update()
{}
-
void Network::init()
{
// SDLNet_Init();
View
1  src/ozCore/Log.cc
@@ -534,7 +534,6 @@ const Log& Log::operator << (const InputStream& is) const
return *this;
}
-
const Log& Log::operator << (const Buffer& buffer) const
{
OZ_PRINT_BOTH({
View
12 src/ozEngine/Lua.cc
@@ -269,18 +269,6 @@ void Lua::loadDir(const File& dir) const
}
}
-bool Lua::exec(const char* code) const
-{
- lua_settop(l, 0);
-
- if (luaL_dostring(l, code) != 0) {
- Log::println("%s", lua_tostring(l, -1));
- System::bell();
- return false;
- }
- return true;
-}
-
void Lua::init()
{
l = luaL_newstate();
View
8 src/ozEngine/Lua.hh
@@ -36,6 +36,12 @@ struct lua_State;
namespace oz
{
+/**
+ * %Lua VM wrapper/base class.
+ *
+ * It provides common functionality for %Lua VMs, like (de)serialisation of variables to (from)
+ * binary streams or JSON files, registering scripting API function and constants etc.
+ */
class Lua
{
public:
@@ -80,8 +86,6 @@ public:
*/
void loadDir(const File& dir) const;
- bool exec(const char* code) const;
-
/**
* Common initialisation for Lua classes.
*/
View
2  src/tools/ozGettext.cc
@@ -285,7 +285,7 @@ static void readNirvana(const File& dir)
static void readCredits(const File& file)
{
if (file.type() != File::REGULAR) {
- OZ_ERROR("Failed to read '%s'", file.path().cstr());
+ return;
}
Buffer buffer = file.read();
Please sign in to comment.
Something went wrong with that request. Please try again.