diff --git a/Engine/Graphics/Graphics.h b/Engine/Graphics/Graphics.h index cf646102..a6cd1a49 100644 --- a/Engine/Graphics/Graphics.h +++ b/Engine/Graphics/Graphics.h @@ -25,13 +25,14 @@ vec2 SpriteDimensions ( const std::string& sheetname ); /** * Draws a sprite. * @note For rotational sprites, pass 0 for sheet_x and sheet_y - * @note This may be used to draw images, using a + before the name of the sprite sheet + * @note This may be used to draw images, using a '+' before the name of the sprite sheet * @param sheetname The sprite sheet to use * @param sheet_x The x position on the sprite sheet * @param sheet_y The y position on the sprite sheet * @param position The position of the centre of the sprite in world coordinates * @param size The size of the sprite in world coordinates * @param rotation The rotation of the sprite, in radians + * @param col The colour of the image */ void DrawSprite ( const std::string& sheetname, int sheet_x, int sheet_y, vec2 position, vec2 size, float rotation, colour col ); /** @@ -46,6 +47,7 @@ inline void DrawImage ( const std::string& imageName, vec2 position, vec2 size ) * Draws a string of text * @param text The text to draw * @param font The font to use + * @param justify The justification of the text (should be "left", "right", or "center") * @param position The position of the centre of the text on-screen * @param height The height of the text * @param col The colour of the text @@ -53,26 +55,13 @@ inline void DrawImage ( const std::string& imageName, vec2 position, vec2 size ) */ void DrawTextSDL ( const std::string& text, const std::string& font, const char* justify, vec2 position, float height, colour col, float rotation ); /** - * Draws text to the screen - * @param text the text to be drawn - * @param font the font to be used - * @param justify the text justification - * @param position the place to justify the text - * @param height the font size of the text + * Draws a line + * @param coordinate1 Beginning coordinates of the line + * @param coordinate2 Ending coordinates of the line + * @param width The width, in pixels, of the line * @param col The colour of the line - * @param rotation how the text is rotated */ void DrawLine ( vec2 coordinate1, vec2 coordinate2, float width, colour col ); -/** - * Draws a box - * @param top The top side of the box - * @param left The left side of the box - * @param bottom The bottom side of the box - * @param right The right side of the box - * @param width The width of the surrounding line, in pixels (zero means no surrounding line) - * @param col The colour of the surrounding line - */ -void DrawBox ( float top, float left, float bottom, float right, float width, colour col ); /** * Draws a filled box * @param top the top bound of the box @@ -82,21 +71,23 @@ void DrawBox ( float top, float left, float bottom, float right, float width, co * @param width The width of the border to the box, in pixels * @param col The colour of the circle */ -void DrawCircle ( vec2 centre, float radius, float width, colour col ); +void DrawBox ( float top, float left, float bottom, float right, float width, colour col ); /** - * Draws a filled triangle - * @param point1 the first point of the triangle - * @param point2 the second point of the triangle - * @param point3 the third point of the triangle + * Draws an approximated circle + * @param centre The location of the centre of the circle + * @param radius The radius of the circle + * @param width The width of the lines that compose the approximated circle * @param col The colour of the circle */ -void DrawTriangle ( const vec2 point1, const vec2 point2, const vec2 point3, colour col ); +void DrawCircle ( vec2 centre, float radius, float width, colour col ); /** * Draws a small triangle to represent a ship - * @param point* the three points of the triangle + * @param point1 the first point of the triangle + * @param point2 the second point of the triangle + * @param point3 the third point of the triangle * @param col The colour of the triangle */ -void DrawDiamond ( float top, float left, float bottom, float right, colour col ); +void DrawTriangle ( const vec2 point1, const vec2 point2, const vec2 point3, colour col ); /** * Draws a small diamond to represent a capital ship * @param top the top bound of the box @@ -105,6 +96,13 @@ void DrawDiamond ( float top, float left, float bottom, float right, colour col * @param right the right bound of the box * @param col The colour of the triangle */ +void DrawDiamond ( float top, float left, float bottom, float right, colour col ); +/** + * Draws some particles + * @param positions The positions of the particles + * @param count How many particles there are + * @param col The colour of the particles + */ void DrawParticles ( const vec2* positions, unsigned int count, colour col ); /** * Draws a star-field that covers the whole screen @@ -119,7 +117,7 @@ void DrawStarfield ( float depth ); float AspectRatio (); /** * Maps a point in window coordinates to a corresponding point in the current camera - * @param point The window point + * @param windowCoords The point to be mapped * @return The point in the camera */ vec2 MapPoint ( vec2 windowCoords ); diff --git a/Engine/Logging.h b/Engine/Logging.h index 030f1e44..38710b95 100644 --- a/Engine/Logging.h +++ b/Engine/Logging.h @@ -41,7 +41,7 @@ void __Log ( const char* subsystem, int level, const char* messageFormat, ... ); * Logs a message * @param subsystem The name of the subsystem to use * @param level The level of message - * @param message A format string, followed by printf-style arguments + * @param messageFormat A format string, followed by printf-style arguments */ #define LOG(subsystem, level, messageFormat...) { if (level >= LOG_LEVEL) { __Log(subsystem, level, messageFormat , ## messageFormat); } } diff --git a/External/TinyXML/tinyxml.h b/External/TinyXML/tinyxml.h index cabe262e..23fcd9a3 100644 --- a/External/TinyXML/tinyxml.h +++ b/External/TinyXML/tinyxml.h @@ -1414,6 +1414,9 @@ class TiXmlDocument : public TiXmlNode /// Load a file using the given filename. Returns true if successful. bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the given filename. Returns true if successful. + /** + * @param filename Name of requested xml file + */ bool SaveFile( const char * filename ) const; /** Load a file using the given FILE*. Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* @@ -1425,7 +1428,12 @@ class TiXmlDocument : public TiXmlNode bool SaveFile( FILE* ) const; #ifdef TIXML_USE_STL - bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. + /** + * Loads a file with a string + * @param filename The name of the file, as a std::string + * @param encoding The encoding of the file, automatically set to TIXML_DEFAULT_ENCODING + */ + bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) { // StringToBuffer f( filename ); // return ( f.buffer && LoadFile( f.buffer, encoding )); @@ -1752,7 +1760,7 @@ class TiXmlPrinter : public TiXmlVisitor virtual bool Visit( const TiXmlUnknown& unknown ); /** Set the indent characters for printing. By default 4 spaces - but tab (\t) is also useful, or null/empty string for no indentation. + but tab is also useful, or null/empty string for no indentation. */ void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } /// Query the indention string. diff --git a/External/eNet/enet/enet.h b/External/eNet/enet/enet.h index 14106aa5..60fba106 100644 --- a/External/eNet/enet/enet.h +++ b/External/eNet/enet/enet.h @@ -367,7 +367,7 @@ typedef struct _ENetEvent /** Initializes ENet globally. Must be called prior to using any functions in ENet. - @returns 0 on success, < 0 on failure + @return 0 on success, < 0 on failure */ ENET_API int enet_initialize (void); @@ -376,7 +376,7 @@ ENET_API int enet_initialize (void); @param version the constant ENET_VERSION should be supplied so ENet knows which version of ENetCallbacks struct to use @param inits user-overriden callbacks where any NULL callbacks will use ENet's defaults - @returns 0 on success, < 0 on failure + @return 0 on success, < 0 on failure */ ENET_API int enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks * inits); @@ -423,7 +423,7 @@ ENET_API void enet_socket_destroy (ENetSocket); @param hostName host name to lookup @retval 0 on success @retval < 0 on failure - @returns the address of the given hostName in address on success + @return the address of the given hostName in address on success */ ENET_API int enet_address_set_host (ENetAddress * address, const char * hostName); @@ -431,7 +431,7 @@ ENET_API int enet_address_set_host (ENetAddress * address, const char * hostName @param address address printed @param hostName destination for name, must not be NULL @param nameLength maximum length of hostName. - @returns the null-terminated name of the host in hostName on success + @return the null-terminated name of the host in hostName on success @retval 0 on success @retval < 0 on failure */ @@ -441,7 +441,7 @@ ENET_API int enet_address_get_host_ip (const ENetAddress * address, char * hostN @param address address used for reverse lookup @param hostName destination for name, must not be NULL @param nameLength maximum length of hostName. - @returns the null-terminated name of the host in hostName on success + @return the null-terminated name of the host in hostName on success @retval 0 on success @retval < 0 on failure */ diff --git a/External/eNet/enet/nettime.h b/External/eNet/enet/nettime.h index c82a5460..516739ca 100644 --- a/External/eNet/enet/nettime.h +++ b/External/eNet/enet/nettime.h @@ -1,5 +1,5 @@ /** - @file time.h + @file nettime.h @brief ENet time constants and macros */ #ifndef __ENET_TIME_H__ diff --git a/External/eNet/host.c b/External/eNet/host.c index 3232403a..8df69a87 100644 --- a/External/eNet/host.c +++ b/External/eNet/host.c @@ -17,7 +17,7 @@ @param incomingBandwidth downstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. @param outgoingBandwidth upstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. - @returns the host on success and NULL on failure + @return the host on success and NULL on failure @remarks ENet will strategically drop packets on specific sides of a connection between hosts to ensure the host's bandwidth is not overwhelmed. The bandwidth parameters also determine @@ -111,7 +111,7 @@ enet_host_destroy (ENetHost * host) @param host host seeking the connection @param address destination for the connection @param channelCount number of channels to allocate - @returns a peer representing the foreign host on success, NULL on failure + @return a peer representing the foreign host on success, NULL on failure @remarks The peer returned will have not completed the connection until enet_host_service() notifies of an ENET_EVENT_TYPE_CONNECT event for the peer. */ diff --git a/External/eNet/packet.c b/External/eNet/packet.c index 32815bc6..da5371b6 100644 --- a/External/eNet/packet.c +++ b/External/eNet/packet.c @@ -11,10 +11,10 @@ */ /** Creates a packet that may be sent to a peer. - @param dataContents initial contents of the packet's data; the packet's data will remain uninitialized if dataContents is NULL. + @param data initial contents of the packet's data; the packet's data will remain uninitialized if dataContents is NULL. @param dataLength size of the data allocated for this packet @param flags flags for this packet as described for the ENetPacket structure. - @returns the packet on success, NULL on failure + @return the packet on success, NULL on failure */ ENetPacket * enet_packet_create (const void * data, size_t dataLength, enet_uint32 flags) @@ -61,7 +61,7 @@ enet_packet_destroy (ENetPacket * packet) dataLength parameter @param packet packet to resize @param dataLength new size for the packet data - @returns 0 on success, < 0 on failure + @return 0 on success, < 0 on failure */ int enet_packet_resize (ENetPacket * packet, size_t dataLength) diff --git a/External/eNet/peer.c b/External/eNet/peer.c index 2fc67816..a8dc5ce1 100644 --- a/External/eNet/peer.c +++ b/External/eNet/peer.c @@ -175,7 +175,7 @@ enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet) /** Attempts to dequeue any incoming queued packet. @param peer peer to dequeue packets from @param channelID channel on which to receive - @returns a pointer to the packet, or NULL if there are no available incoming queued packets + @return a pointer to the packet, or NULL if there are no available incoming queued packets */ ENetPacket * enet_peer_receive (ENetPeer * peer, enet_uint8 channelID) diff --git a/Resources/Scripts/Modes/Demo3.lua b/Resources/Scripts/Modes/Demo3.lua index 45789a9c..8b5d5554 100644 --- a/Resources/Scripts/Modes/Demo3.lua +++ b/Resources/Scripts/Modes/Demo3.lua @@ -655,7 +655,7 @@ function render () if mode_manager.time() - mouseStart >= 2.0 then mouseMovement = false end - end--]] + end --]] -- Menus interface_display(dt) -- Error Printing diff --git a/Resources/Scripts/Modules/AresCLUT.lua b/Resources/Scripts/Modules/AresCLUT.lua index ea4cb575..a8e9374d 100644 --- a/Resources/Scripts/Modules/AresCLUT.lua +++ b/Resources/Scripts/Modules/AresCLUT.lua @@ -27,7 +27,27 @@ clut = { { r = 1.0, g = 1.0, b = 1.0, a = 1.0 }, -- white modifier = { 1.0, 0.941, 0.878, 0.816, 0.753, 0.690, 0.627, 0.565, 0.502, 0.439, 0.376, 0.251, 0.188, 0.125, 0.063, 0.031, 0.0 } function clut_colour(clutnum, modnum) - return { r = clut[clutnum].r * modifier[modnum], g = clut[clutnum].g * modifier[modnum], b = clut[clutnum].b * modifier[modnum], a = 1.0 } + return { r = clut[clutnum].r * modifier[modnum], g = clut[clutnum].g * modifier[modnum], b = clut[clutnum].b * modifier[modnum], a = 1.0, c = clutnum, m = modnum } +end + +function clut_lighten(colour, lightness) + if lightness == nil then + lightness = 1 + end + if modifier[colour.m + lightness] ~= nil then + colour.m = colour.m + lightness + end + return { r = clut[colour.c].r * modifier[colour.m], g = clut[colour.c].g * modifier[colour.m], b = clut[colour.c].b * modifier[colour.m], a = 1.0, c = colour.c, m = colour.m } +end + +function clut_darken(colour, darkness) + if darkness == nil then + darkness = 1 + end + if modifier[colour.m - darkness] ~= nil then + colour.m = colour.m - darkness + end + return { r = clut[colour.c].r * modifier[colour.m], g = clut[colour.c].g * modifier[colour.m], b = clut[colour.c].b * modifier[colour.m], a = 1.0, c = colour.c, m = colour.m } end function display_clut()