[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netPanzer-CVS] netpanzer/src ChangeLog NetPanzer/Classes/Netwo...
From: |
Matthias Braun |
Subject: |
[netPanzer-CVS] netpanzer/src ChangeLog NetPanzer/Classes/Netwo... |
Date: |
Mon, 15 Sep 2003 17:42:16 -0400 |
CVSROOT: /cvsroot/netpanzer
Module name: netpanzer
Branch:
Changes by: Matthias Braun <address@hidden> 03/09/15 17:42:15
Modified files:
src : ChangeLog
src/NetPanzer/Classes/Network: ClientConnectDaemon.cpp
src/NetPanzer/Interfaces: GameManager.cpp
src/NetPanzer/Interfaces/unix: NetworkClientUnix.cpp
src/NetPanzer/Views/Game: LobbyView.cpp LobbyView.hpp
Log message:
-made lobbyview scrolling topdown
-made the app report connection errors
Patches:
Index: netpanzer/src/ChangeLog
diff -u netpanzer/src/ChangeLog:1.23 netpanzer/src/ChangeLog:1.24
--- netpanzer/src/ChangeLog:1.23 Mon Sep 15 17:22:14 2003
+++ netpanzer/src/ChangeLog Mon Sep 15 17:42:15 2003
@@ -1,6 +1,8 @@
15-Sep-2003 by Matthias Braun
-removed the GetConnectionTypeView menu. We're only using tcp/ip.
-made the Join view working again
+-made lobbyview scrolling topdown
+-made the app report connection errors
14-Sep-2003 by Ivo Danihelka
-converted sdlsound to use physfs, Mix_LoadMUS_RW is not used yet
Index: netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp:1.4
netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp:1.5
--- netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp:1.4 Mon Sep
8 17:25:08 2003
+++ netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp Mon Sep
15 17:42:15 2003
@@ -94,7 +94,7 @@
lobbyView.scrollAndUpdate( "Link to Server FAILED!" );
lobbyView.scrollAndUpdate( "Incorrect Network Protocol Revision" );
lobbyView.scrollAndUpdate( "Please update your netPanzer executable at" );
- lobbyView.scrollAndUpdate( "www.pyrosoftgames.com" );
+ lobbyView.scrollAndUpdate( "www.nongnu.org/netpanzer" );
sprintf( buf, "Server Protocol Version: %d",
join_request_ack_mesg->server_protocol_version);
lobbyView.scrollAndUpdate( buf );
connection_state = _connect_state_connect_failure;
Index: netpanzer/src/NetPanzer/Interfaces/GameManager.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.40
netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.41
--- netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.40 Mon Sep 15
17:22:14 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameManager.cpp Mon Sep 15 17:42:15 2003
@@ -1547,7 +1547,7 @@
// ******************************************************************
void GameManager::joinMultiPlayerGame()
- {
+{
setNetPanzerGameOptions();
//reinitializeGameLogic();
NetworkState::setNetworkStatus( _network_state_client );
@@ -1573,7 +1573,7 @@
ClientConnectDaemon::startConnectionProcess();
sound->playTankIdle();
- }
+}
// ******************************************************************
Index: netpanzer/src/NetPanzer/Interfaces/unix/NetworkClientUnix.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/unix/NetworkClientUnix.cpp:1.7
netpanzer/src/NetPanzer/Interfaces/unix/NetworkClientUnix.cpp:1.8
--- netpanzer/src/NetPanzer/Interfaces/unix/NetworkClientUnix.cpp:1.7 Mon Sep
15 17:22:14 2003
+++ netpanzer/src/NetPanzer/Interfaces/unix/NetworkClientUnix.cpp Mon Sep
15 17:42:15 2003
@@ -22,6 +22,7 @@
#include "Desktop.hpp"
#include "NetworkGlobals.hpp"
#include "NetworkState.hpp"
+#include "LobbyView.hpp"
#include "NetworkClientUnix.hpp"
// #define NETWORKDEBUG
@@ -87,6 +88,9 @@
clientsocket = new ClientSocket(session_name,
_NETPANZER_DEFAULT_PORT_TCP);
} catch(Exception e) {
LOG( ( "Couldn't connect to server:\n%s.", e.getMessage()) );
+ char text[128];
+ snprintf(text, 128, "connection error: %s", e.getMessage());
+ lobbyView.scrollAndUpdate(text);
return false;
}
Index: netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.7
netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.7 Sun Sep 7
16:49:03 2003
+++ netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp Mon Sep 15 17:42:15 2003
@@ -36,7 +36,7 @@
// LobbyView
//---------------------------------------------------------------------------
-LobbyView::LobbyView() : View()
+LobbyView::LobbyView() : View(), currentline(0)
{
} // end LobbyView::LobbyView
@@ -64,6 +64,7 @@
addButtonCenterText(iXY(628 - 60, 302 - 15), 60, "Abort", "Cancel the
joining of this game.", bAbort);
+ currentline = 0;
} // end LobbyView::init
// doDraw
@@ -92,11 +93,12 @@
//---------------------------------------------------------------------------
void LobbyView::update(const char *text)
{
- int yOffset = background.getPix().y-CHAR_YPIX - 1;
+ //int yOffset = background.getPix().y-CHAR_YPIX - 1;
+ int yOffset = CHAR_YPIX * currentline;
// Clear the area for the text and draw the new text.
background.fillRect(0, yOffset, background.getPix().x, yOffset +
CHAR_YPIX, Color::black);
- background.bltString(0, background.getPix().y - CHAR_YPIX - 1, text,
Color::white);
+ background.bltString(0, yOffset, text, Color::white);
} // end LobbyView::update
@@ -107,12 +109,15 @@
//---------------------------------------------------------------------------
void LobbyView::scroll()
{
- Surface tempSurface;
- tempSurface.copy(background);
-
- // Move the current text up by the height of the app font.
- tempSurface.blt(background, 0, -CHAR_YPIX - 1);
+ if(currentline * CHAR_YPIX > background.getPix().y - CHAR_YPIX)
+ {
+ Surface tempSurface;
+ tempSurface.copy(background);
+ // Move the current text up by the height of the app font.
+ tempSurface.blt(background, CHAR_YPIX, 0);
+ currentline--;
+ }
} // end LobbyView::scroll
// close
Index: netpanzer/src/NetPanzer/Views/Game/LobbyView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/LobbyView.hpp:1.1
netpanzer/src/NetPanzer/Views/Game/LobbyView.hpp:1.2
--- netpanzer/src/NetPanzer/Views/Game/LobbyView.hpp:1.1 Sun Dec 1
12:52:00 2002
+++ netpanzer/src/NetPanzer/Views/Game/LobbyView.hpp Mon Sep 15 17:42:15 2003
@@ -18,19 +18,15 @@
#ifndef __LobbyView_hpp__
#define __LobbyView_hpp__
-
-#if _MSC_VER > 1000
- #pragma once
-#endif
-
-
#include "View.hpp"
#include "Surface.hpp"
-
//---------------------------------------------------------------------------
class LobbyView : public View
{
+private:
+ int currentline;
+
protected:
virtual void loadBackgroundSurface();