Removed debug spam, fixed issue in libstlport - seems that it cannot be linked dynamically because

it has some export symbols with length bigger than 128, and app hangs when trying to access them.
Fortunately libstlport has MIT-like license, so it can be linked to closed-source apps statically.
This commit is contained in:
pelya
2010-05-13 14:54:11 +03:00
parent 94df8e2921
commit 5cfa74a057
8 changed files with 28 additions and 76 deletions

View File

@@ -20,12 +20,8 @@
#ifndef _AS_STRING_H_
#define _AS_STRING_H_
//#include <sstream>
#include <stdio.h>
#include <sstream>
// TODO: why the hell this function deadlocks? Is ostringstream illegal in Android? And why did it work earlier?
/*
template<typename T> std::string asString(const T& obj) {
std::ostringstream t;
@@ -33,18 +29,5 @@ template<typename T> std::string asString(const T& obj) {
std::string res(t.str());
return res;
}
*/
static inline std::string asString(int obj) {
char t[64];
sprintf(t, "%i", obj);
return std::string (t);
}
static inline std::string asString(unsigned int obj) {
char t[64];
sprintf(t, "%u", obj);
return std::string (t);
}
#endif

View File

@@ -74,37 +74,27 @@ int difficultyLevel;
float actBackgroundPos;
Game::Game() {
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 0");
videoserver = new Video();
screen = 0;
screen = videoserver->init();
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 1");
settings = new Settings();
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 11");
intro = new Intro( screen );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 12");
setDifficulty = new SetDifficulty( screen );
menuArcadeMode = new MenuArcadeMode( screen );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 13");
pauseSprite = surfaceDB.loadSurface( FN_PAUSED );
youLoseSprite = surfaceDB.loadSurface( FN_YOU_LOSE );
youWinSprite = surfaceDB.loadSurface( FN_YOU_WIN );
// for arcadeMode
gameOverSprite = surfaceDB.loadSurface( FN_GAME_OVER );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 14");
nukeEffectSurface = surfaceDB.loadSurface( FN_NUKE_EFFECT );
bossAlarm = Mixer::mixer().loadSample( FN_SOUND_BOSS_ALARM, 60 );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 15");
fontTime = new Font( FN_FONT_NUMBERS_TIME );
fontSizeTime = fontTime->getCharWidth();
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 16");
racers = 0;
explosions = 0;
enemys = 0;
@@ -138,8 +128,6 @@ Game::Game() {
background = new Background();
loadLevel( FN_LEVEL_ONE_PLAYER );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 2");
SDL_Surface *loadingSprite = surfaceDB.loadSurface( FN_LOADING );
SDL_Rect dest;
dest.x = (SCREEN_WIDTH - loadingSprite->w ) / 2;
@@ -148,9 +136,7 @@ Game::Game() {
dest.h = loadingSprite->h;
SDL_BlitSurface( loadingSprite, 0, screen, &dest );
SDL_Flip( screen );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() 3");
initAllSurfaces();
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Game::Game() done");
}
Game::~Game(){

View File

@@ -46,8 +46,6 @@ Intro::~Intro() {}
void Intro::run( GameStates &gameState ) {
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Intro::run()");
if ( playMusicOn && Mixer::mixer().whichMusicPlaying() != MUSIC_INTRO ) {
Mixer::mixer().playMusic( MUSIC_INTRO, -1, 1000 );
}

View File

@@ -39,26 +39,18 @@ Settings *settings;
Settings::Settings() {
opfile = NULL;
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() 0");
introSprite = surfaceDB.loadSurface( FN_ALIENBLASTER_INTRO );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() 1");
activeChoiceSprite = surfaceDB.loadSurface( FN_INTRO_SHOW_CHOICE );
bluePlain = surfaceDB.loadSurface( FN_SETTINGS_BLUE, true );
whitePlain = surfaceDB.loadSurface( FN_SETTINGS_WHITE, false );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() 2");
fontMenu = new Font ( FN_FONT_SETTINGS );
fontMenuHighlighted = new Font ( FN_FONT_SETTINGS_HIGHLIGHTED );
fontNormal = new Font( FN_FONT_SETTINGS_SMALL );
fontKey = new Font ( FN_FONT_SETTINGS_SMALL_BLUE );
fontHighlighted = new Font( FN_FONT_SETTINGS_SMALL_HIGHLIGHTED );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() 3");
playerEventNames[ PE_UNKNOWN ] = "UNKNOWN";
playerEventNames[ PE_UP ] = "UP";
playerEventNames[ PE_DOWN ] = "DOWN";
@@ -87,16 +79,10 @@ Settings::Settings() {
defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_FIRE_WEAPONS ] ] = SDLK_LCTRL;
defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_FIRE_SPECIALS ] ] = SDLK_LALT;
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() 4");
setKeyNames();
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() 5");
loadSettings();
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::Settings() done");
}
@@ -114,33 +100,24 @@ void Settings::loadSettings() {
if (opfile) {
delete opfile;
}
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 1");
opfile = new Options( FN_SETTINGS );
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 2");
playerKeys.clear();
for(int i=0; i < MAX_PLAYER_CNT; ++i) {
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 21: %d", i);
PlayerEventKeys pk;
for(int t=1; t < PlayerEventCnt; ++t) {
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 22: %d %d", i, t);
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 221: %d %d str %s", i, t, asString(i).c_str());
int key;
string keyname = string("PLAYER") + asString(i) + "-" + playerEventNames[(PlayerEvent)t];
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 23: %d %d", i, t);
if (!opfile->getInt( keyname , key)) {
key = defaultSettings[ keyname ];
restoredSettings = true;
}
pk[ (PlayerEvent)t ] = (SDLKey)key;
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 24: %d %d", i, t);
}
playerKeys.push_back(pk);
}
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() 3");
if (restoredSettings) {
saveSettings();
}
__android_log_print(ANDROID_LOG_VERBOSE, "alienblaster", "Settings::loadSettings() done");
}
void Settings::saveSettings() {