make display work better in OSX
This commit is contained in:
parent
02048139d0
commit
4552a81d53
6 changed files with 9 additions and 7 deletions
|
@ -1324,7 +1324,6 @@ std::vector<SDL_Surface*> display::getAdjacentTerrain(int x, int y,
|
|||
|
||||
const gamemap::TERRAIN current_terrain = map_.on_board(loc) ? map_[x][y]:0;
|
||||
|
||||
std::vector<bool> done(6,true);
|
||||
gamemap::location adjacent[6];
|
||||
get_adjacent_tiles(loc,adjacent);
|
||||
int tiles[6];
|
||||
|
@ -1781,7 +1780,7 @@ bool display::unit_attack_ranged(const gamemap::location& a,
|
|||
++sfx_it;
|
||||
}
|
||||
|
||||
if(hits && !played_hit_sound && i >= play_hit_sound_at) {
|
||||
if(!hide && hits && !played_hit_sound && i >= play_hit_sound_at) {
|
||||
sound::play_sound(hit_sound);
|
||||
played_hit_sound = true;
|
||||
}
|
||||
|
@ -2014,7 +2013,7 @@ bool display::unit_attack(const gamemap::location& a,
|
|||
++sfx_it;
|
||||
}
|
||||
|
||||
if(hits && !played_hit_sound && i >= play_hit_sound_at) {
|
||||
if(!hide && hits && !played_hit_sound && i >= play_hit_sound_at) {
|
||||
sound::play_sound(hit_sound);
|
||||
played_hit_sound = true;
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ void play_multiplayer(display& disp, game_data& units_data, config cfg,
|
|||
log_scope("play multiplayer");
|
||||
|
||||
//ensure we send a close game message to the server when we are done
|
||||
const network_game_manager game_manager = network_game_manager();
|
||||
network_game_manager game_manager;
|
||||
|
||||
std::vector<std::string> options;
|
||||
std::vector<config*>& levels = cfg.children["multiplayer"];
|
||||
|
|
|
@ -259,7 +259,7 @@ void play_multiplayer_client(display& disp, game_data& units_data, config& cfg,
|
|||
}
|
||||
|
||||
//ensure we send a close game message to the server when we are done
|
||||
const network_game_manager game_manager = network_game_manager();
|
||||
network_game_manager game_manager;
|
||||
|
||||
std::map<int,int> choice_map;
|
||||
std::vector<std::string> choices;
|
||||
|
|
|
@ -568,7 +568,7 @@ bool turn_slice(game_data& gameinfo, game_state& state_of_game,
|
|||
for(unit_map::const_iterator i = units.begin();
|
||||
i != units.end(); ++i) {
|
||||
if(i->second.side() != team_num)
|
||||
return false;
|
||||
continue;
|
||||
|
||||
std::stringstream row;
|
||||
row << i->second.name() << "," << i->second.hitpoints()
|
||||
|
|
|
@ -55,6 +55,9 @@ int main()
|
|||
config data;
|
||||
while((sock = network::receive_data(data)) != NULL) {
|
||||
|
||||
std::cerr << "from " << (int)sock << " received: "
|
||||
<< data.write() << "\n-----\n";
|
||||
|
||||
//if someone who is not yet logged in is sending
|
||||
//login details
|
||||
if(not_logged_in.is_member(sock)) {
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace {
|
|||
{
|
||||
//SDL under Windows doesn't seem to like hardware surfaces for
|
||||
//some reason.
|
||||
#ifndef _WIN32
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
flags |= SDL_HWSURFACE | SDL_DOUBLEBUF;
|
||||
#endif
|
||||
if((flags&SDL_FULLSCREEN) == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue