mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
update to sfml 1.5
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3594 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
+6
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -49,6 +49,11 @@
|
||||
// MacOS
|
||||
#define SFML_SYSTEM_MACOS
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
|
||||
// FreeBSD
|
||||
#define SFML_SYSTEM_FREEBSD
|
||||
|
||||
#else
|
||||
|
||||
// Unsupported system
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+4
-3
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -315,12 +315,13 @@ public :
|
||||
/// not return instantly; use a thread if you don't want to block your
|
||||
/// application.
|
||||
///
|
||||
/// \param Req : Request to send
|
||||
/// \param Req : Request to send
|
||||
/// \param Timeout : Maximum time to wait, in seconds (0 by default, means no timeout)
|
||||
///
|
||||
/// \return Server's response
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Response SendRequest(const Request& Req);
|
||||
Response SendRequest(const Request& Req, float Timeout = 0.f);
|
||||
|
||||
private :
|
||||
|
||||
|
||||
+4
-2
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -123,10 +123,12 @@ public :
|
||||
/// distant website ; as a consequence, this function may be
|
||||
/// very slow -- use it as few as possible !
|
||||
///
|
||||
/// \param Timeout : Maximum time to wait, in seconds (0 by default : no timeout)
|
||||
///
|
||||
/// \return Public IP address
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static IPAddress GetPublicAddress();
|
||||
static IPAddress GetPublicAddress(float Timeout = 0.f);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Comparison operator ==
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+5
-3
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -100,11 +100,12 @@ public :
|
||||
/// \param MaxSize : Maximum number of bytes to read
|
||||
/// \param SizeReceived : Number of bytes received
|
||||
/// \param Address : Address of the computer which sent the data
|
||||
/// \param Port : Port on which the remote computer sent the data
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived, IPAddress& Address);
|
||||
Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived, IPAddress& Address, unsigned short& Port);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Send a packet of data
|
||||
@@ -124,11 +125,12 @@ public :
|
||||
///
|
||||
/// \param PacketToReceive : Packet to fill with received data
|
||||
/// \param Address : Address of the computer which sent the packet
|
||||
/// \param Port : Port on which the remote computer sent the data
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Socket::Status Receive(Packet& PacketToReceive, IPAddress& Address);
|
||||
Socket::Status Receive(Packet& PacketToReceive, IPAddress& Address, unsigned short& Port);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Close the socket
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -30,14 +30,14 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#include <SFML/Config.hpp>
|
||||
//#include <SFML/System/Clock.hpp>
|
||||
//#include <SFML/System/Lock.hpp>
|
||||
//#include <SFML/System/Mutex.hpp>
|
||||
//#include <SFML/System/Randomizer.hpp>
|
||||
//#include <SFML/System/Sleep.hpp>
|
||||
//#include <SFML/System/Thread.hpp>
|
||||
//#include <SFML/System/Unicode.hpp>
|
||||
//#include <SFML/System/Vector2.hpp>
|
||||
//#include <SFML/System/Vector3.hpp>
|
||||
// #include <SFML/System/Clock.hpp>
|
||||
// #include <SFML/System/Lock.hpp>
|
||||
// #include <SFML/System/Mutex.hpp>
|
||||
// #include <SFML/System/Randomizer.hpp>
|
||||
// #include <SFML/System/Sleep.hpp>
|
||||
// #include <SFML/System/Thread.hpp>
|
||||
// #include <SFML/System/Unicode.hpp>
|
||||
// #include <SFML/System/Vector2.hpp>
|
||||
// #include <SFML/System/Vector3.hpp>
|
||||
|
||||
#endif // SFML_SYSTEM_HPP
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -364,7 +364,7 @@ void Http::SetHost(const std::string& Host, unsigned short Port)
|
||||
/// not return instantly; use a thread if you don't want to block your
|
||||
/// application.
|
||||
////////////////////////////////////////////////////////////
|
||||
Http::Response Http::SendRequest(const Http::Request& Req)
|
||||
Http::Response Http::SendRequest(const Http::Request& Req, float Timeout)
|
||||
{
|
||||
// First make sure the request is valid -- add missing mandatory fields
|
||||
Request ToSend(Req);
|
||||
@@ -391,7 +391,7 @@ Http::Response Http::SendRequest(const Http::Request& Req)
|
||||
Response Received;
|
||||
|
||||
// Connect the socket to the host
|
||||
if (myConnection.Connect(myPort, myHost) == Socket::Done)
|
||||
if (myConnection.Connect(myPort, myHost, Timeout) == Socket::Done)
|
||||
{
|
||||
// Convert the request to string and send it through the connected socket
|
||||
std::string RequestStr = ToSend.ToString();
|
||||
|
||||
+11
-25
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
@@ -20,7 +20,6 @@
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
// ** ALTERED SOURCE : replaced GetPublicAddress() **
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -158,7 +157,7 @@ IPAddress IPAddress::GetLocalAddress()
|
||||
{
|
||||
// The method here is to connect a UDP socket to anyone (here to localhost),
|
||||
// and get the local socket address with the getsockname function.
|
||||
// UDP connection will not send anything to the network, so this function won't cause any overhead
|
||||
// UDP connection will not send anything to the network, so this function won't cause any overhead.
|
||||
|
||||
IPAddress LocalAddress;
|
||||
|
||||
@@ -202,35 +201,22 @@ IPAddress IPAddress::GetLocalAddress()
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the computer's public IP address (from the web point of view)
|
||||
////////////////////////////////////////////////////////////
|
||||
IPAddress IPAddress::GetPublicAddress()
|
||||
IPAddress IPAddress::GetPublicAddress(float Timeout)
|
||||
{
|
||||
// The trick here is more complicated, because the only way
|
||||
// to get our public IP address is to get it from a distant computer.
|
||||
// Here we get the web page from http://www.whatismyip.org
|
||||
// Here we get the web page from http://www.sfml-dev.org/ip-provider.php
|
||||
// and parse the result to extract our IP address
|
||||
// (not very hard : the web page contains only our IP address)
|
||||
// (not very hard : the web page contains only our IP address).
|
||||
|
||||
IPAddress PublicAddress;
|
||||
std::string PageBody;
|
||||
|
||||
// Connect to the web server and get its index page
|
||||
// www.whatismyip.org is so slow that it times out after ~60s
|
||||
// better use this one instead, it is much faster... at least here :P
|
||||
Http Server("www.monip.org");
|
||||
Http::Request Request(Http::Request::Get, "/");
|
||||
Http::Response Page = Server.SendRequest(Request);
|
||||
|
||||
// If the request was successful, we can extract
|
||||
// the address from the body of the web page
|
||||
Http Server("www.sfml-dev.org");
|
||||
Http::Request Request(Http::Request::Get, "/ip-provider.php");
|
||||
Http::Response Page = Server.SendRequest(Request, Timeout);
|
||||
if (Page.GetStatus() == Http::Response::Ok)
|
||||
PageBody = Page.GetBody();
|
||||
return IPAddress(Page.GetBody());
|
||||
|
||||
size_t str_start = PageBody.find("IP : ", 0) + 5;
|
||||
size_t str_end = PageBody.find('<', str_start);
|
||||
|
||||
PublicAddress = PageBody.substr(str_start, str_end - str_start);
|
||||
|
||||
return PublicAddress;
|
||||
// Something failed: return an invalid address
|
||||
return IPAddress();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
|
||||
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user