wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp multiplayer...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp multiplayer...
Date: Mon, 06 Jun 2005 16:12:47 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/06/06 20:12:47

Modified files:
        src            : multiplayer_connect.cpp multiplayer_create.cpp 
                         multiplayer_lobby.cpp multiplayer_ui.cpp 
                         multiplayer_ui.hpp multiplayer_wait.cpp 
                         sound.cpp video.cpp 

Log message:
        * Restored the dialog titles for multiplayer screens (Fixes #13049)
        * Made the --nosound flag circumvent SDL sound initialization (which 
caused
        resources to be opened anyway)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.149&tr2=1.150&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_create.cpp.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_lobby.cpp.diff?tr1=1.74&tr2=1.75&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.cpp.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.hpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_wait.cpp.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sound.cpp.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/video.cpp.diff?tr1=1.68&tr2=1.69&r1=text&r2=text

Patches:
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.149 
wesnoth/src/multiplayer_connect.cpp:1.150
--- wesnoth/src/multiplayer_connect.cpp:1.149   Sun Jun  5 11:15:30 2005
+++ wesnoth/src/multiplayer_connect.cpp Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.149 2005/06/05 11:15:30 silene Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.150 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -476,7 +476,7 @@
 connect::connect(display& disp, const config& game_config, const game_data& 
data,
                chat& c, config& gamelist, const create::parameters& params,
                mp::controller default_controller) :
-       mp::ui(disp, game_config, c, gamelist),
+       mp::ui(disp, _("Game Lobby"), game_config, c, gamelist),
 
        game_data_(data),
        level_(),
@@ -790,9 +790,6 @@
        waiting_label_.set_location(ai_.location().x + ai_.location().w + 8,
                                    bottom-left_button->height() + 4);
 
-       // Title and labels
-       gui::draw_dialog_title(left,top,&video(),_("Game Lobby"));
-
        type_title_label_.set_location(left+30, top+35);
        faction_title_label_.set_location((left+145), top+35);
        team_title_label_.set_location((left+260), top+35);
Index: wesnoth/src/multiplayer_create.cpp
diff -u wesnoth/src/multiplayer_create.cpp:1.26 
wesnoth/src/multiplayer_create.cpp:1.27
--- wesnoth/src/multiplayer_create.cpp:1.26     Sat Jun  4 19:16:05 2005
+++ wesnoth/src/multiplayer_create.cpp  Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_create.cpp,v 1.26 2005/06/04 19:16:05 ott Exp $ */
+/* $Id: multiplayer_create.cpp,v 1.27 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -31,7 +31,7 @@
 namespace mp {
 
 create::create(display& disp, const config &cfg, chat& c, config& gamelist) :
-       ui(disp, cfg, c, gamelist),
+       ui(disp, _("Create Game"), cfg, c, gamelist),
 
        tooltip_manager_(disp.video()),
        map_selection_(-1),
@@ -383,7 +383,7 @@
        int ypos = ca.y;
 
        // Dialog title
-       ypos += gui::draw_dialog_title(xpos, ypos, &video(), _("Create 
Game")).h + border_size;
+       ypos += title().height() + border_size;
 
        // Name Entry
        name_entry_label_.set_location(xpos, ypos);
Index: wesnoth/src/multiplayer_lobby.cpp
diff -u wesnoth/src/multiplayer_lobby.cpp:1.74 
wesnoth/src/multiplayer_lobby.cpp:1.75
--- wesnoth/src/multiplayer_lobby.cpp:1.74      Sat Jun  4 19:16:05 2005
+++ wesnoth/src/multiplayer_lobby.cpp   Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_lobby.cpp,v 1.74 2005/06/04 19:16:05 ott Exp $ */
+/* $Id: multiplayer_lobby.cpp,v 1.75 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -19,6 +19,7 @@
 #include "wml_separators.hpp"
 #include "game_config.hpp"
 #include "gettext.hpp"
+#include "show_dialog.hpp"
 
 namespace {
 
@@ -101,7 +102,7 @@
 }
 
 lobby::lobby(display& disp, const config& cfg, chat& c, config& gamelist) :
-       mp::ui(disp, cfg, c, gamelist),
+       mp::ui(disp, _("Game Lobby"), cfg, c, gamelist),
 
        observe_game_(disp.video(), _("Observe Game")),
        join_game_(disp.video(), _("Join Game")),
@@ -135,8 +136,9 @@
        create_game_.set_location(observe_game_.location().x + 
observe_game_.location().w + 5,yscale(7));
        quit_game_.set_location(create_game_.location().x + 
create_game_.location().w + 5,yscale(7));
 
-       games_menu_.set_width(xscale(832));
-       games_menu_.set_location(xscale(12),yscale(42));
+       games_menu_.set_location(client_area().x, client_area().y + 
title().height());
+       games_menu_.set_measurements(client_area().w, client_area().h 
+                       - title().height() - gui::ButtonVPadding);
 }
 
 void lobby::gamelist_updated(bool silent)
Index: wesnoth/src/multiplayer_ui.cpp
diff -u wesnoth/src/multiplayer_ui.cpp:1.27 wesnoth/src/multiplayer_ui.cpp:1.28
--- wesnoth/src/multiplayer_ui.cpp:1.27 Sat Jun  4 19:16:05 2005
+++ wesnoth/src/multiplayer_ui.cpp      Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.cpp,v 1.27 2005/06/04 19:16:05 ott Exp $ */
+/* $Id: multiplayer_ui.cpp,v 1.28 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C) 2005
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -147,7 +147,7 @@
        return "<" + message.user + ">" + message.message + "\n";
 }
 
-ui::ui(display& disp, const config& cfg, chat& c, config& gamelist) :
+ui::ui(display& disp, const std::string& title, const config& cfg, chat& c, 
config& gamelist) :
        gui::widget(disp.video()),
        disp_(disp),
        initialized_(false),
@@ -159,6 +159,7 @@
        chat_(c),
        gamelist_(gamelist),
 
+       title_(disp.video(), title, font::SIZE_LARGE, font::TITLE_COLOUR),
        chat_textbox_(disp.video(), 100, "", false),
        entry_textbox_(disp.video(), 100),
        users_menu_(disp.video(), std::vector<std::string>()),
@@ -341,6 +342,7 @@
 
 void ui::hide_children(bool hide)
 {
+       title_.hide(hide);
        chat_textbox_.hide(hide);
        entry_textbox_.hide(hide);
        users_menu_.hide(hide);
@@ -348,6 +350,7 @@
 
 void ui::layout_children(const SDL_Rect& rect)
 {
+       title_.set_location(xscale(11)+4, xscale(42) + 4);
        users_menu_.set_width(xscale(159));
        users_menu_.set_location(xscale(856), yscale(42));
        users_menu_.set_height(yscale(715));
@@ -387,5 +390,11 @@
        users_menu_.set_items(user_list_);
 }
 
+const gui::widget& ui::title() const
+{
+       return title_;
+}
+
+
 }
 
Index: wesnoth/src/multiplayer_ui.hpp
diff -u wesnoth/src/multiplayer_ui.hpp:1.10 wesnoth/src/multiplayer_ui.hpp:1.11
--- wesnoth/src/multiplayer_ui.hpp:1.10 Sat Jun  4 19:16:05 2005
+++ wesnoth/src/multiplayer_ui.hpp      Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.hpp,v 1.10 2005/06/04 19:16:05 ott Exp $ */
+/* $Id: multiplayer_ui.hpp,v 1.11 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -17,6 +17,7 @@
 #include "hotkeys.hpp"
 #include "network.hpp"
 #include "preferences.hpp"
+#include "widgets/label.hpp"
 #include "widgets/button.hpp"
 #include "widgets/menu.hpp"
 #include "widgets/textbox.hpp"
@@ -71,7 +72,8 @@
 public:
        enum result { CONTINUE, JOIN, OBSERVE, CREATE, PLAY, QUIT };
 
-       ui(display& d, const config& cfg, chat& c, config& gamelist);
+       ui(display& d, const std::string& title,
+                       const config& cfg, chat& c, config& gamelist);
 
        // Asks the multiplayer_ui to pump some data from the network, and then
        // to process it. The actual processing will be left to the child
@@ -145,6 +147,9 @@
 
        // Returns the current gamelist
        config& gamelist() { return gamelist_; };
+
+       const gui::widget& title() const;
+
 private:
        /** Set to true when the widgets are intialized. Allows delayed
         * initialization on first positioning. */
@@ -163,6 +168,7 @@
 
        config& gamelist_;
 
+       gui::label title_;
        gui::textbox chat_textbox_;
        gui::textbox entry_textbox_;
 
Index: wesnoth/src/multiplayer_wait.cpp
diff -u wesnoth/src/multiplayer_wait.cpp:1.27 
wesnoth/src/multiplayer_wait.cpp:1.28
--- wesnoth/src/multiplayer_wait.cpp:1.27       Sat Jun  4 19:16:05 2005
+++ wesnoth/src/multiplayer_wait.cpp    Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_wait.cpp,v 1.27 2005/06/04 19:16:05 ott Exp $ */
+/* $Id: multiplayer_wait.cpp,v 1.28 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -142,7 +142,7 @@
 }
 
 wait::wait(display& disp, const config& cfg, const game_data& data, mp::chat& 
c, config& gamelist) :
-       ui(disp, cfg, c, gamelist),
+       ui(disp, _("Game Lobby"), cfg, c, gamelist),
 
        cancel_button_(disp.video(), _("Cancel")),
        start_label_(disp.video(), _("Waiting for game to start..."), 
font::SIZE_SMALL, font::LOBBY_COLOUR),
@@ -270,8 +270,9 @@
        const SDL_Rect ca = client_area();
        int y = ca.y + ca.h - cancel_button_.height();
 
-       game_menu_.set_location(ca.x, ca.y);
-       game_menu_.set_measurements(ca.w, y - ca.y - gui::ButtonVPadding);
+       game_menu_.set_location(ca.x, ca.y + title().height());
+       game_menu_.set_measurements(ca.w, y - ca.y - title().height()
+                       - gui::ButtonVPadding);
        cancel_button_.set_location(ca.x + ca.w - cancel_button_.width(), y);
        start_label_.set_location(ca.x, y + 4);
 }
Index: wesnoth/src/sound.cpp
diff -u wesnoth/src/sound.cpp:1.29 wesnoth/src/sound.cpp:1.30
--- wesnoth/src/sound.cpp:1.29  Sat Jun  4 19:16:06 2005
+++ wesnoth/src/sound.cpp       Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: sound.cpp,v 1.29 2005/06/04 19:16:06 ott Exp $ */
+/* $Id: sound.cpp,v 1.30 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -19,6 +19,7 @@
 #include "sound.hpp"
 #include "wesconfig.h"
 
+#include "SDL.h"
 #include "SDL_mixer.h"
 
 #include <iostream>
@@ -45,6 +46,8 @@
                return;
        }
 
+       SDL_Init(SDL_INIT_AUDIO);
+
 //sounds don't sound good on Windows unless the buffer size is 4k,
 //but this seems to cause crashes on other systems...
 #ifdef WIN32
Index: wesnoth/src/video.cpp
diff -u wesnoth/src/video.cpp:1.68 wesnoth/src/video.cpp:1.69
--- wesnoth/src/video.cpp:1.68  Sat Jun  4 20:01:48 2005
+++ wesnoth/src/video.cpp       Mon Jun  6 20:12:47 2005
@@ -1,4 +1,4 @@
-/* $Id: video.cpp,v 1.68 2005/06/04 20:01:48 Sirp Exp $ */
+/* $Id: video.cpp,v 1.69 2005/06/06 20:12:47 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -201,7 +201,7 @@
 }
 CVideo::CVideo() : bpp(0), fake_screen(false), help_string_(0), 
updatesLocked_(0)
 {
-       const int res = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | 
SDL_INIT_NOPARACHUTE);
+       const int res = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
 
        if(res < 0) {
                ERR_DP << "Could not initialize SDL: " << SDL_GetError() << 
"\n";
@@ -212,7 +212,7 @@
 CVideo::CVideo( int x, int y, int bits_per_pixel, int flags)
                 : bpp(0), fake_screen(false), help_string_(0), 
updatesLocked_(0)
 {
-       const int res = SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO | 
SDL_INIT_NOPARACHUTE);
+       const int res = SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
        if(res < 0) {
                ERR_DP << "Could not initialize SDL: " << SDL_GetError() << 
"\n";
                throw CVideo::error();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]