implemented more image related functions

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@59 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-29 22:13:11 +00:00
parent f46b0b6b7b
commit 601af4c778
11 changed files with 377 additions and 33 deletions
+3
View File
@@ -41,6 +41,9 @@ class Age {
/// Compare two ages, smaller means earlier
inline bool operator < (Age a) const { return age < a.age; }
/// A number corresponding to the age
inline LONG get() const { return age; }
private:
/// This age
LONG age;
+4 -4
View File
@@ -27,7 +27,7 @@
/// Declare a dynamic argument.
/** The value of the argument can be got with: name()
* To change the value use WITH_DYNAMIC_ARG(name, newValue) { ... }
* To change the value use WITH_DYNAMIC_ARG(name, newValue)
* To be used in a header file. Use IMPLEMENT_DYN_ARG in a source file
*/
#define DECLARE_DYNAMIC_ARG(Type, name) \
@@ -42,7 +42,6 @@
inline ~name##_changer() { \
name##_private = oldValue; \
} \
inline operator bool() { return true; } \
private: \
Type oldValue; \
}
@@ -55,14 +54,15 @@
/** Usage:
* @code
* // here name() == old value
* WITH_DYNAMIC_ARG(name, newValue) {
* {
* WITH_DYNAMIC_ARG(name, newValue);
* // here name() == newValue
* }
* // here name() == old value
* @endcode
*/
#define WITH_DYNAMIC_ARG(name, value) \
if (name##_changer name##_dummmy = value) // hack: variable in if guard scopes over the following block
name##_changer name##_dummmy(value)
// ----------------------------------------------------------------------------- : EOF
#endif