'favour' -> 'favor', 'colour' -> 'color', 'behaviour' -> 'behavior'...
...in the source code.
This commit is contained in:
parent
1ffb0a3a4d
commit
c2cb357a48
41 changed files with 92 additions and 92 deletions
|
@ -289,7 +289,7 @@ if(UNIX AND NOT CMAKE_COMPILER_IS_GNUCXX)
|
|||
# It needs the files to be forced as c++ manually, it might be a newer
|
||||
# version of cmake will be able to this for us.
|
||||
#
|
||||
# Also silence some Clang specific warnings due to extra parenthesis in if statements when comparing instead
|
||||
# Also silence some Clang specific warnings due to extra parenthesis in if statements when comparing instead
|
||||
set_source_files_properties(
|
||||
${libwesnoth-lua_STAT_SRC}
|
||||
PROPERTIES COMPILE_FLAGS
|
||||
|
@ -412,7 +412,7 @@ add_library(wesnoth-gui_tooltip
|
|||
|
||||
# This library contains the widget code.
|
||||
# It contains the core code of the wigets which determines the
|
||||
# behaviour of the widgets. It also contains the builder code
|
||||
# behavior of the widgets. It also contains the builder code
|
||||
# for the widgets since the code has inter dependencies.
|
||||
set(wesnoth-gui_widget_SRC
|
||||
gui/widgets/button.cpp
|
||||
|
@ -441,13 +441,13 @@ set(wesnoth-gui_widget_SRC
|
|||
gui/widgets/scrollbar_container.cpp
|
||||
gui/widgets/scrollbar_panel.cpp
|
||||
gui/widgets/settings.cpp
|
||||
gui/widgets/slider.cpp
|
||||
gui/widgets/slider.cpp
|
||||
gui/widgets/spacer.cpp
|
||||
gui/widgets/stacked_widget.cpp
|
||||
gui/widgets/text.cpp
|
||||
gui/widgets/text_box.cpp
|
||||
gui/widgets/toggle_button.cpp
|
||||
gui/widgets/toggle_panel.cpp
|
||||
gui/widgets/toggle_button.cpp
|
||||
gui/widgets/toggle_panel.cpp
|
||||
gui/widgets/tree_view.cpp
|
||||
gui/widgets/tree_view_node.cpp
|
||||
gui/widgets/vertical_scrollbar.cpp
|
||||
|
@ -962,7 +962,7 @@ set(wesnothd_SRC
|
|||
server/forum_user_handler.cpp
|
||||
server/sample_user_handler.cpp
|
||||
${network_implementation_files}
|
||||
loadscreen_empty.cpp
|
||||
loadscreen_empty.cpp
|
||||
)
|
||||
|
||||
add_executable(wesnothd WIN32
|
||||
|
@ -1067,7 +1067,7 @@ set(schema_validator_SRC
|
|||
|
||||
add_executable(schema_validator ${schema_validator_SRC})
|
||||
target_link_libraries(schema_validator wesnoth-core ${common-external-libs})
|
||||
set_target_properties(schema_validator PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}schema_validator${BINARY_SUFFIX}
|
||||
set_target_properties(schema_validator PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}schema_validator${BINARY_SUFFIX}
|
||||
COMPILE_DEFINITIONS VALIDATION_ERRORS_LOG)
|
||||
|
||||
install(TARGETS schema_validator DESTINATION ${BINDIR})
|
||||
|
@ -1100,8 +1100,8 @@ if(ENABLE_TESTS)
|
|||
set(test_SRC
|
||||
tests/floating_point_emulation.cpp
|
||||
tests/main.cpp
|
||||
tests/utils/fake_display.cpp
|
||||
tests/utils/fake_event_source.cpp
|
||||
tests/utils/fake_display.cpp
|
||||
tests/utils/fake_event_source.cpp
|
||||
tests/utils/game_config_manager.cpp
|
||||
tests/utils/play_scenario.cpp
|
||||
tests/test_addons.cpp
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Defensive fallback, to be used during unfavourable conditions
|
||||
* Defensive fallback, to be used during unfavorable conditions
|
||||
*/
|
||||
|
||||
#include "ca_global_fallback.hpp"
|
||||
|
|
|
@ -181,7 +181,7 @@ static std::string clipboard_string;
|
|||
|
||||
/**
|
||||
The following string is used for the mouse selection aka PRIMARY
|
||||
Unix behaviour is mouse selection is stored in primary
|
||||
Unix behavior is mouse selection is stored in primary
|
||||
active selection goes to CLIPBOARD.
|
||||
*/
|
||||
static std::string primary_string;
|
||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
|||
/**
|
||||
* Process mouse- and keypress-events from SDL.
|
||||
* Not virtual but calls various virtual function to allow specialized
|
||||
* behaviour of derived classes.
|
||||
* behavior of derived classes.
|
||||
*/
|
||||
void handle_event(const SDL_Event& event);
|
||||
|
||||
|
|
|
@ -542,7 +542,7 @@ public:
|
|||
* If update is true, will also copy the display to the frame buffer.
|
||||
* If force is true, will not skip frames, even if running behind.
|
||||
* Not virtual, since it gathers common actions. Calls various protected
|
||||
* virtuals (further below) to allow specialized behaviour in derived classes.
|
||||
* virtuals (further below) to allow specialized behavior in derived classes.
|
||||
*/
|
||||
void draw(bool update=true, bool force=false);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class editor_action_extendable : public editor_action
|
|||
}
|
||||
/**
|
||||
* The crux of the extendable contract. This member function must be
|
||||
* implemented so that the undo behaviour is consistent, exactly the
|
||||
* implemented so that the undo behavior is consistent, exactly the
|
||||
* same as would be with separate undo actions for every part of
|
||||
* the drag.
|
||||
*/
|
||||
|
|
|
@ -54,7 +54,7 @@ class editor_action
|
|||
* Perform the action, returning an undo action that,
|
||||
* when performed, shall reverse any effects of this
|
||||
* action. The undo action object is owned by the
|
||||
* caller. Default behaviour is to create a whole-map
|
||||
* caller. Default behavior is to create a whole-map
|
||||
* undo, call the perform_without_undo function and
|
||||
* return the undo object.
|
||||
*/
|
||||
|
|
|
@ -296,7 +296,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Overridden to allow special behaviour based on modifier keys
|
||||
* Overridden to allow special behavior based on modifier keys
|
||||
*/
|
||||
std::set<map_location> affected_hexes(editor_display& disp, const map_location& hex);
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ static void handle_preprocess_command(const commandline_options& cmdline_opts)
|
|||
/** Process commandline-arguments */
|
||||
static int process_command_args(const commandline_options& cmdline_opts) {
|
||||
|
||||
// Options that don't change behaviour based on any others should be checked alphabetically below.
|
||||
// Options that don't change behavior based on any others should be checked alphabetically below.
|
||||
|
||||
if(cmdline_opts.config_dir) {
|
||||
set_preferences_dir(*cmdline_opts.config_dir);
|
||||
|
@ -327,7 +327,7 @@ static int process_command_args(const commandline_options& cmdline_opts) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Options changing their behaviour dependant on some others should be checked below.
|
||||
// Options changing their behavior dependant on some others should be checked below.
|
||||
|
||||
if ( cmdline_opts.preprocess ) {
|
||||
handle_preprocess_command(cmdline_opts);
|
||||
|
|
|
@ -296,7 +296,7 @@ public:
|
|||
/**
|
||||
* Sets the linger mode for the display.
|
||||
* There have been some discussions on what to do with fog and shroud
|
||||
* the extra variables make it easier to modify the behaviour. There
|
||||
* the extra variables make it easier to modify the behavior. There
|
||||
* might even be a split between victory and defeat.
|
||||
*
|
||||
* @todo if the current implementation is wanted we can change
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace game_events
|
|||
void handle_deprecated_message(const config& cfg);
|
||||
|
||||
/** Gets a vector of sides from side= attribute in a given config node.
|
||||
* Promotes consistent behaviour.
|
||||
* Promotes consistent behavior.
|
||||
*/
|
||||
std::vector<int> get_sides_vector(const vconfig& cfg);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace event {
|
|||
/***** tdispatcher class. *****/
|
||||
|
||||
tdispatcher::tdispatcher()
|
||||
: mouse_behaviour_(all)
|
||||
: mouse_behavior_(all)
|
||||
, want_keyboard_input_(true)
|
||||
, signal_queue_()
|
||||
, signal_mouse_queue_()
|
||||
|
@ -462,7 +462,7 @@ bool tdispatcher::execute_hotkey(const hotkey::HOTKEY_COMMAND id)
|
|||
* to solve with the first solution:
|
||||
*
|
||||
* Assume there is a listbox with toggle panels and on the panel there are a
|
||||
* few buttons, the wanted behaviour is:
|
||||
* few buttons, the wanted behavior is:
|
||||
* - if clicked on the panel it should toggle, which may or may not be allowed.
|
||||
* - if clicked on a button in the panel, we want to make sure the panel is
|
||||
* selected, which again may or may not be allowed.
|
||||
|
|
|
@ -471,7 +471,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* The behaviour of the mouse events.
|
||||
* The behavior of the mouse events.
|
||||
*
|
||||
* Normally for mouse events there's first cheched whether a dispatcher has
|
||||
* captured the mouse if so it gets the event.
|
||||
|
@ -487,7 +487,7 @@ public:
|
|||
*
|
||||
* If after these tests no dispatcher is found the event is ignored.
|
||||
*/
|
||||
enum tmouse_behaviour
|
||||
enum tmouse_behavior
|
||||
{
|
||||
all
|
||||
, hit
|
||||
|
@ -508,14 +508,14 @@ public:
|
|||
|
||||
/***** ***** ***** setters/getters ***** ***** *****/
|
||||
|
||||
void set_mouse_behaviour(const tmouse_behaviour mouse_behaviour)
|
||||
void set_mouse_behavior(const tmouse_behavior mouse_behavior)
|
||||
{
|
||||
mouse_behaviour_ = mouse_behaviour;
|
||||
mouse_behavior_ = mouse_behavior;
|
||||
}
|
||||
|
||||
tmouse_behaviour get_mouse_behaviour() const
|
||||
tmouse_behavior get_mouse_behavior() const
|
||||
{
|
||||
return mouse_behaviour_;
|
||||
return mouse_behavior_;
|
||||
}
|
||||
|
||||
void set_want_keyboard_input(const bool want_keyboard_input)
|
||||
|
@ -673,8 +673,8 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
/** The mouse behaviour for the dispatcher. */
|
||||
tmouse_behaviour mouse_behaviour_;
|
||||
/** The mouse behavior for the dispatcher. */
|
||||
tmouse_behavior mouse_behavior_;
|
||||
|
||||
/**
|
||||
* Does the dispatcher want to receive keyboard input.
|
||||
|
|
|
@ -524,13 +524,13 @@ void thandler::mouse(const tevent event, const tpoint& position)
|
|||
for(std::vector<tdispatcher*>::reverse_iterator ritor =
|
||||
dispatchers_.rbegin(); ritor != dispatchers_.rend(); ++ritor) {
|
||||
|
||||
if((**ritor).get_mouse_behaviour() == tdispatcher::all) {
|
||||
if((**ritor).get_mouse_behavior() == tdispatcher::all) {
|
||||
(**ritor).fire(event
|
||||
, dynamic_cast<twidget&>(**ritor)
|
||||
, position);
|
||||
break;
|
||||
}
|
||||
if((**ritor).get_mouse_behaviour() == tdispatcher::none) {
|
||||
if((**ritor).get_mouse_behavior() == tdispatcher::none) {
|
||||
continue;
|
||||
}
|
||||
if((**ritor).is_at(position)) {
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace iterator {
|
|||
* level allows the user to only visit a part of the widget tree.
|
||||
*
|
||||
* @note At the moment when gui2::iterator::twalker_::widget is skipped the
|
||||
* child class also skips its children. This behaviour might change.
|
||||
* child class also skips its children. This behavior might change.
|
||||
*
|
||||
*
|
||||
* @section gui2_iterator_walker Walker
|
||||
|
@ -132,7 +132,7 @@ namespace iterator {
|
|||
*
|
||||
* When during the iteration a widget is added to or removed from the
|
||||
* widget-tree being walked the iterator becomes invalid. Using the iterator
|
||||
* when it is invalid results in Undefined Behaviour.
|
||||
* when it is invalid results in Undefined Behavior.
|
||||
*
|
||||
* When it's certain there's at least one widget to visit a simple do while loop
|
||||
* can be used. It the policy visits the widget, it's certain there is at least
|
||||
|
|
|
@ -51,7 +51,7 @@ tlistbox_definition::tresolution::tresolution(const config& cfg)
|
|||
* @begin{table}{config}
|
||||
* scrollbar & section & & A grid containing the widgets for the
|
||||
* scrollbar. The scrollbar has some special
|
||||
* widgets so it can make default behaviour
|
||||
* widgets so it can make default behavior
|
||||
* for certain widgets. $
|
||||
* @end{table}
|
||||
* @begin{table}{dialog_widgets}
|
||||
|
|
|
@ -329,16 +329,16 @@ twindow_builder::tresolution::tresolution(const config& cfg) :
|
|||
*
|
||||
*
|
||||
* click_dismiss & bool & false &
|
||||
* Does the window need click dismiss behaviour? Click dismiss behaviour
|
||||
* Does the window need click dismiss behavior? Click dismiss behavior
|
||||
* means that any mouse click will close the dialog. Note certain widgets
|
||||
* will automatically disable this behaviour since they need to process the
|
||||
* will automatically disable this behavior since they need to process the
|
||||
* clicks as well, for example buttons do need a click and a misclick on
|
||||
* button shouldn't close the dialog. NOTE with some widgets this behaviour
|
||||
* depends on their contents (like scrolling labels) so the behaviour might
|
||||
* button shouldn't close the dialog. NOTE with some widgets this behavior
|
||||
* depends on their contents (like scrolling labels) so the behavior might
|
||||
* get changed depending on the data in the dialog. NOTE the default
|
||||
* behaviour might be changed since it will be disabled when can't be used
|
||||
* behavior might be changed since it will be disabled when can't be used
|
||||
* due to widgets which use the mouse, including buttons, so it might be
|
||||
* wise to set the behaviour explicitly when not wanted and no mouse using
|
||||
* wise to set the behavior explicitly when not wanted and no mouse using
|
||||
* widgets are available. This means enter, escape or an external source
|
||||
* needs to be used to close the dialog (which is valid). $
|
||||
*
|
||||
|
|
|
@ -317,7 +317,7 @@ private:
|
|||
*
|
||||
* Most windows should restore the display after showing so this value
|
||||
* defaults to true. Toplevel windows (like the titlescreen don't want this
|
||||
* behaviour so they can change it in pre_show().
|
||||
* behavior so they can change it in pre_show().
|
||||
*/
|
||||
bool restore_;
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ private:
|
|||
*
|
||||
* @param T The type of the item to show in the widget.
|
||||
* @param W The type of widget to show, this is not a
|
||||
* widget class but a behaviour class.
|
||||
* widget class but a behavior class.
|
||||
* @param CT The type tp be used in the
|
||||
* callback_save_value callback. Normally this
|
||||
* is const T but for example with strings it
|
||||
|
|
|
@ -28,7 +28,7 @@ class twindow;
|
|||
* The popup class shows windows that are shown non-modal.
|
||||
*
|
||||
* At the moment these windows also don't capture the mouse and keyboard so can
|
||||
* only be used for things like tooltips. This behaviour might change later.
|
||||
* only be used for things like tooltips. This behavior might change later.
|
||||
*/
|
||||
class tpopup
|
||||
{
|
||||
|
|
|
@ -349,7 +349,7 @@ private:
|
|||
* Load class dependant config settings.
|
||||
*
|
||||
* load_config will call this method after loading the config, by default it
|
||||
* does nothing but classes can override it to implement custom behaviour.
|
||||
* does nothing but classes can override it to implement custom behavior.
|
||||
*/
|
||||
virtual void load_config_extra() {}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class tevent_handler;
|
|||
*
|
||||
* Base class with all possible events, most widgets can ignore most of these,
|
||||
* but they are available. In order to use an event simply override the
|
||||
* execution function and implement the wanted behaviour. The default behaviour
|
||||
* execution function and implement the wanted behavior. The default behavior
|
||||
* defined here is to do nothing.
|
||||
*
|
||||
* For more info about the event handling have a look at the tevent_handler
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
* Else is goes through all selected items and returns the first one
|
||||
* selected.
|
||||
*
|
||||
* @note tstacked_widget depends on that behaviour it always has all items
|
||||
* @note tstacked_widget depends on that behavior it always has all items
|
||||
* selected and thus shown and by default the last selected item (the top
|
||||
* one) is active.
|
||||
*
|
||||
|
|
|
@ -530,7 +530,7 @@ struct tshow
|
|||
/**
|
||||
* Basic template class to generate new items.
|
||||
*
|
||||
* The class is policy based so the behaviour can be selected.
|
||||
* The class is policy based so the behavior can be selected.
|
||||
*/
|
||||
template
|
||||
< class minimum_selection
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
* the wanted id (if any). If the member id is an
|
||||
* empty string, it is send to all members.
|
||||
* Having both empty and non-empty id's gives
|
||||
* undefined behaviour.
|
||||
* undefined behavior.
|
||||
* @param index The item before which to add the new item,
|
||||
* 0 == begin, -1 == end.
|
||||
*/
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
* the wanted id (if any). If the member id is an
|
||||
* empty string, it is send to all members.
|
||||
* Having both empty and non-empty id's gives
|
||||
* undefined behaviour.
|
||||
* undefined behavior.
|
||||
* @param index The item before which to add the new item,
|
||||
* 0 == begin, -1 == end.
|
||||
*/
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
* has the wanted id (if any). If the member
|
||||
* id is an empty string, it is send to all
|
||||
* members. Having both empty and non-empty
|
||||
* id's gives undefined behaviour.
|
||||
* id's gives undefined behavior.
|
||||
*/
|
||||
void add_page(const std::map<std::string /* widget id */,
|
||||
string_map>& data);
|
||||
|
|
|
@ -224,7 +224,7 @@ private:
|
|||
/****** handling of special keys first the pure virtuals *****/
|
||||
|
||||
/**
|
||||
* Every key can have several behaviours.
|
||||
* Every key can have several behaviors.
|
||||
*
|
||||
* Unmodified No modifier is pressed.
|
||||
* Control The control key is pressed.
|
||||
|
@ -251,14 +251,14 @@ private:
|
|||
/**
|
||||
* Up arrow key pressed.
|
||||
*
|
||||
* The behaviour is implementation defined.
|
||||
* The behavior is implementation defined.
|
||||
*/
|
||||
virtual void handle_key_up_arrow(SDLMod modifier, bool& handled) = 0;
|
||||
|
||||
/**
|
||||
* Down arrow key pressed.
|
||||
*
|
||||
* The behaviour is implementation defined.
|
||||
* The behavior is implementation defined.
|
||||
*/
|
||||
virtual void handle_key_down_arrow(SDLMod modifier, bool& handled) = 0;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
* the wanted id (if any). If the member id is an
|
||||
* empty string, it is send to all members.
|
||||
* Having both empty and non-empty id's gives
|
||||
* undefined behaviour.
|
||||
* undefined behavior.
|
||||
* @param index The item before which to add the new item,
|
||||
* 0 == begin, -1 == end.
|
||||
*/
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
* the wanted id (if any). If the member id is an
|
||||
* empty string, it is send to all members.
|
||||
* Having both empty and non-empty id's gives
|
||||
* undefined behaviour.
|
||||
* undefined behavior.
|
||||
*/
|
||||
ttree_view_node& add_sibling(const std::string& id
|
||||
, const std::map<std::string /* widget id */, string_map>& data)
|
||||
|
|
|
@ -621,7 +621,7 @@ private:
|
|||
* the next drawing cycle, setting it to dirty also need to set it's parent
|
||||
* dirty so at so point the toplevel parent knows which item to redraw.
|
||||
*
|
||||
* NOTE dirtying the parent might be inefficient and this behaviour might be
|
||||
* NOTE dirtying the parent might be inefficient and this behavior might be
|
||||
* optimized later on.
|
||||
*/
|
||||
bool dirty_;
|
||||
|
|
|
@ -508,7 +508,7 @@ void twindow::show_tooltip(/*const unsigned auto_close_timeout*/)
|
|||
|
||||
assert(status_ == NEW);
|
||||
|
||||
set_mouse_behaviour(event::tdispatcher::none);
|
||||
set_mouse_behavior(event::tdispatcher::none);
|
||||
set_want_keyboard_input(false);
|
||||
|
||||
show_mode_ = tooltip;
|
||||
|
@ -530,7 +530,7 @@ void twindow::show_non_modal(/*const unsigned auto_close_timeout*/)
|
|||
|
||||
assert(status_ == NEW);
|
||||
|
||||
set_mouse_behaviour(event::tdispatcher::hit);
|
||||
set_mouse_behavior(event::tdispatcher::hit);
|
||||
|
||||
show_mode_ = modal;
|
||||
|
||||
|
@ -1437,7 +1437,7 @@ void twindow::signal_handler_request_placement(
|
|||
*
|
||||
* - @ref gui2::tgrid::tchild "Grid cell"; Every widget which is in a grid is
|
||||
* put in a grid cell. These cells also hold the information about the gaps
|
||||
* between widgets the behaviour on growing etc. All grid cells must have a
|
||||
* between widgets the behavior on growing etc. All grid cells must have a
|
||||
* widget inside them.
|
||||
*
|
||||
* - @ref gui2::twindow "Window"; A window is a top level item which has a
|
||||
|
|
|
@ -73,10 +73,10 @@ struct map_location {
|
|||
int do_compare(const map_location& a) const {return x == a.x ? y - a.y : x - a.x; }
|
||||
|
||||
// Adds an absolute location to a "delta" location
|
||||
// This is not the mathematically correct behaviour, it is neither
|
||||
// This is not the mathematically correct behavior, it is neither
|
||||
// commutative nor associative. Negative coordinates may give strange
|
||||
// results. It is retained because terrain builder code relies in this
|
||||
// broken behaviour. Best avoid.
|
||||
// broken behavior. Best avoid.
|
||||
map_location legacy_negation() const;
|
||||
map_location legacy_sum(const map_location &a) const;
|
||||
map_location& legacy_sum_assign(const map_location &a);
|
||||
|
|
|
@ -629,7 +629,7 @@ void ui::process_network_error(network::error& error)
|
|||
{
|
||||
ERR_NW << "Caught networking error: " << error.message << "\n";
|
||||
|
||||
// Default behaviour is to re-throw the error. May be overridden.
|
||||
// Default behavior is to re-throw the error. May be overridden.
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ protected:
|
|||
/**
|
||||
* Processes any pending network data. Called by the public
|
||||
* process_network() method. Overridden by subclasses who add more
|
||||
* behaviour for network.
|
||||
* behavior for network.
|
||||
*/
|
||||
virtual void process_network_data(const config& data, const network::connection sock);
|
||||
|
||||
|
@ -182,7 +182,7 @@ protected:
|
|||
|
||||
/**
|
||||
* Called each time the gamelist_ variable is updated. May be
|
||||
* overridden by child classes to add custom gamelist behaviour.
|
||||
* overridden by child classes to add custom gamelist behavior.
|
||||
*/
|
||||
virtual void gamelist_updated(bool silent=true);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
|
||||
/**
|
||||
* This function provides explicit access to the resource.
|
||||
* Its behaviour is identical to operator resource_type()
|
||||
* Its behavior is identical to operator resource_type()
|
||||
*
|
||||
* @return the underlying resource
|
||||
*/
|
||||
|
@ -162,7 +162,7 @@ struct scoped_ptr : public scoped_resource<T*,delete_item>
|
|||
};
|
||||
|
||||
/**
|
||||
* This class has identical behaviour to @ref scoped_ptr, except it
|
||||
* This class has identical behavior to @ref scoped_ptr, except it
|
||||
* manages heap-allocated arrays instead of heap-allocated single objects
|
||||
*
|
||||
* Usage example:
|
||||
|
|
|
@ -289,16 +289,16 @@ surface blur_alpha_surface(const surface &surf, int depth = 1, bool optimize=tru
|
|||
surface cut_surface(const surface &surf, SDL_Rect const &r);
|
||||
|
||||
/**
|
||||
* Blends a surface with a colour.
|
||||
* Blends a surface with a color.
|
||||
*
|
||||
* Every pixel in the surface will be blended with the @p color given. The
|
||||
* final colour of a pixel is amount * @p color + (1 - amount) * original.
|
||||
* final color of a pixel is amount * @p color + (1 - amount) * original.
|
||||
*
|
||||
* @param surf The surface to blend.
|
||||
* @param amount The amount of the new colour is determined by
|
||||
* @param amount The amount of the new color is determined by
|
||||
* @p color. Must be a number in the range
|
||||
* [0, 1].
|
||||
* @param color The colour to blend width, note its alpha
|
||||
* @param color The color to blend width, note its alpha
|
||||
* channel is ignored.
|
||||
* @param optimize Should the return surface be RLE optimized.
|
||||
*
|
||||
|
|
|
@ -81,9 +81,9 @@ create_image_blend_functor(
|
|||
const surface& dst
|
||||
, const std::string root
|
||||
, const Uint8 amount
|
||||
, const Uint32 colour)
|
||||
, const Uint32 color)
|
||||
{
|
||||
const std::string filename = blend_get_filename(root, amount, colour);
|
||||
const std::string filename = blend_get_filename(root, amount, color);
|
||||
|
||||
save_image(dst, filename);
|
||||
}
|
||||
|
|
|
@ -76,18 +76,18 @@ compare_image(
|
|||
}
|
||||
|
||||
static void
|
||||
test_blend(const surface& dst, const Uint8 amount, const Uint32 colour)
|
||||
test_blend(const surface& dst, const Uint8 amount, const Uint32 color)
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << std::hex << std::setfill('0')
|
||||
<< "Blend image amount »"
|
||||
<< std::setw(2) << static_cast<Uint32>(amount)
|
||||
<< "« colour »"
|
||||
<< std::setw(8) << colour
|
||||
<< "« color »"
|
||||
<< std::setw(8) << color
|
||||
<< "« : ";
|
||||
|
||||
const std::string filename =
|
||||
blend_get_filename("data/test/test/image/blend/", amount, colour);
|
||||
blend_get_filename("data/test/test/image/blend/", amount, color);
|
||||
|
||||
BOOST_REQUIRE_EQUAL(image::exists(filename), true);
|
||||
|
||||
|
|
|
@ -28,24 +28,24 @@ typedef boost::function<
|
|||
inline void
|
||||
blend_image(const surface& src, tblend_functor functor)
|
||||
{
|
||||
for(Uint32 colour = 0x00FF0000; colour != 0x00000000; colour >>= 8) {
|
||||
for(Uint32 color = 0x00FF0000; color != 0x00000000; color >>= 8) {
|
||||
for(int i = 0xf; i < 0x100; i += 0x10) {
|
||||
const surface dst = blend_surface(src, i / 255., colour);
|
||||
const surface dst = blend_surface(src, i / 255., color);
|
||||
if(functor) {
|
||||
functor(dst, i, colour);
|
||||
functor(dst, i, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string
|
||||
blend_get_filename(std::string root, const Uint8 amount, const Uint32 colour)
|
||||
blend_get_filename(std::string root, const Uint8 amount, const Uint32 color)
|
||||
{
|
||||
// The name of the file is
|
||||
// A the amount of blended [0..256) as hex.
|
||||
// C the colour to blend with as hex.
|
||||
// C the color to blend with as hex.
|
||||
char filename[] = "AA_CCCCCCCC.png";
|
||||
snprintf(filename, sizeof(filename), "%02X_%08X.png", amount, colour);
|
||||
snprintf(filename, sizeof(filename), "%02X_%08X.png", amount, color);
|
||||
|
||||
return root + filename;
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ private:
|
|||
*
|
||||
* Depending on the @p type_ the @p list_iterator_ and the @p map_iterator_ are
|
||||
* a valid iterator or singular. Since most actions on singular iterators
|
||||
* result in Undefined Behaviour care should be taken when copying the
|
||||
* result in Undefined Behavior care should be taken when copying the
|
||||
* @p list_iterator_ and @p map_iterator_.
|
||||
*/
|
||||
class variant_iterator {
|
||||
|
|
|
@ -150,15 +150,15 @@ REGISTER(brighten,
|
|||
"|amount"
|
||||
"|float"
|
||||
"|The amount the image should be brightened. The value of the every "
|
||||
"colour channel is multiplied by this value. Value less than zero "
|
||||
"color channel is multiplied by this value. Value less than zero "
|
||||
"are set to zero. The alpha channel is not modified.");
|
||||
|
||||
static void
|
||||
blend(surface& surf, const std::string& parameters)
|
||||
{
|
||||
float amount;
|
||||
unsigned colour;
|
||||
const int count = sscanf(parameters.c_str(), "%f,%x", &amount, &colour);
|
||||
unsigned color;
|
||||
const int count = sscanf(parameters.c_str(), "%f,%x", &amount, &color);
|
||||
|
||||
if(count != 2) {
|
||||
std::cerr << "Error: Arguments to blend »"
|
||||
|
@ -168,19 +168,19 @@ blend(surface& surf, const std::string& parameters)
|
|||
throw texit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
surf = blend_surface(surf, amount, colour);
|
||||
surf = blend_surface(surf, amount, color);
|
||||
}
|
||||
REGISTER(blend,
|
||||
"|Blends an image with another colour."
|
||||
"|Blends an image with another color."
|
||||
"|amount"
|
||||
"|float"
|
||||
"|The amount every pixel needs to be blended with its original value. "
|
||||
"The formula is:\n"
|
||||
"result = amount * colour + (1 - amount) * original\n"
|
||||
"result = amount * color + (1 - amount) * original\n"
|
||||
"The value needs to be in the range [0, 1]."
|
||||
"|colour"
|
||||
"|color"
|
||||
"|unsigned"
|
||||
"|The colour to blend with. The value should be given as 32-bit "
|
||||
"|The color to blend with. The value should be given as 32-bit "
|
||||
"hexadecimal value. The first fields should look like AARRGGBB, "
|
||||
"where AA is the alpha channel, RR is the red channel, GG is the "
|
||||
"green channel and BB is the blue channel. (Note the alpha channel "
|
||||
|
|
Loading…
Add table
Reference in a new issue