mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 13:53:36 +02:00
Merge pull request #92 from SFML/bugfix/doc_issues
Corrected issues with documentation
This commit is contained in:
commit
19e3a18cde
13 files changed
+57
-58
No files matched your search
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing circle Shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfCircleShape_destroy(sfCircleShape* shape);
|
||||
|
||||
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing convex Shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfConvexShape_destroy(sfConvexShape* shape);
|
||||
|
||||
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShap
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing rectangle shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape);
|
||||
|
||||
@@ -57,7 +57,7 @@ CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPoint
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShape_destroy(sfShape* shape);
|
||||
|
||||
@@ -139,7 +139,7 @@ CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect(const sfTransform* tran
|
||||
/// equivalent to a matrix multiplication.
|
||||
///
|
||||
/// \param transform Transform object
|
||||
/// \param right Transform to combine to \a transform
|
||||
/// \param other Transform to combine to \a transform
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTransform_combine(sfTransform* transform, const sfTransform* other);
|
||||
|
||||
@@ -332,7 +332,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp);
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* name, const char* password);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Close the connection with the server
|
||||
@@ -486,7 +486,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name);
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* localPath, sfFtpTransferMode mode);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Upload a file to a FTP server
|
||||
@@ -504,7 +504,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantF
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a command to the FTP server
|
||||
|
||||
@@ -114,8 +114,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address);
|
||||
/// from a host name.
|
||||
///
|
||||
/// \param address Address object
|
||||
///
|
||||
/// \return String representation of the address
|
||||
/// \param string String where the string representation will be stored
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string);
|
||||
|
||||
@@ -134,7 +134,7 @@ CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* so
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Disconnect a TCP socket from its remote peer
|
||||
@@ -194,7 +194,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPartial(sfTcpSocket* socket, co
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t size, size_t* received);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to the remote peer of a TCP socket
|
||||
|
||||
@@ -137,7 +137,7 @@ CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket* socket);
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive raw data from a remote peer with a UDP socket
|
||||
@@ -159,7 +159,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const voi
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to a remote peer with a UDP socket
|
||||
@@ -176,7 +176,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void*
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive a formatted packet of data from a remote peer with a UDP socket
|
||||
@@ -191,7 +191,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfP
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Return the maximum number of bytes that can be
|
||||
|
||||
@@ -70,7 +70,7 @@ CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode(void);
|
||||
/// \return Pointer to an array containing all the supported fullscreen modes
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count);
|
||||
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not a video mode is valid
|
||||
|
||||
@@ -189,11 +189,11 @@ sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password)
|
||||
sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* name, const char* password)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.login(userName ? userName : "", password ? password : ""));
|
||||
return new sfFtpResponse(ftp->This.login(name ? name : "", password ? password : ""));
|
||||
}
|
||||
|
||||
|
||||
@@ -288,23 +288,23 @@ sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode)
|
||||
sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* localPath, sfFtpTransferMode mode)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.download(distantFile ? distantFile : "",
|
||||
destPath ? destPath : "",
|
||||
return new sfFtpResponse(ftp->This.download(remoteFile ? remoteFile : "",
|
||||
localPath ? localPath : "",
|
||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode)
|
||||
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.upload(localFile ? localFile : "",
|
||||
destPath ? destPath : "",
|
||||
remotePath ? remotePath : "",
|
||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||
}
|
||||
|
||||
|
||||
@@ -89,13 +89,13 @@ unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout)
|
||||
sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout)
|
||||
{
|
||||
sf::IpAddress address(host.address);
|
||||
sf::IpAddress address(remoteAddress.address);
|
||||
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.connect(address, port, sf::microseconds(timeout.microseconds)));
|
||||
return static_cast<sfSocketStatus>(socket->This.connect(address, remotePort, sf::microseconds(timeout.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
@@ -125,18 +125,18 @@ sfSocketStatus sfTcpSocket_sendPartial(sfTcpSocket* socket, const void* data, si
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived)
|
||||
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t size, size_t* received)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
if (sizeReceived)
|
||||
if (received)
|
||||
{
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, maxSize, *sizeReceived));
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, size, *received));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::size_t size = 0;
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, maxSize, size));
|
||||
std::size_t tempReceived = 0;
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, size, tempReceived));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,74 +84,74 @@ void sfUdpSocket_unbind(sfUdpSocket* socket)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
// Convert the address
|
||||
sf::IpAddress receiver(address.address);
|
||||
sf::IpAddress address(remoteAddress.address);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size, receiver, port));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size, address, remotePort));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port)
|
||||
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
// Call SFML internal function
|
||||
sf::IpAddress sender;
|
||||
unsigned short senderPort;
|
||||
std::size_t received;
|
||||
sf::IpAddress address;
|
||||
unsigned short port;
|
||||
std::size_t sizeReceived;
|
||||
|
||||
sf::Socket::Status status = socket->This.receive(data, maxSize, received, sender, senderPort);
|
||||
sf::Socket::Status status = socket->This.receive(data, size, sizeReceived, address, port);
|
||||
if (status != sf::Socket::Done)
|
||||
return static_cast<sfSocketStatus>(status);
|
||||
|
||||
if (sizeReceived)
|
||||
*sizeReceived = received;
|
||||
if (received)
|
||||
*received = sizeReceived;
|
||||
|
||||
if (address)
|
||||
strncpy(address->address, sender.toString().c_str(), 16);
|
||||
if (remoteAddress)
|
||||
strncpy(remoteAddress->address, address.toString().c_str(), 16);
|
||||
|
||||
if (port)
|
||||
*port = senderPort;
|
||||
if (remotePort)
|
||||
*remotePort = port;
|
||||
|
||||
return sfSocketDone;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
// Convert the address
|
||||
sf::IpAddress receiver(address.address);
|
||||
sf::IpAddress address(remoteAddress.address);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.send(packet->This, receiver, port));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(packet->This, address, remotePort));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port)
|
||||
sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
sf::IpAddress sender;
|
||||
unsigned short senderPort;
|
||||
sf::Socket::Status status = socket->This.receive(packet->This, sender, senderPort);
|
||||
sf::IpAddress address;
|
||||
unsigned short port;
|
||||
|
||||
sf::Socket::Status status = socket->This.receive(packet->This, address, port);
|
||||
if (status != sf::Socket::Done)
|
||||
return static_cast<sfSocketStatus>(status);
|
||||
|
||||
if (address)
|
||||
strncpy(address->address, sender.toString().c_str(), 16);
|
||||
if (remoteAddress)
|
||||
strncpy(remoteAddress->address, address.toString().c_str(), 16);
|
||||
|
||||
if (port)
|
||||
*port = senderPort;
|
||||
if (remotePort)
|
||||
*remotePort = port;
|
||||
|
||||
return sfSocketDone;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user