Permalink
Browse files

OSS bell, misc fixes

- ozCore
  * OSS bell, enabled instead of ALSA on non-Linux-based Unices
- ozDynamics
 * working ODE
-glsl
  * fog fixed on low detail
- README, .spec & PKGBUILD updates
  • Loading branch information...
1 parent 5b0f9f9 commit 63eb7c2acaffe84bb3083e03ffdcdf8debb4bdca @ducakar committed Nov 23, 2012
View
@@ -82,9 +82,6 @@ elseif( NACL )
link_directories( ${PLATFORM_PORTS_PREFIX}/usr/lib )
endif()
-# Local libmad, faad and eSpeak headers.
-include_directories( SYSTEM ./include )
-
find_package( PhysFS REQUIRED )
mark_as_advanced( PHYSFS_INCLUDE_DIR )
mark_as_advanced( PHYSFS_LIBRARY )
@@ -96,7 +93,7 @@ endif()
if( OZ_LUAJIT )
pkg_check_modules( LUAJIT REQUIRED luajit )
- include_directories( SYSTEM ${LUAJIT_INCLUDE_DIR} )
+ include_directories( SYSTEM ${LUAJIT_INCLUDE_DIRS} )
else()
find_package( Lua51 REQUIRED )
endif()
@@ -105,7 +102,7 @@ if( OZ_SDL2 )
pkg_check_modules( SDL2 REQUIRED sdl2 )
pkg_check_modules( SDL2_TTF REQUIRED SDL2_ttf )
- include_directories( SYSTEM ${SDL2_INCLUDE_DIR} )
+ include_directories( SYSTEM ${SDL2_INCLUDE_DIRS} )
else()
find_package( SDL REQUIRED )
find_package( SDL_ttf REQUIRED )
@@ -119,7 +116,7 @@ endif()
if( OZ_GL_ES )
# On embedded platform GLES is part of system libraries and is guaranteed to exist in toolchain or
- # platform directory, no need to explicitly check existence or detect library names.
+ # platform directory, no need to explicitly check existence or to detect library names.
if( NOT PLATFORM_EMBEDDED )
pkg_check_modules( GLES2 REQUIRED gles2 )
endif()
@@ -136,7 +133,7 @@ if( PLATFORM_EMBEDDED )
pkg_check_modules( VORBIS REQUIRED vorbis ) # required by vorbisfile
pkg_check_modules( OGG REQUIRED ogg ) # required by vorbisfile
find_package( Freetype REQUIRED ) # required by SDL_ttf
- find_package( ZLIB ) # required by PhysicsFS & FreeType
+ find_package( ZLIB REQUIRED ) # required by PhysicsFS & FreeType
endif()
if( NOT PLATFORM_EMBEDDED )
@@ -163,9 +160,14 @@ mark_as_advanced( MINGW32_LIBRARY )
# Compiler flags
#
+# Local libmad, faad and eSpeak headers.
+include_directories( SYSTEM ./include )
+
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang )
set( flags "-std=c++11 -pedantic" )
+ # Use libc++ instead of libstdc++.
+ # set( flags "${flags} -stdlib=libc++" )
# AddressSanitizer memory checker
# set( flags "${flags} -faddress-sanitizer" )
elseif( ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.5 )
View
@@ -11,7 +11,7 @@
* new Mat33 class
* SIMD support in linear algebra classes
* new SpinLock class
- * PulseAudio replaced with ALSA for System::bell()
+ * ALSA and OSS back-ends for System::bell()
* linear algebra classes added as primitives to streams, Log and JSON
- ozDynamics
* collision
View
@@ -10,15 +10,16 @@ This README file is intended for developers only. See `doc/README.html` if you a
Building
--------
-Building is currently supported under Linux. You can build Linux, Windows (MinGW) and Native Client
-ports. Android port in still under development.
+Building is currently supported under Linux. You can build Linux/Unix, Windows (MinGW) and Native
+Client ports. Android port in still under development.
For generic Linux builds, make sure you have all the dependencies installed. You need to install
development packages for the following libraries:
-- libpulse
-- ALSA
+- ALSA (Linux only)
+- libpulse (Linux/Unix only)
- PhysicsFS 2.0 or 2.1
+- ODE (optional)
- Lua 5.1 or 5.2 or LuaJIT 2.0
- SDL 1.2 or 2.0
- SDL_ttf
@@ -28,11 +29,6 @@ development packages for the following libraries:
- FreeImage
- libsquish (optional)
-If you don't have libmad, faad and eSpeak on your system, you can use headers located in `include`
-subdirectory. Those are automatically used on Android, NaCl and Windows, overriding any of those
-headers found on the system. On Linux one may add "`-I./include`" to `CMAKE_CXXFLAGS` for the same
-effect.
-
You can then use generic steps for building CMake projects:
mkdir build
@@ -55,11 +51,6 @@ MinGW32 is searched in `/usr/i486-mingw32` by default. You may change that in
You may also want to set several options when configuring CMake build system:
-- `OZ_SHARED_LIBS`: Build liboz (OpenZone Core Library plus OpenZone Dynamics Library) as a shared
- library. This is useful if one wants to put liboz into a separate Linux package so other programs
- can use it too.
- `OFF` by default, forced to `OFF` on Android and NaCl.
-
- `OZ_TRACK_ALLOCS`: Enable tracking of allocated memory chunks in liboz. Stack trace for every
memory allocation performed via new operator is saved for later diagnostics. It detects new/delete
mismatches and one can check for currently allocated memory chunks (and hence memory leaks).
@@ -71,6 +62,10 @@ You may also want to set several options when configuring CMake build system:
vector components in OpenZone code.
`OFF` by default.
+- `OZ_ODE`: Compile with Open Dynamics Engine. Without this option ozDynamics builds only partially,
+ without physics support.
+ `OFF` by default.
+
- `OZ_LUAJIT`: Use LuaJIT instead of official Lua library. Lua scripts execute significantly faster.
`OFF` by default.
View
@@ -41,7 +41,3 @@ CURRENT
- unittest
* write missing tests
- documentation
-
-2.0
-
-- ozdynamics
@@ -7,7 +7,7 @@ set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-i686" )
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
-set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/${PLATFORM_TRIPLET}" )
+set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/x86_64-nacl" )
set( CMAKE_C_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-gcc" )
set( CMAKE_CXX_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-g++" )
set( CMAKE_C_FLAGS "-msse3 -mfpmath=sse" CACHE STRING "" )
@@ -7,7 +7,7 @@ set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-x86_64" )
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
-set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/${PLATFORM_TRIPLET}" )
+set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/x86_64-nacl" )
set( CMAKE_C_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-gcc" )
set( CMAKE_CXX_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-g++" )
set( CMAKE_C_FLAGS "-msse3" CACHE STRING "" )
@@ -32,7 +32,7 @@ void main()
vec3 normal = normalize( exNormal );
#ifdef OZ_LOW_DETAIL
- float dist = gl_FragCoord.w / gl_FragCoord.z;
+ float dist = 1.0 / gl_FragCoord.w;
#else
vec3 toCamera = oz_CameraPosition - exPosition;
float dist = length( toCamera );
@@ -34,7 +34,7 @@ void main()
vec3 normal = normalize( exNormal );
#ifdef OZ_LOW_DETAIL
- float dist = gl_FragCoord.w / gl_FragCoord.z;
+ float dist = 1.0 / gl_FragCoord.w;
#else
vec3 toCamera = oz_CameraPosition - exPosition;
float dist = length( toCamera );
@@ -32,7 +32,7 @@ void main()
vec3 normal = normalize( exNormal );
#ifdef OZ_LOW_DETAIL
- float dist = gl_FragCoord.w / gl_FragCoord.z;
+ float dist = 1.0 / gl_FragCoord.w;
#else
vec3 toCamera = oz_CameraPosition - exPosition;
float dist = length( toCamera );
@@ -34,7 +34,7 @@ void main()
vec3 normal = normalize( exNormal );
#ifdef OZ_LOW_DETAIL
- float dist = gl_FragCoord.w / gl_FragCoord.z;
+ float dist = 1.0 / gl_FragCoord.w;
#else
vec3 toCamera = oz_CameraPosition - exPosition;
float dist = length( toCamera );
View
@@ -432,7 +432,7 @@ <h1 class="centre">OpenZone</h1>
</td>
</tr>
<tr>
- <th>dir.music [string] ""</th>
+ <th>dir.music [string] "<a href="#dirs">&lt;music&gt;</a>/OpenZone"</th>
</tr>
<tr>
<td>
@@ -693,6 +693,30 @@ <h1 class="centre">OpenZone</h1>
</tr>
</table>
+<h4>Imenik &lt;music&gt;</h4>
+<table>
+ <tr>
+ <th>Platforma</th>
+ <th>Natančna pot</th>
+ <th>Običajna pot</th>
+ </tr>
+ <tr>
+ <td>Linux</td>
+ <td>$XDG_MUSIC_DIR/OpenZone</td>
+ <td>~/Music/OpenZone</td>
+ </tr>
+ <tr>
+ <td>Windows XP</td>
+ <td>%MYMUSIC%\OpenZone</td>
+ <td>C:\Documents and Settings\&lt;uporabniško_ime&gt;\My Music\OpenZone</td>
+ </tr>
+ <tr>
+ <td>Windows 7</td>
+ <td>%MYMUSIC%\OpenZone</td>
+ <td>C:\Users\&lt;uporabniško_ime&gt;\Music\OpenZone</td>
+ </tr>
+</table>
+
<h2><a name="vfs" href="#">Navidezni datotečni sistem</a></h2>
<p>
Podatki za igro se preberejo iz notranjega navideznega datotečnega sistema, ki je unija naslednjih
View
@@ -430,7 +430,7 @@ <h1 class="centre">OpenZone</h1>
</td>
</tr>
<tr>
- <th>dir.music [string] ""</th>
+ <th>dir.music [string] "<a href="#dirs">&lt;music&gt;</a>/OpenZone"</th>
</tr>
<tr>
<td>
@@ -691,6 +691,30 @@ <h1 class="centre">OpenZone</h1>
</tr>
</table>
+<h4>&lt;music&gt; directory</h4>
+<table>
+ <tr>
+ <th>Platform</th>
+ <th>Exact location</th>
+ <th>Typical location</th>
+ </tr>
+ <tr>
+ <td>Linux</td>
+ <td>$XDG_MUSIC_DIR/OpenZone</td>
+ <td>~/Music/OpenZone</td>
+ </tr>
+ <tr>
+ <td>Windows XP</td>
+ <td>%MYMUSIC%\OpenZone</td>
+ <td>C:\Documents and Settings\&lt;username&gt;\My Music\OpenZone</td>
+ </tr>
+ <tr>
+ <td>Windows 7</td>
+ <td>%MYMUSIC%\OpenZone</td>
+ <td>C:\Users\&lt;username&gt;\Music\OpenZone</td>
+ </tr>
+</table>
+
<h2><a name="vfs" href="#">Virtual Filesystem</a></h2>
<p>
Game data are read from internal virtual filesystem that is a union of the following locations:
View
@@ -7,14 +7,14 @@ pkgrel=1
url="http://ducakar.github.com/openzone/"
license=('GPL3')
arch=('i686' 'x86_64')
-makedepends=('cmake' 'freeimage' 'git' 'libpulse' 'luajit' 'mesa' 'openal' 'physfs' 'sdl_ttf')
-source=("https://github.com/downloads/ducakar/openzone/openzone-src-$pkgver.tar.xz"
- "https://github.com/downloads/ducakar/openzone/openzone-data-$pkgver.tar.xz")
+makedepends=('cmake' 'freeimage' 'libpulse' 'luajit' 'mesa' 'openal' 'physfs' 'sdl_ttf' 'libsquish')
+source=("https://github.com/downloads/ducakar/openzone/${pkgbase}-src-${pkgver}.tar.xz"
+ "https://github.com/downloads/ducakar/openzone/${pkgbase}-data-${pkgver}.tar.xz")
sha1sums=()
build()
{
- cd "$srcdir/$pkgbase-$pkgver/build"
+ cd "${srcdir}/${pkgbase}-${pkgver}/build"
cmake \
-D CMAKE_BUILD_TYPE=Release \
@@ -31,15 +31,15 @@ package_liboz()
{
pkgdesc='OpenZone Core and Dynamics libraries'
license=('ZLIB')
- depends=('libpulse' 'physfs' 'ode-sp')
+ depends=('libpulse' 'physfs')
- cd "$srcdir/$pkgbase-$pkgver"
+ cd "${srcdir}/${pkgbase}-${pkgver}"
- ( cd build && make install DESTDIR="$pkgdir" )
+ ( cd build && make install DESTDIR="${pkgdir}" )
- rm -rf "$pkgdir/usr/"{bin,share}
+ rm -rf "${pkgdir}"/usr/{bin,share}
- install -Dm644 "src/ozCore/COPYING" "$pkgdir/usr/share/licenses/liboz/COPYING"
+ install -Dm644 "src/ozCore/COPYING" "${pkgdir}/usr/share/licenses/liboz/COPYING"
}
package_openzone()
@@ -53,15 +53,15 @@ package_openzone()
'zip: building ZIP game data archives'
'p7zip: building 7zip game data archives')
- cd "$srcdir/$pkgbase-$pkgver"
+ cd "${srcdir}/${pkgbase}-${pkgver}"
- ( cd build && make install DESTDIR="$pkgdir" )
+ ( cd build && make install DESTDIR="${pkgdir}" )
- rm -rf "$pkgdir/usr/"{lib,include,share/doc}
+ rm -rf "${pkgdir}/usr/"{lib,include,share/doc}
- install -dm755 "$pkgdir/usr/share/doc/openzone/licences"
- install -m644 AUTHORS README.md ChangeLog.md doc/*.html "$pkgdir/usr/share/doc/openzone"
- install -m644 doc/licences/* "$pkgdir/usr/share/doc/openzone/licences"
+ install -dm755 "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}/licences"
+ install -m644 doc/*.html "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}"
+ install -m644 doc/licences/* "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}/licences"
}
package_openzone-data()
@@ -70,8 +70,8 @@ package_openzone-data()
license=('custom')
arch=('any')
- cd "$srcdir/$pkgbase-$pkgver"
+ cd "${srcdir}/${pkgbase}-${pkgver}"
- install -dm755 "$pkgdir/usr/share/openzone"
- install -m644 "share/openzone/"*.zip "$pkgdir/usr/share/openzone"
+ install -dm755 "${pkgdir}/usr/share/openzone"
+ install -m644 "share/openzone/"*.zip "${pkgdir}/usr/share/openzone"
}
View
@@ -0,0 +1,51 @@
+# Maintainer: Davorin Učakar <davorin.ucakar@gmail.com>
+
+pkgname=openzone
+pkgver=0.3.81
+pkgrel=1
+pkgdesc='Simple cross-platform FPS/RTS game engine'
+url="http://ducakar.github.com/openzone/"
+license=('GPL3' 'ZLIB')
+arch=('i686' 'x86_64')
+depends=('libpulse' 'physfs' 'freeimage' 'libgl' 'luajit' 'openal' 'sdl_ttf')
+optdepends=('openzone-data: game data'
+ 'espeak: speech synthesis'
+ 'libmad: MP3 playing'
+ 'faad2: AAC playing'
+ 'zip: building ZIP game data archives'
+ 'p7zip: building 7zip game data archives')
+makedepends=('cmake' 'freeimage' 'libpulse' 'luajit' 'mesa' 'openal' 'physfs' 'sdl_ttf' 'libsquish')
+source=("https://github.com/downloads/ducakar/openzone/${pkgname}-src-${pkgver}.tar.xz"
+ "https://github.com/downloads/ducakar/openzone/${pkgname}-data-${pkgver}.tar.xz")
+sha1sums=()
+
+build()
+{
+ cd "${srcdir}/${pkgbase}-${pkgver}/build"
+
+ cmake \
+ -D CMAKE_BUILD_TYPE=Release \
+ -D CMAKE_INSTALL_PREFIX=/usr \
+ -D CMAKE_CXX_FLAGS="$CXXFLAGS -msse3 -mfpmath=sse" \
+ -D OZ_LUAJIT=1 \
+ -D OZ_NONFREE=1 \
+ ..
+
+ make
+}
+
+package()
+{
+ cd "${srcdir}/${pkgbase}-${pkgver}"
+
+ ( cd build && make install DESTDIR="${pkgdir}" )
+
+ install -Dm644 "src/ozCore/COPYING" "${pkgdir}/usr/share/licenses/openzone/COPYING.liboz"
+
+ install -dm755 "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}/licences"
+ install -m644 doc/*.html "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}"
+ install -m644 doc/licences/* "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}/licences"
+
+ install -dm755 "${pkgdir}/usr/share/openzone"
+ install -m644 "share/openzone/"*.zip "${pkgdir}/usr/share/openzone"
+}
Oops, something went wrong. Retry.

0 comments on commit 63eb7c2

Please sign in to comment.