Skip to content

Commit

Permalink
Fixed some comments for doxygen compatibility on the Apollo side.
Browse files Browse the repository at this point in the history
For Xsera, I created a couple new functions to lighten or darken CLUT colours, replacing old colour functions.

Signed-off-by: Adam Hintz <[email protected]>
  • Loading branch information
adam000 committed Sep 8, 2009
1 parent 2c9874b commit fa92338
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 44 deletions.
52 changes: 25 additions & 27 deletions Engine/Graphics/Graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
/**
Expand All @@ -46,33 +47,21 @@ 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
* @param rotation The rotation of the text
*/
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion Engine/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); } }

Expand Down
12 changes: 10 additions & 2 deletions External/TinyXML/tinyxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand All @@ -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 ));
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions External/eNet/enet/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -423,15 +423,15 @@ 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);

/** Gives the printable form of the ip address specified in the address parameter.
@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
*/
Expand All @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion External/eNet/enet/nettime.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
@file time.h
@file nettime.h
@brief ENet time constants and macros
*/
#ifndef __ENET_TIME_H__
Expand Down
4 changes: 2 additions & 2 deletions External/eNet/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down
6 changes: 3 additions & 3 deletions External/eNet/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion External/eNet/peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Resources/Scripts/Modes/Demo3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 21 additions & 1 deletion Resources/Scripts/Modules/AresCLUT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fa92338

Please sign in to comment.