Permalink
Browse files

UI layouts finished, next track works

- ui
  * Area::align() calculates global (x, y)
  * layout settings finished
  * MusicPlayer: auto next track fixed
- client
  * VehicleAudio fixed
  * Sound: track can be restarted
  • Loading branch information...
1 parent 63eb7c2 commit 706481d0604514fc3c1373b255d94b25526373ad @ducakar committed Nov 25, 2012
View
@@ -118,7 +118,7 @@ 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 to detect library names.
if( NOT PLATFORM_EMBEDDED )
- pkg_check_modules( GLES2 REQUIRED gles2 )
+ pkg_check_modules( GLES2 REQUIRED glesv2 )
endif()
else()
find_package( OpenGL REQUIRED )
@@ -169,7 +169,7 @@ if( ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang )
# Use libc++ instead of libstdc++.
# set( flags "${flags} -stdlib=libc++" )
# AddressSanitizer memory checker
- # set( flags "${flags} -faddress-sanitizer" )
+ # set( flags "${flags} -fsanitize=address" )
elseif( ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.5 )
set( flags "-pipe -std=gnu++0x" )
elseif( ANDROID )
View
@@ -2,9 +2,10 @@
- ozCore
* null replaced by nullptr keyword
+ * global abs(), min(), max(), clamp() and hash() functions, overloaded where necessary
* container improvements
+ improved iterators: much less code duplication, no more key() and value() members
- + STL-like begin() and end() members for containers
+ + STL-like begin() and end() members on containers
+ new Set template class: Map with arbitrary elements instead of key-value pairs
+ HashIndex and HashString merged into new HashMap template class with an arbitrary key type
+ new HashSet template class: hashtable of key-only elements instead of key-value pairs
View
@@ -361,7 +361,7 @@ <h1 class="centre">OpenZone</h1>
<tr>
<th>-v</th>
<td>
- Zgovornejši dnevnik.
+ Izpisuj podrobna dnevniška sporočila na terminal.
</td>
</tr>
<tr>
@@ -386,8 +386,8 @@ <h1 class="centre">OpenZone</h1>
<tr>
<th>-L &lt;jezik&gt;</th>
<td>
- Nastavi jezik »&lt;jezik&gt;. Mora sovpadati s podimenikom imenika »lingua/« v podatkovnih
- arhivih.
+ Nastavi jezik »&lt;jezik&gt;. Mora sovpadati s imenom podimenika v imeniku »lingua/« v
+ podatkovnih arhivih.
</td>
</tr>
<tr>
View
@@ -361,13 +361,13 @@ <h1 class="centre">OpenZone</h1>
<tr>
<th>-v</th>
<td>
- More verbose log output.
+ Print verbose log messages to terminal.
</td>
</tr>
<tr>
<th>-l</th>
<td>
- Skip main menu and load the last autosaved state.
+ Skip main menu and load the last autosaved game.
</td>
</tr>
<tr>
@@ -386,7 +386,8 @@ <h1 class="centre">OpenZone</h1>
<tr>
<th>-L &lt;lang&gt;</th>
<td>
- Use language &lt;lang&gt;. Should match a subdirectory of 'lingua/' directory in game data.
+ Use language &lt;lang&gt;. Should match a subdirectory name in 'lingua/' directory inside game
+ data archives.
</td>
</tr>
<tr>
View
@@ -17,9 +17,10 @@ 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 CMAKE_BUILD_TYPE=Release \
+ -D CMAKE_CXX_FLAGS="${CXXFLAGS/-O2} -msse3 -mfpmath=sse" \
+ -D CMAKE_CXX_FLAGS_RELEASE="-Ofast -flto" \
-D OZ_LUAJIT=1 \
-D OZ_NONFREE=1 \
..
View
@@ -69,10 +69,10 @@ Game data for OpenZone. Includes tutorial, test world and cviček mission.
cd build
cmake \
- -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr \
- -D CMAKE_C_FLAGS="-msse3 -mfpmath=sse" \
+ -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS="-msse3 -mfpmath=sse" \
+ -D CMAKE_CXX_FLAGS_RELEASE="-Ofast -flto" \
..
make %{?_smp_mflags}
View
@@ -20,7 +20,7 @@ for i in share/openzone/*.{7z,zip} share/openzone/packages.ozManifest \
build/NaCl-*/src/tools/openzone.*.nexe etc/nacl/openzone.nmf \
etc/nacl/openzone.??.html doc
do
- [[ -e $i ]] && ln -sf $i build/NaCl-test
+ [[ -e $i ]] && ln -sf ../../$i build/NaCl-test
done
# Strip binaries if "strip" parameter given.
View
@@ -41,11 +41,6 @@ void Audio::playSound( int sound, float volume, const Object* parent ) const
{
hard_assert( uint( sound ) < uint( liber.sounds.length() ) );
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( sound );
- static_cast<void>( volume );
- static_cast<void>( parent );
-#else
const Dynamic* dynParent = static_cast<const Dynamic*>( parent );
uint srcId = context.addSource( sound );
@@ -80,18 +75,12 @@ void Audio::playSound( int sound, float volume, const Object* parent ) const
alSourcePlay( srcId );
OZ_AL_CHECK_ERROR();
-#endif
}
void Audio::playContSound( int sound, float volume, const Object* parent ) const
{
hard_assert( uint( sound ) < uint( liber.sounds.length() ) );
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( sound );
- static_cast<void>( volume );
- static_cast<void>( parent );
-#else
int key = obj->index * ObjectClass::MAX_SOUNDS + sound;
Context::ContSource* contSource = context.contSources.find( key );
@@ -128,16 +117,10 @@ void Audio::playContSound( int sound, float volume, const Object* parent ) const
}
OZ_AL_CHECK_ERROR();
-#endif
}
bool Audio::playSpeak( const char* text, float volume, const Object* parent ) const
{
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( text );
- static_cast<void>( volume );
- static_cast<void>( parent );
-#else
const Dynamic* dynParent = static_cast<const Dynamic*>( parent );
if( context.speakSource.owner < 0 ) {
@@ -169,7 +152,6 @@ bool Audio::playSpeak( const char* text, float volume, const Object* parent ) co
}
OZ_AL_CHECK_ERROR();
-#endif
return true;
}
@@ -179,11 +161,6 @@ void Audio::playEngineSound( int sound, float volume, float pitch ) const
hard_assert( uint( sound ) < uint( liber.sounds.length() ) );
hard_assert( obj->flags & Object::VEHICLE_BIT );
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( sound );
- static_cast<void>( volume );
- static_cast<void>( pitch );
-#else
const Vehicle* veh = static_cast<const Vehicle*>( obj );
if( !camera.isExternal && veh->pilot >= 0 && veh->pilot == camera.bot ) {
@@ -224,13 +201,11 @@ void Audio::playEngineSound( int sound, float volume, float pitch ) const
}
OZ_AL_CHECK_ERROR();
-#endif
}
Audio::Audio( const Object* obj_ ) :
obj( obj_ ), clazz( obj_->clazz ), flags( 0 )
{
-#ifndef OZ_ADDRESS_SANITIZER
const int* sounds = clazz->audioSounds;
Log::verboseMode = true;
@@ -244,12 +219,10 @@ Audio::Audio( const Object* obj_ ) :
Log::verboseMode = false;
OZ_AL_CHECK_ERROR();
-#endif
}
Audio::~Audio()
{
-#ifndef OZ_ADDRESS_SANITIZER
const int* sounds = clazz->audioSounds;
Log::verboseMode = true;
@@ -263,7 +236,6 @@ Audio::~Audio()
Log::verboseMode = false;
OZ_AL_CHECK_ERROR();
-#endif
}
}
View
@@ -36,10 +36,6 @@ void BSPAudio::playDemolish( const Struct* str, int sound ) const
{
hard_assert( uint( sound ) < uint( liber.sounds.length() ) );
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( str );
- static_cast<void>( sound );
-#else
uint srcId = context.addSource( sound );
if( srcId == Context::INVALID_SOURCE ) {
return;
@@ -53,17 +49,12 @@ void BSPAudio::playDemolish( const Struct* str, int sound ) const
alSourcePlay( srcId );
OZ_AL_CHECK_ERROR();
-#endif
}
void BSPAudio::playSound( const Entity* entity, int sound ) const
{
hard_assert( uint( sound ) < uint( liber.sounds.length() ) );
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( entity );
- static_cast<void>( sound );
-#else
const Struct* str = entity->str;
Point p = str->toAbsoluteCS( entity->clazz->p() + entity->offset );
Vec3 velocity = str->toAbsoluteCS( entity->velocity );
@@ -82,17 +73,12 @@ void BSPAudio::playSound( const Entity* entity, int sound ) const
alSourcePlay( srcId );
OZ_AL_CHECK_ERROR();
-#endif
}
void BSPAudio::playContSound( const Entity* entity, int sound ) const
{
hard_assert( uint( sound ) < uint( liber.sounds.length() ) );
-#ifdef OZ_ADDRESS_SANITIZER
- static_cast<void>( entity );
- static_cast<void>( sound );
-#else
const Struct* str = entity->str;
int key = str->index * Struct::MAX_ENTITIES +
int( entity - str->entities.begin() );
@@ -122,26 +108,21 @@ void BSPAudio::playContSound( const Entity* entity, int sound ) const
}
OZ_AL_CHECK_ERROR();
-#endif
}
BSPAudio::BSPAudio( const matrix::BSP* bsp_ ) :
bsp( bsp_ )
{
-#ifndef OZ_ADDRESS_SANITIZER
foreach( i, bsp->sounds.citer() ) {
context.requestSound( *i );
}
-#endif
}
BSPAudio::~BSPAudio()
{
-#ifndef OZ_ADDRESS_SANITIZER
foreach( i, bsp->sounds.citer() ) {
context.releaseSound( *i );
}
-#endif
}
void BSPAudio::play( const Struct* str ) const
View
@@ -46,7 +46,7 @@ Audio* BasicAudio::create( const Object* obj )
void BasicAudio::play( const Audio* parent )
{
- const int ( & sounds )[ObjectClass::MAX_SOUNDS] = obj->clazz->audioSounds;
+ const auto& sounds = obj->clazz->audioSounds;
for( int i = 0; i < ObjectClass::MAX_SOUNDS; ++i ) {
recent[i] = max( recent[i] - 1, 0 );
View
@@ -112,7 +112,7 @@ void BotAudio::play( const Audio* parent )
prevStep = 0;
}
-// if( bot->clazz->name.equals( "bauul" ) ) {
+ if( bot->clazz->name.equals( "bauul" ) ) {
// playSpeak( "Gil-galad was an Elven-king.\n"
// "Of him the harpers sadly sing:\n"
// "the last whose realm was fair and free\n"
@@ -128,8 +128,8 @@ void BotAudio::play( const Audio* parent )
// "for into darkness fell his star\n"
// "in Mordor where the shadows are.\n",
// 1.0f, bot );
-// playSpeak( "Booa-ha-ha-ha-ha!", 1.0f, bot );
-// }
+ playSpeak( "Joj prejoj, kako sem žejen!", 1.0f, bot );
+ }
}
}
@@ -24,7 +24,7 @@ namespace oz
{
#ifdef OZ_MSVC
-static const String COMPILER_STRING = "MSVC " + String::str( "%g", float( OZ_MSVC ) / 100.0f );
+static const String COMPILER_STRING = String::str( "MSVC %g", float( OZ_MSVC ) / 100.0f );
#endif
const char* const BuildInfo::TIME = __DATE__ " " __TIME__;
@@ -34,6 +34,8 @@ const char* const BuildInfo::TARGET_ARCH = "@CMAKE_SYSTEM_NAME@-@CMAKE_SYSTEM_
const char* const BuildInfo::BUILD_TYPE = "@CMAKE_BUILD_TYPE@";
#if defined( OZ_MSVC )
const char* const BuildInfo::COMPILER = COMPILER_STRING;
+#elif defined( OZ_OPEN64 )
+const char* const BuildInfo::COMPILER = "Open64 " __OPEN64__;
#elif defined( OZ_CLANG )
const char* const BuildInfo::COMPILER = "LLVM/Clang " __clang_version__;
#else
@@ -233,7 +233,7 @@ void CinematicProxy::update()
sound.stopMusic();
}
else if( step.track != -1 ) {
- sound.playMusic( step.track, false );
+ sound.playMusic( step.track );
}
if( !step.title.isEmpty() ) {
View
@@ -41,11 +41,10 @@
#include <client/Network.hh>
#include <client/BuildInfo.hh>
-#include <SDL_ttf.h>
-
#include <clocale>
#include <sstream>
#include <unistd.h>
+#include <SDL_ttf.h>
#if defined( __native_client__ )
# include <ppapi/cpp/completion_callback.h>
@@ -62,22 +61,22 @@ namespace client
void Client::printUsage( const char* invocationName )
{
+
Log::printRaw(
"Usage:\n"
" %s [-v] [-l | -i <mission>] [-t <num>] [-L <lang>] [-p <prefix>]\n"
"\n"
- " -v More verbose log output.\n"
- " -l Skip main menu and load the last autosaved state.\n"
+ " -v Print verbose log messages to terminal.\n"
+ " -l Skip main menu and load the last autosaved game.\n"
" -i <mission> Skip main menu and start mission <mission>.\n"
" -t <num> Exit after <num> seconds (can be a floating-point number) and\n"
" use 42 as the random seed. Useful for benchmarking.\n"
- " -L <lang> Use language <lang>. Should match a subdirectory of 'lingua/'\n"
- " directory in game data.\n"
+ " -L <lang> Use language <lang>. Should match a subdirectory name in\n"
+ " 'lingua/' directory inside game data archives.\n"
" -p <prefix> Sets data directory to '<prefix>/share/openzone'.\n"
" Defaults to '%s'.\n"
"\n",
- invocationName,
- OZ_INSTALL_PREFIX );
+ invocationName, OZ_INSTALL_PREFIX );
}
int Client::init( int argc, char** argv )
Oops, something went wrong.

0 comments on commit 706481d

Please sign in to comment.