]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
parentheses
authorClyne Sullivan <tullivan99@gmail.com>
Wed, 13 Apr 2016 12:47:41 +0000 (08:47 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Wed, 13 Apr 2016 12:47:41 +0000 (08:47 -0400)
70 files changed:
Changelog
include/common.hpp
include/config.hpp
include/entities.hpp
include/freetype/config/ftconfig.h
include/freetype/config/ftmodule.h
include/freetype/config/ftoption.h
include/freetype/config/ftstdlib.h
include/freetype/freetype.h
include/freetype/ftadvanc.h
include/freetype/ftautoh.h
include/freetype/ftbbox.h
include/freetype/ftbdf.h
include/freetype/ftbitmap.h
include/freetype/ftbzip2.h
include/freetype/ftcache.h
include/freetype/ftcffdrv.h
include/freetype/ftcid.h
include/freetype/fterrdef.h
include/freetype/fterrors.h
include/freetype/ftgasp.h
include/freetype/ftglyph.h
include/freetype/ftgxval.h
include/freetype/ftgzip.h
include/freetype/ftimage.h
include/freetype/ftincrem.h
include/freetype/ftlcdfil.h
include/freetype/ftlist.h
include/freetype/ftlzw.h
include/freetype/ftmac.h
include/freetype/ftmm.h
include/freetype/ftmodapi.h
include/freetype/ftmoderr.h
include/freetype/ftotval.h
include/freetype/ftoutln.h
include/freetype/ftpfr.h
include/freetype/ftrender.h
include/freetype/ftsizes.h
include/freetype/ftsnames.h
include/freetype/ftstroke.h
include/freetype/ftsynth.h
include/freetype/ftsystem.h
include/freetype/fttrigon.h
include/freetype/ftttdrv.h
include/freetype/fttypes.h
include/freetype/ftwinfnt.h
include/freetype/ftxf86.h
include/freetype/t1tables.h
include/freetype/ttnameid.h
include/freetype/tttables.h
include/freetype/tttags.h
include/freetype/ttunpat.h
include/texture.hpp
include/tinyxml2.h
include/ui.hpp
include/ui_menu.hpp
include/world.hpp
main.cpp
setup.mk
src/common.cpp
src/config.cpp
src/entities.cpp
src/gameplay.cpp
src/inventory.cpp
src/quest.cpp
src/texture.cpp
src/tinyxml2.cpp
src/ui.cpp
src/ui_menu.cpp
src/world.cpp

index 18d2efe7fac914ceb4d95f2c3df5d96987fbc5ce..e73cd1019dd88750c1a37160f54a2531efd78a28 100644 (file)
--- a/Changelog
+++ b/Changelog
 
        - potentially fixed inventory drawing bug
        - moved menu library to its own file
+
+4/13/2016:
+==========
+
+       - began making the world great again
+       - adopted indent style: linuxxxx kernel
+       - began converting pointers to better things
+       - parentheses
index a62d75ab916e829926d11270bdbb24ebf902b856..65ac47b9de982d8cb2c968d20cfcbb18e0caf8bc 100644 (file)
@@ -46,7 +46,7 @@ typedef unsigned int uint;
  * Defines how many milliseconds each game tick will take.
  */
 
-#define MSEC_PER_TICK ( 1000 / TICKS_PER_SEC )
+#define MSEC_PER_TICK (1000 / TICKS_PER_SEC)
 
 //#define SEGFAULT
 
@@ -192,7 +192,7 @@ extern float VOLUME_SFX;
  * DEBUG must be defined for this macro to function.
  */
 
-#define DEBUG_printf( message, ...) DEBUG_prints(__FILE__, __LINE__, message, __VA_ARGS__ )
+#define DEBUG_printf(message, ...) DEBUG_prints(__FILE__, __LINE__, message, __VA_ARGS__)
 
 #ifdef SEGFAULT
 #define C(x) std::cout << m << std::endl
index d003c666f66b1200cb9ca466a0737f47e10c67d9..8bd0bc9f1c71d6c7483c709cae8a769157c57721 100644 (file)
@@ -10,9 +10,9 @@
 
 
 namespace config {
-    void read( void );
-    void update( void );
-    void save( void );
+    void read(void);
+    void update(void);
+    void save(void);
 }
 
 #endif //CONFIG_H
index 5ab4066416a1dff9b41dd3d01ad330bb1a40c788..6cd573120972881aabba713c81aa27ae0e68266e 100644 (file)
@@ -13,6 +13,7 @@
 #define NPCp(n)                        ((NPC *)n)
 #define Structurep(n)  ((Structures *)n)
 #define Mobp(n)                        ((Mob *)n)
+#define Objectp(n)             ((Object *)n)
 
 #define PLAYER_INV_SIZE        43      // The size of the player's inventory
 #define NPC_INV_SIZE   3       // Size of an NPC's inventory
@@ -102,18 +103,18 @@ public:
                        glTexCoord2f(.25*index.x, .125*index.y);        glVertex2i(loc.x, loc.y + width);
                glEnd();
        }
-       void update( float _gravity, float ground_y ) {
+       void update(float _gravity, float ground_y) {
                // handle ground collision
-               if ( loc.y < ground_y ) {
+               if (loc.y < ground_y) {
                        loc.y = ground_y;
-                       if ( bounce ) {
+                       if (bounce) {
                                vel.y *= -0.2f;
                                vel.x /= 4;
                        } else {
                                vel.x = vel.y = 0;
                                canMove = false;
                        }
-               } else if ( gravity && vel.y > -1 )
+               } else if (gravity && vel.y > -1)
                        vel.y -= _gravity * deltaTime;
        }
        bool kill(float delta){
@@ -188,6 +189,9 @@ public:
 
        void follow(Entity *e);
 
+       bool isNear(Entity e);
+       bool isInside(vec2 coord) const;
+
        virtual ~Entity(){}
 };
 
index 11d5d95bf3bbcd42ef049c447f2445aab932dc83..c35053f5dcedc374593c7b70d1d4a478bd856ce0 100644 (file)
@@ -121,7 +121,7 @@ FT_BEGIN_HEADER
   /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
   /* used -- this is only used to get rid of unpleasant compiler warnings */
 #ifndef FT_UNUSED
-#define FT_UNUSED( arg )  ( (arg) = (arg) )
+#define FT_UNUSED(arg)  ((arg) = (arg))
 #endif
 
 
@@ -143,7 +143,7 @@ FT_BEGIN_HEADER
   /*   This is the only necessary change, so it is defined here instead    */
   /*   providing a new configuration file.                                 */
   /*                                                                       */
-#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+#if defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh))
   /* no Carbon frameworks for 64bit 10.4.x */
   /* AvailabilityMacros.h is available since Mac OS X 10.2,        */
   /* so guess the system version by maximum errno before inclusion */
@@ -151,12 +151,12 @@ FT_BEGIN_HEADER
 #ifdef ECANCELED /* defined since 10.2 */
 #include "AvailabilityMacros.h"
 #endif
-#if defined( __LP64__ ) && \
-    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
+#if defined(__LP64__) && \
+    (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
 #undef FT_MACINTOSH
 #endif
 
-#elif defined( __SC__ ) || defined( __MRC__ )
+#elif defined(__SC__) || defined(__MRC__)
   /* Classic MacOS compilers */
 #include "ConditionalMacros.h"
 #if TARGET_OS_MAC
@@ -167,8 +167,8 @@ FT_BEGIN_HEADER
 
 
   /* Fix compiler warning with sgi compiler */
-#if defined( __sgi ) && !defined( __GNUC__ )
-#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
+#if defined(__sgi) && !defined(__GNUC__)
+#if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 730)
 #pragma set woff 3505
 #endif
 #endif
@@ -297,14 +297,14 @@ FT_BEGIN_HEADER
 #define FT_INT64   long
 #define FT_UINT64  unsigned long
 
-#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
+#elif defined(_MSC_VER) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
 
   /* this compiler provides the __int64 type */
 #define FT_LONG64
 #define FT_INT64   __int64
 #define FT_UINT64  unsigned __int64
 
-#elif defined( __BORLANDC__ )  /* Borland C++ */
+#elif defined(__BORLANDC__)  /* Borland C++ */
 
   /* XXXX: We should probably check the value of __BORLANDC__ in order */
   /*       to test the compiler version.                               */
@@ -314,17 +314,17 @@ FT_BEGIN_HEADER
 #define FT_INT64   __int64
 #define FT_UINT64  unsigned __int64
 
-#elif defined( __WATCOMC__ )   /* Watcom C++ */
+#elif defined(__WATCOMC__)   /* Watcom C++ */
 
   /* Watcom doesn't provide 64-bit data types */
 
-#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */
+#elif defined(__MWERKS__)    /* Metrowerks CodeWarrior */
 
 #define FT_LONG64
 #define FT_INT64   long long int
 #define FT_UINT64  unsigned long long int
 
-#elif defined( __GNUC__ )
+#elif defined(__GNUC__)
 
   /* GCC provides the `long long' type */
 #define FT_LONG64
@@ -341,7 +341,7 @@ FT_BEGIN_HEADER
   /* is defined.  You can however ignore this rule by defining the         */
   /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */
   /*                                                                       */
-#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
+#if defined(FT_LONG64) && !defined(FT_CONFIG_OPTION_FORCE_INT64)
 
 #ifdef __STDC__
 
@@ -363,7 +363,7 @@ FT_BEGIN_HEADER
 
 
 #define FT_BEGIN_STMNT  do {
-#define FT_END_STMNT    } while ( 0 )
+#define FT_END_STMNT    } while (0)
 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
 
 
@@ -371,15 +371,15 @@ FT_BEGIN_HEADER
   /* Provide assembler fragments for performance-critical functions. */
   /* These must be defined `static __inline__' with GCC.             */
 
-#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */
+#if defined(__CC_ARM) || defined(__ARMCC__)  /* RVCT */
 
 #define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
 
   /* documentation is in freetype.h */
 
   static __inline FT_Int32
-  FT_MulFix_arm( FT_Int32  a,
-                 FT_Int32  b )
+  FT_MulFix_arm(FT_Int32  a,
+                 FT_Int32  b)
   {
     register FT_Int32  t, t2;
 
@@ -402,17 +402,17 @@ FT_BEGIN_HEADER
 
 #ifdef __GNUC__
 
-#if defined( __arm__ )                                 && \
-    ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
-    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
+#if defined(__arm__)                                 && \
+    (!defined(__thumb__) || defined(__thumb2__)) && \
+    !(defined(__CC_ARM) || defined(__ARMCC__))
 
 #define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
 
   /* documentation is in freetype.h */
 
   static __inline__ FT_Int32
-  FT_MulFix_arm( FT_Int32  a,
-                 FT_Int32  b )
+  FT_MulFix_arm(FT_Int32  a,
+                 FT_Int32  b)
   {
     register FT_Int32  t, t2;
 
@@ -431,24 +431,24 @@ FT_BEGIN_HEADER
       "orr    %0, %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
       : "=r"(a), "=&r"(t2), "=&r"(t)
       : "r"(a), "r"(b)
-      : "cc" );
+      : "cc");
     return a;
   }
 
 #endif /* __arm__                      && */
-       /* ( __thumb2__ || !__thumb__ ) && */
-       /* !( __CC_ARM || __ARMCC__ )      */
+       /* (__thumb2__ || !__thumb__) && */
+       /* !(__CC_ARM || __ARMCC__)      */
 
 
-#if defined( __i386__ )
+#if defined(__i386__)
 
 #define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
 
   /* documentation is in freetype.h */
 
   static __inline__ FT_Int32
-  FT_MulFix_i386( FT_Int32  a,
-                  FT_Int32  b )
+  FT_MulFix_i386(FT_Int32  a,
+                  FT_Int32  b)
   {
     register FT_Int32  result;
 
@@ -465,7 +465,7 @@ FT_BEGIN_HEADER
       "addl  %%edx, %%eax\n"
       : "=a"(result), "=d"(b)
       : "a"(a), "d"(b)
-      : "%ecx", "cc" );
+      : "%ecx", "cc");
     return result;
   }
 
@@ -483,8 +483,8 @@ FT_BEGIN_HEADER
   /* documentation is in freetype.h */
 
   static __inline FT_Int32
-  FT_MulFix_i386( FT_Int32  a,
-                  FT_Int32  b )
+  FT_MulFix_i386(FT_Int32  a,
+                  FT_Int32  b)
   {
     register FT_Int32  result;
 
@@ -511,17 +511,17 @@ FT_BEGIN_HEADER
 #endif /* _MSC_VER */
 
 
-#if defined( __GNUC__ ) && defined( __x86_64__ )
+#if defined(__GNUC__) && defined(__x86_64__)
 
 #define FT_MULFIX_ASSEMBLER  FT_MulFix_x86_64
 
   static __inline__ FT_Int32
-  FT_MulFix_x86_64( FT_Int32  a,
-                    FT_Int32  b )
+  FT_MulFix_x86_64(FT_Int32  a,
+                    FT_Int32  b)
   {
     /* Temporarily disable the warning that C90 doesn't support */
     /* `long long'.                                             */
-#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) )
+#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wlong-long"
 #endif
@@ -536,7 +536,7 @@ FT_BEGIN_HEADER
     tmp  = ret >> 63;
     ret += 0x8000 + tmp;
 
-    return (FT_Int32)( ret >> 16 );
+    return (FT_Int32)(ret >> 16);
 #else
 
     /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine  */
@@ -558,12 +558,12 @@ FT_BEGIN_HEADER
       "sar $16, %0\n"
       : "=&r"(result), "=&r"(wide_a)
       : "r"(wide_b)
-      : "cc" );
+      : "cc");
 
     return (FT_Int32)result;
 #endif
 
-#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) )
+#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
 #pragma GCC diagnostic pop
 #endif
   }
@@ -582,31 +582,31 @@ FT_BEGIN_HEADER
 
 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
-#define FT_LOCAL( x )      static  x
-#define FT_LOCAL_DEF( x )  static  x
+#define FT_LOCAL(x)      static  x
+#define FT_LOCAL_DEF(x)  static  x
 
 #else
 
 #ifdef __cplusplus
-#define FT_LOCAL( x )      extern "C"  x
-#define FT_LOCAL_DEF( x )  extern "C"  x
+#define FT_LOCAL(x)      extern "C"  x
+#define FT_LOCAL_DEF(x)  extern "C"  x
 #else
-#define FT_LOCAL( x )      extern  x
-#define FT_LOCAL_DEF( x )  x
+#define FT_LOCAL(x)      extern  x
+#define FT_LOCAL_DEF(x)  x
 #endif
 
 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
 
-#define FT_LOCAL_ARRAY( x )      extern const  x
-#define FT_LOCAL_ARRAY_DEF( x )  const  x
+#define FT_LOCAL_ARRAY(x)      extern const  x
+#define FT_LOCAL_ARRAY_DEF(x)  const  x
 
 
 #ifndef FT_BASE
 
 #ifdef __cplusplus
-#define FT_BASE( x )  extern "C"  x
+#define FT_BASE(x)  extern "C"  x
 #else
-#define FT_BASE( x )  extern  x
+#define FT_BASE(x)  extern  x
 #endif
 
 #endif /* !FT_BASE */
@@ -615,9 +615,9 @@ FT_BEGIN_HEADER
 #ifndef FT_BASE_DEF
 
 #ifdef __cplusplus
-#define FT_BASE_DEF( x )  x
+#define FT_BASE_DEF(x)  x
 #else
-#define FT_BASE_DEF( x )  x
+#define FT_BASE_DEF(x)  x
 #endif
 
 #endif /* !FT_BASE_DEF */
@@ -626,9 +626,9 @@ FT_BEGIN_HEADER
 #ifndef FT_EXPORT
 
 #ifdef __cplusplus
-#define FT_EXPORT( x )  extern "C"  x
+#define FT_EXPORT(x)  extern "C"  x
 #else
-#define FT_EXPORT( x )  extern  x
+#define FT_EXPORT(x)  extern  x
 #endif
 
 #endif /* !FT_EXPORT */
@@ -637,9 +637,9 @@ FT_BEGIN_HEADER
 #ifndef FT_EXPORT_DEF
 
 #ifdef __cplusplus
-#define FT_EXPORT_DEF( x )  extern "C"  x
+#define FT_EXPORT_DEF(x)  extern "C"  x
 #else
-#define FT_EXPORT_DEF( x )  extern  x
+#define FT_EXPORT_DEF(x)  extern  x
 #endif
 
 #endif /* !FT_EXPORT_DEF */
@@ -648,9 +648,9 @@ FT_BEGIN_HEADER
 #ifndef FT_EXPORT_VAR
 
 #ifdef __cplusplus
-#define FT_EXPORT_VAR( x )  extern "C"  x
+#define FT_EXPORT_VAR(x)  extern "C"  x
 #else
-#define FT_EXPORT_VAR( x )  extern  x
+#define FT_EXPORT_VAR(x)  extern  x
 #endif
 
 #endif /* !FT_EXPORT_VAR */
@@ -680,9 +680,9 @@ FT_BEGIN_HEADER
   /*                                                                 */
 #ifndef FT_CALLBACK_DEF
 #ifdef __cplusplus
-#define FT_CALLBACK_DEF( x )  extern "C"  x
+#define FT_CALLBACK_DEF(x)  extern "C"  x
 #else
-#define FT_CALLBACK_DEF( x )  static  x
+#define FT_CALLBACK_DEF(x)  static  x
 #endif
 #endif /* FT_CALLBACK_DEF */
 
index d1b938baafc0c133b80211df96a479b0021f724f..2933775c5fb5656f0450183afbb10a4bee858a27 100644 (file)
@@ -1,22 +1,22 @@
 /* This is a generated file. */
-FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
-FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
-FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
-FT_USE_MODULE( FT_Module_Class, autofit_module_class )
-FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
-FT_USE_MODULE( FT_Module_Class, gxv_module_class )
-FT_USE_MODULE( FT_Module_Class, otv_module_class )
-FT_USE_MODULE( FT_Module_Class, psaux_module_class )
-FT_USE_MODULE( FT_Module_Class, psnames_module_class )
+FT_USE_MODULE(FT_Driver_ClassRec, tt_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, t1_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, cff_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, t1cid_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, pfr_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, t42_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, winfnt_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, pcf_driver_class)
+FT_USE_MODULE(FT_Driver_ClassRec, bdf_driver_class)
+FT_USE_MODULE(FT_Module_Class, sfnt_module_class)
+FT_USE_MODULE(FT_Module_Class, autofit_module_class)
+FT_USE_MODULE(FT_Module_Class, pshinter_module_class)
+FT_USE_MODULE(FT_Renderer_Class, ft_raster1_renderer_class)
+FT_USE_MODULE(FT_Renderer_Class, ft_smooth_renderer_class)
+FT_USE_MODULE(FT_Renderer_Class, ft_smooth_lcd_renderer_class)
+FT_USE_MODULE(FT_Renderer_Class, ft_smooth_lcdv_renderer_class)
+FT_USE_MODULE(FT_Module_Class, gxv_module_class)
+FT_USE_MODULE(FT_Module_Class, otv_module_class)
+FT_USE_MODULE(FT_Module_Class, psaux_module_class)
+FT_USE_MODULE(FT_Module_Class, psnames_module_class)
 /* EOF */
index 84eb8d0e09f215df8704ab7553715ea8792b45a5..87b0e1dc5fcc969ffd80b602af0914398df6eb11 100644 (file)
@@ -239,20 +239,20 @@ FT_BEGIN_HEADER
   /*   Two macros are used within the FreeType source code to define       */
   /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */
   /*                                                                       */
-  /*     FT_EXPORT( return_type )                                          */
+  /*     FT_EXPORT(return_type)                                          */
   /*                                                                       */
   /*       is used in a function declaration, as in                        */
   /*                                                                       */
-  /*         FT_EXPORT( FT_Error )                                         */
-  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */
+  /*         FT_EXPORT(FT_Error)                                         */
+  /*         FT_Init_FreeType(FT_Library*  alibrary);                    */
   /*                                                                       */
   /*                                                                       */
-  /*     FT_EXPORT_DEF( return_type )                                      */
+  /*     FT_EXPORT_DEF(return_type)                                      */
   /*                                                                       */
   /*       is used in a function definition, as in                         */
   /*                                                                       */
-  /*         FT_EXPORT_DEF( FT_Error )                                     */
-  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */
+  /*         FT_EXPORT_DEF(FT_Error)                                     */
+  /*         FT_Init_FreeType(FT_Library*  alibrary)                     */
   /*         {                                                             */
   /*           ... some code ...                                           */
   /*           return FT_Err_Ok;                                           */
@@ -637,7 +637,7 @@ FT_BEGIN_HEADER
   /*     open_args.num_params = 1;                                         */
   /*     open_args.params     = &parameter;                                */
   /*                                                                       */
-  /*     error = FT_Open_Face( library, &open_args, index, &face );        */
+  /*     error = FT_Open_Face(library, &open_args, index, &face);        */
   /*     ...                                                               */
   /*   }                                                                   */
   /*                                                                       */
index b940efc4273f68f333022d1ece8df1cc30b217fb..ae63522993afa742dcf556836b70636d449c3ed7 100644 (file)
                                 /*       on certain platforms           */
 
 #define ft_longjmp     longjmp
-#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
+#define ft_setjmp(b) setjmp(*(ft_jmp_buf*) &(b)) /* same thing here */
 
 
   /* the following is only used for debugging purposes, i.e., if */
index 39a18af89e95d6c732805a3c8613a801eaa168a1..431ffb6aafa09eb50d7875f1e99324e06f188c7a 100644 (file)
@@ -507,18 +507,18 @@ FT_BEGIN_HEADER
   /*    this:                                                              */
   /*                                                                       */
   /*    {                                                                  */
-  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */
+  /*      #define FT_ENC_TAG(value, a, b, c, d)  value                   */
   /*    }                                                                  */
   /*                                                                       */
   /*    to get a simple enumeration without assigning special numbers.     */
   /*                                                                       */
 
 #ifndef FT_ENC_TAG
-#define FT_ENC_TAG( value, a, b, c, d )         \
-          value = ( ( (FT_UInt32)(a) << 24 ) |  \
-                    ( (FT_UInt32)(b) << 16 ) |  \
-                    ( (FT_UInt32)(c) <<  8 ) |  \
-                      (FT_UInt32)(d)         )
+#define FT_ENC_TAG(value, a, b, c, d)         \
+          value = (((FT_UInt32)(a) << 24) |  \
+                    ((FT_UInt32)(b) << 16) |  \
+                    ((FT_UInt32)(c) <<  8) |  \
+                      (FT_UInt32)(d)  )
 
 #endif /* FT_ENC_TAG */
 
@@ -665,16 +665,16 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef enum  FT_Encoding_
   {
-    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
+    FT_ENC_TAG(FT_ENCODING_NONE, 0, 0, 0, 0),
 
-    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
-    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
+    FT_ENC_TAG(FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b'),
+    FT_ENC_TAG(FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c'),
 
-    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
-    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
-    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
-    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
-    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
+    FT_ENC_TAG(FT_ENCODING_SJIS,    's', 'j', 'i', 's'),
+    FT_ENC_TAG(FT_ENCODING_GB2312,  'g', 'b', ' ', ' '),
+    FT_ENC_TAG(FT_ENCODING_BIG5,    'b', 'i', 'g', '5'),
+    FT_ENC_TAG(FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's'),
+    FT_ENC_TAG(FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a'),
 
     /* for backwards compatibility */
     FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
@@ -683,14 +683,14 @@ FT_BEGIN_HEADER
     FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
     FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
 
-    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
-    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),
-    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),
-    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),
+    FT_ENC_TAG(FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B'),
+    FT_ENC_TAG(FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E'),
+    FT_ENC_TAG(FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C'),
+    FT_ENC_TAG(FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1'),
 
-    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
+    FT_ENC_TAG(FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2'),
 
-    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
+    FT_ENC_TAG(FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n')
 
   } FT_Encoding;
 
@@ -1084,27 +1084,27 @@ FT_BEGIN_HEADER
   /*      Set if the font has color glyph tables.  To access color glyphs  */
   /*      use @FT_LOAD_COLOR.                                              */
   /*                                                                       */
-#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
-#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
-#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )
-#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )
-#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )
-#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )
-#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )
-#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )
-#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )
-#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )
-#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )
-#define FT_FACE_FLAG_HINTER            ( 1L << 11 )
-#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )
-#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )
-#define FT_FACE_FLAG_COLOR             ( 1L << 14 )
+#define FT_FACE_FLAG_SCALABLE          (1L <<  0)
+#define FT_FACE_FLAG_FIXED_SIZES       (1L <<  1)
+#define FT_FACE_FLAG_FIXED_WIDTH       (1L <<  2)
+#define FT_FACE_FLAG_SFNT              (1L <<  3)
+#define FT_FACE_FLAG_HORIZONTAL        (1L <<  4)
+#define FT_FACE_FLAG_VERTICAL          (1L <<  5)
+#define FT_FACE_FLAG_KERNING           (1L <<  6)
+#define FT_FACE_FLAG_FAST_GLYPHS       (1L <<  7)
+#define FT_FACE_FLAG_MULTIPLE_MASTERS  (1L <<  8)
+#define FT_FACE_FLAG_GLYPH_NAMES       (1L <<  9)
+#define FT_FACE_FLAG_EXTERNAL_STREAM   (1L << 10)
+#define FT_FACE_FLAG_HINTER            (1L << 11)
+#define FT_FACE_FLAG_CID_KEYED         (1L << 12)
+#define FT_FACE_FLAG_TRICKY            (1L << 13)
+#define FT_FACE_FLAG_COLOR             (1L << 14)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_HORIZONTAL( face )
+   *   FT_HAS_HORIZONTAL(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains
@@ -1114,42 +1114,42 @@ FT_BEGIN_HEADER
    *   @FT_HAS_VERTICAL can be used to check for vertical metrics.
    *
    */
-#define FT_HAS_HORIZONTAL( face ) \
-          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
+#define FT_HAS_HORIZONTAL(face) \
+          (face->face_flags & FT_FACE_FLAG_HORIZONTAL)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_VERTICAL( face )
+   *   FT_HAS_VERTICAL(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains real
    *   vertical metrics (and not only synthesized ones).
    *
    */
-#define FT_HAS_VERTICAL( face ) \
-          ( face->face_flags & FT_FACE_FLAG_VERTICAL )
+#define FT_HAS_VERTICAL(face) \
+          (face->face_flags & FT_FACE_FLAG_VERTICAL)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_KERNING( face )
+   *   FT_HAS_KERNING(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains kerning
    *   data that can be accessed with @FT_Get_Kerning.
    *
    */
-#define FT_HAS_KERNING( face ) \
-          ( face->face_flags & FT_FACE_FLAG_KERNING )
+#define FT_HAS_KERNING(face) \
+          (face->face_flags & FT_FACE_FLAG_KERNING)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_IS_SCALABLE( face )
+   *   FT_IS_SCALABLE(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains a scalable
@@ -1157,14 +1157,14 @@ FT_BEGIN_HEADER
    *   and PFR font formats.
    *
    */
-#define FT_IS_SCALABLE( face ) \
-          ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+#define FT_IS_SCALABLE(face) \
+          (face->face_flags & FT_FACE_FLAG_SCALABLE)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_IS_SFNT( face )
+   *   FT_IS_SFNT(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains a font
@@ -1176,14 +1176,14 @@ FT_BEGIN_HEADER
    *   @FT_TRUETYPE_TABLES_H are available.
    *
    */
-#define FT_IS_SFNT( face ) \
-          ( face->face_flags & FT_FACE_FLAG_SFNT )
+#define FT_IS_SFNT(face) \
+          (face->face_flags & FT_FACE_FLAG_SFNT)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_IS_FIXED_WIDTH( face )
+   *   FT_IS_FIXED_WIDTH(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains a font face
@@ -1191,14 +1191,14 @@ FT_BEGIN_HEADER
    *   glyphs.
    *
    */
-#define FT_IS_FIXED_WIDTH( face ) \
-          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+#define FT_IS_FIXED_WIDTH(face) \
+          (face->face_flags & FT_FACE_FLAG_FIXED_WIDTH)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_FIXED_SIZES( face )
+   *   FT_HAS_FIXED_SIZES(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains some
@@ -1206,40 +1206,40 @@ FT_BEGIN_HEADER
    *   @FT_FaceRec structure.
    *
    */
-#define FT_HAS_FIXED_SIZES( face ) \
-          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+#define FT_HAS_FIXED_SIZES(face) \
+          (face->face_flags & FT_FACE_FLAG_FIXED_SIZES)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_FAST_GLYPHS( face )
+   *   FT_HAS_FAST_GLYPHS(face)
    *
    * @description:
    *   Deprecated.
    *
    */
-#define FT_HAS_FAST_GLYPHS( face )  0
+#define FT_HAS_FAST_GLYPHS(face)  0
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_GLYPH_NAMES( face )
+   *   FT_HAS_GLYPH_NAMES(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains some glyph
    *   names that can be accessed through @FT_Get_Glyph_Name.
    *
    */
-#define FT_HAS_GLYPH_NAMES( face ) \
-          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+#define FT_HAS_GLYPH_NAMES(face) \
+          (face->face_flags & FT_FACE_FLAG_GLYPH_NAMES)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_MULTIPLE_MASTERS( face )
+   *   FT_HAS_MULTIPLE_MASTERS(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains some
@@ -1247,14 +1247,14 @@ FT_BEGIN_HEADER
    *   are then available to choose the exact design you want.
    *
    */
-#define FT_HAS_MULTIPLE_MASTERS( face ) \
-          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+#define FT_HAS_MULTIPLE_MASTERS(face) \
+          (face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_IS_CID_KEYED( face )
+   *   FT_IS_CID_KEYED(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains a CID-keyed
@@ -1265,36 +1265,36 @@ FT_BEGIN_HEADER
    *   available.
    *
    */
-#define FT_IS_CID_KEYED( face ) \
-          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
+#define FT_IS_CID_KEYED(face) \
+          (face->face_flags & FT_FACE_FLAG_CID_KEYED)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_IS_TRICKY( face )
+   *   FT_IS_TRICKY(face)
    *
    * @description:
    *   A macro that returns true whenever a face represents a `tricky' font.
    *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.
    *
    */
-#define FT_IS_TRICKY( face ) \
-          ( face->face_flags & FT_FACE_FLAG_TRICKY )
+#define FT_IS_TRICKY(face) \
+          (face->face_flags & FT_FACE_FLAG_TRICKY)
 
 
   /*************************************************************************
    *
    * @macro:
-   *   FT_HAS_COLOR( face )
+   *   FT_HAS_COLOR(face)
    *
    * @description:
    *   A macro that returns true whenever a face object contains
    *   tables for color glyphs.
    *
    */
-#define FT_HAS_COLOR( face ) \
-          ( face->face_flags & FT_FACE_FLAG_COLOR )
+#define FT_HAS_COLOR(face) \
+          (face->face_flags & FT_FACE_FLAG_COLOR)
 
 
   /*************************************************************************/
@@ -1319,8 +1319,8 @@ FT_BEGIN_HEADER
   /*    (for example, by analyzing various fields of the `OS/2' table in   */
   /*    SFNT based fonts).                                                 */
   /*                                                                       */
-#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )
-#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )
+#define FT_STYLE_FLAG_ITALIC  (1 << 0)
+#define FT_STYLE_FLAG_BOLD    (1 << 1)
 
 
   /*************************************************************************/
@@ -1622,9 +1622,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*        <load glyph with `FT_Load_Glyph'>                              */
   /*                                                                       */
-  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */
+  /*        if (prev_rsb_delta - face->glyph->lsb_delta >= 32)           */
   /*          origin_x -= 64;                                              */
-  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */
+  /*        else if (prev_rsb_delta - face->glyph->lsb_delta < -32)      */
   /*          origin_x += 64;                                              */
   /*                                                                       */
   /*        prev_rsb_delta = face->glyph->rsb_delta;                       */
@@ -1707,8 +1707,8 @@ FT_BEGIN_HEADER
   /*    If you need reference-counting (cf. @FT_Reference_Library), use    */
   /*    @FT_New_Library and @FT_Done_Library.                              */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Init_FreeType( FT_Library  *alibrary );
+  FT_EXPORT(FT_Error)
+  FT_Init_FreeType(FT_Library  *alibrary);
 
 
   /*************************************************************************/
@@ -1726,8 +1726,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Done_FreeType( FT_Library  library );
+  FT_EXPORT(FT_Error)
+  FT_Done_FreeType(FT_Library  library);
 
 
   /*************************************************************************/
@@ -1905,11 +1905,11 @@ FT_BEGIN_HEADER
   /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */
   /*    with its slot and sizes).                                          */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Face( FT_Library   library,
+  FT_EXPORT(FT_Error)
+  FT_New_Face(FT_Library   library,
                const char*  filepathname,
                FT_Long      face_index,
-               FT_Face     *aface );
+               FT_Face     *aface);
 
 
   /*************************************************************************/
@@ -1943,12 +1943,12 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    You must not deallocate the memory before calling @FT_Done_Face.   */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Memory_Face( FT_Library      library,
+  FT_EXPORT(FT_Error)
+  FT_New_Memory_Face(FT_Library      library,
                       const FT_Byte*  file_base,
                       FT_Long         file_size,
                       FT_Long         face_index,
-                      FT_Face        *aface );
+                      FT_Face        *aface);
 
 
   /*************************************************************************/
@@ -2003,11 +2003,11 @@ FT_BEGIN_HEADER
   /*    See the discussion of reference counters in the description of     */
   /*    @FT_Reference_Face.                                                */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Open_Face( FT_Library           library,
+  FT_EXPORT(FT_Error)
+  FT_Open_Face(FT_Library           library,
                 const FT_Open_Args*  args,
                 FT_Long              face_index,
-                FT_Face             *aface );
+                FT_Face             *aface);
 
 
   /*************************************************************************/
@@ -2027,9 +2027,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Attach_File( FT_Face      face,
-                  const char*  filepathname );
+  FT_EXPORT(FT_Error)
+  FT_Attach_File(FT_Face      face,
+                  const char*  filepathname);
 
 
   /*************************************************************************/
@@ -2062,9 +2062,9 @@ FT_BEGIN_HEADER
   /*    when invoking this function.  Most drivers simply do not implement */
   /*    file attachments.                                                  */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Attach_Stream( FT_Face        face,
-                    FT_Open_Args*  parameters );
+  FT_EXPORT(FT_Error)
+  FT_Attach_Stream(FT_Face        face,
+                    FT_Open_Args*  parameters);
 
 
   /*************************************************************************/
@@ -2090,8 +2090,8 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.4.2                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Reference_Face( FT_Face  face );
+  FT_EXPORT(FT_Error)
+  FT_Reference_Face(FT_Face  face);
 
 
   /*************************************************************************/
@@ -2113,8 +2113,8 @@ FT_BEGIN_HEADER
   /*    See the discussion of reference counters in the description of     */
   /*    @FT_Reference_Face.                                                */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Done_Face( FT_Face  face );
+  FT_EXPORT(FT_Error)
+  FT_Done_Face(FT_Face  face);
 
 
   /*************************************************************************/
@@ -2135,9 +2135,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Select_Size( FT_Face  face,
-                  FT_Int   strike_index );
+  FT_EXPORT(FT_Error)
+  FT_Select_Size(FT_Face  face,
+                  FT_Int   strike_index);
 
 
   /*************************************************************************/
@@ -2273,9 +2273,9 @@ FT_BEGIN_HEADER
   /*    glyph relative to this size.  For more information refer to        */
   /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Request_Size( FT_Face          face,
-                   FT_Size_Request  req );
+  FT_EXPORT(FT_Error)
+  FT_Request_Size(FT_Face          face,
+                   FT_Size_Request  req);
 
 
   /*************************************************************************/
@@ -2314,12 +2314,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    Don't use this function if you are using the FreeType cache API.   */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_Char_Size( FT_Face     face,
+  FT_EXPORT(FT_Error)
+  FT_Set_Char_Size(FT_Face     face,
                     FT_F26Dot6  char_width,
                     FT_F26Dot6  char_height,
                     FT_UInt     horz_resolution,
-                    FT_UInt     vert_resolution );
+                    FT_UInt     vert_resolution);
 
 
   /*************************************************************************/
@@ -2347,10 +2347,10 @@ FT_BEGIN_HEADER
   /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */
   /*    understand how requested sizes relate to actual sizes.             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_Pixel_Sizes( FT_Face  face,
+  FT_EXPORT(FT_Error)
+  FT_Set_Pixel_Sizes(FT_Face  face,
                       FT_UInt  pixel_width,
-                      FT_UInt  pixel_height );
+                      FT_UInt  pixel_height);
 
 
   /*************************************************************************/
@@ -2389,10 +2389,10 @@ FT_BEGIN_HEADER
   /*    don't have a corresponding glyph in the font).  See the discussion */
   /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Load_Glyph( FT_Face   face,
+  FT_EXPORT(FT_Error)
+  FT_Load_Glyph(FT_Face   face,
                  FT_UInt   glyph_index,
-                 FT_Int32  load_flags );
+                 FT_Int32  load_flags);
 
 
   /*************************************************************************/
@@ -2424,10 +2424,10 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Load_Char( FT_Face   face,
+  FT_EXPORT(FT_Error)
+  FT_Load_Char(FT_Face   face,
                 FT_ULong  char_code,
-                FT_Int32  load_flags );
+                FT_Int32  load_flags);
 
 
   /*************************************************************************
@@ -2587,28 +2587,28 @@ FT_BEGIN_HEADER
    *
    */
 #define FT_LOAD_DEFAULT                      0x0
-#define FT_LOAD_NO_SCALE                     ( 1L << 0 )
-#define FT_LOAD_NO_HINTING                   ( 1L << 1 )
-#define FT_LOAD_RENDER                       ( 1L << 2 )
-#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )
-#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )
-#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )
-#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )
-#define FT_LOAD_PEDANTIC                     ( 1L << 7 )
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )
-#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )
-#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )
-#define FT_LOAD_MONOCHROME                   ( 1L << 12 )
-#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )
-#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )
+#define FT_LOAD_NO_SCALE                     (1L << 0)
+#define FT_LOAD_NO_HINTING                   (1L << 1)
+#define FT_LOAD_RENDER                       (1L << 2)
+#define FT_LOAD_NO_BITMAP                    (1L << 3)
+#define FT_LOAD_VERTICAL_LAYOUT              (1L << 4)
+#define FT_LOAD_FORCE_AUTOHINT               (1L << 5)
+#define FT_LOAD_CROP_BITMAP                  (1L << 6)
+#define FT_LOAD_PEDANTIC                     (1L << 7)
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  (1L << 9)
+#define FT_LOAD_NO_RECURSE                   (1L << 10)
+#define FT_LOAD_IGNORE_TRANSFORM             (1L << 11)
+#define FT_LOAD_MONOCHROME                   (1L << 12)
+#define FT_LOAD_LINEAR_DESIGN                (1L << 13)
+#define FT_LOAD_NO_AUTOHINT                  (1L << 15)
   /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
-#define FT_LOAD_COLOR                        ( 1L << 20 )
+#define FT_LOAD_COLOR                        (1L << 20)
 
   /* */
 
   /* used internally only by certain font drivers! */
-#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )
-#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )
+#define FT_LOAD_ADVANCE_ONLY                 (1L << 8)
+#define FT_LOAD_SBITS_ONLY                   (1L << 14)
 
 
   /**************************************************************************
@@ -2669,20 +2669,20 @@ FT_BEGIN_HEADER
    *   pixel mode, with code like
    *
    *     {
-   *       FT_Load_Glyph( face, glyph_index,
-   *                      load_flags | FT_LOAD_TARGET_LIGHT );
+   *       FT_Load_Glyph(face, glyph_index,
+   *                      load_flags | FT_LOAD_TARGET_LIGHT);
    *
-   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
+   *       FT_Render_Glyph(face->glyph, FT_RENDER_MODE_LCD);
    *     }
    *
    */
-#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )
+#define FT_LOAD_TARGET_(x)   ((FT_Int32)((x) & 15) << 16)
 
-#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
-#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )
-#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )
-#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )
-#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )
+#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_(FT_RENDER_MODE_NORMAL)
+#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_(FT_RENDER_MODE_LIGHT)
+#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_(FT_RENDER_MODE_MONO)
+#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_(FT_RENDER_MODE_LCD)
+#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_(FT_RENDER_MODE_LCD_V)
 
 
   /**************************************************************************
@@ -2695,7 +2695,7 @@ FT_BEGIN_HEADER
    *   @FT_LOAD_TARGET_XXX value.
    *
    */
-#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
+#define FT_LOAD_TARGET_MODE(x)  ((FT_Render_Mode)(((x) >> 16) & 15))
 
 
   /*************************************************************************/
@@ -2726,10 +2726,10 @@ FT_BEGIN_HEADER
   /*    Note that this also transforms the `face.glyph.advance' field, but */
   /*    *not* the values in `face.glyph.metrics'.                          */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Set_Transform( FT_Face     face,
+  FT_EXPORT(void)
+  FT_Set_Transform(FT_Face     face,
                     FT_Matrix*  matrix,
-                    FT_Vector*  delta );
+                    FT_Vector*  delta);
 
 
   /*************************************************************************/
@@ -2839,9 +2839,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Render_Glyph( FT_GlyphSlot    slot,
-                   FT_Render_Mode  render_mode );
+  FT_EXPORT(FT_Error)
+  FT_Render_Glyph(FT_GlyphSlot    slot,
+                   FT_Render_Mode  render_mode);
 
 
   /*************************************************************************/
@@ -2941,12 +2941,12 @@ FT_BEGIN_HEADER
   /*    kernings, are out of the scope of this API function -- they can be */
   /*    implemented through format-specific interfaces.                    */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Kerning( FT_Face     face,
+  FT_EXPORT(FT_Error)
+  FT_Get_Kerning(FT_Face     face,
                   FT_UInt     left_glyph,
                   FT_UInt     right_glyph,
                   FT_UInt     kern_mode,
-                  FT_Vector  *akerning );
+                  FT_Vector  *akerning);
 
 
   /*************************************************************************/
@@ -2982,11 +2982,11 @@ FT_BEGIN_HEADER
   /*    Only very few AFM files come with track kerning data; please refer */
   /*    to the Adobe's AFM specification for more details.                 */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Track_Kerning( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Get_Track_Kerning(FT_Face    face,
                         FT_Fixed   point_size,
                         FT_Int     degree,
-                        FT_Fixed*  akerning );
+                        FT_Fixed*  akerning);
 
 
   /*************************************************************************/
@@ -3029,11 +3029,11 @@ FT_BEGIN_HEADER
   /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */
   /*    `ftoptions.h'.                                                     */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Glyph_Name( FT_Face     face,
+  FT_EXPORT(FT_Error)
+  FT_Get_Glyph_Name(FT_Face     face,
                      FT_UInt     glyph_index,
                      FT_Pointer  buffer,
-                     FT_UInt     buffer_max );
+                     FT_UInt     buffer_max);
 
 
   /*************************************************************************/
@@ -3055,8 +3055,8 @@ FT_BEGIN_HEADER
   /*    The returned pointer is owned by the face and is destroyed with    */
   /*    it.                                                                */
   /*                                                                       */
-  FT_EXPORT( const char* )
-  FT_Get_Postscript_Name( FT_Face  face );
+  FT_EXPORT(const char*)
+  FT_Get_Postscript_Name(FT_Face  face);
 
 
   /*************************************************************************/
@@ -3087,9 +3087,9 @@ FT_BEGIN_HEADER
   /*    preferred to a UCS-2 cmap).  It is thus preferable to              */
   /*    @FT_Set_Charmap in this case.                                      */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Select_Charmap( FT_Face      face,
-                     FT_Encoding  encoding );
+  FT_EXPORT(FT_Error)
+  FT_Select_Charmap(FT_Face      face,
+                     FT_Encoding  encoding);
 
 
   /*************************************************************************/
@@ -3116,9 +3116,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    It also fails if a type~14 charmap is selected.                    */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_Charmap( FT_Face     face,
-                  FT_CharMap  charmap );
+  FT_EXPORT(FT_Error)
+  FT_Set_Charmap(FT_Face     face,
+                  FT_CharMap  charmap);
 
 
   /*************************************************************************
@@ -3138,8 +3138,8 @@ FT_BEGIN_HEADER
    *   `charmap' belongs.  If an error occurs, -1 is returned.
    *
    */
-  FT_EXPORT( FT_Int )
-  FT_Get_Charmap_Index( FT_CharMap  charmap );
+  FT_EXPORT(FT_Int)
+  FT_Get_Charmap_Index(FT_CharMap  charmap);
 
 
   /*************************************************************************/
@@ -3172,9 +3172,9 @@ FT_BEGIN_HEADER
   /*    whatever was there will be moved to the last index -- Type~42      */
   /*    fonts are considered invalid under this condition.                 */
   /*                                                                       */
-  FT_EXPORT( FT_UInt )
-  FT_Get_Char_Index( FT_Face   face,
-                     FT_ULong  charcode );
+  FT_EXPORT(FT_UInt)
+  FT_Get_Char_Index(FT_Face   face,
+                     FT_ULong  charcode);
 
 
   /*************************************************************************/
@@ -3207,12 +3207,12 @@ FT_BEGIN_HEADER
   /*      FT_UInt   gindex;                                                */
   /*                                                                       */
   /*                                                                       */
-  /*      charcode = FT_Get_First_Char( face, &gindex );                   */
-  /*      while ( gindex != 0 )                                            */
+  /*      charcode = FT_Get_First_Char(face, &gindex);                   */
+  /*      while (gindex != 0)                                            */
   /*      {                                                                */
   /*        ... do something with (charcode,gindex) pair ...               */
   /*                                                                       */
-  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */
+  /*        charcode = FT_Get_Next_Char(face, charcode, &gindex);        */
   /*      }                                                                */
   /*    }                                                                  */
   /*                                                                       */
@@ -3220,9 +3220,9 @@ FT_BEGIN_HEADER
   /*    result itself can be~0 in two cases: if the charmap is empty or    */
   /*    if the value~0 is the first valid character code.                  */
   /*                                                                       */
-  FT_EXPORT( FT_ULong )
-  FT_Get_First_Char( FT_Face   face,
-                     FT_UInt  *agindex );
+  FT_EXPORT(FT_ULong)
+  FT_Get_First_Char(FT_Face   face,
+                     FT_UInt  *agindex);
 
 
   /*************************************************************************/
@@ -3254,10 +3254,10 @@ FT_BEGIN_HEADER
   /*    Note that `*agindex' is set to~0 when there are no more codes in   */
   /*    the charmap.                                                       */
   /*                                                                       */
-  FT_EXPORT( FT_ULong )
-  FT_Get_Next_Char( FT_Face    face,
+  FT_EXPORT(FT_ULong)
+  FT_Get_Next_Char(FT_Face    face,
                     FT_ULong   char_code,
-                    FT_UInt   *agindex );
+                    FT_UInt   *agindex);
 
 
   /*************************************************************************/
@@ -3277,9 +3277,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The glyph index.  0~means `undefined character code'.              */
   /*                                                                       */
-  FT_EXPORT( FT_UInt )
-  FT_Get_Name_Index( FT_Face     face,
-                     FT_String*  glyph_name );
+  FT_EXPORT(FT_UInt)
+  FT_Get_Name_Index(FT_Face     face,
+                     FT_String*  glyph_name);
 
 
   /*************************************************************************
@@ -3353,14 +3353,14 @@ FT_BEGIN_HEADER
    *   TrueType specification for details.
    *
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,
+  FT_EXPORT(FT_Error)
+  FT_Get_SubGlyph_Info(FT_GlyphSlot  glyph,
                         FT_UInt       sub_index,
                         FT_Int       *p_index,
                         FT_UInt      *p_flags,
                         FT_Int       *p_arg1,
                         FT_Int       *p_arg2,
-                        FT_Matrix    *p_transform );
+                        FT_Matrix    *p_transform);
 
 
   /*************************************************************************/
@@ -3444,8 +3444,8 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.8                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_UShort )
-  FT_Get_FSType_Flags( FT_Face  face );
+  FT_EXPORT(FT_UShort)
+  FT_Get_FSType_Flags(FT_Face  face);
 
 
   /*************************************************************************/
@@ -3530,10 +3530,10 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.6                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_UInt )
-  FT_Face_GetCharVariantIndex( FT_Face   face,
+  FT_EXPORT(FT_UInt)
+  FT_Face_GetCharVariantIndex(FT_Face   face,
                                FT_ULong  charcode,
-                               FT_ULong  variantSelector );
+                               FT_ULong  variantSelector);
 
 
   /*************************************************************************/
@@ -3566,10 +3566,10 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.6                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_Int )
-  FT_Face_GetCharVariantIsDefault( FT_Face   face,
+  FT_EXPORT(FT_Int)
+  FT_Face_GetCharVariantIsDefault(FT_Face   face,
                                    FT_ULong  charcode,
-                                   FT_ULong  variantSelector );
+                                   FT_ULong  variantSelector);
 
 
   /*************************************************************************/
@@ -3597,8 +3597,8 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.6                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_UInt32* )
-  FT_Face_GetVariantSelectors( FT_Face  face );
+  FT_EXPORT(FT_UInt32*)
+  FT_Face_GetVariantSelectors(FT_Face  face);
 
 
   /*************************************************************************/
@@ -3630,9 +3630,9 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.6                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_UInt32* )
-  FT_Face_GetVariantsOfChar( FT_Face   face,
-                             FT_ULong  charcode );
+  FT_EXPORT(FT_UInt32*)
+  FT_Face_GetVariantsOfChar(FT_Face   face,
+                             FT_ULong  charcode);
 
 
   /*************************************************************************/
@@ -3664,9 +3664,9 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.6                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_UInt32* )
-  FT_Face_GetCharsOfVariant( FT_Face   face,
-                             FT_ULong  variantSelector );
+  FT_EXPORT(FT_UInt32*)
+  FT_Face_GetCharsOfVariant(FT_Face   face,
+                             FT_ULong  variantSelector);
 
 
   /*************************************************************************/
@@ -3721,10 +3721,10 @@ FT_BEGIN_HEADER
   /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */
   /*    on the signs of `a' and `b'.                                       */
   /*                                                                       */
-  FT_EXPORT( FT_Long )
-  FT_MulDiv( FT_Long  a,
+  FT_EXPORT(FT_Long)
+  FT_MulDiv(FT_Long  a,
              FT_Long  b,
-             FT_Long  c );
+             FT_Long  c);
 
 
   /* */
@@ -3762,19 +3762,19 @@ FT_BEGIN_HEADER
   /*    _second_ argument of this function; this can make a great          */
   /*    difference.                                                        */
   /*                                                                       */
-  FT_EXPORT( FT_Long )
-  FT_MulFix( FT_Long  a,
-             FT_Long  b );
+  FT_EXPORT(FT_Long)
+  FT_MulFix(FT_Long  a,
+             FT_Long  b);
 
   /* */
 #endif
 
 #ifdef FT_MULFIX_INLINED
-#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )
+#define FT_MulFix(a, b)  FT_MULFIX_INLINED(a, b)
 #else
-  FT_EXPORT( FT_Long )
-  FT_MulFix( FT_Long  a,
-             FT_Long  b );
+  FT_EXPORT(FT_Long)
+  FT_MulFix(FT_Long  a,
+             FT_Long  b);
 #endif
 
 
@@ -3801,9 +3801,9 @@ FT_BEGIN_HEADER
   /*    32~bits, then the division is computed directly.  Otherwise, we    */
   /*    use a specialized version of @FT_MulDiv.                           */
   /*                                                                       */
-  FT_EXPORT( FT_Long )
-  FT_DivFix( FT_Long  a,
-             FT_Long  b );
+  FT_EXPORT(FT_Long)
+  FT_DivFix(FT_Long  a,
+             FT_Long  b);
 
 
   /*************************************************************************/
@@ -3820,8 +3820,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The result of `(a + 0x8000) & -0x10000'.                           */
   /*                                                                       */
-  FT_EXPORT( FT_Fixed )
-  FT_RoundFix( FT_Fixed  a );
+  FT_EXPORT(FT_Fixed)
+  FT_RoundFix(FT_Fixed  a);
 
 
   /*************************************************************************/
@@ -3839,8 +3839,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */
   /*                                                                       */
-  FT_EXPORT( FT_Fixed )
-  FT_CeilFix( FT_Fixed  a );
+  FT_EXPORT(FT_Fixed)
+  FT_CeilFix(FT_Fixed  a);
 
 
   /*************************************************************************/
@@ -3858,8 +3858,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The result of `a & -0x10000'.                                      */
   /*                                                                       */
-  FT_EXPORT( FT_Fixed )
-  FT_FloorFix( FT_Fixed  a );
+  FT_EXPORT(FT_Fixed)
+  FT_FloorFix(FT_Fixed  a);
 
 
   /*************************************************************************/
@@ -3879,9 +3879,9 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    The result is undefined if either `vector' or `matrix' is invalid. */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Vector_Transform( FT_Vector*        vec,
-                       const FT_Matrix*  matrix );
+  FT_EXPORT(void)
+  FT_Vector_Transform(FT_Vector*        vec,
+                       const FT_Matrix*  matrix);
 
 
   /*************************************************************************/
@@ -3957,11 +3957,11 @@ FT_BEGIN_HEADER
   /*    In such cases, the library version might not be available before   */
   /*    the library object has been created.                               */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Library_Version( FT_Library   library,
+  FT_EXPORT(void)
+  FT_Library_Version(FT_Library   library,
                       FT_Int      *amajor,
                       FT_Int      *aminor,
-                      FT_Int      *apatch );
+                      FT_Int      *apatch);
 
 
   /*************************************************************************/
@@ -3991,8 +3991,8 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.5                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_Bool )
-  FT_Face_CheckTrueTypePatents( FT_Face  face );
+  FT_EXPORT(FT_Bool)
+  FT_Face_CheckTrueTypePatents(FT_Face  face);
 
 
   /*************************************************************************/
@@ -4021,9 +4021,9 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.3.5                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_Bool )
-  FT_Face_SetUnpatentedHinting( FT_Face  face,
-                                FT_Bool  value );
+  FT_EXPORT(FT_Bool)
+  FT_Face_SetUnpatentedHinting(FT_Face  face,
+                                FT_Bool  value);
 
   /* */
 
index 8f7e2fce5edef11aed8d84ddbcde7c5e8e2b8b17..6e3b0b5a61d5d1db1479289d6757d1589117d97e 100644 (file)
@@ -113,11 +113,11 @@ FT_BEGIN_HEADER
   /*    A scaled advance is returned in 16.16 format but isn't transformed */
   /*    by the affine transformation specified by @FT_Set_Transform.       */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Advance( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Get_Advance(FT_Face    face,
                   FT_UInt    gindex,
                   FT_Int32   load_flags,
-                  FT_Fixed  *padvance );
+                  FT_Fixed  *padvance);
 
 
   /*************************************************************************/
@@ -164,12 +164,12 @@ FT_BEGIN_HEADER
   /*    transformed by the affine transformation specified by              */
   /*    @FT_Set_Transform.                                                 */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Advances( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Get_Advances(FT_Face    face,
                    FT_UInt    start,
                    FT_UInt    count,
                    FT_Int32   load_flags,
-                   FT_Fixed  *padvances );
+                   FT_Fixed  *padvances);
 
 /* */
 
index bf97b3f2404a4b822ba6ea44e11c7ec16f44171a..08ae597fd0b4cd1e0b8f31a301436eefcf08614f 100644 (file)
@@ -93,17 +93,17 @@ FT_BEGIN_HEADER
    *     FT_Prop_GlyphToScriptMap  prop;
    *
    *
-   *     FT_Init_FreeType( &library );
-   *     FT_New_Face( library, "foo.ttf", 0, &face );
+   *     FT_Init_FreeType(&library);
+   *     FT_New_Face(library, "foo.ttf", 0, &face);
    *
    *     prop.face = face;
    *
-   *     FT_Property_Get( library, "autofitter",
-   *                               "glyph-to-script-map", &prop );
+   *     FT_Property_Get(library, "autofitter",
+   *                               "glyph-to-script-map", &prop);
    *
    *     // adjust `prop.map' as needed right here
    *
-   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
+   *     FT_Load_Glyph(face, ..., FT_LOAD_FORCE_AUTOHINT);
    *   }
    *
    */
@@ -272,10 +272,10 @@ FT_BEGIN_HEADER
    *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
    *
    *
-   *     FT_Init_FreeType( &library );
+   *     FT_Init_FreeType(&library);
    *
-   *     FT_Property_Set( library, "autofitter",
-   *                               "fallback-script", &fallback_script );
+   *     FT_Property_Set(library, "autofitter",
+   *                               "fallback-script", &fallback_script);
    *   }
    *
    * @note:
@@ -310,15 +310,15 @@ FT_BEGIN_HEADER
    *     FT_Prop_IncreaseXHeight  prop;
    *
    *
-   *     FT_Init_FreeType( &library );
-   *     FT_New_Face( library, "foo.ttf", 0, &face );
-   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
+   *     FT_Init_FreeType(&library);
+   *     FT_New_Face(library, "foo.ttf", 0, &face);
+   *     FT_Set_Char_Size(face, 10 * 64, 0, 72, 0);
    *
    *     prop.face  = face;
    *     prop.limit = 14;
    *
-   *     FT_Property_Set( library, "autofitter",
-   *                               "increase-x-height", &prop );
+   *     FT_Property_Set(library, "autofitter",
+   *                               "increase-x-height", &prop);
    *   }
    *
    * @note:
index 8938841a6229b2d6ac8db28d42db8fa547565ae9..2ff25ea72c2a5171029ea6698013a02e2bf090e8 100644 (file)
@@ -81,9 +81,9 @@ FT_BEGIN_HEADER
   /*    properly shift and scale the subglyphs), then extracting the BBox, */
   /*    which can be eventually converted back to font units.              */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Get_BBox( FT_Outline*  outline,
-                       FT_BBox     *abbox );
+  FT_EXPORT(FT_Error)
+  FT_Outline_Get_BBox(FT_Outline*  outline,
+                       FT_BBox     *abbox);
 
 
   /* */
index 4f8baf84017b52c29b05c0e1b839c1c1adf74021..66c57c69b8148abc639399d886a9929cfad2e957 100644 (file)
@@ -153,10 +153,10 @@ FT_BEGIN_HEADER
   * @note:
   *   This function only works with BDF faces, returning an error otherwise.
   */
-  FT_EXPORT( FT_Error )
-  FT_Get_BDF_Charset_ID( FT_Face       face,
+  FT_EXPORT(FT_Error)
+  FT_Get_BDF_Charset_ID(FT_Face       face,
                          const char*  *acharset_encoding,
-                         const char*  *acharset_registry );
+                         const char*  *acharset_registry);
 
 
  /**********************************************************************
@@ -194,10 +194,10 @@ FT_BEGIN_HEADER
   *   In case of error, `aproperty->type' is always set to
   *   @BDF_PROPERTY_TYPE_NONE.
   */
-  FT_EXPORT( FT_Error )
-  FT_Get_BDF_Property( FT_Face           face,
+  FT_EXPORT(FT_Error)
+  FT_Get_BDF_Property(FT_Face           face,
                        const char*       prop_name,
-                       BDF_PropertyRec  *aproperty );
+                       BDF_PropertyRec  *aproperty);
 
  /* */
 
index 7dbf5ba3fe6f4c38e5e121a87572a12227891fcc..ff7649b10fb435de8ca79be5cd5b0ca032d68ff2 100644 (file)
@@ -61,8 +61,8 @@ FT_BEGIN_HEADER
   /* <InOut>                                                               */
   /*    abitmap :: A pointer to the bitmap structure.                      */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Bitmap_New( FT_Bitmap  *abitmap );
+  FT_EXPORT(void)
+  FT_Bitmap_New(FT_Bitmap  *abitmap);
 
 
   /*************************************************************************/
@@ -84,8 +84,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Bitmap_Copy( FT_Library        library,
+  FT_EXPORT(FT_Error)
+  FT_Bitmap_Copy(FT_Library        library,
                   const FT_Bitmap  *source,
                   FT_Bitmap        *target);
 
@@ -122,11 +122,11 @@ FT_BEGIN_HEADER
   /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */
   /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Bitmap_Embolden( FT_Library  library,
+  FT_EXPORT(FT_Error)
+  FT_Bitmap_Embolden(FT_Library  library,
                       FT_Bitmap*  bitmap,
                       FT_Pos      xStrength,
-                      FT_Pos      yStrength );
+                      FT_Pos      yStrength);
 
 
   /*************************************************************************/
@@ -162,11 +162,11 @@ FT_BEGIN_HEADER
   /*    The `library' argument is taken to have access to FreeType's       */
   /*    memory handling functions.                                         */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Bitmap_Convert( FT_Library        library,
+  FT_EXPORT(FT_Error)
+  FT_Bitmap_Convert(FT_Library        library,
                      const FT_Bitmap  *source,
                      FT_Bitmap        *target,
-                     FT_Int            alignment );
+                     FT_Int            alignment);
 
 
   /*************************************************************************/
@@ -187,8 +187,8 @@ FT_BEGIN_HEADER
   /*    This function is to be used in combination with                    */
   /*    @FT_Bitmap_Embolden.                                               */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );
+  FT_EXPORT(FT_Error)
+  FT_GlyphSlot_Own_Bitmap(FT_GlyphSlot  slot);
 
 
   /*************************************************************************/
@@ -211,9 +211,9 @@ FT_BEGIN_HEADER
   /*    The `library' argument is taken to have access to FreeType's       */
   /*    memory handling functions.                                         */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Bitmap_Done( FT_Library  library,
-                  FT_Bitmap  *bitmap );
+  FT_EXPORT(FT_Error)
+  FT_Bitmap_Done(FT_Library  library,
+                  FT_Bitmap  *bitmap);
 
 
   /* */
index 1bf81b15e891faf70b18a491542cf1f37c44e7ba..068c47a80694e3bd35cf99a213127f4fbf4e7774 100644 (file)
@@ -87,9 +87,9 @@ FT_BEGIN_HEADER
   *   This function may return `FT_Err_Unimplemented_Feature' if your build
   *   of FreeType was not compiled with bzip2 support.
   */
-  FT_EXPORT( FT_Error )
-  FT_Stream_OpenBzip2( FT_Stream  stream,
-                       FT_Stream  source );
+  FT_EXPORT(FT_Error)
+  FT_Stream_OpenBzip2(FT_Stream  stream,
+                       FT_Stream  source);
 
  /* */
 
index a5d7100a3fb57bef1de378179488de24d0e12320..1dfdcc63c128a0e8a2578cadb1c8dd93881b9ae9 100644 (file)
@@ -207,10 +207,10 @@ FT_BEGIN_HEADER
    *   transformation through @FT_Set_Transform!
    */
   typedef FT_Error
-  (*FTC_Face_Requester)( FTC_FaceID  face_id,
+  (*FTC_Face_Requester)(FTC_FaceID  face_id,
                          FT_Library  library,
                          FT_Pointer  request_data,
-                         FT_Face*    aface );
+                         FT_Face*    aface);
 
  /* */
 
@@ -304,14 +304,14 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_Manager_New( FT_Library          library,
+  FT_EXPORT(FT_Error)
+  FTC_Manager_New(FT_Library          library,
                    FT_UInt             max_faces,
                    FT_UInt             max_sizes,
                    FT_ULong            max_bytes,
                    FTC_Face_Requester  requester,
                    FT_Pointer          req_data,
-                   FTC_Manager        *amanager );
+                   FTC_Manager        *amanager);
 
 
   /*************************************************************************/
@@ -326,8 +326,8 @@ FT_BEGIN_HEADER
   /* <InOut>                                                               */
   /*    manager :: A handle to the manager.                                */
   /*                                                                       */
-  FT_EXPORT( void )
-  FTC_Manager_Reset( FTC_Manager  manager );
+  FT_EXPORT(void)
+  FTC_Manager_Reset(FTC_Manager  manager);
 
 
   /*************************************************************************/
@@ -341,8 +341,8 @@ FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    manager :: A handle to the target cache manager object.            */
   /*                                                                       */
-  FT_EXPORT( void )
-  FTC_Manager_Done( FTC_Manager  manager );
+  FT_EXPORT(void)
+  FTC_Manager_Done(FTC_Manager  manager);
 
 
   /*************************************************************************/
@@ -385,10 +385,10 @@ FT_BEGIN_HEADER
   /*    already been completely flushed, and still no memory was available */
   /*    for the operation.                                                 */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_Manager_LookupFace( FTC_Manager  manager,
+  FT_EXPORT(FT_Error)
+  FTC_Manager_LookupFace(FTC_Manager  manager,
                           FTC_FaceID   face_id,
-                          FT_Face     *aface );
+                          FT_Face     *aface);
 
 
   /*************************************************************************/
@@ -482,10 +482,10 @@ FT_BEGIN_HEADER
   /*    already been completely flushed, and still no memory is available  */
   /*    for the operation.                                                 */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_Manager_LookupSize( FTC_Manager  manager,
+  FT_EXPORT(FT_Error)
+  FTC_Manager_LookupSize(FTC_Manager  manager,
                           FTC_Scaler   scaler,
-                          FT_Size     *asize );
+                          FT_Size     *asize);
 
 
   /*************************************************************************/
@@ -503,9 +503,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    manager :: The cache manager handle.                               */
   /*                                                                       */
-  FT_EXPORT( void )
-  FTC_Node_Unref( FTC_Node     node,
-                  FTC_Manager  manager );
+  FT_EXPORT(void)
+  FTC_Node_Unref(FTC_Node     node,
+                  FTC_Manager  manager);
 
 
   /*************************************************************************
@@ -535,9 +535,9 @@ FT_BEGIN_HEADER
    *   destroyed when released by all their users.
    *
    */
-  FT_EXPORT( void )
-  FTC_Manager_RemoveFaceID( FTC_Manager  manager,
-                            FTC_FaceID   face_id );
+  FT_EXPORT(void)
+  FTC_Manager_RemoveFaceID(FTC_Manager  manager,
+                            FTC_FaceID   face_id);
 
 
   /*************************************************************************/
@@ -584,9 +584,9 @@ FT_BEGIN_HEADER
    *   manager.
    *
    */
-  FT_EXPORT( FT_Error )
-  FTC_CMapCache_New( FTC_Manager     manager,
-                     FTC_CMapCache  *acache );
+  FT_EXPORT(FT_Error)
+  FTC_CMapCache_New(FTC_Manager     manager,
+                     FTC_CMapCache  *acache);
 
 
   /************************************************************************
@@ -616,11 +616,11 @@ FT_BEGIN_HEADER
    *    Glyph index.  0~means `no glyph'.
    *
    */
-  FT_EXPORT( FT_UInt )
-  FTC_CMapCache_Lookup( FTC_CMapCache  cache,
+  FT_EXPORT(FT_UInt)
+  FTC_CMapCache_Lookup(FTC_CMapCache  cache,
                         FTC_FaceID     face_id,
                         FT_Int         cmap_index,
-                        FT_UInt32      char_code );
+                        FT_UInt32      char_code);
 
 
   /*************************************************************************/
@@ -689,10 +689,10 @@ FT_BEGIN_HEADER
   /* */
 
 
-#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \
-          ( (d1)->face_id == (d2)->face_id && \
+#define FTC_IMAGE_TYPE_COMPARE(d1, d2)      \
+          ((d1)->face_id == (d2)->face_id && \
             (d1)->width   == (d2)->width   && \
-            (d1)->flags   == (d2)->flags   )
+            (d1)->flags   == (d2)->flags)
 
 
   /*************************************************************************/
@@ -725,9 +725,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_ImageCache_New( FTC_Manager      manager,
-                      FTC_ImageCache  *acache );
+  FT_EXPORT(FT_Error)
+  FTC_ImageCache_New(FTC_Manager      manager,
+                      FTC_ImageCache  *acache);
 
 
   /*************************************************************************/
@@ -772,12 +772,12 @@ FT_BEGIN_HEADER
   /*    call to one of the caching sub-system APIs.  Don't assume that it  */
   /*    is persistent!                                                     */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_ImageCache_Lookup( FTC_ImageCache  cache,
+  FT_EXPORT(FT_Error)
+  FTC_ImageCache_Lookup(FTC_ImageCache  cache,
                          FTC_ImageType   type,
                          FT_UInt         gindex,
                          FT_Glyph       *aglyph,
-                         FTC_Node       *anode );
+                         FTC_Node       *anode);
 
 
   /*************************************************************************/
@@ -828,13 +828,13 @@ FT_BEGIN_HEADER
   /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */
   /*    glyphs; you should always use the FreeType cache API instead.      */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,
+  FT_EXPORT(FT_Error)
+  FTC_ImageCache_LookupScaler(FTC_ImageCache  cache,
                                FTC_Scaler      scaler,
                                FT_ULong        load_flags,
                                FT_UInt         gindex,
                                FT_Glyph       *aglyph,
-                               FTC_Node       *anode );
+                               FTC_Node       *anode);
 
 
   /*************************************************************************/
@@ -933,9 +933,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_SBitCache_New( FTC_Manager     manager,
-                     FTC_SBitCache  *acache );
+  FT_EXPORT(FT_Error)
+  FTC_SBitCache_New(FTC_Manager     manager,
+                     FTC_SBitCache  *acache);
 
 
   /*************************************************************************/
@@ -983,12 +983,12 @@ FT_BEGIN_HEADER
   /*    call to one of the caching sub-system APIs.  Don't assume that it  */
   /*    is persistent!                                                     */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_SBitCache_Lookup( FTC_SBitCache    cache,
+  FT_EXPORT(FT_Error)
+  FTC_SBitCache_Lookup(FTC_SBitCache    cache,
                         FTC_ImageType    type,
                         FT_UInt          gindex,
                         FTC_SBit        *sbit,
-                        FTC_Node        *anode );
+                        FTC_Node        *anode);
 
 
   /*************************************************************************/
@@ -1038,13 +1038,13 @@ FT_BEGIN_HEADER
   /*    call to one of the caching sub-system APIs.  Don't assume that it  */
   /*    is persistent!                                                     */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,
+  FT_EXPORT(FT_Error)
+  FTC_SBitCache_LookupScaler(FTC_SBitCache  cache,
                               FTC_Scaler     scaler,
                               FT_ULong       load_flags,
                               FT_UInt        gindex,
                               FTC_SBit      *sbit,
-                              FTC_Node      *anode );
+                              FTC_Node      *anode);
 
 
  /* */
index e4d039d02142b1a3e5b3ef6378e96fbb2b46325c..2f5b05c9092cb21eb0af91d06926bf2ca9234297 100644 (file)
@@ -133,10 +133,10 @@ FT_BEGIN_HEADER
    *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;
    *
    *
-   *     FT_Init_FreeType( &library );
+   *     FT_Init_FreeType(&library);
    *
-   *     FT_Property_Set( library, "cff",
-   *                               "hinting-engine", &hinting_engine );
+   *     FT_Property_Set(library, "cff",
+   *                               "hinting-engine", &hinting_engine);
    *   }
    *
    * @note:
@@ -184,10 +184,10 @@ FT_BEGIN_HEADER
    *     FT_Bool     no_stem_darkening = TRUE;
    *
    *
-   *     FT_Init_FreeType( &library );
+   *     FT_Init_FreeType(&library);
    *
-   *     FT_Property_Set( library, "cff",
-   *                               "no-stem-darkening", &no_stem_darkening );
+   *     FT_Property_Set(library, "cff",
+   *                               "no-stem-darkening", &no_stem_darkening);
    *   }
    *
    * @note:
@@ -224,10 +224,10 @@ FT_BEGIN_HEADER
    *                                      2000,   0 }; // x4, y4
    *
    *
-   *     FT_Init_FreeType( &library );
+   *     FT_Init_FreeType(&library);
    *
-   *     FT_Property_Set( library, "cff",
-   *                               "darkening-parameters", darken_params );
+   *     FT_Property_Set(library, "cff",
+   *                               "darkening-parameters", darken_params);
    *   }
    *
    *   The x~values give the stem width, and the y~values the darkening
index 203a30caf853632cfa2f4549676c7046789d8138..05d7df67ded524e90a96e7e23ce344ee5bae6bd1 100644 (file)
@@ -82,8 +82,8 @@ FT_BEGIN_HEADER
    * @since:
    *    2.3.6
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,
+  FT_EXPORT(FT_Error)
+  FT_Get_CID_Registry_Ordering_Supplement(FT_Face       face,
                                            const char*  *registry,
                                            const char*  *ordering,
                                            FT_Int       *supplement);
@@ -117,9 +117,9 @@ FT_BEGIN_HEADER
    * @since:
    *    2.3.9
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,
-                                      FT_Bool  *is_cid );
+  FT_EXPORT(FT_Error)
+  FT_Get_CID_Is_Internally_CID_Keyed(FT_Face   face,
+                                      FT_Bool  *is_cid);
 
 
   /**********************************************************************
@@ -151,10 +151,10 @@ FT_BEGIN_HEADER
    * @since:
    *    2.3.9
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_CID_From_Glyph_Index( FT_Face   face,
+  FT_EXPORT(FT_Error)
+  FT_Get_CID_From_Glyph_Index(FT_Face   face,
                                FT_UInt   glyph_index,
-                               FT_UInt  *cid );
+                               FT_UInt  *cid);
 
  /* */
 
index 76c7b9e36fc5d4cf49a55ba3c36171c7ac11743f..e56ec11c0068a7f1b0a8fdd1470af7a2ea5cff1e 100644 (file)
 
   /* generic errors */
 
-  FT_NOERRORDEF_( Ok,                                        0x00, \
-                  "no error" )
-
-  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \
-                "cannot open resource" )
-  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \
-                "unknown file format" )
-  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \
-                "broken file" )
-  FT_ERRORDEF_( Invalid_Version,                             0x04, \
-                "invalid FreeType version" )
-  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \
-                "module version is too low" )
-  FT_ERRORDEF_( Invalid_Argument,                            0x06, \
-                "invalid argument" )
-  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \
-                "unimplemented feature" )
-  FT_ERRORDEF_( Invalid_Table,                               0x08, \
-                "broken table" )
-  FT_ERRORDEF_( Invalid_Offset,                              0x09, \
-                "broken offset within table" )
-  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \
-                "array allocation size too large" )
-  FT_ERRORDEF_( Missing_Module,                              0x0B, \
-                "missing module" )
-  FT_ERRORDEF_( Missing_Property,                            0x0C, \
-                "missing property" )
+  FT_NOERRORDEF_(Ok,                                        0x00, \
+                  "no error")
+
+  FT_ERRORDEF_(Cannot_Open_Resource,                        0x01, \
+                "cannot open resource")
+  FT_ERRORDEF_(Unknown_File_Format,                         0x02, \
+                "unknown file format")
+  FT_ERRORDEF_(Invalid_File_Format,                         0x03, \
+                "broken file")
+  FT_ERRORDEF_(Invalid_Version,                             0x04, \
+                "invalid FreeType version")
+  FT_ERRORDEF_(Lower_Module_Version,                        0x05, \
+                "module version is too low")
+  FT_ERRORDEF_(Invalid_Argument,                            0x06, \
+                "invalid argument")
+  FT_ERRORDEF_(Unimplemented_Feature,                       0x07, \
+                "unimplemented feature")
+  FT_ERRORDEF_(Invalid_Table,                               0x08, \
+                "broken table")
+  FT_ERRORDEF_(Invalid_Offset,                              0x09, \
+                "broken offset within table")
+  FT_ERRORDEF_(Array_Too_Large,                             0x0A, \
+                "array allocation size too large")
+  FT_ERRORDEF_(Missing_Module,                              0x0B, \
+                "missing module")
+  FT_ERRORDEF_(Missing_Property,                            0x0C, \
+                "missing property")
 
   /* glyph/character errors */
 
-  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \
-                "invalid glyph index" )
-  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \
-                "invalid character code" )
-  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \
-                "unsupported glyph image format" )
-  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \
-                "cannot render this glyph format" )
-  FT_ERRORDEF_( Invalid_Outline,                             0x14, \
-                "invalid outline" )
-  FT_ERRORDEF_( Invalid_Composite,                           0x15, \
-                "invalid composite glyph" )
-  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \
-                "too many hints" )
-  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \
-                "invalid pixel size" )
+  FT_ERRORDEF_(Invalid_Glyph_Index,                         0x10, \
+                "invalid glyph index")
+  FT_ERRORDEF_(Invalid_Character_Code,                      0x11, \
+                "invalid character code")
+  FT_ERRORDEF_(Invalid_Glyph_Format,                        0x12, \
+                "unsupported glyph image format")
+  FT_ERRORDEF_(Cannot_Render_Glyph,                         0x13, \
+                "cannot render this glyph format")
+  FT_ERRORDEF_(Invalid_Outline,                             0x14, \
+                "invalid outline")
+  FT_ERRORDEF_(Invalid_Composite,                           0x15, \
+                "invalid composite glyph")
+  FT_ERRORDEF_(Too_Many_Hints,                              0x16, \
+                "too many hints")
+  FT_ERRORDEF_(Invalid_Pixel_Size,                          0x17, \
+                "invalid pixel size")
 
   /* handle errors */
 
-  FT_ERRORDEF_( Invalid_Handle,                              0x20, \
-                "invalid object handle" )
-  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \
-                "invalid library handle" )
-  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \
-                "invalid module handle" )
-  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \
-                "invalid face handle" )
-  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \
-                "invalid size handle" )
-  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \
-                "invalid glyph slot handle" )
-  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \
-                "invalid charmap handle" )
-  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \
-                "invalid cache manager handle" )
-  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \
-                "invalid stream handle" )
+  FT_ERRORDEF_(Invalid_Handle,                              0x20, \
+                "invalid object handle")
+  FT_ERRORDEF_(Invalid_Library_Handle,                      0x21, \
+                "invalid library handle")
+  FT_ERRORDEF_(Invalid_Driver_Handle,                       0x22, \
+                "invalid module handle")
+  FT_ERRORDEF_(Invalid_Face_Handle,                         0x23, \
+                "invalid face handle")
+  FT_ERRORDEF_(Invalid_Size_Handle,                         0x24, \
+                "invalid size handle")
+  FT_ERRORDEF_(Invalid_Slot_Handle,                         0x25, \
+                "invalid glyph slot handle")
+  FT_ERRORDEF_(Invalid_CharMap_Handle,                      0x26, \
+                "invalid charmap handle")
+  FT_ERRORDEF_(Invalid_Cache_Handle,                        0x27, \
+                "invalid cache manager handle")
+  FT_ERRORDEF_(Invalid_Stream_Handle,                       0x28, \
+                "invalid stream handle")
 
   /* driver errors */
 
-  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \
-                "too many modules" )
-  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \
-                "too many extensions" )
+  FT_ERRORDEF_(Too_Many_Drivers,                            0x30, \
+                "too many modules")
+  FT_ERRORDEF_(Too_Many_Extensions,                         0x31, \
+                "too many extensions")
 
   /* memory errors */
 
-  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \
-                "out of memory" )
-  FT_ERRORDEF_( Unlisted_Object,                             0x41, \
-                "unlisted object" )
+  FT_ERRORDEF_(Out_Of_Memory,                               0x40, \
+                "out of memory")
+  FT_ERRORDEF_(Unlisted_Object,                             0x41, \
+                "unlisted object")
 
   /* stream errors */
 
-  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \
-                "cannot open stream" )
-  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \
-                "invalid stream seek" )
-  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \
-                "invalid stream skip" )
-  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \
-                "invalid stream read" )
-  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \
-                "invalid stream operation" )
-  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \
-                "invalid frame operation" )
-  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \
-                "nested frame access" )
-  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \
-                "invalid frame read" )
+  FT_ERRORDEF_(Cannot_Open_Stream,                          0x51, \
+                "cannot open stream")
+  FT_ERRORDEF_(Invalid_Stream_Seek,                         0x52, \
+                "invalid stream seek")
+  FT_ERRORDEF_(Invalid_Stream_Skip,                         0x53, \
+                "invalid stream skip")
+  FT_ERRORDEF_(Invalid_Stream_Read,                         0x54, \
+                "invalid stream read")
+  FT_ERRORDEF_(Invalid_Stream_Operation,                    0x55, \
+                "invalid stream operation")
+  FT_ERRORDEF_(Invalid_Frame_Operation,                     0x56, \
+                "invalid frame operation")
+  FT_ERRORDEF_(Nested_Frame_Access,                         0x57, \
+                "nested frame access")
+  FT_ERRORDEF_(Invalid_Frame_Read,                          0x58, \
+                "invalid frame read")
 
   /* raster errors */
 
-  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \
-                "raster uninitialized" )
-  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \
-                "raster corrupted" )
-  FT_ERRORDEF_( Raster_Overflow,                             0x62, \
-                "raster overflow" )
-  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \
-                "negative height while rastering" )
+  FT_ERRORDEF_(Raster_Uninitialized,                        0x60, \
+                "raster uninitialized")
+  FT_ERRORDEF_(Raster_Corrupted,                            0x61, \
+                "raster corrupted")
+  FT_ERRORDEF_(Raster_Overflow,                             0x62, \
+                "raster overflow")
+  FT_ERRORDEF_(Raster_Negative_Height,                      0x63, \
+                "negative height while rastering")
 
   /* cache errors */
 
-  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \
-                "too many registered caches" )
+  FT_ERRORDEF_(Too_Many_Caches,                             0x70, \
+                "too many registered caches")
 
   /* TrueType and SFNT errors */
 
-  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \
-                "invalid opcode" )
-  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \
-                "too few arguments" )
-  FT_ERRORDEF_( Stack_Overflow,                              0x82, \
-                "stack overflow" )
-  FT_ERRORDEF_( Code_Overflow,                               0x83, \
-                "code overflow" )
-  FT_ERRORDEF_( Bad_Argument,                                0x84, \
-                "bad argument" )
-  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \
-                "division by zero" )
-  FT_ERRORDEF_( Invalid_Reference,                           0x86, \
-                "invalid reference" )
-  FT_ERRORDEF_( Debug_OpCode,                                0x87, \
-                "found debug opcode" )
-  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \
-                "found ENDF opcode in execution stream" )
-  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \
-                "nested DEFS" )
-  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \
-                "invalid code range" )
-  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \
-                "execution context too long" )
-  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \
-                "too many function definitions" )
-  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \
-                "too many instruction definitions" )
-  FT_ERRORDEF_( Table_Missing,                               0x8E, \
-                "SFNT font table missing" )
-  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \
-                "horizontal header (hhea) table missing" )
-  FT_ERRORDEF_( Locations_Missing,                           0x90, \
-                "locations (loca) table missing" )
-  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \
-                "name table missing" )
-  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \
-                "character map (cmap) table missing" )
-  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \
-                "horizontal metrics (hmtx) table missing" )
-  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \
-                "PostScript (post) table missing" )
-  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \
-                "invalid horizontal metrics" )
-  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \
-                "invalid character map (cmap) format" )
-  FT_ERRORDEF_( Invalid_PPem,                                0x97, \
-                "invalid ppem value" )
-  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \
-                "invalid vertical metrics" )
-  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \
-                "could not find context" )
-  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \
-                "invalid PostScript (post) table format" )
-  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \
-                "invalid PostScript (post) table" )
+  FT_ERRORDEF_(Invalid_Opcode,                              0x80, \
+                "invalid opcode")
+  FT_ERRORDEF_(Too_Few_Arguments,                           0x81, \
+                "too few arguments")
+  FT_ERRORDEF_(Stack_Overflow,                              0x82, \
+                "stack overflow")
+  FT_ERRORDEF_(Code_Overflow,                               0x83, \
+                "code overflow")
+  FT_ERRORDEF_(Bad_Argument,                                0x84, \
+                "bad argument")
+  FT_ERRORDEF_(Divide_By_Zero,                              0x85, \
+                "division by zero")
+  FT_ERRORDEF_(Invalid_Reference,                           0x86, \
+                "invalid reference")
+  FT_ERRORDEF_(Debug_OpCode,                                0x87, \
+                "found debug opcode")
+  FT_ERRORDEF_(ENDF_In_Exec_Stream,                         0x88, \
+                "found ENDF opcode in execution stream")
+  FT_ERRORDEF_(Nested_DEFS,                                 0x89, \
+                "nested DEFS")
+  FT_ERRORDEF_(Invalid_CodeRange,                           0x8A, \
+                "invalid code range")
+  FT_ERRORDEF_(Execution_Too_Long,                          0x8B, \
+                "execution context too long")
+  FT_ERRORDEF_(Too_Many_Function_Defs,                      0x8C, \
+                "too many function definitions")
+  FT_ERRORDEF_(Too_Many_Instruction_Defs,                   0x8D, \
+                "too many instruction definitions")
+  FT_ERRORDEF_(Table_Missing,                               0x8E, \
+                "SFNT font table missing")
+  FT_ERRORDEF_(Horiz_Header_Missing,                        0x8F, \
+                "horizontal header (hhea) table missing")
+  FT_ERRORDEF_(Locations_Missing,                           0x90, \
+                "locations (loca) table missing")
+  FT_ERRORDEF_(Name_Table_Missing,                          0x91, \
+                "name table missing")
+  FT_ERRORDEF_(CMap_Table_Missing,                          0x92, \
+                "character map (cmap) table missing")
+  FT_ERRORDEF_(Hmtx_Table_Missing,                          0x93, \
+                "horizontal metrics (hmtx) table missing")
+  FT_ERRORDEF_(Post_Table_Missing,                          0x94, \
+                "PostScript (post) table missing")
+  FT_ERRORDEF_(Invalid_Horiz_Metrics,                       0x95, \
+                "invalid horizontal metrics")
+  FT_ERRORDEF_(Invalid_CharMap_Format,                      0x96, \
+                "invalid character map (cmap) format")
+  FT_ERRORDEF_(Invalid_PPem,                                0x97, \
+                "invalid ppem value")
+  FT_ERRORDEF_(Invalid_Vert_Metrics,                        0x98, \
+                "invalid vertical metrics")
+  FT_ERRORDEF_(Could_Not_Find_Context,                      0x99, \
+                "could not find context")
+  FT_ERRORDEF_(Invalid_Post_Table_Format,                   0x9A, \
+                "invalid PostScript (post) table format")
+  FT_ERRORDEF_(Invalid_Post_Table,                          0x9B, \
+                "invalid PostScript (post) table")
 
   /* CFF, CID, and Type 1 errors */
 
-  FT_ERRORDEF_( Syntax_Error,                                0xA0, \
-                "opcode syntax error" )
-  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \
-                "argument stack underflow" )
-  FT_ERRORDEF_( Ignore,                                      0xA2, \
-                "ignore" )
-  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \
-                "no Unicode glyph name found" )
-  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4, \
-                "glyph to big for hinting" )
+  FT_ERRORDEF_(Syntax_Error,                                0xA0, \
+                "opcode syntax error")
+  FT_ERRORDEF_(Stack_Underflow,                             0xA1, \
+                "argument stack underflow")
+  FT_ERRORDEF_(Ignore,                                      0xA2, \
+                "ignore")
+  FT_ERRORDEF_(No_Unicode_Glyph_Name,                       0xA3, \
+                "no Unicode glyph name found")
+  FT_ERRORDEF_(Glyph_Too_Big,                               0xA4, \
+                "glyph to big for hinting")
 
   /* BDF errors */
 
-  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \
-                "`STARTFONT' field missing" )
-  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \
-                "`FONT' field missing" )
-  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \
-                "`SIZE' field missing" )
-  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \
-                "`FONTBOUNDINGBOX' field missing" )
-  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \
-                "`CHARS' field missing" )
-  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \
-                "`STARTCHAR' field missing" )
-  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \
-                "`ENCODING' field missing" )
-  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \
-                "`BBX' field missing" )
-  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \
-                "`BBX' too big" )
-  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \
-                "Font header corrupted or missing fields" )
-  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \
-                "Font glyphs corrupted or missing fields" )
+  FT_ERRORDEF_(Missing_Startfont_Field,                     0xB0, \
+                "`STARTFONT' field missing")
+  FT_ERRORDEF_(Missing_Font_Field,                          0xB1, \
+                "`FONT' field missing")
+  FT_ERRORDEF_(Missing_Size_Field,                          0xB2, \
+                "`SIZE' field missing")
+  FT_ERRORDEF_(Missing_Fontboundingbox_Field,               0xB3, \
+                "`FONTBOUNDINGBOX' field missing")
+  FT_ERRORDEF_(Missing_Chars_Field,                         0xB4, \
+                "`CHARS' field missing")
+  FT_ERRORDEF_(Missing_Startchar_Field,                     0xB5, \
+                "`STARTCHAR' field missing")
+  FT_ERRORDEF_(Missing_Encoding_Field,                      0xB6, \
+                "`ENCODING' field missing")
+  FT_ERRORDEF_(Missing_Bbx_Field,                           0xB7, \
+                "`BBX' field missing")
+  FT_ERRORDEF_(Bbx_Too_Big,                                 0xB8, \
+                "`BBX' too big")
+  FT_ERRORDEF_(Corrupted_Font_Header,                       0xB9, \
+                "Font header corrupted or missing fields")
+  FT_ERRORDEF_(Corrupted_Font_Glyphs,                       0xBA, \
+                "Font glyphs corrupted or missing fields")
 
 
 /* END */
index 0fa3e4dce19e179a66e7581c09af2035edc89538..0f92387b4e163e83abb0530ea87bc5ee88bc268f 100644 (file)
@@ -49,7 +49,7 @@
   /*     the error list.  It is followed by several FT_ERROR_DEF calls     */
   /*     (see below).                                                      */
   /*                                                                       */
-  /*   FT_ERROR_DEF( e, v, s ) ::                                          */
+  /*   FT_ERROR_DEF(e, v, s) ::                                          */
   /*     This macro is called to define one single error.                  */
   /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */
   /*     `v' is the error numerical value.                                 */
@@ -65,7 +65,7 @@
   /*                                                                       */
   /*     {                                                                 */
   /*       #undef __FTERRORS_H__                                           */
-  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */
+  /*       #define FT_ERRORDEF(e, v, s)  { e, s },                       */
   /*       #define FT_ERROR_START_LIST     {                               */
   /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */
   /*                                                                       */
   /*                                                           */
 #ifndef FT_ERRORDEF
 
-#define FT_ERRORDEF( e, v, s )  e = v,
+#define FT_ERRORDEF(e, v, s)  e = v,
 #define FT_ERROR_START_LIST     enum {
-#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
+#define FT_ERROR_END_LIST       FT_ERR_CAT(FT_ERR_PREFIX, Max) };
 
 #ifdef __cplusplus
 #define FT_NEED_EXTERN_C
 
 
   /* this macro is used to define an error */
-#define FT_ERRORDEF_( e, v, s )                                             \
-          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
+#define FT_ERRORDEF_(e, v, s)                                             \
+          FT_ERRORDEF(FT_ERR_CAT(FT_ERR_PREFIX, e), v + FT_ERR_BASE, s)
 
   /* this is only used for <module>_Err_Ok, which must be 0! */
-#define FT_NOERRORDEF_( e, v, s )                             \
-          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
+#define FT_NOERRORDEF_(e, v, s)                             \
+          FT_ERRORDEF(FT_ERR_CAT(FT_ERR_PREFIX, e), v, s)
 
 
 #ifdef FT_ERROR_START_LIST
index 453d4fa42c9a1965d1c6b51cfae3a7f916c2d21c..4c49791700b2813eacf8a97e80d13cd5ac941e51 100644 (file)
    * @since:
    *   2.3.0
    */
-  FT_EXPORT( FT_Int )
-  FT_Get_Gasp( FT_Face  face,
-               FT_UInt  ppem );
+  FT_EXPORT(FT_Int)
+  FT_Get_Gasp(FT_Face  face,
+               FT_UInt  ppem);
 
 /* */
 
index 2d30ed9de7b5b996b31ccef2805b6b4eda9c1c65..35fd658f7c39fd5286854deb049853ec4988afc2 100644 (file)
@@ -231,9 +231,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Glyph( FT_GlyphSlot  slot,
-                FT_Glyph     *aglyph );
+  FT_EXPORT(FT_Error)
+  FT_Get_Glyph(FT_GlyphSlot  slot,
+                FT_Glyph     *aglyph);
 
 
   /*************************************************************************/
@@ -255,9 +255,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Glyph_Copy( FT_Glyph   source,
-                 FT_Glyph  *target );
+  FT_EXPORT(FT_Error)
+  FT_Glyph_Copy(FT_Glyph   source,
+                 FT_Glyph  *target);
 
 
   /*************************************************************************/
@@ -284,10 +284,10 @@ FT_BEGIN_HEADER
   /*    The 2x2 transformation matrix is also applied to the glyph's       */
   /*    advance vector.                                                    */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Glyph_Transform( FT_Glyph    glyph,
+  FT_EXPORT(FT_Error)
+  FT_Glyph_Transform(FT_Glyph    glyph,
                       FT_Matrix*  matrix,
-                      FT_Vector*  delta );
+                      FT_Vector*  delta);
 
 
   /*************************************************************************/
@@ -417,10 +417,10 @@ FT_BEGIN_HEADER
   /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */
   /*    to @FT_GLYPH_BBOX_PIXELS.                                          */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Glyph_Get_CBox( FT_Glyph  glyph,
+  FT_EXPORT(void)
+  FT_Glyph_Get_CBox(FT_Glyph  glyph,
                      FT_UInt   bbox_mode,
-                     FT_BBox  *acbox );
+                     FT_BBox  *acbox);
 
 
   /*************************************************************************/
@@ -467,17 +467,17 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*                                                                       */
   /*        // load glyph                                                  */
-  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */
+  /*        error = FT_Load_Char(face, glyph_index, FT_LOAD_DEFAUT);     */
   /*                                                                       */
   /*        // extract glyph image                                         */
-  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */
+  /*        error = FT_Get_Glyph(face->glyph, &glyph);                   */
   /*                                                                       */
   /*        // convert to a bitmap (default render mode + destroying old)  */
-  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */
+  /*        if (glyph->format != FT_GLYPH_FORMAT_BITMAP)                 */
   /*        {                                                              */
-  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */
-  /*                                      0, 1 );                          */
-  /*          if ( error ) // `glyph' unchanged                            */
+  /*          error = FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_NORMAL,   */
+  /*                                      0, 1);                          */
+  /*          if (error) // `glyph' unchanged                            */
   /*            ...                                                        */
   /*        }                                                              */
   /*                                                                       */
@@ -488,7 +488,7 @@ FT_BEGIN_HEADER
   /*        ...                                                            */
   /*                                                                       */
   /*        // discard glyph image (bitmap or not)                         */
-  /*        FT_Done_Glyph( glyph );                                        */
+  /*        FT_Done_Glyph(glyph);                                        */
   /*      }                                                                */
   /*                                                                       */
   /*                                                                       */
@@ -501,13 +501,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*        ...                                                            */
   /*                                                                       */
-  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */
-  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */
-  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */
+  /*        for (idx = 0; i < MAX_GLYPHS; i++)                           */
+  /*          error = FT_Load_Glyph(face, idx, FT_LOAD_DEFAULT) ||       */
+  /*                  FT_Get_Glyph (face->glyph, &glyph[idx]);           */
   /*                                                                       */
   /*        ...                                                            */
   /*                                                                       */
-  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */
+  /*        for (idx = 0; i < MAX_GLYPHS; i++)                           */
   /*        {                                                              */
   /*          FT_Glyph  bitmap = glyphs[idx];                              */
   /*                                                                       */
@@ -516,24 +516,24 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*          // after this call, `bitmap' no longer points into           */
   /*          // the `glyphs' array (and the old value isn't destroyed)    */
-  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */
+  /*          FT_Glyph_To_Bitmap(&bitmap, FT_RENDER_MODE_MONO, 0, 0);    */
   /*                                                                       */
   /*          ...                                                          */
   /*                                                                       */
-  /*          FT_Done_Glyph( bitmap );                                     */
+  /*          FT_Done_Glyph(bitmap);                                     */
   /*        }                                                              */
   /*                                                                       */
   /*        ...                                                            */
   /*                                                                       */
-  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */
-  /*          FT_Done_Glyph( glyphs[idx] );                                */
+  /*        for (idx = 0; i < MAX_GLYPHS; i++)                           */
+  /*          FT_Done_Glyph(glyphs[idx]);                                */
   /*      }                                                                */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,
+  FT_EXPORT(FT_Error)
+  FT_Glyph_To_Bitmap(FT_Glyph*       the_glyph,
                       FT_Render_Mode  render_mode,
                       FT_Vector*      origin,
-                      FT_Bool         destroy );
+                      FT_Bool         destroy);
 
 
   /*************************************************************************/
@@ -547,8 +547,8 @@ FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    glyph :: A handle to the target glyph object.                      */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Done_Glyph( FT_Glyph  glyph );
+  FT_EXPORT(void)
+  FT_Done_Glyph(FT_Glyph  glyph);
 
   /* */
 
@@ -580,9 +580,9 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    The result is undefined if either `a' or `b' is zero.              */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Matrix_Multiply( const FT_Matrix*  a,
-                      FT_Matrix*        b );
+  FT_EXPORT(void)
+  FT_Matrix_Multiply(const FT_Matrix*  a,
+                      FT_Matrix*        b);
 
 
   /*************************************************************************/
@@ -600,8 +600,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Matrix_Invert( FT_Matrix*  matrix );
+  FT_EXPORT(FT_Error)
+  FT_Matrix_Invert(FT_Matrix*  matrix);
 
 
   /* */
index 6d38e327aa1c132005e6e8ab0a5eea1612207957..588e4e1fe7653bcd2fd0564a3b929d6b24434a82 100644 (file)
@@ -98,8 +98,8 @@ FT_BEGIN_HEADER
   /* Up to 0x1000 is used by otvalid.
      Ox2xxx is reserved for feature OT extension. */
 #define FT_VALIDATE_GX_START 0x4000
-#define FT_VALIDATE_GX_BITFIELD( tag )                  \
-  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
+#define FT_VALIDATE_GX_BITFIELD(tag)                  \
+  (FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX)
 
 
  /**********************************************************************
@@ -148,18 +148,18 @@ FT_BEGIN_HEADER
   *
   */
 
-#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )
-#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )
-#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )
-#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )
-#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )
-#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )
-#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )
-#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )
-#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )
-#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )
-
-#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \
+#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD(feat)
+#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD(mort)
+#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD(morx)
+#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD(bsln)
+#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD(just)
+#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD(kern)
+#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD(opbd)
+#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD(trak)
+#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD(prop)
+#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD(lcar)
+
+#define FT_VALIDATE_GX  (FT_VALIDATE_feat | \
                           FT_VALIDATE_mort | \
                           FT_VALIDATE_morx | \
                           FT_VALIDATE_bsln | \
@@ -168,7 +168,7 @@ FT_BEGIN_HEADER
                           FT_VALIDATE_opbd | \
                           FT_VALIDATE_trak | \
                           FT_VALIDATE_prop | \
-                          FT_VALIDATE_lcar )
+                          FT_VALIDATE_lcar)
 
 
   /* */
@@ -214,11 +214,11 @@ FT_BEGIN_HEADER
   *   application hasn't asked for validation, or the validator doesn't have
   *   the ability to validate the sfnt table.
   */
-  FT_EXPORT( FT_Error )
-  FT_TrueTypeGX_Validate( FT_Face   face,
+  FT_EXPORT(FT_Error)
+  FT_TrueTypeGX_Validate(FT_Face   face,
                           FT_UInt   validation_flags,
                           FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],
-                          FT_UInt   table_length );
+                          FT_UInt   table_length);
 
 
   /* */
@@ -243,9 +243,9 @@ FT_BEGIN_HEADER
   *   This function must be used to free the buffer allocated by
   *   @FT_TrueTypeGX_Validate only.
   */
-  FT_EXPORT( void )
-  FT_TrueTypeGX_Free( FT_Face   face,
-                      FT_Bytes  table );
+  FT_EXPORT(void)
+  FT_TrueTypeGX_Free(FT_Face   face,
+                      FT_Bytes  table);
 
 
   /* */
@@ -271,10 +271,10 @@ FT_BEGIN_HEADER
   *    FT_VALIDATE_CKERN ::
   *      Handle the `kern' as either classic Apple or Microsoft kern table.
   */
-#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )
-#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )
+#define FT_VALIDATE_MS     (FT_VALIDATE_GX_START << 0)
+#define FT_VALIDATE_APPLE  (FT_VALIDATE_GX_START << 1)
 
-#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
+#define FT_VALIDATE_CKERN  (FT_VALIDATE_MS | FT_VALIDATE_APPLE)
 
 
   /* */
@@ -314,10 +314,10 @@ FT_BEGIN_HEADER
   *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value
   *   indicates that the table doesn't exist in the font.
   */
-  FT_EXPORT( FT_Error )
-  FT_ClassicKern_Validate( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_ClassicKern_Validate(FT_Face    face,
                            FT_UInt    validation_flags,
-                           FT_Bytes  *ckern_table );
+                           FT_Bytes  *ckern_table);
 
 
   /* */
@@ -342,9 +342,9 @@ FT_BEGIN_HEADER
   *   This function must be used to free the buffer allocated by
   *   @FT_ClassicKern_Validate only.
   */
-  FT_EXPORT( void )
-  FT_ClassicKern_Free( FT_Face   face,
-                       FT_Bytes  table );
+  FT_EXPORT(void)
+  FT_ClassicKern_Free(FT_Face   face,
+                       FT_Bytes  table);
 
 
  /* */
index 78e726999ac44e040181a651bcca1066ab56dc93..faae8440130620a81da3aa92fb12a44b00a57e12 100644 (file)
@@ -87,9 +87,9 @@ FT_BEGIN_HEADER
   *   This function may return `FT_Err_Unimplemented_Feature' if your build
   *   of FreeType was not compiled with zlib support.
   */
-  FT_EXPORT( FT_Error )
-  FT_Stream_OpenGzip( FT_Stream  stream,
-                      FT_Stream  source );
+  FT_EXPORT(FT_Error)
+  FT_Stream_OpenGzip(FT_Stream  stream,
+                      FT_Stream  source);
 
 
  /************************************************************************
@@ -130,12 +130,12 @@ FT_BEGIN_HEADER
   *   This function may return `FT_Err_Unimplemented_Feature' if your build
   *   of FreeType was not compiled with zlib support.
   */
-  FT_EXPORT( FT_Error )
-  FT_Gzip_Uncompress( FT_Memory       memory,
+  FT_EXPORT(FT_Error)
+  FT_Gzip_Uncompress(FT_Memory       memory,
                       FT_Byte*        output,
                       FT_ULong*       output_len,
                       const FT_Byte*  input,
-                      FT_ULong        input_len );
+                      FT_ULong        input_len);
 
 
  /* */
index b66f0361d74a55d6742a252007a108f865b90655..27184c102bd502a6de5d73abf8a17293ecae5a32 100644 (file)
@@ -520,7 +520,7 @@ FT_BEGIN_HEADER
 
   /* */
 
-#define FT_CURVE_TAG( flag )  ( flag & 3 )
+#define FT_CURVE_TAG(flag)  (flag & 3)
 
 #define FT_CURVE_TAG_ON            1
 #define FT_CURVE_TAG_CONIC         0
@@ -531,8 +531,8 @@ FT_BEGIN_HEADER
 #define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */
 #define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */
 
-#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \
-                                     FT_CURVE_TAG_TOUCH_Y )
+#define FT_CURVE_TAG_TOUCH_BOTH    (FT_CURVE_TAG_TOUCH_X | \
+                                     FT_CURVE_TAG_TOUCH_Y)
 
 #define FT_Curve_Tag_On       FT_CURVE_TAG_ON
 #define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC
@@ -562,8 +562,8 @@ FT_BEGIN_HEADER
   /*    Error code.  0~means success.                                      */
   /*                                                                       */
   typedef int
-  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,
-                            void*             user );
+  (*FT_Outline_MoveToFunc)(const FT_Vector*  to,
+                            void*             user);
 
 #define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc
 
@@ -589,8 +589,8 @@ FT_BEGIN_HEADER
   /*    Error code.  0~means success.                                      */
   /*                                                                       */
   typedef int
-  (*FT_Outline_LineToFunc)( const FT_Vector*  to,
-                            void*             user );
+  (*FT_Outline_LineToFunc)(const FT_Vector*  to,
+                            void*             user);
 
 #define FT_Outline_LineTo_Func  FT_Outline_LineToFunc
 
@@ -620,9 +620,9 @@ FT_BEGIN_HEADER
   /*    Error code.  0~means success.                                      */
   /*                                                                       */
   typedef int
-  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,
+  (*FT_Outline_ConicToFunc)(const FT_Vector*  control,
                              const FT_Vector*  to,
-                             void*             user );
+                             void*             user);
 
 #define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc
 
@@ -652,10 +652,10 @@ FT_BEGIN_HEADER
   /*    Error code.  0~means success.                                      */
   /*                                                                       */
   typedef int
-  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,
+  (*FT_Outline_CubicToFunc)(const FT_Vector*  control1,
                              const FT_Vector*  control2,
                              const FT_Vector*  to,
-                             void*             user );
+                             void*             user);
 
 #define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc
 
@@ -732,17 +732,17 @@ FT_BEGIN_HEADER
   /*    this:                                                              */
   /*                                                                       */
   /*    {                                                                  */
-  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */
+  /*      #define FT_IMAGE_TAG(value, _x1, _x2, _x3, _x4)  value         */
   /*    }                                                                  */
   /*                                                                       */
   /*    to get a simple enumeration without assigning special numbers.     */
   /*                                                                       */
 #ifndef FT_IMAGE_TAG
-#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \
-          value = ( ( (unsigned long)_x1 << 24 ) | \
-                    ( (unsigned long)_x2 << 16 ) | \
-                    ( (unsigned long)_x3 << 8  ) | \
-                      (unsigned long)_x4         )
+#define FT_IMAGE_TAG(value, _x1, _x2, _x3, _x4)  \
+          value = (((unsigned long)_x1 << 24) | \
+                    ((unsigned long)_x2 << 16) | \
+                    ((unsigned long)_x3 << 8) | \
+                      (unsigned long)_x4  )
 #endif /* FT_IMAGE_TAG */
 
 
@@ -786,12 +786,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef enum  FT_Glyph_Format_
   {
-    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
+    FT_IMAGE_TAG(FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0),
 
-    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
-    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),
-    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),
-    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )
+    FT_IMAGE_TAG(FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p'),
+    FT_IMAGE_TAG(FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's'),
+    FT_IMAGE_TAG(FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l'),
+    FT_IMAGE_TAG(FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't')
 
   } FT_Glyph_Format;
 
@@ -943,10 +943,10 @@ FT_BEGIN_HEADER
   /*    only for those scanlines that do have `gray' pixels on them.       */
   /*                                                                       */
   typedef void
-  (*FT_SpanFunc)( int             y,
+  (*FT_SpanFunc)(int             y,
                   int             count,
                   const FT_Span*  spans,
-                  void*           user );
+                  void*           user);
 
 #define FT_Raster_Span_Func  FT_SpanFunc
 
@@ -975,9 +975,9 @@ FT_BEGIN_HEADER
   /*   1~if the pixel is `set', 0~otherwise.                               */
   /*                                                                       */
   typedef int
-  (*FT_Raster_BitTest_Func)( int    y,
+  (*FT_Raster_BitTest_Func)(int    y,
                              int    x,
-                             void*  user );
+                             void*  user);
 
 
   /*************************************************************************/
@@ -1003,9 +1003,9 @@ FT_BEGIN_HEADER
   /*    1~if the pixel is `set', 0~otherwise.                              */
   /*                                                                       */
   typedef void
-  (*FT_Raster_BitSet_Func)( int    y,
+  (*FT_Raster_BitSet_Func)(int    y,
                             int    x,
-                            void*  user );
+                            void*  user);
 
 
   /*************************************************************************/
@@ -1150,8 +1150,8 @@ FT_BEGIN_HEADER
   /*    completely ignored by a given raster implementation.               */
   /*                                                                       */
   typedef int
-  (*FT_Raster_NewFunc)( void*       memory,
-                        FT_Raster*  raster );
+  (*FT_Raster_NewFunc)(void*       memory,
+                        FT_Raster*  raster);
 
 #define FT_Raster_New_Func  FT_Raster_NewFunc
 
@@ -1168,7 +1168,7 @@ FT_BEGIN_HEADER
   /*    raster :: A handle to the raster object.                           */
   /*                                                                       */
   typedef void
-  (*FT_Raster_DoneFunc)( FT_Raster  raster );
+  (*FT_Raster_DoneFunc)(FT_Raster  raster);
 
 #define FT_Raster_Done_Func  FT_Raster_DoneFunc
 
@@ -1201,9 +1201,9 @@ FT_BEGIN_HEADER
   /*    recommended for efficiency purposes.                               */
   /*                                                                       */
   typedef void
-  (*FT_Raster_ResetFunc)( FT_Raster       raster,
+  (*FT_Raster_ResetFunc)(FT_Raster       raster,
                           unsigned char*  pool_base,
-                          unsigned long   pool_size );
+                          unsigned long   pool_size);
 
 #define FT_Raster_Reset_Func  FT_Raster_ResetFunc
 
@@ -1227,9 +1227,9 @@ FT_BEGIN_HEADER
   /*    args   :: A pointer to the new mode/property to use.               */
   /*                                                                       */
   typedef int
-  (*FT_Raster_SetModeFunc)( FT_Raster      raster,
+  (*FT_Raster_SetModeFunc)(FT_Raster      raster,
                             unsigned long  mode,
-                            void*          args );
+                            void*          args);
 
 #define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc
 
@@ -1269,8 +1269,8 @@ FT_BEGIN_HEADER
   /*         composition).                                                 */
   /*                                                                       */
   typedef int
-  (*FT_Raster_RenderFunc)( FT_Raster                raster,
-                           const FT_Raster_Params*  params );
+  (*FT_Raster_RenderFunc)(FT_Raster                raster,
+                           const FT_Raster_Params*  params);
 
 #define FT_Raster_Render_Func  FT_Raster_RenderFunc
 
index aaf689ff16c152fb19eade89f4cbd454b0fe2182..ced48917223585c4dda2e542116f302356f83777 100644 (file)
@@ -176,9 +176,9 @@ FT_BEGIN_HEADER
    *
    */
   typedef FT_Error
-  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,
+  (*FT_Incremental_GetGlyphDataFunc)(FT_Incremental  incremental,
                                       FT_UInt         glyph_index,
-                                      FT_Data*        adata );
+                                      FT_Data*        adata);
 
 
   /***************************************************************************
@@ -201,8 +201,8 @@ FT_BEGIN_HEADER
    *
    */
   typedef void
-  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,
-                                       FT_Data*        data );
+  (*FT_Incremental_FreeGlyphDataFunc)(FT_Incremental  incremental,
+                                       FT_Data*        data);
 
 
   /***************************************************************************
@@ -239,10 +239,10 @@ FT_BEGIN_HEADER
    */
   typedef FT_Error
   (*FT_Incremental_GetGlyphMetricsFunc)
-                      ( FT_Incremental              incremental,
+                      (FT_Incremental              incremental,
                         FT_UInt                     glyph_index,
                         FT_Bool                     vertical,
-                        FT_Incremental_MetricsRec  *ametrics );
+                        FT_Incremental_MetricsRec  *ametrics);
 
 
   /**************************************************************************
@@ -306,7 +306,7 @@ FT_BEGIN_HEADER
    *       open_args.params     = &parameter; // we use one optional argument
    *
    *       // open the font
-   *       error = FT_Open_Face( library, &open_args, index, &face );
+   *       error = FT_Open_Face(library, &open_args, index, &face);
    *       ...
    *     }
    *
@@ -341,7 +341,7 @@ FT_BEGIN_HEADER
    *   an incremental loading object to be used by FreeType.
    *
    */
-#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
+#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG('i', 'n', 'c', 'r')
 
   /* */
 
index 39206f0192741b82836a3c66aa409f9074db9647..9a42d6e4236a58d8e9d1969bb22e7f68e07cf9d9 100644 (file)
@@ -195,9 +195,9 @@ FT_BEGIN_HEADER
    * @since:
    *   2.3.0
    */
-  FT_EXPORT( FT_Error )
-  FT_Library_SetLcdFilter( FT_Library    library,
-                           FT_LcdFilter  filter );
+  FT_EXPORT(FT_Error)
+  FT_Library_SetLcdFilter(FT_Library    library,
+                           FT_LcdFilter  filter);
 
 
   /**************************************************************************
@@ -236,9 +236,9 @@ FT_BEGIN_HEADER
    * @since:
    *   2.4.0
    */
-  FT_EXPORT( FT_Error )
-  FT_Library_SetLcdFilterWeights( FT_Library      library,
-                                  unsigned char  *weights );
+  FT_EXPORT(FT_Error)
+  FT_Library_SetLcdFilterWeights(FT_Library      library,
+                                  unsigned char  *weights);
 
   /* */
 
index 241e21e555cd479deb88c69090c286fa94fd97a5..4153ecca70de7e2000965d8abae9d04b2e597f2f 100644 (file)
@@ -90,9 +90,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    List node.  NULL if it wasn't found.                               */
   /*                                                                       */
-  FT_EXPORT( FT_ListNode )
-  FT_List_Find( FT_List  list,
-                void*    data );
+  FT_EXPORT(FT_ListNode)
+  FT_List_Find(FT_List  list,
+                void*    data);
 
 
   /*************************************************************************/
@@ -107,9 +107,9 @@ FT_BEGIN_HEADER
   /*    list :: A pointer to the parent list.                              */
   /*    node :: The node to append.                                        */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_List_Add( FT_List      list,
-               FT_ListNode  node );
+  FT_EXPORT(void)
+  FT_List_Add(FT_List      list,
+               FT_ListNode  node);
 
 
   /*************************************************************************/
@@ -124,9 +124,9 @@ FT_BEGIN_HEADER
   /*    list :: A pointer to parent list.                                  */
   /*    node :: The node to insert.                                        */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_List_Insert( FT_List      list,
-                  FT_ListNode  node );
+  FT_EXPORT(void)
+  FT_List_Insert(FT_List      list,
+                  FT_ListNode  node);
 
 
   /*************************************************************************/
@@ -144,9 +144,9 @@ FT_BEGIN_HEADER
   /* <InOut>                                                               */
   /*    list :: A pointer to the parent list.                              */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_List_Remove( FT_List      list,
-                  FT_ListNode  node );
+  FT_EXPORT(void)
+  FT_List_Remove(FT_List      list,
+                  FT_ListNode  node);
 
 
   /*************************************************************************/
@@ -162,9 +162,9 @@ FT_BEGIN_HEADER
   /*    list :: A pointer to the parent list.                              */
   /*    node :: The node to move.                                          */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_List_Up( FT_List      list,
-              FT_ListNode  node );
+  FT_EXPORT(void)
+  FT_List_Up(FT_List      list,
+              FT_ListNode  node);
 
 
   /*************************************************************************/
@@ -183,8 +183,8 @@ FT_BEGIN_HEADER
   /*            Can be used to point to the iteration's state.             */
   /*                                                                       */
   typedef FT_Error
-  (*FT_List_Iterator)( FT_ListNode  node,
-                       void*        user );
+  (*FT_List_Iterator)(FT_ListNode  node,
+                       void*        user);
 
 
   /*************************************************************************/
@@ -206,10 +206,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The result (a FreeType error code) of the last iterator call.      */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_List_Iterate( FT_List           list,
+  FT_EXPORT(FT_Error)
+  FT_List_Iterate(FT_List           list,
                    FT_List_Iterator  iterator,
-                   void*             user );
+                   void*             user);
 
 
   /*************************************************************************/
@@ -231,9 +231,9 @@ FT_BEGIN_HEADER
   /*              be used to point to the iteration's state.               */
   /*                                                                       */
   typedef void
-  (*FT_List_Destructor)( FT_Memory  memory,
+  (*FT_List_Destructor)(FT_Memory  memory,
                          void*      data,
-                         void*      user );
+                         void*      user);
 
 
   /*************************************************************************/
@@ -259,11 +259,11 @@ FT_BEGIN_HEADER
   /*    This function expects that all nodes added by @FT_List_Add or      */
   /*    @FT_List_Insert have been dynamically allocated.                   */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_List_Finalize( FT_List             list,
+  FT_EXPORT(void)
+  FT_List_Finalize(FT_List             list,
                     FT_List_Destructor  destroy,
                     FT_Memory           memory,
-                    void*               user );
+                    void*               user);
 
 
   /* */
index 00d40169a7533e77f84e3817fbe50304e9c9e690..3ea50779d9c3a8878f2f60bf62e3f18312048f8b 100644 (file)
@@ -84,9 +84,9 @@ FT_BEGIN_HEADER
   *   This function may return `FT_Err_Unimplemented_Feature' if your build
   *   of FreeType was not compiled with LZW support.
   */
-  FT_EXPORT( FT_Error )
-  FT_Stream_OpenLZW( FT_Stream  stream,
-                     FT_Stream  source );
+  FT_EXPORT(FT_Error)
+  FT_Stream_OpenLZW(FT_Stream  stream,
+                     FT_Stream  source);
 
  /* */
 
index 42874fe6fc1510249d61aaedb2701a434ceda5bc..8376e41d667b95c6184c98959c93884e10e111ad 100644 (file)
@@ -92,15 +92,15 @@ FT_BEGIN_HEADER
   /*    that are installed in the system as follows.                       */
   /*                                                                       */
   /*    {                                                                  */
-  /*      fond = GetResource( 'FOND', fontName );                          */
-  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */
+  /*      fond = GetResource('FOND', fontName);                          */
+  /*      error = FT_New_Face_From_FOND(library, fond, 0, &face);        */
   /*    }                                                                  */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Face_From_FOND( FT_Library  library,
+  FT_EXPORT(FT_Error)
+  FT_New_Face_From_FOND(FT_Library  library,
                          Handle      fond,
                          FT_Long     face_index,
-                         FT_Face    *aface )
+                         FT_Face    *aface)
                        FT_DEPRECATED_ATTRIBUTE;
 
 
@@ -126,10 +126,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_GetFile_From_Mac_Name( const char*  fontName,
+  FT_EXPORT(FT_Error)
+  FT_GetFile_From_Mac_Name(const char*  fontName,
                             FSSpec*      pathSpec,
-                            FT_Long*     face_index )
+                            FT_Long*     face_index)
                           FT_DEPRECATED_ATTRIBUTE;
 
 
@@ -154,10 +154,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
+  FT_EXPORT(FT_Error)
+  FT_GetFile_From_Mac_ATS_Name(const char*  fontName,
                                 FSSpec*      pathSpec,
-                                FT_Long*     face_index )
+                                FT_Long*     face_index)
                               FT_DEPRECATED_ATTRIBUTE;
 
 
@@ -185,11 +185,11 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,
+  FT_EXPORT(FT_Error)
+  FT_GetFilePath_From_Mac_ATS_Name(const char*  fontName,
                                     UInt8*       path,
                                     UInt32       maxPathSize,
-                                    FT_Long*     face_index )
+                                    FT_Long*     face_index)
                                   FT_DEPRECATED_ATTRIBUTE;
 
 
@@ -220,11 +220,11 @@ FT_BEGIN_HEADER
   /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */
   /*    it accepts an FSSpec instead of a path.                            */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Face_From_FSSpec( FT_Library     library,
+  FT_EXPORT(FT_Error)
+  FT_New_Face_From_FSSpec(FT_Library     library,
                            const FSSpec  *spec,
                            FT_Long        face_index,
-                           FT_Face       *aface )
+                           FT_Face       *aface)
                          FT_DEPRECATED_ATTRIBUTE;
 
 
@@ -255,11 +255,11 @@ FT_BEGIN_HEADER
   /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */
   /*    it accepts an FSRef instead of a path.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Face_From_FSRef( FT_Library    library,
+  FT_EXPORT(FT_Error)
+  FT_New_Face_From_FSRef(FT_Library    library,
                           const FSRef  *ref,
                           FT_Long       face_index,
-                          FT_Face      *aface )
+                          FT_Face      *aface)
                         FT_DEPRECATED_ATTRIBUTE;
 
   /* */
index 837975a0b5cd0070ce2b4cd9ffa1847e0a89fac7..0e1b274d79a8f20b05aacbac8c2ad708cf24b5f0 100644 (file)
@@ -240,9 +240,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Multi_Master( FT_Face           face,
-                       FT_Multi_Master  *amaster );
+  FT_EXPORT(FT_Error)
+  FT_Get_Multi_Master(FT_Face           face,
+                       FT_Multi_Master  *amaster);
 
 
   /*************************************************************************/
@@ -263,9 +263,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_MM_Var( FT_Face      face,
-                 FT_MM_Var*  *amaster );
+  FT_EXPORT(FT_Error)
+  FT_Get_MM_Var(FT_Face      face,
+                 FT_MM_Var*  *amaster);
 
 
   /*************************************************************************/
@@ -291,10 +291,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_MM_Design_Coordinates( FT_Face   face,
+  FT_EXPORT(FT_Error)
+  FT_Set_MM_Design_Coordinates(FT_Face   face,
                                 FT_UInt   num_coords,
-                                FT_Long*  coords );
+                                FT_Long*  coords);
 
 
   /*************************************************************************/
@@ -318,10 +318,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_Var_Design_Coordinates( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Set_Var_Design_Coordinates(FT_Face    face,
                                  FT_UInt    num_coords,
-                                 FT_Fixed*  coords );
+                                 FT_Fixed*  coords);
 
 
   /*************************************************************************/
@@ -346,10 +346,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_MM_Blend_Coordinates( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Set_MM_Blend_Coordinates(FT_Face    face,
                                FT_UInt    num_coords,
-                               FT_Fixed*  coords );
+                               FT_Fixed*  coords);
 
 
   /*************************************************************************/
@@ -360,10 +360,10 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_Var_Blend_Coordinates( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Set_Var_Blend_Coordinates(FT_Face    face,
                                 FT_UInt    num_coords,
-                                FT_Fixed*  coords );
+                                FT_Fixed*  coords);
 
 
   /* */
index 22878f8c6d72d0d5d2e9f771d29dca8cacef6d64..6f37f90ea78a715768b8ee0999f1f0aa11289d64 100644 (file)
@@ -118,7 +118,7 @@ FT_BEGIN_HEADER
   /*    module :: The module to initialize.                                */
   /*                                                                       */
   typedef FT_Error
-  (*FT_Module_Constructor)( FT_Module  module );
+  (*FT_Module_Constructor)(FT_Module  module);
 
 
   /*************************************************************************/
@@ -133,7 +133,7 @@ FT_BEGIN_HEADER
   /*    module :: The module to finalize.                                  */
   /*                                                                       */
   typedef void
-  (*FT_Module_Destructor)( FT_Module  module );
+  (*FT_Module_Destructor)(FT_Module  module);
 
 
   /*************************************************************************/
@@ -150,8 +150,8 @@ FT_BEGIN_HEADER
   /*    name ::   The name of the interface in the module.                 */
   /*                                                                       */
   typedef FT_Module_Interface
-  (*FT_Module_Requester)( FT_Module    module,
-                          const char*  name );
+  (*FT_Module_Requester)(FT_Module    module,
+                          const char*  name);
 
 
   /*************************************************************************/
@@ -221,9 +221,9 @@ FT_BEGIN_HEADER
   /*    An error will be returned if a module already exists by that name, */
   /*    or if the module requires a version of FreeType that is too great. */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Add_Module( FT_Library              library,
-                 const FT_Module_Class*  clazz );
+  FT_EXPORT(FT_Error)
+  FT_Add_Module(FT_Library              library,
+                 const FT_Module_Class*  clazz);
 
 
   /*************************************************************************/
@@ -246,9 +246,9 @@ FT_BEGIN_HEADER
   /*    FreeType's internal modules aren't documented very well, and you   */
   /*    should look up the source code for details.                        */
   /*                                                                       */
-  FT_EXPORT( FT_Module )
-  FT_Get_Module( FT_Library   library,
-                 const char*  module_name );
+  FT_EXPORT(FT_Module)
+  FT_Get_Module(FT_Library   library,
+                 const char*  module_name);
 
 
   /*************************************************************************/
@@ -271,9 +271,9 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    The module object is destroyed by the function in case of success. */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Remove_Module( FT_Library  library,
-                    FT_Module   module );
+  FT_EXPORT(FT_Error)
+  FT_Remove_Module(FT_Library  library,
+                    FT_Module   module);
 
 
   /**********************************************************************
@@ -319,7 +319,7 @@ FT_BEGIN_HEADER
    *
    *
    *      bar = 1;
-   *      FT_Property_Set( library, "foo", "bar", &bar );
+   *      FT_Property_Set(library, "foo", "bar", &bar);
    *    }
    *
    *    Note that the FreeType Cache sub-system doesn't recognize module
@@ -336,11 +336,11 @@ FT_BEGIN_HEADER
    *    2.4.11
    *
    */
-  FT_EXPORT( FT_Error )
-  FT_Property_Set( FT_Library        library,
+  FT_EXPORT(FT_Error)
+  FT_Property_Set(FT_Library        library,
                    const FT_String*  module_name,
                    const FT_String*  property_name,
-                   const void*       value );
+                   const void*       value);
 
 
   /**********************************************************************
@@ -390,7 +390,7 @@ FT_BEGIN_HEADER
    *      range  baz;
    *
    *
-   *      FT_Property_Get( library, "foo", "baz", &baz );
+   *      FT_Property_Get(library, "foo", "baz", &baz);
    *    }
    *
    *    It is not possible to retrieve properties of the FreeType Cache
@@ -400,11 +400,11 @@ FT_BEGIN_HEADER
    *    2.4.11
    *
    */
-  FT_EXPORT( FT_Error )
-  FT_Property_Get( FT_Library        library,
+  FT_EXPORT(FT_Error)
+  FT_Property_Get(FT_Library        library,
                    const FT_String*  module_name,
                    const FT_String*  property_name,
-                   void*             value );
+                   void*             value);
 
 
   /*************************************************************************/
@@ -430,8 +430,8 @@ FT_BEGIN_HEADER
   /* <Since>                                                               */
   /*    2.4.2                                                              */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Reference_Library( FT_Library  library );
+  FT_EXPORT(FT_Error)
+  FT_Reference_Library(FT_Library  library);
 
 
   /*************************************************************************/
@@ -464,9 +464,9 @@ FT_BEGIN_HEADER
   /*    See the discussion of reference counters in the description of     */
   /*    @FT_Reference_Library.                                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Library( FT_Memory    memory,
-                  FT_Library  *alibrary );
+  FT_EXPORT(FT_Error)
+  FT_New_Library(FT_Memory    memory,
+                  FT_Library  *alibrary);
 
 
   /*************************************************************************/
@@ -488,13 +488,13 @@ FT_BEGIN_HEADER
   /*    See the discussion of reference counters in the description of     */
   /*    @FT_Reference_Library.                                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Done_Library( FT_Library  library );
+  FT_EXPORT(FT_Error)
+  FT_Done_Library(FT_Library  library);
 
 /* */
 
   typedef void
-  (*FT_DebugHook_Func)( void*  arg );
+  (*FT_DebugHook_Func)(void*  arg);
 
 
   /*************************************************************************/
@@ -524,10 +524,10 @@ FT_BEGIN_HEADER
   /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */
   /*    This is a bug and will be fixed in a forthcoming release.          */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Set_Debug_Hook( FT_Library         library,
+  FT_EXPORT(void)
+  FT_Set_Debug_Hook(FT_Library         library,
                      FT_UInt            hook_index,
-                     FT_DebugHook_Func  debug_hook );
+                     FT_DebugHook_Func  debug_hook);
 
 
   /*************************************************************************/
@@ -543,8 +543,8 @@ FT_BEGIN_HEADER
   /* <InOut>                                                               */
   /*    library :: A handle to a new library object.                       */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Add_Default_Modules( FT_Library  library );
+  FT_EXPORT(void)
+  FT_Add_Default_Modules(FT_Library  library);
 
 
 
@@ -626,8 +626,8 @@ FT_BEGIN_HEADER
    *     2.2
    *
    */
-  FT_EXPORT( FT_TrueTypeEngineType )
-  FT_Get_TrueType_Engine_Type( FT_Library  library );
+  FT_EXPORT(FT_TrueTypeEngineType)
+  FT_Get_TrueType_Engine_Type(FT_Library  library);
 
 
   /* */
index 5a27db151a31d09975e2fe2141cee4c105de9e6b..75470b7f5256a78c0f00ec40929aecf47f239902 100644 (file)
   /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */
   /* provides some macros in `fttypes.h'.                                  */
   /*                                                                       */
-  /*   FT_ERR( err )                                                       */
+  /*   FT_ERR(err)                                                       */
   /*     Add current error module prefix (as defined with the              */
   /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */
   /*     the line                                                          */
   /*                                                                       */
-  /*       error = FT_ERR( Invalid_Outline );                              */
+  /*       error = FT_ERR(Invalid_Outline);                              */
   /*                                                                       */
   /*     expands to                                                        */
   /*                                                                       */
   /*       error = BDF_Err_Invalid_Outline;                                */
   /*                                                                       */
   /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */
-  /*     of `FT_ERR( Ok )'.                                                */
+  /*     of `FT_ERR(Ok)'.                                                */
   /*                                                                       */
-  /*   FT_ERR_EQ( errcode, err )                                           */
-  /*   FT_ERR_NEQ( errcode, err )                                          */
+  /*   FT_ERR_EQ(errcode, err)                                           */
+  /*   FT_ERR_NEQ(errcode, err)                                          */
   /*     Compare error code `errcode' with the error `err' for equality    */
   /*     and inequality, respectively.  Example:                           */
   /*                                                                       */
-  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */
+  /*       if (FT_ERR_EQ(error, Invalid_Outline))                      */
   /*         ...                                                           */
   /*                                                                       */
   /*     Using this macro you don't have to think about error prefixes.    */
   /*     Of course, if module errors are not active, the above example is  */
   /*     the same as                                                       */
   /*                                                                       */
-  /*       if ( error == FT_Err_Invalid_Outline )                          */
+  /*       if (error == FT_Err_Invalid_Outline)                          */
   /*         ...                                                           */
   /*                                                                       */
-  /*   FT_ERROR_BASE( errcode )                                            */
-  /*   FT_ERROR_MODULE( errcode )                                          */
+  /*   FT_ERROR_BASE(errcode)                                            */
+  /*   FT_ERROR_MODULE(errcode)                                          */
   /*     Get base error and module error code, respectively.               */
   /*                                                                       */
   /*                                                                       */
@@ -75,7 +75,7 @@
   /*                                                                       */
   /*   {                                                                   */
   /*     #undef __FTMODERR_H__                                             */
-  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */
+  /*     #define FT_MODERRDEF(e, v, s)  { FT_Mod_Err_ ## e, s },         */
   /*     #define FT_MODERR_START_LIST     {                                */
   /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */
   /*                                                                       */
 #ifndef FT_MODERRDEF
 
 #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
-#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,
+#define FT_MODERRDEF(e, v, s)  FT_Mod_Err_ ## e = v,
 #else
-#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,
+#define FT_MODERRDEF(e, v, s)  FT_Mod_Err_ ## e = 0,
 #endif
 
 #define FT_MODERR_START_LIST  enum {
 #endif
 
 
-  FT_MODERRDEF( Base,      0x000, "base module" )
-  FT_MODERRDEF( Autofit,   0x100, "autofitter module" )
-  FT_MODERRDEF( BDF,       0x200, "BDF module" )
-  FT_MODERRDEF( Bzip2,     0x300, "Bzip2 module" )
-  FT_MODERRDEF( Cache,     0x400, "cache module" )
-  FT_MODERRDEF( CFF,       0x500, "CFF module" )
-  FT_MODERRDEF( CID,       0x600, "CID module" )
-  FT_MODERRDEF( Gzip,      0x700, "Gzip module" )
-  FT_MODERRDEF( LZW,       0x800, "LZW module" )
-  FT_MODERRDEF( OTvalid,   0x900, "OpenType validation module" )
-  FT_MODERRDEF( PCF,       0xA00, "PCF module" )
-  FT_MODERRDEF( PFR,       0xB00, "PFR module" )
-  FT_MODERRDEF( PSaux,     0xC00, "PS auxiliary module" )
-  FT_MODERRDEF( PShinter,  0xD00, "PS hinter module" )
-  FT_MODERRDEF( PSnames,   0xE00, "PS names module" )
-  FT_MODERRDEF( Raster,    0xF00, "raster module" )
-  FT_MODERRDEF( SFNT,     0x1000, "SFNT module" )
-  FT_MODERRDEF( Smooth,   0x1100, "smooth raster module" )
-  FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
-  FT_MODERRDEF( Type1,    0x1300, "Type 1 module" )
-  FT_MODERRDEF( Type42,   0x1400, "Type 42 module" )
-  FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
-  FT_MODERRDEF( GXvalid,  0x1600, "GX validation module" )
+  FT_MODERRDEF(Base,      0x000, "base module")
+  FT_MODERRDEF(Autofit,   0x100, "autofitter module")
+  FT_MODERRDEF(BDF,       0x200, "BDF module")
+  FT_MODERRDEF(Bzip2,     0x300, "Bzip2 module")
+  FT_MODERRDEF(Cache,     0x400, "cache module")
+  FT_MODERRDEF(CFF,       0x500, "CFF module")
+  FT_MODERRDEF(CID,       0x600, "CID module")
+  FT_MODERRDEF(Gzip,      0x700, "Gzip module")
+  FT_MODERRDEF(LZW,       0x800, "LZW module")
+  FT_MODERRDEF(OTvalid,   0x900, "OpenType validation module")
+  FT_MODERRDEF(PCF,       0xA00, "PCF module")
+  FT_MODERRDEF(PFR,       0xB00, "PFR module")
+  FT_MODERRDEF(PSaux,     0xC00, "PS auxiliary module")
+  FT_MODERRDEF(PShinter,  0xD00, "PS hinter module")
+  FT_MODERRDEF(PSnames,   0xE00, "PS names module")
+  FT_MODERRDEF(Raster,    0xF00, "raster module")
+  FT_MODERRDEF(SFNT,     0x1000, "SFNT module")
+  FT_MODERRDEF(Smooth,   0x1100, "smooth raster module")
+  FT_MODERRDEF(TrueType, 0x1200, "TrueType module")
+  FT_MODERRDEF(Type1,    0x1300, "Type 1 module")
+  FT_MODERRDEF(Type42,   0x1400, "Type 42 module")
+  FT_MODERRDEF(Winfonts, 0x1500, "Windows FON/FNT module")
+  FT_MODERRDEF(GXvalid,  0x1600, "GX validation module")
 
 
 #ifdef FT_MODERR_END_LIST
index bb52dc4a0d24ab7d532ac38dc13dd562d6b53884..9fe3bc6b09601cd0b26a9aa49c57ae922883d60f 100644 (file)
@@ -156,14 +156,14 @@ FT_BEGIN_HEADER
   *   doesn't exist in the font, or the application hasn't asked for
   *   validation.
   */
-  FT_EXPORT( FT_Error )
-  FT_OpenType_Validate( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_OpenType_Validate(FT_Face    face,
                         FT_UInt    validation_flags,
                         FT_Bytes  *BASE_table,
                         FT_Bytes  *GDEF_table,
                         FT_Bytes  *GPOS_table,
                         FT_Bytes  *GSUB_table,
-                        FT_Bytes  *JSTF_table );
+                        FT_Bytes  *JSTF_table);
 
   /* */
 
@@ -187,9 +187,9 @@ FT_BEGIN_HEADER
   *   This function must be used to free the buffer allocated by
   *   @FT_OpenType_Validate only.
   */
-  FT_EXPORT( void )
-  FT_OpenType_Free( FT_Face   face,
-                    FT_Bytes  table );
+  FT_EXPORT(void)
+  FT_OpenType_Free(FT_Face   face,
+                    FT_Bytes  table);
 
 
  /* */
index 8c7c57d99eba42cca17a5906ff21c06de4ea0a64..0fbfbc763a3ae3d32257b352116abc563cb60fde 100644 (file)
@@ -112,10 +112,10 @@ FT_BEGIN_HEADER
   /*    outline for stroking purposes (otherwise it would result in a      */
   /*    visible dot when round caps are used).                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Decompose( FT_Outline*              outline,
+  FT_EXPORT(FT_Error)
+  FT_Outline_Decompose(FT_Outline*              outline,
                         const FT_Outline_Funcs*  func_interface,
-                        void*                    user );
+                        void*                    user);
 
 
   /*************************************************************************/
@@ -148,18 +148,18 @@ FT_BEGIN_HEADER
   /*    The reason why this function takes a `library' parameter is simply */
   /*    to use the library's memory allocator.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_New( FT_Library   library,
+  FT_EXPORT(FT_Error)
+  FT_Outline_New(FT_Library   library,
                   FT_UInt      numPoints,
                   FT_Int       numContours,
-                  FT_Outline  *anoutline );
+                  FT_Outline  *anoutline);
 
 
-  FT_EXPORT( FT_Error )
-  FT_Outline_New_Internal( FT_Memory    memory,
+  FT_EXPORT(FT_Error)
+  FT_Outline_New_Internal(FT_Memory    memory,
                            FT_UInt      numPoints,
                            FT_Int       numContours,
-                           FT_Outline  *anoutline );
+                           FT_Outline  *anoutline);
 
 
   /*************************************************************************/
@@ -186,14 +186,14 @@ FT_BEGIN_HEADER
   /*    The reason why this function takes an `library' parameter is       */
   /*    simply to use ft_mem_free().                                       */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Done( FT_Library   library,
-                   FT_Outline*  outline );
+  FT_EXPORT(FT_Error)
+  FT_Outline_Done(FT_Library   library,
+                   FT_Outline*  outline);
 
 
-  FT_EXPORT( FT_Error )
-  FT_Outline_Done_Internal( FT_Memory    memory,
-                            FT_Outline*  outline );
+  FT_EXPORT(FT_Error)
+  FT_Outline_Done_Internal(FT_Memory    memory,
+                            FT_Outline*  outline);
 
 
   /*************************************************************************/
@@ -210,8 +210,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Check( FT_Outline*  outline );
+  FT_EXPORT(FT_Error)
+  FT_Outline_Check(FT_Outline*  outline);
 
 
   /*************************************************************************/
@@ -240,9 +240,9 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Outline_Get_CBox( const FT_Outline*  outline,
-                       FT_BBox           *acbox );
+  FT_EXPORT(void)
+  FT_Outline_Get_CBox(const FT_Outline*  outline,
+                       FT_BBox           *acbox);
 
 
   /*************************************************************************/
@@ -261,10 +261,10 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    yOffset :: The vertical offset.                                    */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Outline_Translate( const FT_Outline*  outline,
+  FT_EXPORT(void)
+  FT_Outline_Translate(const FT_Outline*  outline,
                         FT_Pos             xOffset,
-                        FT_Pos             yOffset );
+                        FT_Pos             yOffset);
 
 
   /*************************************************************************/
@@ -286,9 +286,9 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Copy( const FT_Outline*  source,
-                   FT_Outline        *target );
+  FT_EXPORT(FT_Error)
+  FT_Outline_Copy(const FT_Outline*  source,
+                   FT_Outline        *target);
 
 
   /*************************************************************************/
@@ -310,9 +310,9 @@ FT_BEGIN_HEADER
   /*    You can use @FT_Outline_Translate if you need to translate the     */
   /*    outline's points.                                                  */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Outline_Transform( const FT_Outline*  outline,
-                        const FT_Matrix*   matrix );
+  FT_EXPORT(void)
+  FT_Outline_Transform(const FT_Outline*  outline,
+                        const FT_Matrix*   matrix);
 
 
   /*************************************************************************/
@@ -350,14 +350,14 @@ FT_BEGIN_HEADER
   /*    Example call:                                                      */
   /*                                                                       */
   /*    {                                                                  */
-  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */
-  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */
-  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */
+  /*      FT_Load_Glyph(face, index, FT_LOAD_DEFAULT);                   */
+  /*      if (face->slot->format == FT_GLYPH_FORMAT_OUTLINE)             */
+  /*        FT_Outline_Embolden(&face->slot->outline, strength);         */
   /*    }                                                                  */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Embolden( FT_Outline*  outline,
-                       FT_Pos       strength );
+  FT_EXPORT(FT_Error)
+  FT_Outline_Embolden(FT_Outline*  outline,
+                       FT_Pos       strength);
 
 
   /*************************************************************************/
@@ -371,10 +371,10 @@ FT_BEGIN_HEADER
   /*    @FT_Outline_Embolden, which uses the same strength in both         */
   /*    directions.                                                        */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_EmboldenXY( FT_Outline*  outline,
+  FT_EXPORT(FT_Error)
+  FT_Outline_EmboldenXY(FT_Outline*  outline,
                          FT_Pos       xstrength,
-                         FT_Pos       ystrength );
+                         FT_Pos       ystrength);
 
 
   /*************************************************************************/
@@ -396,8 +396,8 @@ FT_BEGIN_HEADER
   /*    It shouldn't be used by a normal client application, unless it     */
   /*    knows what it is doing.                                            */
   /*                                                                       */
-  FT_EXPORT( void )
-  FT_Outline_Reverse( FT_Outline*  outline );
+  FT_EXPORT(void)
+  FT_Outline_Reverse(FT_Outline*  outline);
 
 
   /*************************************************************************/
@@ -431,10 +431,10 @@ FT_BEGIN_HEADER
   /*    you select the gray-level rasterizer, and you want less than 256   */
   /*    gray levels, you have to use @FT_Outline_Render directly.          */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Get_Bitmap( FT_Library        library,
+  FT_EXPORT(FT_Error)
+  FT_Outline_Get_Bitmap(FT_Library        library,
                          FT_Outline*       outline,
-                         const FT_Bitmap  *abitmap );
+                         const FT_Bitmap  *abitmap);
 
 
   /*************************************************************************/
@@ -473,10 +473,10 @@ FT_BEGIN_HEADER
   /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */
   /*    @FT_Raster_Params structure for more details.                      */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Outline_Render( FT_Library         library,
+  FT_EXPORT(FT_Error)
+  FT_Outline_Render(FT_Library         library,
                      FT_Outline*        outline,
-                     FT_Raster_Params*  params );
+                     FT_Raster_Params*  params);
 
 
  /**************************************************************************
@@ -549,8 +549,8 @@ FT_BEGIN_HEADER
   *   The orientation.
   *
   */
-  FT_EXPORT( FT_Orientation )
-  FT_Outline_Get_Orientation( FT_Outline*  outline );
+  FT_EXPORT(FT_Orientation)
+  FT_Outline_Get_Orientation(FT_Outline*  outline);
 
 
   /* */
index 0b7b7d427c9d84d4718bbe5922234a0b49f5f7a9..0b3e81d012802a3125d5523edb3eb2d4e573be61 100644 (file)
@@ -86,12 +86,12 @@ FT_BEGIN_HEADER
   *   If the input face is not a PFR, this function will return an error.
   *   However, in all cases, it will return valid values.
   */
-  FT_EXPORT( FT_Error )
-  FT_Get_PFR_Metrics( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Get_PFR_Metrics(FT_Face    face,
                       FT_UInt   *aoutline_resolution,
                       FT_UInt   *ametrics_resolution,
                       FT_Fixed  *ametrics_x_scale,
-                      FT_Fixed  *ametrics_y_scale );
+                      FT_Fixed  *ametrics_y_scale);
 
 
  /**********************************************************************
@@ -125,11 +125,11 @@ FT_BEGIN_HEADER
   *    You can use the value of the `x_scale' and `y_scale' parameters
   *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
   */
-  FT_EXPORT( FT_Error )
-  FT_Get_PFR_Kerning( FT_Face     face,
+  FT_EXPORT(FT_Error)
+  FT_Get_PFR_Kerning(FT_Face     face,
                       FT_UInt     left,
                       FT_UInt     right,
-                      FT_Vector  *avector );
+                      FT_Vector  *avector);
 
 
  /**********************************************************************
@@ -156,10 +156,10 @@ FT_BEGIN_HEADER
   *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
   *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
   */
-  FT_EXPORT( FT_Error )
-  FT_Get_PFR_Advance( FT_Face   face,
+  FT_EXPORT(FT_Error)
+  FT_Get_PFR_Advance(FT_Face   face,
                       FT_UInt   gindex,
-                      FT_Pos   *aadvance );
+                      FT_Pos   *aadvance);
 
  /* */
 
index dd0229b815e8bacac458fba286fc888aa20d0e49..3569c637f2494ed5c5e2b842f745efdf1807c308 100644 (file)
@@ -38,29 +38,29 @@ FT_BEGIN_HEADER
 
   /* create a new glyph object */
   typedef FT_Error
-  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,
-                        FT_GlyphSlot  slot );
+  (*FT_Glyph_InitFunc)(FT_Glyph      glyph,
+                        FT_GlyphSlot  slot);
 
   /* destroys a given glyph object */
   typedef void
-  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );
+  (*FT_Glyph_DoneFunc)(FT_Glyph  glyph);
 
   typedef void
-  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,
+  (*FT_Glyph_TransformFunc)(FT_Glyph          glyph,
                              const FT_Matrix*  matrix,
-                             const FT_Vector*  delta );
+                             const FT_Vector*  delta);
 
   typedef void
-  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,
-                           FT_BBox*  abbox );
+  (*FT_Glyph_GetBBoxFunc)(FT_Glyph  glyph,
+                           FT_BBox*  abbox);
 
   typedef FT_Error
-  (*FT_Glyph_CopyFunc)( FT_Glyph   source,
-                        FT_Glyph   target );
+  (*FT_Glyph_CopyFunc)(FT_Glyph   source,
+                        FT_Glyph   target);
 
   typedef FT_Error
-  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,
-                           FT_GlyphSlot  slot );
+  (*FT_Glyph_PrepareFunc)(FT_Glyph      glyph,
+                           FT_GlyphSlot  slot);
 
 /* deprecated */
 #define FT_Glyph_Init_Func       FT_Glyph_InitFunc
@@ -85,28 +85,28 @@ FT_BEGIN_HEADER
 
 
   typedef FT_Error
-  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,
+  (*FT_Renderer_RenderFunc)(FT_Renderer       renderer,
                              FT_GlyphSlot      slot,
                              FT_UInt           mode,
-                             const FT_Vector*  origin );
+                             const FT_Vector*  origin);
 
   typedef FT_Error
-  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,
+  (*FT_Renderer_TransformFunc)(FT_Renderer       renderer,
                                 FT_GlyphSlot      slot,
                                 const FT_Matrix*  matrix,
-                                const FT_Vector*  delta );
+                                const FT_Vector*  delta);
 
 
   typedef void
-  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,
+  (*FT_Renderer_GetCBoxFunc)(FT_Renderer   renderer,
                               FT_GlyphSlot  slot,
-                              FT_BBox*      cbox );
+                              FT_BBox*      cbox);
 
 
   typedef FT_Error
-  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,
+  (*FT_Renderer_SetModeFunc)(FT_Renderer  renderer,
                               FT_ULong     mode_tag,
-                              FT_Pointer   mode_ptr );
+                              FT_Pointer   mode_ptr);
 
 /* deprecated identifiers */
 #define FTRenderer_render  FT_Renderer_RenderFunc
@@ -180,9 +180,9 @@ FT_BEGIN_HEADER
   /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */
   /*    renderer by its name, use @FT_Get_Module.                          */
   /*                                                                       */
-  FT_EXPORT( FT_Renderer )
-  FT_Get_Renderer( FT_Library       library,
-                   FT_Glyph_Format  format );
+  FT_EXPORT(FT_Renderer)
+  FT_Get_Renderer(FT_Library       library,
+                   FT_Glyph_Format  format);
 
 
   /*************************************************************************/
@@ -220,11 +220,11 @@ FT_BEGIN_HEADER
   /*    5~elements.  Consequently, the third and fourth argument are zero  */
   /*    normally.                                                          */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Set_Renderer( FT_Library     library,
+  FT_EXPORT(FT_Error)
+  FT_Set_Renderer(FT_Library     library,
                    FT_Renderer    renderer,
                    FT_UInt        num_params,
-                   FT_Parameter*  parameters );
+                   FT_Parameter*  parameters);
 
 
   /* */
index 4167045701479d0de5889858d96a735154235107..d7f879c8c27e820db0d55c98fbbb226b92a6b614 100644 (file)
@@ -96,9 +96,9 @@ FT_BEGIN_HEADER
   /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */
   /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_New_Size( FT_Face   face,
-               FT_Size*  size );
+  FT_EXPORT(FT_Error)
+  FT_New_Size(FT_Face   face,
+               FT_Size*  size);
 
 
   /*************************************************************************/
@@ -117,8 +117,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Done_Size( FT_Size  size );
+  FT_EXPORT(FT_Error)
+  FT_Done_Size(FT_Size  size);
 
 
   /*************************************************************************/
@@ -145,8 +145,8 @@ FT_BEGIN_HEADER
   /*    If `face' is the size's parent face object, this function changes  */
   /*    the value of `face->size' to the input size handle.                */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Activate_Size( FT_Size  size );
+  FT_EXPORT(FT_Error)
+  FT_Activate_Size(FT_Size  size);
 
   /* */
 
index 88af440356c7a5875ec1cae4d1092281095d398b..d0fb76e8bd17a7ef93ecd9b3dbb61681c7dfa6fd 100644 (file)
@@ -122,8 +122,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The number of strings in the `name' table.                         */
   /*                                                                       */
-  FT_EXPORT( FT_UInt )
-  FT_Get_Sfnt_Name_Count( FT_Face  face );
+  FT_EXPORT(FT_UInt)
+  FT_Get_Sfnt_Name_Count(FT_Face  face);
 
 
   /*************************************************************************/
@@ -154,10 +154,10 @@ FT_BEGIN_HEADER
   /*    `name' table entries, then do a loop until you get the right       */
   /*    platform, encoding, and name ID.                                   */
   /*                                                                       */
-  FT_EXPORT( FT_Error )
-  FT_Get_Sfnt_Name( FT_Face       face,
+  FT_EXPORT(FT_Error)
+  FT_Get_Sfnt_Name(FT_Face       face,
                     FT_UInt       idx,
-                    FT_SfntName  *aname );
+                    FT_SfntName  *aname);
 
 
   /***************************************************************************
@@ -172,7 +172,7 @@ FT_BEGIN_HEADER
    *   legacy systems that have a 4-face-per-family restriction.
    *
    */
-#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
+#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG('i', 'g', 'p', 'f')
 
 
   /***************************************************************************
@@ -187,7 +187,7 @@ FT_BEGIN_HEADER
    *   systems that have a 4-face-per-family restriction.
    *
    */
-#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )
+#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG('i', 'g', 'p', 's')
 
   /* */
 
index a498e4a883befe14f3d319c86c64d145cb36daa6..f0de7161702ead79dd64d1bee6385685eb487d9e 100644 (file)
@@ -198,8 +198,8 @@ FT_BEGIN_HEADER
    *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid
    *   outlines.
    */
-  FT_EXPORT( FT_StrokerBorder )
-  FT_Outline_GetInsideBorder( FT_Outline*  outline );
+  FT_EXPORT(FT_StrokerBorder)
+  FT_Outline_GetInsideBorder(FT_Outline*  outline);
 
 
   /**************************************************************
@@ -219,8 +219,8 @@ FT_BEGIN_HEADER
    *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid
    *   outlines.
    */
-  FT_EXPORT( FT_StrokerBorder )
-  FT_Outline_GetOutsideBorder( FT_Outline*  outline );
+  FT_EXPORT(FT_StrokerBorder)
+  FT_Outline_GetOutsideBorder(FT_Outline*  outline);
 
 
   /**************************************************************
@@ -242,9 +242,9 @@ FT_BEGIN_HEADER
    * @return:
    *    FreeType error code.  0~means success.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_New( FT_Library   library,
-                  FT_Stroker  *astroker );
+  FT_EXPORT(FT_Error)
+  FT_Stroker_New(FT_Library   library,
+                  FT_Stroker  *astroker);
 
 
   /**************************************************************
@@ -277,12 +277,12 @@ FT_BEGIN_HEADER
    *   The radius is expressed in the same units as the outline
    *   coordinates.
    */
-  FT_EXPORT( void )
-  FT_Stroker_Set( FT_Stroker           stroker,
+  FT_EXPORT(void)
+  FT_Stroker_Set(FT_Stroker           stroker,
                   FT_Fixed             radius,
                   FT_Stroker_LineCap   line_cap,
                   FT_Stroker_LineJoin  line_join,
-                  FT_Fixed             miter_limit );
+                  FT_Fixed             miter_limit);
 
 
   /**************************************************************
@@ -300,8 +300,8 @@ FT_BEGIN_HEADER
    *   stroker ::
    *     The target stroker handle.
    */
-  FT_EXPORT( void )
-  FT_Stroker_Rewind( FT_Stroker  stroker );
+  FT_EXPORT(void)
+  FT_Stroker_Rewind(FT_Stroker  stroker);
 
 
   /**************************************************************
@@ -337,10 +337,10 @@ FT_BEGIN_HEADER
    *
    *   This function calls @FT_Stroker_Rewind automatically.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_ParseOutline( FT_Stroker   stroker,
+  FT_EXPORT(FT_Error)
+  FT_Stroker_ParseOutline(FT_Stroker   stroker,
                            FT_Outline*  outline,
-                           FT_Bool      opened );
+                           FT_Bool      opened);
 
 
   /**************************************************************
@@ -368,10 +368,10 @@ FT_BEGIN_HEADER
    *   This function is useful when you need to stroke a path that is
    *   not stored as an @FT_Outline object.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_BeginSubPath( FT_Stroker  stroker,
+  FT_EXPORT(FT_Error)
+  FT_Stroker_BeginSubPath(FT_Stroker  stroker,
                            FT_Vector*  to,
-                           FT_Bool     open );
+                           FT_Bool     open);
 
 
   /**************************************************************
@@ -394,8 +394,8 @@ FT_BEGIN_HEADER
    *   If the subpath was not `opened', this function `draws' a
    *   single line segment to the start position when needed.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_EndSubPath( FT_Stroker  stroker );
+  FT_EXPORT(FT_Error)
+  FT_Stroker_EndSubPath(FT_Stroker  stroker);
 
 
   /**************************************************************
@@ -421,9 +421,9 @@ FT_BEGIN_HEADER
    *   You should call this function between @FT_Stroker_BeginSubPath and
    *   @FT_Stroker_EndSubPath.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_LineTo( FT_Stroker  stroker,
-                     FT_Vector*  to );
+  FT_EXPORT(FT_Error)
+  FT_Stroker_LineTo(FT_Stroker  stroker,
+                     FT_Vector*  to);
 
 
   /**************************************************************
@@ -452,10 +452,10 @@ FT_BEGIN_HEADER
    *   You should call this function between @FT_Stroker_BeginSubPath and
    *   @FT_Stroker_EndSubPath.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_ConicTo( FT_Stroker  stroker,
+  FT_EXPORT(FT_Error)
+  FT_Stroker_ConicTo(FT_Stroker  stroker,
                       FT_Vector*  control,
-                      FT_Vector*  to );
+                      FT_Vector*  to);
 
 
   /**************************************************************
@@ -487,11 +487,11 @@ FT_BEGIN_HEADER
    *   You should call this function between @FT_Stroker_BeginSubPath and
    *   @FT_Stroker_EndSubPath.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_CubicTo( FT_Stroker  stroker,
+  FT_EXPORT(FT_Error)
+  FT_Stroker_CubicTo(FT_Stroker  stroker,
                       FT_Vector*  control1,
                       FT_Vector*  control2,
-                      FT_Vector*  to );
+                      FT_Vector*  to);
 
 
   /**************************************************************
@@ -533,11 +533,11 @@ FT_BEGIN_HEADER
    *   Use the function @FT_Stroker_GetCounts instead if you want to
    *   retrieve the counts associated to both borders.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,
+  FT_EXPORT(FT_Error)
+  FT_Stroker_GetBorderCounts(FT_Stroker        stroker,
                               FT_StrokerBorder  border,
                               FT_UInt          *anum_points,
-                              FT_UInt          *anum_contours );
+                              FT_UInt          *anum_contours);
 
 
   /**************************************************************
@@ -579,10 +579,10 @@ FT_BEGIN_HEADER
    *   Use the function @FT_Stroker_Export instead if you want to
    *   retrieve all borders at once.
    */
-  FT_EXPORT( void )
-  FT_Stroker_ExportBorder( FT_Stroker        stroker,
+  FT_EXPORT(void)
+  FT_Stroker_ExportBorder(FT_Stroker        stroker,
                            FT_StrokerBorder  border,
-                           FT_Outline*       outline );
+                           FT_Outline*       outline);
 
 
   /**************************************************************
@@ -610,10 +610,10 @@ FT_BEGIN_HEADER
    * @return:
    *   FreeType error code.  0~means success.
    */
-  FT_EXPORT( FT_Error )
-  FT_Stroker_GetCounts( FT_Stroker  stroker,
+  FT_EXPORT(FT_Error)
+  FT_Stroker_GetCounts(FT_Stroker  stroker,
                         FT_UInt    *anum_points,
-                        FT_UInt    *anum_contours );
+                        FT_UInt    *anum_contours);
 
 
   /**************************************************************
@@ -636,9 +636,9 @@ FT_BEGIN_HEADER
    *   outline ::
    *     The target outline handle.
    */
-  FT_EXPORT( void )
-  FT_Stroker_Export( FT_Stroker   stroker,
-                     FT_Outline*  outline );
+  FT_EXPORT(void)
+  FT_Stroker_Export(FT_Stroker   stroker,
+                     FT_Outline*  outline);
 
 
   /**************************************************************
@@ -653,8 +653,8 @@ FT_BEGIN_HEADER
    *   stroker ::
    *     A stroker handle.  Can be NULL.
    */
-  FT_EXPORT( void )
-  FT_Stroker_Done( FT_Stroker  stroker );
+  FT_EXPORT(void)
+  FT_Stroker_Done(FT_Stroker  stroker);
 
 
   /**************************************************************
@@ -688,10 +688,10 @@ FT_BEGIN_HEADER
    *   may need to manually adjust horizontal and vertical advance amounts
    *   to account for this added size.
    */
-  FT_EXPORT( FT_Error )
-  FT_Glyph_Stroke( FT_Glyph    *pglyph,
+  FT_EXPORT(FT_Error)
+  FT_Glyph_Stroke(FT_Glyph    *pglyph,
                    FT_Stroker   stroker,
-                   FT_Bool      destroy );
+                   FT_Bool      destroy);
 
 
   /**************************************************************
@@ -730,11 +730,11 @@ FT_BEGIN_HEADER
    *   may need to manually adjust horizontal and vertical advance amounts
    *   to account for this added size.
    */
-  FT_EXPORT( FT_Error )
-  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
+  FT_EXPORT(FT_Error)
+  FT_Glyph_StrokeBorder(FT_Glyph    *pglyph,
                          FT_Stroker   stroker,
                          FT_Bool      inside,
-                         FT_Bool      destroy );
+                         FT_Bool      destroy);
 
  /* */
 
index 839ab5e4002a961833b38027c586cb23ce6dc667..03c82ba04406b908a45320cf163f8c069ab42e5f 100644 (file)
@@ -64,12 +64,12 @@ FT_BEGIN_HEADER
   /* For emboldened outlines the height, width, and advance metrics are    */
   /* increased by the strength of the emboldening.  You can also call      */
   /* @FT_Outline_Get_CBox to get precise values.                           */
-  FT_EXPORT( void )
-  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );
+  FT_EXPORT(void)
+  FT_GlyphSlot_Embolden(FT_GlyphSlot  slot);
 
   /* Slant an outline glyph to the right by about 12 degrees. */
-  FT_EXPORT( void )
-  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );
+  FT_EXPORT(void)
+  FT_GlyphSlot_Oblique(FT_GlyphSlot  slot);
 
   /* */
 
index e07460c55d45ed73e28d13c0741af0c10c075d51..da6a3b36d17ddf1825e5c37b911f6927c79ac1da 100644 (file)
@@ -86,8 +86,8 @@ FT_BEGIN_HEADER
    *
    */
   typedef void*
-  (*FT_Alloc_Func)( FT_Memory  memory,
-                    long       size );
+  (*FT_Alloc_Func)(FT_Memory  memory,
+                    long       size);
 
 
   /*************************************************************************
@@ -107,8 +107,8 @@ FT_BEGIN_HEADER
    *
    */
   typedef void
-  (*FT_Free_Func)( FT_Memory  memory,
-                   void*      block );
+  (*FT_Free_Func)(FT_Memory  memory,
+                   void*      block);
 
 
   /*************************************************************************
@@ -140,10 +140,10 @@ FT_BEGIN_HEADER
    *
    */
   typedef void*
-  (*FT_Realloc_Func)( FT_Memory  memory,
+  (*FT_Realloc_Func)(FT_Memory  memory,
                       long       cur_size,
                       long       new_size,
-                      void*      block );
+                      void*      block);
 
 
   /*************************************************************************
@@ -245,10 +245,10 @@ FT_BEGIN_HEADER
    *
    */
   typedef unsigned long
-  (*FT_Stream_IoFunc)( FT_Stream       stream,
+  (*FT_Stream_IoFunc)(FT_Stream       stream,
                        unsigned long   offset,
                        unsigned char*  buffer,
-                       unsigned long   count );
+                       unsigned long   count);
 
 
   /*************************************************************************
@@ -265,7 +265,7 @@ FT_BEGIN_HEADER
    *
    */
   typedef void
-  (*FT_Stream_CloseFunc)( FT_Stream  stream );
+  (*FT_Stream_CloseFunc)(FT_Stream  stream);
 
 
   /*************************************************************************
index 65143cb8c85624c210a118ebf51b383f91b6ce65..33cfd3bad3aa364ebcc602b47bf99304a4b4267a 100644 (file)
@@ -61,7 +61,7 @@ FT_BEGIN_HEADER
    *   The angle pi expressed in @FT_Angle units.
    *
    */
-#define FT_ANGLE_PI  ( 180L << 16 )
+#define FT_ANGLE_PI  (180L << 16)
 
 
   /*************************************************************************
@@ -73,7 +73,7 @@ FT_BEGIN_HEADER
    *   The angle 2*pi expressed in @FT_Angle units.
    *
    */
-#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )
+#define FT_ANGLE_2PI  (FT_ANGLE_PI * 2)
 
 
   /*************************************************************************
@@ -85,7 +85,7 @@ FT_BEGIN_HEADER
    *   The angle pi/2 expressed in @FT_Angle units.
    *
    */
-#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )
+#define FT_ANGLE_PI2  (FT_ANGLE_PI / 2)
 
 
   /*************************************************************************
@@ -97,7 +97,7 @@ FT_BEGIN_HEADER
    *   The angle pi/4 expressed in @FT_Angle units.
    *
    */
-#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )
+#define FT_ANGLE_PI4  (FT_ANGLE_PI / 4)
 
 
   /*************************************************************************
@@ -120,8 +120,8 @@ FT_BEGIN_HEADER
    *   function @FT_Vector_Unit.
    *
    */
-  FT_EXPORT( FT_Fixed )
-  FT_Sin( FT_Angle  angle );
+  FT_EXPORT(FT_Fixed)
+  FT_Sin(FT_Angle  angle);
 
 
   /*************************************************************************
@@ -144,8 +144,8 @@ FT_BEGIN_HEADER
    *   function @FT_Vector_Unit.
    *
    */
-  FT_EXPORT( FT_Fixed )
-  FT_Cos( FT_Angle  angle );
+  FT_EXPORT(FT_Fixed)
+  FT_Cos(FT_Angle  angle);
 
 
   /*************************************************************************
@@ -164,8 +164,8 @@ FT_BEGIN_HEADER
    *   The tangent value.
    *
    */
-  FT_EXPORT( FT_Fixed )
-  FT_Tan( FT_Angle  angle );
+  FT_EXPORT(FT_Fixed)
+  FT_Tan(FT_Angle  angle);
 
 
   /*************************************************************************
@@ -188,9 +188,9 @@ FT_BEGIN_HEADER
    *   The arc-tangent value (i.e. angle).
    *
    */
-  FT_EXPORT( FT_Angle )
-  FT_Atan2( FT_Fixed  x,
-            FT_Fixed  y );
+  FT_EXPORT(FT_Angle)
+  FT_Atan2(FT_Fixed  x,
+            FT_Fixed  y);
 
 
   /*************************************************************************
@@ -213,9 +213,9 @@ FT_BEGIN_HEADER
    *   Constrained value of `value2-value1'.
    *
    */
-  FT_EXPORT( FT_Angle )
-  FT_Angle_Diff( FT_Angle  angle1,
-                 FT_Angle  angle2 );
+  FT_EXPORT(FT_Angle)
+  FT_Angle_Diff(FT_Angle  angle1,
+                 FT_Angle  angle2);
 
 
   /*************************************************************************
@@ -240,9 +240,9 @@ FT_BEGIN_HEADER
    *     The address of angle.
    *
    */
-  FT_EXPORT( void )
-  FT_Vector_Unit( FT_Vector*  vec,
-                  FT_Angle    angle );
+  FT_EXPORT(void)
+  FT_Vector_Unit(FT_Vector*  vec,
+                  FT_Angle    angle);
 
 
   /*************************************************************************
@@ -262,9 +262,9 @@ FT_BEGIN_HEADER
    *     The address of angle.
    *
    */
-  FT_EXPORT( void )
-  FT_Vector_Rotate( FT_Vector*  vec,
-                    FT_Angle    angle );
+  FT_EXPORT(void)
+  FT_Vector_Rotate(FT_Vector*  vec,
+                    FT_Angle    angle);
 
 
   /*************************************************************************
@@ -284,8 +284,8 @@ FT_BEGIN_HEADER
    *   vector coordinates.
    *
    */
-  FT_EXPORT( FT_Fixed )
-  FT_Vector_Length( FT_Vector*  vec );
+  FT_EXPORT(FT_Fixed)
+  FT_Vector_Length(FT_Vector*  vec);
 
 
   /*************************************************************************
@@ -308,10 +308,10 @@ FT_BEGIN_HEADER
    *     The vector angle.
    *
    */
-  FT_EXPORT( void )
-  FT_Vector_Polarize( FT_Vector*  vec,
+  FT_EXPORT(void)
+  FT_Vector_Polarize(FT_Vector*  vec,
                       FT_Fixed   *length,
-                      FT_Angle   *angle );
+                      FT_Angle   *angle);
 
 
   /*************************************************************************
@@ -334,10 +334,10 @@ FT_BEGIN_HEADER
    *     The vector angle.
    *
    */
-  FT_EXPORT( void )
-  FT_Vector_From_Polar( FT_Vector*  vec,
+  FT_EXPORT(void)
+  FT_Vector_From_Polar(FT_Vector*  vec,
                         FT_Fixed    length,
-                        FT_Angle    angle );
+                        FT_Angle    angle);
 
   /* */
 
index 70ad3d583b37b57de6c6a93a2e035304162b1cc2..13f04805c3847233f82536e7addca7e75bc9ab62 100644 (file)
@@ -88,11 +88,11 @@ FT_BEGIN_HEADER
    *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;
    *
    *
-   *     FT_Init_FreeType( &library );
+   *     FT_Init_FreeType(&library);
    *
-   *     FT_Property_Set( library, "truetype",
+   *     FT_Property_Set(library, "truetype",
    *                               "interpreter-version",
-   *                               &interpreter_version );
+   *                               &interpreter_version);
    *   }
    *
    * @note:
index bd944a4935ff6b166381a564f620aaf47943857c..9f10b279cc954aef9bcf1c0582df82bd9e461b33 100644 (file)
@@ -473,12 +473,12 @@ FT_BEGIN_HEADER
   /*    The produced values *must* be 32-bit integers.  Don't redefine     */
   /*    this macro.                                                        */
   /*                                                                       */
-#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
+#define FT_MAKE_TAG(_x1, _x2, _x3, _x4) \
           (FT_Tag)                        \
-          ( ( (FT_ULong)_x1 << 24 ) |     \
-            ( (FT_ULong)_x2 << 16 ) |     \
-            ( (FT_ULong)_x3 <<  8 ) |     \
-              (FT_ULong)_x4         )
+          (((FT_ULong)_x1 << 24) |     \
+            ((FT_ULong)_x2 << 16) |     \
+            ((FT_ULong)_x3 <<  8) |     \
+              (FT_ULong)_x4  )
 
 
   /*************************************************************************/
@@ -570,24 +570,24 @@ FT_BEGIN_HEADER
 
   /* */
 
-#define FT_IS_EMPTY( list )  ( (list).head == 0 )
-#define FT_BOOL( x )  ( (FT_Bool)( x ) )
+#define FT_IS_EMPTY(list)  ((list).head == 0)
+#define FT_BOOL(x)  ((FT_Bool)(x))
 
   /* concatenate C tokens */
-#define FT_ERR_XCAT( x, y )  x ## y
-#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
+#define FT_ERR_XCAT(x, y)  x ## y
+#define FT_ERR_CAT(x, y)   FT_ERR_XCAT(x, y)
 
   /* see `ftmoderr.h' for descriptions of the following macros */
 
-#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
+#define FT_ERR(e)  FT_ERR_CAT(FT_ERR_PREFIX, e)
 
-#define FT_ERROR_BASE( x )    ( (x) & 0xFF )
-#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )
+#define FT_ERROR_BASE(x)    ((x) & 0xFF)
+#define FT_ERROR_MODULE(x)  ((x) & 0xFF00U)
 
-#define FT_ERR_EQ( x, e )                                        \
-          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )
-#define FT_ERR_NEQ( x, e )                                       \
-          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )
+#define FT_ERR_EQ(x, e)                                        \
+          (FT_ERROR_BASE(x) == FT_ERROR_BASE(FT_ERR(e)))
+#define FT_ERR_NEQ(x, e)                                       \
+          (FT_ERROR_BASE(x) != FT_ERROR_BASE(FT_ERR(e)))
 
 
 FT_END_HEADER
index 0b673517914adafc8a8f13772a7ff8bae1cbdcca..cc5f7db9a7af2bde0821f7a4894eeb044872cf9e 100644 (file)
@@ -255,9 +255,9 @@ FT_BEGIN_HEADER
    *   This function only works with Windows FNT faces, returning an error
    *   otherwise.
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_WinFNT_Header( FT_Face               face,
-                        FT_WinFNT_HeaderRec  *aheader );
+  FT_EXPORT(FT_Error)
+  FT_Get_WinFNT_Header(FT_Face               face,
+                        FT_WinFNT_HeaderRec  *aheader);
 
 
   /* */
index 493cccdd0a5cadf1825cf73bd51060b83abbf219..0ede2dab2646a01b90e063828f660f209e9057d1 100644 (file)
@@ -73,8 +73,8 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*   Font format string.  NULL in case of error.                         */
   /*                                                                       */
-  FT_EXPORT( const char* )
-  FT_Get_X11_Font_Format( FT_Face  face );
+  FT_EXPORT(const char*)
+  FT_Get_X11_Font_Format(FT_Face  face);
 
  /* */
 
index a14255e5f5818cb7840af0222824c3811567f407..ed4235c8bc6631a848ee00a4369c353bb98314d8 100644 (file)
@@ -424,8 +424,8 @@ FT_BEGIN_HEADER
    *    Boolean.  True if glyph names are reliable.
    *
    */
-  FT_EXPORT( FT_Int )
-  FT_Has_PS_Glyph_Names( FT_Face  face );
+  FT_EXPORT(FT_Int)
+  FT_Has_PS_Glyph_Names(FT_Face  face);
 
 
   /************************************************************************
@@ -456,9 +456,9 @@ FT_BEGIN_HEADER
    *    return the `FT_Err_Invalid_Argument' error code.
    *
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_PS_Font_Info( FT_Face      face,
-                       PS_FontInfo  afont_info );
+  FT_EXPORT(FT_Error)
+  FT_Get_PS_Font_Info(FT_Face      face,
+                       PS_FontInfo  afont_info);
 
 
   /************************************************************************
@@ -489,9 +489,9 @@ FT_BEGIN_HEADER
    *    the `FT_Err_Invalid_Argument' error code.
    *
    */
-  FT_EXPORT( FT_Error )
-  FT_Get_PS_Font_Private( FT_Face     face,
-                          PS_Private  afont_private );
+  FT_EXPORT(FT_Error)
+  FT_Get_PS_Font_Private(FT_Face     face,
+                          PS_Private  afont_private);
 
 
   /*************************************************************************/
@@ -645,12 +645,12 @@ FT_BEGIN_HEADER
    *    the `FT_Err_Invalid_Argument' error code.
    *
    */
-  FT_EXPORT( FT_Long )
-  FT_Get_PS_Font_Value( FT_Face       face,
+  FT_EXPORT(FT_Long)
+  FT_Get_PS_Font_Value(FT_Face       face,
                         PS_Dict_Keys  key,
                         FT_UInt       idx,
                         void         *value,
-                        FT_Long       value_len );
+                        FT_Long       value_len);
 
   /* */
 
index 9711d1d9475e855864b1353b2543959f17b7bcb0..ee890e7304cb7d43e3505cd82d7d589986bc36c6 100644 (file)
@@ -1196,7 +1196,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* Some compilers have a very limited length of identifiers.             */
   /*                                                                       */
-#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
+#if defined(__TURBOC__) && __TURBOC__ < 0x0410 || defined(__PACIFIC__)
 #define HAVE_LIMIT_ON_IDENTS
 #endif
 
index bb49dc0dafdc7958897fea699ec6b0beedf7c279..babe2286c20bb1c99cd69a76d7937eb46419b728 100644 (file)
@@ -611,12 +611,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*                                                                       */
   /*      vert_header =                                                    */
-  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );       */
+  /*        (TT_VertHeader*)FT_Get_Sfnt_Table(face, ft_sfnt_vhea);       */
   /*    }                                                                  */
   /*                                                                       */
-  FT_EXPORT( void* )
-  FT_Get_Sfnt_Table( FT_Face      face,
-                     FT_Sfnt_Tag  tag );
+  FT_EXPORT(void*)
+  FT_Get_Sfnt_Table(FT_Face      face,
+                     FT_Sfnt_Tag  tag);
 
 
  /**************************************************************************
@@ -667,14 +667,14 @@ FT_BEGIN_HEADER
   *       FT_ULong  length = 0;
   *
   *
-  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
-  *       if ( error ) { ... table does not exist ... }
+  *       error = FT_Load_Sfnt_Table(face, tag, 0, NULL, &length);
+  *       if (error) { ... table does not exist ... }
   *
-  *       buffer = malloc( length );
-  *       if ( buffer == NULL ) { ... not enough memory ... }
+  *       buffer = malloc(length);
+  *       if (buffer == NULL) { ... not enough memory ... }
   *
-  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
-  *       if ( error ) { ... could not load table ... }
+  *       error = FT_Load_Sfnt_Table(face, tag, 0, buffer, &length);
+  *       if (error) { ... could not load table ... }
   *     }
   *
   *   Note that structures like @TT_Header or @TT_OS2 can't be used with
@@ -683,12 +683,12 @@ FT_BEGIN_HEADER
   *   size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
   *
   */
-  FT_EXPORT( FT_Error )
-  FT_Load_Sfnt_Table( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Load_Sfnt_Table(FT_Face    face,
                       FT_ULong   tag,
                       FT_Long    offset,
                       FT_Byte*   buffer,
-                      FT_ULong*  length );
+                      FT_ULong*  length);
 
 
  /**************************************************************************
@@ -726,11 +726,11 @@ FT_BEGIN_HEADER
   *   missing.
   *
   */
-  FT_EXPORT( FT_Error )
-  FT_Sfnt_Table_Info( FT_Face    face,
+  FT_EXPORT(FT_Error)
+  FT_Sfnt_Table_Info(FT_Face    face,
                       FT_UInt    table_index,
                       FT_ULong  *tag,
-                      FT_ULong  *length );
+                      FT_ULong  *length);
 
 
   /*************************************************************************/
@@ -753,8 +753,8 @@ FT_BEGIN_HEADER
   /*    For a format~14 cmap (to access Unicode IVS), the return value is  */
   /*    0xFFFFFFFF.                                                        */
   /*                                                                       */
-  FT_EXPORT( FT_ULong )
-  FT_Get_CMap_Language_ID( FT_CharMap  charmap );
+  FT_EXPORT(FT_ULong)
+  FT_Get_CMap_Language_ID(FT_CharMap  charmap);
 
 
   /*************************************************************************/
@@ -773,8 +773,8 @@ FT_BEGIN_HEADER
   /*    The format of `charmap'.  If `charmap' doesn't belong to a         */
   /*    TrueType/sfnt face, return -1.                                     */
   /*                                                                       */
-  FT_EXPORT( FT_Long )
-  FT_Get_CMap_Format( FT_CharMap  charmap );
+  FT_EXPORT(FT_Long)
+  FT_Get_CMap_Format(FT_CharMap  charmap);
 
   /* */
 
index d59aa19a3389c41336b68643bf8c407d1ae11a6f..b7a81b5d4f58e2ba7c858bff6f73f48ba26462e8 100644 (file)
 FT_BEGIN_HEADER
 
 
-#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
-#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
-#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )
-#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
-#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
-#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
-#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )
-#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
-#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
-#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
-#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
-#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
-#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
-#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )
-#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
-#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
-#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
-#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
-#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )
-#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
-#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
-#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
-#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )
-#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
-#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
-#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
-#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
-#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
-#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
-#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
-#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
-#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )
-#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
-#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )
-#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
-#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
-#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
-#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
-#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
-#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
-#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
-#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
-#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
-#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
-#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )
-#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
-#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
-#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
-#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )
-#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
-#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
-#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
-#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )
-#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
-#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
-#define TTAG_sbix  FT_MAKE_TAG( 's', 'b', 'i', 'x' )
-#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )
-#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
-#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )
-#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )
-#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )
-#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )
-#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
-#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )
-#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
-#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
-#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )
-#define TTAG_wOFF  FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
+#define TTAG_avar  FT_MAKE_TAG('a', 'v', 'a', 'r')
+#define TTAG_BASE  FT_MAKE_TAG('B', 'A', 'S', 'E')
+#define TTAG_bdat  FT_MAKE_TAG('b', 'd', 'a', 't')
+#define TTAG_BDF   FT_MAKE_TAG('B', 'D', 'F', ' ')
+#define TTAG_bhed  FT_MAKE_TAG('b', 'h', 'e', 'd')
+#define TTAG_bloc  FT_MAKE_TAG('b', 'l', 'o', 'c')
+#define TTAG_bsln  FT_MAKE_TAG('b', 's', 'l', 'n')
+#define TTAG_CBDT  FT_MAKE_TAG('C', 'B', 'D', 'T')
+#define TTAG_CBLC  FT_MAKE_TAG('C', 'B', 'L', 'C')
+#define TTAG_CFF   FT_MAKE_TAG('C', 'F', 'F', ' ')
+#define TTAG_CID   FT_MAKE_TAG('C', 'I', 'D', ' ')
+#define TTAG_cmap  FT_MAKE_TAG('c', 'm', 'a', 'p')
+#define TTAG_cvar  FT_MAKE_TAG('c', 'v', 'a', 'r')
+#define TTAG_cvt   FT_MAKE_TAG('c', 'v', 't', ' ')
+#define TTAG_DSIG  FT_MAKE_TAG('D', 'S', 'I', 'G')
+#define TTAG_EBDT  FT_MAKE_TAG('E', 'B', 'D', 'T')
+#define TTAG_EBLC  FT_MAKE_TAG('E', 'B', 'L', 'C')
+#define TTAG_EBSC  FT_MAKE_TAG('E', 'B', 'S', 'C')
+#define TTAG_feat  FT_MAKE_TAG('f', 'e', 'a', 't')
+#define TTAG_FOND  FT_MAKE_TAG('F', 'O', 'N', 'D')
+#define TTAG_fpgm  FT_MAKE_TAG('f', 'p', 'g', 'm')
+#define TTAG_fvar  FT_MAKE_TAG('f', 'v', 'a', 'r')
+#define TTAG_gasp  FT_MAKE_TAG('g', 'a', 's', 'p')
+#define TTAG_GDEF  FT_MAKE_TAG('G', 'D', 'E', 'F')
+#define TTAG_glyf  FT_MAKE_TAG('g', 'l', 'y', 'f')
+#define TTAG_GPOS  FT_MAKE_TAG('G', 'P', 'O', 'S')
+#define TTAG_GSUB  FT_MAKE_TAG('G', 'S', 'U', 'B')
+#define TTAG_gvar  FT_MAKE_TAG('g', 'v', 'a', 'r')
+#define TTAG_hdmx  FT_MAKE_TAG('h', 'd', 'm', 'x')
+#define TTAG_head  FT_MAKE_TAG('h', 'e', 'a', 'd')
+#define TTAG_hhea  FT_MAKE_TAG('h', 'h', 'e', 'a')
+#define TTAG_hmtx  FT_MAKE_TAG('h', 'm', 't', 'x')
+#define TTAG_JSTF  FT_MAKE_TAG('J', 'S', 'T', 'F')
+#define TTAG_just  FT_MAKE_TAG('j', 'u', 's', 't')
+#define TTAG_kern  FT_MAKE_TAG('k', 'e', 'r', 'n')
+#define TTAG_lcar  FT_MAKE_TAG('l', 'c', 'a', 'r')
+#define TTAG_loca  FT_MAKE_TAG('l', 'o', 'c', 'a')
+#define TTAG_LTSH  FT_MAKE_TAG('L', 'T', 'S', 'H')
+#define TTAG_LWFN  FT_MAKE_TAG('L', 'W', 'F', 'N')
+#define TTAG_MATH  FT_MAKE_TAG('M', 'A', 'T', 'H')
+#define TTAG_maxp  FT_MAKE_TAG('m', 'a', 'x', 'p')
+#define TTAG_META  FT_MAKE_TAG('M', 'E', 'T', 'A')
+#define TTAG_MMFX  FT_MAKE_TAG('M', 'M', 'F', 'X')
+#define TTAG_MMSD  FT_MAKE_TAG('M', 'M', 'S', 'D')
+#define TTAG_mort  FT_MAKE_TAG('m', 'o', 'r', 't')
+#define TTAG_morx  FT_MAKE_TAG('m', 'o', 'r', 'x')
+#define TTAG_name  FT_MAKE_TAG('n', 'a', 'm', 'e')
+#define TTAG_opbd  FT_MAKE_TAG('o', 'p', 'b', 'd')
+#define TTAG_OS2   FT_MAKE_TAG('O', 'S', '/', '2')
+#define TTAG_OTTO  FT_MAKE_TAG('O', 'T', 'T', 'O')
+#define TTAG_PCLT  FT_MAKE_TAG('P', 'C', 'L', 'T')
+#define TTAG_POST  FT_MAKE_TAG('P', 'O', 'S', 'T')
+#define TTAG_post  FT_MAKE_TAG('p', 'o', 's', 't')
+#define TTAG_prep  FT_MAKE_TAG('p', 'r', 'e', 'p')
+#define TTAG_prop  FT_MAKE_TAG('p', 'r', 'o', 'p')
+#define TTAG_sbix  FT_MAKE_TAG('s', 'b', 'i', 'x')
+#define TTAG_sfnt  FT_MAKE_TAG('s', 'f', 'n', 't')
+#define TTAG_SING  FT_MAKE_TAG('S', 'I', 'N', 'G')
+#define TTAG_trak  FT_MAKE_TAG('t', 'r', 'a', 'k')
+#define TTAG_true  FT_MAKE_TAG('t', 'r', 'u', 'e')
+#define TTAG_ttc   FT_MAKE_TAG('t', 't', 'c', ' ')
+#define TTAG_ttcf  FT_MAKE_TAG('t', 't', 'c', 'f')
+#define TTAG_TYP1  FT_MAKE_TAG('T', 'Y', 'P', '1')
+#define TTAG_typ1  FT_MAKE_TAG('t', 'y', 'p', '1')
+#define TTAG_VDMX  FT_MAKE_TAG('V', 'D', 'M', 'X')
+#define TTAG_vhea  FT_MAKE_TAG('v', 'h', 'e', 'a')
+#define TTAG_vmtx  FT_MAKE_TAG('v', 'm', 't', 'x')
+#define TTAG_wOFF  FT_MAKE_TAG('w', 'O', 'F', 'F')
 
 
 FT_END_HEADER
index a0162759b783bffe0855b46c8cb292f80085c98f..932a17ee36df835856de2759779c641206d2e92d 100644 (file)
@@ -46,7 +46,7 @@ FT_BEGIN_HEADER
   *   interpreter for a typeface opened by @FT_Open_Face.
   *
   */
-#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
+#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG('u', 'n', 'p', 'a')
 
  /* */
 
index 420204352148bbfcd45c7afb9a6419f2552501fd..0611dedc7fb6ba168cd228f70a67a87d03baf3b7 100644 (file)
@@ -73,7 +73,7 @@ public:
 
        Texturec(uint amt,const char **paths);
        Texturec(std::vector<std::string>vec);
-       Texturec( std::initializer_list<std::string> l );
+       Texturec(std::initializer_list<std::string> l);
 
        /**
         * Frees memory taken by the image array.
index 4282642308dda37c50052e801bb3379065b14dc6..8e51a6acaed85d1b7f181729b7d122ae2558fd47 100755 (executable)
@@ -51,7 +51,7 @@ distribution.
         AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h\r
 */\r
 \r
-#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__)\r
+#if defined(_DEBUG) || defined(DEBUG) || defined (__DEBUG__)\r
 #   ifndef DEBUG\r
 #       define DEBUG\r
 #   endif\r
@@ -78,16 +78,16 @@ distribution.
 #if defined(DEBUG)\r
 #   if defined(_MSC_VER)\r
 #       // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like\r
-#       define TIXMLASSERT( x )           if ( !((void)0,(x))) { __debugbreak(); }\r
+#       define TIXMLASSERT(x)           if (!((void)0,(x))) { __debugbreak(); }\r
 #   elif defined (ANDROID_NDK)\r
 #       include <android/log.h>\r
-#       define TIXMLASSERT( x )           if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }\r
+#       define TIXMLASSERT(x)           if (!(x)) { __android_log_assert("assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__); }\r
 #   else\r
 #       include <assert.h>\r
 #       define TIXMLASSERT                assert\r
 #   endif\r
 #else\r
-#   define TIXMLASSERT( x )               {}\r
+#   define TIXMLASSERT(x)               {}\r
 #endif\r
 \r
 \r
@@ -131,10 +131,10 @@ public:
         COMMENT                                        = NEEDS_NEWLINE_NORMALIZATION\r
     };\r
 \r
-    StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}\r
+    StrPair() : _flags(0), _start(0), _end(0) {}\r
     ~StrPair();\r
 \r
-    void Set( char* start, char* end, int flags ) {\r
+    void Set(char* start, char* end, int flags) {\r
         Reset();\r
         _start  = start;\r
         _end    = end;\r
@@ -147,17 +147,17 @@ public:
         return _start == _end;\r
     }\r
 \r
-    void SetInternedStr( const char* str ) {\r
+    void SetInternedStr(const char* str) {\r
         Reset();\r
         _start = const_cast<char*>(str);\r
     }\r
 \r
-    void SetStr( const char* str, int flags=0 );\r
+    void SetStr(const char* str, int flags=0);\r
 \r
-    char* ParseText( char* in, const char* endTag, int strFlags );\r
-    char* ParseName( char* in );\r
+    char* ParseText(char* in, const char* endTag, int strFlags);\r
+    char* ParseName(char* in);\r
 \r
-    void TransferTo( StrPair* other );\r
+    void TransferTo(StrPair* other);\r
 \r
 private:\r
     void Reset();\r
@@ -172,8 +172,8 @@ private:
     char*   _start;\r
     char*   _end;\r
 \r
-    StrPair( const StrPair& other );   // not supported\r
-    void operator=( StrPair& other );  // not supported, use TransferTo()\r
+    StrPair(const StrPair& other);     // not supported\r
+    void operator=(StrPair& other);    // not supported, use TransferTo()\r
 };\r
 \r
 \r
@@ -193,7 +193,7 @@ public:
     }\r
 \r
     ~DynArray() {\r
-        if ( _mem != _pool ) {\r
+        if (_mem != _pool) {\r
             delete [] _mem;\r
         }\r
     }\r
@@ -202,28 +202,28 @@ public:
         _size = 0;\r
     }\r
 \r
-    void Push( T t ) {\r
-        TIXMLASSERT( _size < INT_MAX );\r
-        EnsureCapacity( _size+1 );\r
+    void Push(T t) {\r
+        TIXMLASSERT(_size < INT_MAX);\r
+        EnsureCapacity(_size+1);\r
         _mem[_size++] = t;\r
     }\r
 \r
-    T* PushArr( int count ) {\r
-        TIXMLASSERT( count >= 0 );\r
-        TIXMLASSERT( _size <= INT_MAX - count );\r
-        EnsureCapacity( _size+count );\r
+    T* PushArr(int count) {\r
+        TIXMLASSERT(count >= 0);\r
+        TIXMLASSERT(_size <= INT_MAX - count);\r
+        EnsureCapacity(_size+count);\r
         T* ret = &_mem[_size];\r
         _size += count;\r
         return ret;\r
     }\r
 \r
     T Pop() {\r
-        TIXMLASSERT( _size > 0 );\r
+        TIXMLASSERT(_size > 0);\r
         return _mem[--_size];\r
     }\r
 \r
-    void PopArr( int count ) {\r
-        TIXMLASSERT( _size >= count );\r
+    void PopArr(int count) {\r
+        TIXMLASSERT(_size >= count);\r
         _size -= count;\r
     }\r
 \r
@@ -232,52 +232,52 @@ public:
     }\r
 \r
     T& operator[](int i)                               {\r
-        TIXMLASSERT( i>= 0 && i < _size );\r
+        TIXMLASSERT(i>= 0 && i < _size);\r
         return _mem[i];\r
     }\r
 \r
     const T& operator[](int i) const   {\r
-        TIXMLASSERT( i>= 0 && i < _size );\r
+        TIXMLASSERT(i>= 0 && i < _size);\r
         return _mem[i];\r
     }\r
 \r
     const T& PeekTop() const            {\r
-        TIXMLASSERT( _size > 0 );\r
+        TIXMLASSERT(_size > 0);\r
         return _mem[ _size - 1];\r
     }\r
 \r
     int Size() const                                   {\r
-        TIXMLASSERT( _size >= 0 );\r
+        TIXMLASSERT(_size >= 0);\r
         return _size;\r
     }\r
 \r
     int Capacity() const                               {\r
-        TIXMLASSERT( _allocated >= INITIAL_SIZE );\r
+        TIXMLASSERT(_allocated >= INITIAL_SIZE);\r
         return _allocated;\r
     }\r
 \r
     const T* Mem() const                               {\r
-        TIXMLASSERT( _mem );\r
+        TIXMLASSERT(_mem);\r
         return _mem;\r
     }\r
 \r
     T* Mem()                                                   {\r
-        TIXMLASSERT( _mem );\r
+        TIXMLASSERT(_mem);\r
         return _mem;\r
     }\r
 \r
 private:\r
-    DynArray( const DynArray& ); // not supported\r
-    void operator=( const DynArray& ); // not supported\r
+    DynArray(const DynArray&); // not supported\r
+    void operator=(const DynArray&); // not supported\r
 \r
-    void EnsureCapacity( int cap ) {\r
-        TIXMLASSERT( cap > 0 );\r
-        if ( cap > _allocated ) {\r
-            TIXMLASSERT( cap <= INT_MAX / 2 );\r
+    void EnsureCapacity(int cap) {\r
+        TIXMLASSERT(cap > 0);\r
+        if (cap > _allocated) {\r
+            TIXMLASSERT(cap <= INT_MAX / 2);\r
             int newAllocated = cap * 2;\r
             T* newMem = new T[newAllocated];\r
-            memcpy( newMem, _mem, sizeof(T)*_size );   // warning: not using constructors, only works for PODs\r
-            if ( _mem != _pool ) {\r
+            memcpy(newMem, _mem, sizeof(T)*_size);     // warning: not using constructors, only works for PODs\r
+            if (_mem != _pool) {\r
                 delete [] _mem;\r
             }\r
             _mem = newMem;\r
@@ -304,7 +304,7 @@ public:
 \r
     virtual int ItemSize() const = 0;\r
     virtual void* Alloc() = 0;\r
-    virtual void Free( void* ) = 0;\r
+    virtual void Free(void*) = 0;\r
     virtual void SetTracked() = 0;\r
     virtual void Clear() = 0;\r
 };\r
@@ -324,7 +324,7 @@ public:
     \r
     void Clear() {\r
         // Delete the blocks.\r
-        while( !_blockPtrs.Empty()) {\r
+        while(!_blockPtrs.Empty()) {\r
             Block* b  = _blockPtrs.Pop();\r
             delete b;\r
         }\r
@@ -343,12 +343,12 @@ public:
     }\r
 \r
     virtual void* Alloc() {\r
-        if ( !_root ) {\r
+        if (!_root) {\r
             // Need a new block.\r
             Block* block = new Block();\r
-            _blockPtrs.Push( block );\r
+            _blockPtrs.Push(block);\r
 \r
-            for( int i=0; i<COUNT-1; ++i ) {\r
+            for(int i=0; i<COUNT-1; ++i) {\r
                 block->chunk[i].next = &block->chunk[i+1];\r
             }\r
             block->chunk[COUNT-1].next = 0;\r
@@ -358,7 +358,7 @@ public:
         _root = _root->next;\r
 \r
         ++_currentAllocs;\r
-        if ( _currentAllocs > _maxAllocs ) {\r
+        if (_currentAllocs > _maxAllocs) {\r
             _maxAllocs = _currentAllocs;\r
         }\r
         _nAllocs++;\r
@@ -366,21 +366,21 @@ public:
         return result;\r
     }\r
     \r
-    virtual void Free( void* mem ) {\r
-        if ( !mem ) {\r
+    virtual void Free(void* mem) {\r
+        if (!mem) {\r
             return;\r
         }\r
         --_currentAllocs;\r
-        Chunk* chunk = static_cast<Chunk*>( mem );\r
+        Chunk* chunk = static_cast<Chunk*>(mem);\r
 #ifdef DEBUG\r
-        memset( chunk, 0xfe, sizeof(Chunk) );\r
+        memset(chunk, 0xfe, sizeof(Chunk));\r
 #endif\r
         chunk->next = _root;\r
         _root = chunk;\r
     }\r
-    void Trace( const char* name ) {\r
-        printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",\r
-                name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() );\r
+    void Trace(const char* name) {\r
+        printf("Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",\r
+                name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size());\r
     }\r
 \r
     void SetTracked() {\r
@@ -403,8 +403,8 @@ public:
     enum { COUNT = (4*1024)/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private\r
 \r
 private:\r
-    MemPoolT( const MemPoolT& ); // not supported\r
-    void operator=( const MemPoolT& ); // not supported\r
+    MemPoolT(const MemPoolT&); // not supported\r
+    void operator=(const MemPoolT&); // not supported\r
 \r
     union Chunk {\r
         Chunk*  next;\r
@@ -449,37 +449,37 @@ public:
     virtual ~XMLVisitor() {}\r
 \r
     /// Visit a document.\r
-    virtual bool VisitEnter( const XMLDocument& /*doc*/ )                      {\r
+    virtual bool VisitEnter(const XMLDocument& /*doc*/)                        {\r
         return true;\r
     }\r
     /// Visit a document.\r
-    virtual bool VisitExit( const XMLDocument& /*doc*/ )                       {\r
+    virtual bool VisitExit(const XMLDocument& /*doc*/)                 {\r
         return true;\r
     }\r
 \r
     /// Visit an element.\r
-    virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ )   {\r
+    virtual bool VisitEnter(const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/)     {\r
         return true;\r
     }\r
     /// Visit an element.\r
-    virtual bool VisitExit( const XMLElement& /*element*/ )                    {\r
+    virtual bool VisitExit(const XMLElement& /*element*/)                      {\r
         return true;\r
     }\r
 \r
     /// Visit a declaration.\r
-    virtual bool Visit( const XMLDeclaration& /*declaration*/ )                {\r
+    virtual bool Visit(const XMLDeclaration& /*declaration*/)          {\r
         return true;\r
     }\r
     /// Visit a text node.\r
-    virtual bool Visit( const XMLText& /*text*/ )                                      {\r
+    virtual bool Visit(const XMLText& /*text*/)                                        {\r
         return true;\r
     }\r
     /// Visit a comment node.\r
-    virtual bool Visit( const XMLComment& /*comment*/ )                                {\r
+    virtual bool Visit(const XMLComment& /*comment*/)                          {\r
         return true;\r
     }\r
     /// Visit an unknown node.\r
-    virtual bool Visit( const XMLUnknown& /*unknown*/ )                                {\r
+    virtual bool Visit(const XMLUnknown& /*unknown*/)                          {\r
         return true;\r
     }\r
 };\r
@@ -518,72 +518,72 @@ enum XMLError {
 class XMLUtil\r
 {\r
 public:\r
-    static const char* SkipWhiteSpace( const char* p ) {\r
-        TIXMLASSERT( p );\r
-        while( IsWhiteSpace(*p) ) {\r
+    static const char* SkipWhiteSpace(const char* p)   {\r
+        TIXMLASSERT(p);\r
+        while(IsWhiteSpace(*p)) {\r
             ++p;\r
         }\r
-        TIXMLASSERT( p );\r
+        TIXMLASSERT(p);\r
         return p;\r
     }\r
-    static char* SkipWhiteSpace( char* p )                             {\r
-        return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p) ) );\r
+    static char* SkipWhiteSpace(char* p)                               {\r
+        return const_cast<char*>(SkipWhiteSpace(const_cast<const char*>(p)));\r
     }\r
 \r
     // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't\r
     // correct, but simple, and usually works.\r
-    static bool IsWhiteSpace( char p )                                 {\r
-        return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );\r
+    static bool IsWhiteSpace(char p)                                   {\r
+        return !IsUTF8Continuation(p) && isspace(static_cast<unsigned char>(p));\r
     }\r
     \r
-    inline static bool IsNameStartChar( unsigned char ch ) {\r
-        if ( ch >= 128 ) {\r
+    inline static bool IsNameStartChar(unsigned char ch) {\r
+        if (ch >= 128) {\r
             // This is a heuristic guess in attempt to not implement Unicode-aware isalpha()\r
             return true;\r
         }\r
-        if ( isalpha( ch ) ) {\r
+        if (isalpha(ch)) {\r
             return true;\r
         }\r
         return ch == ':' || ch == '_';\r
     }\r
     \r
-    inline static bool IsNameChar( unsigned char ch ) {\r
-        return IsNameStartChar( ch )\r
-               || isdigit( ch )\r
+    inline static bool IsNameChar(unsigned char ch) {\r
+        return IsNameStartChar(ch)\r
+               || isdigit(ch)\r
                || ch == '.'\r
                || ch == '-';\r
     }\r
 \r
-    inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX )  {\r
-        if ( p == q ) {\r
+    inline static bool StringEqual(const char* p, const char* q, int nChar=INT_MAX)  {\r
+        if (p == q) {\r
             return true;\r
         }\r
-        return strncmp( p, q, nChar ) == 0;\r
+        return strncmp(p, q, nChar) == 0;\r
     }\r
     \r
-    inline static bool IsUTF8Continuation( char p ) {\r
-        return ( p & 0x80 ) != 0;\r
+    inline static bool IsUTF8Continuation(char p) {\r
+        return (p & 0x80) != 0;\r
     }\r
 \r
-    static const char* ReadBOM( const char* p, bool* hasBOM );\r
+    static const char* ReadBOM(const char* p, bool* hasBOM);\r
     // p is the starting location,\r
     // the UTF-8 value of the entity will be placed in value, and length filled in.\r
-    static const char* GetCharacterRef( const char* p, char* value, int* length );\r
-    static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );\r
+    static const char* GetCharacterRef(const char* p, char* value, int* length);\r
+    static void ConvertUTF32ToUTF8(unsigned long input, char* output, int* length);\r
 \r
     // converts primitive types to strings\r
-    static void ToStr( int v, char* buffer, int bufferSize );\r
-    static void ToStr( unsigned v, char* buffer, int bufferSize );\r
-    static void ToStr( bool v, char* buffer, int bufferSize );\r
-    static void ToStr( float v, char* buffer, int bufferSize );\r
-    static void ToStr( double v, char* buffer, int bufferSize );\r
+    static void ToStr(int v, char* buffer, int bufferSize);\r
+    static void ToStr(unsigned v, char* buffer, int bufferSize);\r
+    static void ToStr(bool v, char* buffer, int bufferSize);\r
+    static void ToStr(float v, char* buffer, int bufferSize);\r
+    static void ToStr(double v, char* buffer, int bufferSize);\r
 \r
     // converts strings to primitive types\r
-    static bool        ToInt( const char* str, int* value );\r
-    static bool ToUnsigned( const char* str, unsigned* value );\r
-    static bool        ToBool( const char* str, bool* value );\r
-    static bool        ToFloat( const char* str, float* value );\r
-    static bool ToDouble( const char* str, double* value );\r
+    static bool        ToInt(const char* str, int* value);\r
+    static bool ToUnsigned(const char* str, unsigned* value);\r
+    static bool        ToBool(const char* str, bool* value);\r
+    static bool        ToFloat(const char* str, float* value);\r
+    static bool ToDouble(const char* str, double* value);\r
 };\r
 \r
 \r
@@ -602,7 +602,7 @@ public:
        A Document can contain: Element (container or leaf)\r
                                                        Comment (leaf)\r
                                                        Unknown (leaf)\r
-                                                       Declaration( leaf )\r
+                                                       Declaration(leaf)\r
 \r
        An Element can contain: Element (container or leaf)\r
                                                        Text    (leaf)\r
@@ -620,12 +620,12 @@ public:
 \r
     /// Get the XMLDocument that owns this XMLNode.\r
     const XMLDocument* GetDocument() const     {\r
-        TIXMLASSERT( _document );\r
+        TIXMLASSERT(_document);\r
         return _document;\r
     }\r
     /// Get the XMLDocument that owns this XMLNode.\r
     XMLDocument* GetDocument()                         {\r
-        TIXMLASSERT( _document );\r
+        TIXMLASSERT(_document);\r
         return _document;\r
     }\r
 \r
@@ -687,7 +687,7 @@ public:
     /** Set the Value of an XML node.\r
        @sa Value()\r
     */\r
-    void SetValue( const char* val, bool staticMem=false );\r
+    void SetValue(const char* val, bool staticMem=false);\r
 \r
     /// Get the parent of this node on the DOM.\r
     const XMLNode*     Parent() const                  {\r
@@ -715,10 +715,10 @@ public:
     /** Get the first child element, or optionally the first child\r
         element with the specified name.\r
     */\r
-    const XMLElement* FirstChildElement( const char* name = 0 ) const;\r
+    const XMLElement* FirstChildElement(const char* name = 0) const;\r
 \r
-    XMLElement* FirstChildElement( const char* name = 0 )      {\r
-        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( name ));\r
+    XMLElement* FirstChildElement(const char* name = 0)        {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement(name));\r
     }\r
 \r
     /// Get the last child node, or null if none exists.\r
@@ -733,10 +733,10 @@ public:
     /** Get the last child element or optionally the last child\r
         element with the specified name.\r
     */\r
-    const XMLElement* LastChildElement( const char* name = 0 ) const;\r
+    const XMLElement* LastChildElement(const char* name = 0) const;\r
 \r
-    XMLElement* LastChildElement( const char* name = 0 )       {\r
-        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(name) );\r
+    XMLElement* LastChildElement(const char* name = 0) {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(name));\r
     }\r
 \r
     /// Get the previous (left) sibling node of this node.\r
@@ -749,10 +749,10 @@ public:
     }\r
 \r
     /// Get the previous (left) sibling element of this node, with an optionally supplied name.\r
-    const XMLElement*  PreviousSiblingElement( const char* name = 0 ) const ;\r
+    const XMLElement*  PreviousSiblingElement(const char* name = 0) const ;\r
 \r
-    XMLElement*        PreviousSiblingElement( const char* name = 0 ) {\r
-        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( name ) );\r
+    XMLElement*        PreviousSiblingElement(const char* name = 0) {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement(name));\r
     }\r
 \r
     /// Get the next (right) sibling node of this node.\r
@@ -765,10 +765,10 @@ public:
     }\r
 \r
     /// Get the next (right) sibling element of this node, with an optionally supplied name.\r
-    const XMLElement*  NextSiblingElement( const char* name = 0 ) const;\r
+    const XMLElement*  NextSiblingElement(const char* name = 0) const;\r
 \r
-    XMLElement*        NextSiblingElement( const char* name = 0 )      {\r
-        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( name ) );\r
+    XMLElement*        NextSiblingElement(const char* name = 0)        {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement(name));\r
     }\r
 \r
     /**\r
@@ -778,10 +778,10 @@ public:
                Returns the addThis argument or 0 if the node does not\r
                belong to the same document.\r
     */\r
-    XMLNode* InsertEndChild( XMLNode* addThis );\r
+    XMLNode* InsertEndChild(XMLNode* addThis);\r
 \r
-    XMLNode* LinkEndChild( XMLNode* addThis )  {\r
-        return InsertEndChild( addThis );\r
+    XMLNode* LinkEndChild(XMLNode* addThis)    {\r
+        return InsertEndChild(addThis);\r
     }\r
     /**\r
        Add a child node as the first (left) child.\r
@@ -790,7 +790,7 @@ public:
                Returns the addThis argument or 0 if the node does not\r
                belong to the same document.\r
     */\r
-    XMLNode* InsertFirstChild( XMLNode* addThis );\r
+    XMLNode* InsertFirstChild(XMLNode* addThis);\r
     /**\r
        Add a node after the specified child node.\r
                If the child node is already part of the document,\r
@@ -799,7 +799,7 @@ public:
                is not a child of this node, or if the node does not\r
                belong to the same document.\r
     */\r
-    XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );\r
+    XMLNode* InsertAfterChild(XMLNode* afterThis, XMLNode* addThis);\r
 \r
     /**\r
        Delete all the children of this node.\r
@@ -809,7 +809,7 @@ public:
     /**\r
        Delete a child of this node.\r
     */\r
-    void DeleteChild( XMLNode* node );\r
+    void DeleteChild(XMLNode* node);\r
 \r
     /**\r
        Make a copy of this node, but not its children.\r
@@ -820,7 +820,7 @@ public:
 \r
        Note: if called on a XMLDocument, this will return null.\r
     */\r
-    virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;\r
+    virtual XMLNode* ShallowClone(XMLDocument* document) const = 0;\r
 \r
     /**\r
        Test if 2 nodes are the same, but don't test children.\r
@@ -828,7 +828,7 @@ public:
 \r
        Note: if called on a XMLDocument, this will return false.\r
     */\r
-    virtual bool ShallowEqual( const XMLNode* compare ) const = 0;\r
+    virtual bool ShallowEqual(const XMLNode* compare) const = 0;\r
 \r
     /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the\r
        XML tree will be conditionally visited and the host will be called back\r
@@ -848,17 +848,17 @@ public:
        An example of using Accept():\r
        @verbatim\r
        XMLPrinter printer;\r
-       tinyxmlDoc.Accept( &printer );\r
+       tinyxmlDoc.Accept(&printer);\r
        const char* xmlcstr = printer.CStr();\r
        @endverbatim\r
     */\r
-    virtual bool Accept( XMLVisitor* visitor ) const = 0;\r
+    virtual bool Accept(XMLVisitor* visitor) const = 0;\r
 \r
 protected:\r
-    XMLNode( XMLDocument* );\r
+    XMLNode(XMLDocument*);\r
     virtual ~XMLNode();\r
 \r
-    virtual char* ParseDeep( char*, StrPair* );\r
+    virtual char* ParseDeep(char*, StrPair*);\r
 \r
     XMLDocument*       _document;\r
     XMLNode*           _parent;\r
@@ -872,12 +872,12 @@ protected:
 \r
 private:\r
     MemPool*           _memPool;\r
-    void Unlink( XMLNode* child );\r
-    static void DeleteNode( XMLNode* node );\r
-    void InsertChildPreamble( XMLNode* insertThis ) const;\r
+    void Unlink(XMLNode* child);\r
+    static void DeleteNode(XMLNode* node);\r
+    void InsertChildPreamble(XMLNode* insertThis) const;\r
 \r
-    XMLNode( const XMLNode& ); // not supported\r
-    XMLNode& operator=( const XMLNode& );      // not supported\r
+    XMLNode(const XMLNode&);   // not supported\r
+    XMLNode& operator=(const XMLNode&);        // not supported\r
 };\r
 \r
 \r
@@ -898,7 +898,7 @@ class TINYXML2_LIB XMLText : public XMLNode
     friend class XMLBase;\r
     friend class XMLDocument;\r
 public:\r
-    virtual bool Accept( XMLVisitor* visitor ) const;\r
+    virtual bool Accept(XMLVisitor* visitor) const;\r
 \r
     virtual XMLText* ToText()                  {\r
         return this;\r
@@ -908,7 +908,7 @@ public:
     }\r
 \r
     /// Declare whether this should be CDATA or standard text.\r
-    void SetCData( bool isCData )                      {\r
+    void SetCData(bool isCData)                        {\r
         _isCData = isCData;\r
     }\r
     /// Returns true if this is a CDATA text element.\r
@@ -916,20 +916,20 @@ public:
         return _isCData;\r
     }\r
 \r
-    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
-    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+    virtual XMLNode* ShallowClone(XMLDocument* document) const;\r
+    virtual bool ShallowEqual(const XMLNode* compare) const;\r
 \r
 protected:\r
-    XMLText( XMLDocument* doc )        : XMLNode( doc ), _isCData( false )     {}\r
+    XMLText(XMLDocument* doc)  : XMLNode(doc), _isCData(false) {}\r
     virtual ~XMLText()                                                                                         {}\r
 \r
-    char* ParseDeep( char*, StrPair* endTag );\r
+    char* ParseDeep(char*, StrPair* endTag);\r
 \r
 private:\r
     bool _isCData;\r
 \r
-    XMLText( const XMLText& ); // not supported\r
-    XMLText& operator=( const XMLText& );      // not supported\r
+    XMLText(const XMLText&);   // not supported\r
+    XMLText& operator=(const XMLText&);        // not supported\r
 };\r
 \r
 \r
@@ -945,20 +945,20 @@ public:
         return this;\r
     }\r
 \r
-    virtual bool Accept( XMLVisitor* visitor ) const;\r
+    virtual bool Accept(XMLVisitor* visitor) const;\r
 \r
-    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
-    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+    virtual XMLNode* ShallowClone(XMLDocument* document) const;\r
+    virtual bool ShallowEqual(const XMLNode* compare) const;\r
 \r
 protected:\r
-    XMLComment( XMLDocument* doc );\r
+    XMLComment(XMLDocument* doc);\r
     virtual ~XMLComment();\r
 \r
-    char* ParseDeep( char*, StrPair* endTag );\r
+    char* ParseDeep(char*, StrPair* endTag);\r
 \r
 private:\r
-    XMLComment( const XMLComment& );   // not supported\r
-    XMLComment& operator=( const XMLComment& );        // not supported\r
+    XMLComment(const XMLComment&);     // not supported\r
+    XMLComment& operator=(const XMLComment&);  // not supported\r
 };\r
 \r
 \r
@@ -984,20 +984,20 @@ public:
         return this;\r
     }\r
 \r
-    virtual bool Accept( XMLVisitor* visitor ) const;\r
+    virtual bool Accept(XMLVisitor* visitor) const;\r
 \r
-    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
-    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+    virtual XMLNode* ShallowClone(XMLDocument* document) const;\r
+    virtual bool ShallowEqual(const XMLNode* compare) const;\r
 \r
 protected:\r
-    XMLDeclaration( XMLDocument* doc );\r
+    XMLDeclaration(XMLDocument* doc);\r
     virtual ~XMLDeclaration();\r
 \r
-    char* ParseDeep( char*, StrPair* endTag );\r
+    char* ParseDeep(char*, StrPair* endTag);\r
 \r
 private:\r
-    XMLDeclaration( const XMLDeclaration& );   // not supported\r
-    XMLDeclaration& operator=( const XMLDeclaration& );        // not supported\r
+    XMLDeclaration(const XMLDeclaration&);     // not supported\r
+    XMLDeclaration& operator=(const XMLDeclaration&);  // not supported\r
 };\r
 \r
 \r
@@ -1019,20 +1019,20 @@ public:
         return this;\r
     }\r
 \r
-    virtual bool Accept( XMLVisitor* visitor ) const;\r
+    virtual bool Accept(XMLVisitor* visitor) const;\r
 \r
-    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
-    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+    virtual XMLNode* ShallowClone(XMLDocument* document) const;\r
+    virtual bool ShallowEqual(const XMLNode* compare) const;\r
 \r
 protected:\r
-    XMLUnknown( XMLDocument* doc );\r
+    XMLUnknown(XMLDocument* doc);\r
     virtual ~XMLUnknown();\r
 \r
-    char* ParseDeep( char*, StrPair* endTag );\r
+    char* ParseDeep(char*, StrPair* endTag);\r
 \r
 private:\r
-    XMLUnknown( const XMLUnknown& );   // not supported\r
-    XMLUnknown& operator=( const XMLUnknown& );        // not supported\r
+    XMLUnknown(const XMLUnknown&);     // not supported\r
+    XMLUnknown& operator=(const XMLUnknown&);  // not supported\r
 };\r
 \r
 \r
@@ -1064,31 +1064,31 @@ public:
     */\r
     int                 IntValue() const                               {\r
         int i=0;\r
-        QueryIntValue( &i );\r
+        QueryIntValue(&i);\r
         return i;\r
     }\r
     /// Query as an unsigned integer. See IntValue()\r
     unsigned UnsignedValue() const                     {\r
         unsigned i=0;\r
-        QueryUnsignedValue( &i );\r
+        QueryUnsignedValue(&i);\r
         return i;\r
     }\r
     /// Query as a boolean. See IntValue()\r
     bool        BoolValue() const                              {\r
         bool b=false;\r
-        QueryBoolValue( &b );\r
+        QueryBoolValue(&b);\r
         return b;\r
     }\r
     /// Query as a double. See IntValue()\r
     double      DoubleValue() const                    {\r
         double d=0;\r
-        QueryDoubleValue( &d );\r
+        QueryDoubleValue(&d);\r
         return d;\r
     }\r
     /// Query as a float. See IntValue()\r
     float       FloatValue() const                             {\r
         float f=0;\r
-        QueryFloatValue( &f );\r
+        QueryFloatValue(&f);\r
         return f;\r
     }\r
 \r
@@ -1096,40 +1096,40 @@ public:
        in the provided parameter. The function will return XML_NO_ERROR on success,\r
        and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.\r
     */\r
-    XMLError QueryIntValue( int* value ) const;\r
+    XMLError QueryIntValue(int* value) const;\r
     /// See QueryIntValue\r
-    XMLError QueryUnsignedValue( unsigned int* value ) const;\r
+    XMLError QueryUnsignedValue(unsigned int* value) const;\r
     /// See QueryIntValue\r
-    XMLError QueryBoolValue( bool* value ) const;\r
+    XMLError QueryBoolValue(bool* value) const;\r
     /// See QueryIntValue\r
-    XMLError QueryDoubleValue( double* value ) const;\r
+    XMLError QueryDoubleValue(double* value) const;\r
     /// See QueryIntValue\r
-    XMLError QueryFloatValue( float* value ) const;\r
+    XMLError QueryFloatValue(float* value) const;\r
 \r
     /// Set the attribute to a string value.\r
-    void SetAttribute( const char* value );\r
+    void SetAttribute(const char* value);\r
     /// Set the attribute to value.\r
-    void SetAttribute( int value );\r
+    void SetAttribute(int value);\r
     /// Set the attribute to value.\r
-    void SetAttribute( unsigned value );\r
+    void SetAttribute(unsigned value);\r
     /// Set the attribute to value.\r
-    void SetAttribute( bool value );\r
+    void SetAttribute(bool value);\r
     /// Set the attribute to value.\r
-    void SetAttribute( double value );\r
+    void SetAttribute(double value);\r
     /// Set the attribute to value.\r
-    void SetAttribute( float value );\r
+    void SetAttribute(float value);\r
 \r
 private:\r
     enum { BUF_SIZE = 200 };\r
 \r
-    XMLAttribute() : _next( 0 ), _memPool( 0 ) {}\r
+    XMLAttribute() : _next(0), _memPool(0) {}\r
     virtual ~XMLAttribute()    {}\r
 \r
-    XMLAttribute( const XMLAttribute& );       // not supported\r
-    void operator=( const XMLAttribute& );     // not supported\r
-    void SetName( const char* name );\r
+    XMLAttribute(const XMLAttribute&); // not supported\r
+    void operator=(const XMLAttribute&);       // not supported\r
+    void SetName(const char* name);\r
 \r
-    char* ParseDeep( char* p, bool processEntities );\r
+    char* ParseDeep(char* p, bool processEntities);\r
 \r
     mutable StrPair _name;\r
     mutable StrPair _value;\r
@@ -1152,8 +1152,8 @@ public:
         return Value();\r
     }\r
     /// Set the name of the element.\r
-    void SetName( const char* str, bool staticMem=false )      {\r
-        SetValue( str, staticMem );\r
+    void SetName(const char* str, bool staticMem=false)        {\r
+        SetValue(str, staticMem);\r
     }\r
 \r
     virtual XMLElement* ToElement()                            {\r
@@ -1162,14 +1162,14 @@ public:
     virtual const XMLElement* ToElement() const {\r
         return this;\r
     }\r
-    virtual bool Accept( XMLVisitor* visitor ) const;\r
+    virtual bool Accept(XMLVisitor* visitor) const;\r
 \r
     /** Given an attribute name, Attribute() returns the value\r
        for the attribute of that name, or null if none\r
        exists. For example:\r
 \r
        @verbatim\r
-       const char* value = ele->Attribute( "foo" );\r
+       const char* value = ele->Attribute("foo");\r
        @endverbatim\r
 \r
        The 'value' parameter is normally null. However, if specified,\r
@@ -1177,55 +1177,55 @@ public:
        match. This allow you to write code:\r
 \r
        @verbatim\r
-       if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar();\r
+       if (ele->Attribute("foo", "bar")) callFooIsBar();\r
        @endverbatim\r
 \r
        rather than:\r
        @verbatim\r
-       if ( ele->Attribute( "foo" ) ) {\r
-               if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();\r
+       if (ele->Attribute("foo")) {\r
+               if (strcmp(ele->Attribute("foo"), "bar") == 0) callFooIsBar();\r
        }\r
        @endverbatim\r
     */\r
-    const char* Attribute( const char* name, const char* value=0 ) const;\r
+    const char* Attribute(const char* name, const char* value=0) const;\r
 \r
        /** Functions the same as Attribute(), but returns the result\r
            as a std::string.\r
        */\r
-       std::string StrAttribute( const char* name, const char* value=0 ) const;\r
+       std::string StrAttribute(const char* name, const char* value=0) const;\r
 \r
     /** Given an attribute name, IntAttribute() returns the value\r
        of the attribute interpreted as an integer. 0 will be\r
        returned if there is an error. For a method with error\r
        checking, see QueryIntAttribute()\r
     */\r
-    int                 IntAttribute( const char* name ) const         {\r
+    int                 IntAttribute(const char* name) const           {\r
         int i=0;\r
-        QueryIntAttribute( name, &i );\r
+        QueryIntAttribute(name, &i);\r
         return i;\r
     }\r
     /// See IntAttribute()\r
-    unsigned UnsignedAttribute( const char* name ) const {\r
+    unsigned UnsignedAttribute(const char* name) const {\r
         unsigned i=0;\r
-        QueryUnsignedAttribute( name, &i );\r
+        QueryUnsignedAttribute(name, &i);\r
         return i;\r
     }\r
     /// See IntAttribute()\r
-    bool        BoolAttribute( const char* name ) const        {\r
+    bool        BoolAttribute(const char* name) const  {\r
         bool b=false;\r
-        QueryBoolAttribute( name, &b );\r
+        QueryBoolAttribute(name, &b);\r
         return b;\r
     }\r
     /// See IntAttribute()\r
-    double      DoubleAttribute( const char* name ) const      {\r
+    double      DoubleAttribute(const char* name) const        {\r
         double d=0;\r
-        QueryDoubleAttribute( name, &d );\r
+        QueryDoubleAttribute(name, &d);\r
         return d;\r
     }\r
     /// See IntAttribute()\r
-    float       FloatAttribute( const char* name ) const       {\r
+    float       FloatAttribute(const char* name) const {\r
         float f=0;\r
-        QueryFloatAttribute( name, &f );\r
+        QueryFloatAttribute(name, &f);\r
         return f;\r
     }\r
 \r
@@ -1239,47 +1239,47 @@ public:
 \r
        @verbatim\r
        int value = 10;\r
-       QueryIntAttribute( "foo", &value );             // if "foo" isn't found, value will still be 10\r
+       QueryIntAttribute("foo", &value);               // if "foo" isn't found, value will still be 10\r
        @endverbatim\r
     */\r
-    XMLError QueryIntAttribute( const char* name, int* value ) const                           {\r
-        const XMLAttribute* a = FindAttribute( name );\r
-        if ( !a ) {\r
+    XMLError QueryIntAttribute(const char* name, int* value) const                             {\r
+        const XMLAttribute* a = FindAttribute(name);\r
+        if (!a) {\r
             return XML_NO_ATTRIBUTE;\r
         }\r
-        return a->QueryIntValue( value );\r
+        return a->QueryIntValue(value);\r
     }\r
     /// See QueryIntAttribute()\r
-    XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const     {\r
-        const XMLAttribute* a = FindAttribute( name );\r
-        if ( !a ) {\r
+    XMLError QueryUnsignedAttribute(const char* name, unsigned int* value) const       {\r
+        const XMLAttribute* a = FindAttribute(name);\r
+        if (!a) {\r
             return XML_NO_ATTRIBUTE;\r
         }\r
-        return a->QueryUnsignedValue( value );\r
+        return a->QueryUnsignedValue(value);\r
     }\r
     /// See QueryIntAttribute()\r
-    XMLError QueryBoolAttribute( const char* name, bool* value ) const                         {\r
-        const XMLAttribute* a = FindAttribute( name );\r
-        if ( !a ) {\r
+    XMLError QueryBoolAttribute(const char* name, bool* value) const                           {\r
+        const XMLAttribute* a = FindAttribute(name);\r
+        if (!a) {\r
             return XML_NO_ATTRIBUTE;\r
         }\r
-        return a->QueryBoolValue( value );\r
+        return a->QueryBoolValue(value);\r
     }\r
     /// See QueryIntAttribute()\r
-    XMLError QueryDoubleAttribute( const char* name, double* value ) const                     {\r
-        const XMLAttribute* a = FindAttribute( name );\r
-        if ( !a ) {\r
+    XMLError QueryDoubleAttribute(const char* name, double* value) const                       {\r
+        const XMLAttribute* a = FindAttribute(name);\r
+        if (!a) {\r
             return XML_NO_ATTRIBUTE;\r
         }\r
-        return a->QueryDoubleValue( value );\r
+        return a->QueryDoubleValue(value);\r
     }\r
     /// See QueryIntAttribute()\r
-    XMLError QueryFloatAttribute( const char* name, float* value ) const                       {\r
-        const XMLAttribute* a = FindAttribute( name );\r
-        if ( !a ) {\r
+    XMLError QueryFloatAttribute(const char* name, float* value) const                 {\r
+        const XMLAttribute* a = FindAttribute(name);\r
+        if (!a) {\r
             return XML_NO_ATTRIBUTE;\r
         }\r
-        return a->QueryFloatValue( value );\r
+        return a->QueryFloatValue(value);\r
     }\r
 \r
        \r
@@ -1297,71 +1297,71 @@ public:
 \r
        @verbatim\r
        int value = 10;\r
-       QueryAttribute( "foo", &value );                // if "foo" isn't found, value will still be 10\r
+       QueryAttribute("foo", &value);          // if "foo" isn't found, value will still be 10\r
        @endverbatim\r
     */\r
-       int QueryAttribute( const char* name, int* value ) const {\r
-               return QueryIntAttribute( name, value );\r
+       int QueryAttribute(const char* name, int* value) const {\r
+               return QueryIntAttribute(name, value);\r
        }\r
 \r
-       int QueryAttribute( const char* name, unsigned int* value ) const {\r
-               return QueryUnsignedAttribute( name, value );\r
+       int QueryAttribute(const char* name, unsigned int* value) const {\r
+               return QueryUnsignedAttribute(name, value);\r
        }\r
 \r
-       int QueryAttribute( const char* name, bool* value ) const {\r
-               return QueryBoolAttribute( name, value );\r
+       int QueryAttribute(const char* name, bool* value) const {\r
+               return QueryBoolAttribute(name, value);\r
        }\r
 \r
-       int QueryAttribute( const char* name, double* value ) const {\r
-               return QueryDoubleAttribute( name, value );\r
+       int QueryAttribute(const char* name, double* value) const {\r
+               return QueryDoubleAttribute(name, value);\r
        }\r
 \r
-       int QueryAttribute( const char* name, float* value ) const {\r
-               return QueryFloatAttribute( name, value );\r
+       int QueryAttribute(const char* name, float* value) const {\r
+               return QueryFloatAttribute(name, value);\r
        }\r
 \r
        /// Sets the named attribute to value.\r
-    void SetAttribute( const char* name, const char* value )   {\r
-        XMLAttribute* a = FindOrCreateAttribute( name );\r
-        a->SetAttribute( value );\r
+    void SetAttribute(const char* name, const char* value)     {\r
+        XMLAttribute* a = FindOrCreateAttribute(name);\r
+        a->SetAttribute(value);\r
     }\r
     /// Sets the named attribute to value.\r
-    void SetAttribute( const char* name, int value )                   {\r
-        XMLAttribute* a = FindOrCreateAttribute( name );\r
-        a->SetAttribute( value );\r
+    void SetAttribute(const char* name, int value)                     {\r
+        XMLAttribute* a = FindOrCreateAttribute(name);\r
+        a->SetAttribute(value);\r
     }\r
     /// Sets the named attribute to value.\r
-    void SetAttribute( const char* name, unsigned value )              {\r
-        XMLAttribute* a = FindOrCreateAttribute( name );\r
-        a->SetAttribute( value );\r
+    void SetAttribute(const char* name, unsigned value)                {\r
+        XMLAttribute* a = FindOrCreateAttribute(name);\r
+        a->SetAttribute(value);\r
     }\r
     /// Sets the named attribute to value.\r
-    void SetAttribute( const char* name, bool value )                  {\r
-        XMLAttribute* a = FindOrCreateAttribute( name );\r
-        a->SetAttribute( value );\r
+    void SetAttribute(const char* name, bool value)                    {\r
+        XMLAttribute* a = FindOrCreateAttribute(name);\r
+        a->SetAttribute(value);\r
     }\r
     /// Sets the named attribute to value.\r
-    void SetAttribute( const char* name, double value )                {\r
-        XMLAttribute* a = FindOrCreateAttribute( name );\r
-        a->SetAttribute( value );\r
+    void SetAttribute(const char* name, double value)          {\r
+        XMLAttribute* a = FindOrCreateAttribute(name);\r
+        a->SetAttribute(value);\r
     }\r
     /// Sets the named attribute to value.\r
-    void SetAttribute( const char* name, float value )         {\r
-        XMLAttribute* a = FindOrCreateAttribute( name );\r
-        a->SetAttribute( value );\r
+    void SetAttribute(const char* name, float value)           {\r
+        XMLAttribute* a = FindOrCreateAttribute(name);\r
+        a->SetAttribute(value);\r
     }\r
 \r
     /**\r
        Delete an attribute.\r
     */\r
-    void DeleteAttribute( const char* name );\r
+    void DeleteAttribute(const char* name);\r
 \r
     /// Return the first attribute in the list.\r
     const XMLAttribute* FirstAttribute() const {\r
         return _rootAttribute;\r
     }\r
     /// Query a specific attribute in the list.\r
-    const XMLAttribute* FindAttribute( const char* name ) const;\r
+    const XMLAttribute* FindAttribute(const char* name) const;\r
 \r
     /** Convenience function for easy access to the text inside an element. Although easy\r
        and concise, GetText() is limited compared to getting the XMLText child\r
@@ -1403,7 +1403,7 @@ public:
        This is a convenient method for setting the text of simple contained text:\r
        @verbatim\r
        <foo>This is text</foo>\r
-               fooElement->SetText( "Hullaballoo!" );\r
+               fooElement->SetText("Hullaballoo!");\r
        <foo>Hullaballoo!</foo>\r
                @endverbatim\r
 \r
@@ -1427,17 +1427,17 @@ public:
                <foo>Hullaballoo!</foo>\r
        @endverbatim\r
     */\r
-       void SetText( const char* inText );\r
+       void SetText(const char* inText);\r
     /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
-    void SetText( int value );\r
+    void SetText(int value);\r
     /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
-    void SetText( unsigned value );  \r
+    void SetText(unsigned value);  \r
     /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
-    void SetText( bool value );  \r
+    void SetText(bool value);  \r
     /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
-    void SetText( double value );  \r
+    void SetText(double value);  \r
     /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
-    void SetText( float value );  \r
+    void SetText(float value);  \r
 \r
     /**\r
        Convenience method to query the value of a child text node. This is probably best\r
@@ -1455,25 +1455,25 @@ public:
        @verbatim\r
                int x = 0;\r
                float y = 0;    // types of x and y are contrived for example\r
-               const XMLElement* xElement = pointElement->FirstChildElement( "x" );\r
-               const XMLElement* yElement = pointElement->FirstChildElement( "y" );\r
-               xElement->QueryIntText( &x );\r
-               yElement->QueryFloatText( &y );\r
+               const XMLElement* xElement = pointElement->FirstChildElement("x");\r
+               const XMLElement* yElement = pointElement->FirstChildElement("y");\r
+               xElement->QueryIntText(&x);\r
+               yElement->QueryFloatText(&y);\r
        @endverbatim\r
 \r
        @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted\r
                         to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.\r
 \r
     */\r
-    XMLError QueryIntText( int* ival ) const;\r
+    XMLError QueryIntText(int* ival) const;\r
     /// See QueryIntText()\r
-    XMLError QueryUnsignedText( unsigned* uval ) const;\r
+    XMLError QueryUnsignedText(unsigned* uval) const;\r
     /// See QueryIntText()\r
-    XMLError QueryBoolText( bool* bval ) const;\r
+    XMLError QueryBoolText(bool* bval) const;\r
     /// See QueryIntText()\r
-    XMLError QueryDoubleText( double* dval ) const;\r
+    XMLError QueryDoubleText(double* dval) const;\r
     /// See QueryIntText()\r
-    XMLError QueryFloatText( float* fval ) const;\r
+    XMLError QueryFloatText(float* fval) const;\r
 \r
     // internal:\r
     enum {\r
@@ -1484,25 +1484,25 @@ public:
     int ClosingType() const {\r
         return _closingType;\r
     }\r
-    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
-    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+    virtual XMLNode* ShallowClone(XMLDocument* document) const;\r
+    virtual bool ShallowEqual(const XMLNode* compare) const;\r
 \r
 protected:\r
-    char* ParseDeep( char* p, StrPair* endTag );\r
+    char* ParseDeep(char* p, StrPair* endTag);\r
 \r
 private:\r
-    XMLElement( XMLDocument* doc );\r
+    XMLElement(XMLDocument* doc);\r
     virtual ~XMLElement();\r
-    XMLElement( const XMLElement& );   // not supported\r
-    void operator=( const XMLElement& );       // not supported\r
+    XMLElement(const XMLElement&);     // not supported\r
+    void operator=(const XMLElement&); // not supported\r
 \r
-    XMLAttribute* FindAttribute( const char* name ) {\r
-        return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute( name ));\r
+    XMLAttribute* FindAttribute(const char* name) {\r
+        return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute(name));\r
     }\r
-    XMLAttribute* FindOrCreateAttribute( const char* name );\r
-    //void LinkAttribute( XMLAttribute* attrib );\r
-    char* ParseAttributes( char* p );\r
-    static void DeleteAttribute( XMLAttribute* attribute );\r
+    XMLAttribute* FindOrCreateAttribute(const char* name);\r
+    //void LinkAttribute(XMLAttribute* attrib);\r
+    char* ParseAttributes(char* p);\r
+    static void DeleteAttribute(XMLAttribute* attribute);\r
 \r
     enum { BUF_SIZE = 200 };\r
     int _closingType;\r
@@ -1529,15 +1529,15 @@ class TINYXML2_LIB XMLDocument : public XMLNode
     friend class XMLElement;\r
 public:\r
     /// constructor\r
-    XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE );\r
+    XMLDocument(bool processEntities = true, Whitespace = PRESERVE_WHITESPACE);\r
     ~XMLDocument();\r
 \r
     virtual XMLDocument* ToDocument()                          {\r
-        TIXMLASSERT( this == _document );\r
+        TIXMLASSERT(this == _document);\r
         return this;\r
     }\r
     virtual const XMLDocument* ToDocument() const      {\r
-        TIXMLASSERT( this == _document );\r
+        TIXMLASSERT(this == _document);\r
         return this;\r
     }\r
 \r
@@ -1551,14 +1551,14 @@ public:
        specified, TinyXML-2 will assume 'xml' points to a\r
        null terminated string.\r
     */\r
-    XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );\r
+    XMLError Parse(const char* xml, size_t nBytes=(size_t)(-1));\r
 \r
     /**\r
        Load an XML file from disk.\r
        Returns XML_NO_ERROR (0) on success, or\r
        an errorID.\r
     */\r
-    XMLError LoadFile( const char* filename );\r
+    XMLError LoadFile(const char* filename);\r
 \r
     /**\r
        Load an XML file from disk. You are responsible\r
@@ -1571,14 +1571,14 @@ public:
        Returns XML_NO_ERROR (0) on success, or\r
        an errorID.\r
     */\r
-    XMLError LoadFile( FILE* );\r
+    XMLError LoadFile(FILE*);\r
 \r
     /**\r
        Save the XML file to disk.\r
        Returns XML_NO_ERROR (0) on success, or\r
        an errorID.\r
     */\r
-    XMLError SaveFile( const char* filename, bool compact = false );\r
+    XMLError SaveFile(const char* filename, bool compact = false);\r
 \r
     /**\r
        Save the XML file to disk. You are responsible\r
@@ -1587,7 +1587,7 @@ public:
        Returns XML_NO_ERROR (0) on success, or\r
        an errorID.\r
     */\r
-    XMLError SaveFile( FILE* fp, bool compact = false );\r
+    XMLError SaveFile(FILE* fp, bool compact = false);\r
 \r
     bool ProcessEntities() const               {\r
         return _processEntities;\r
@@ -1604,7 +1604,7 @@ public:
     }\r
     /** Sets whether to write the BOM when writing the file.\r
     */\r
-    void SetBOM( bool useBOM ) {\r
+    void SetBOM(bool useBOM) {\r
         _writeBOM = useBOM;\r
     }\r
 \r
@@ -1621,38 +1621,38 @@ public:
     /** Print the Document. If the Printer is not provided, it will\r
         print to stdout. If you provide Printer, this can print to a file:\r
        @verbatim\r
-       XMLPrinter printer( fp );\r
-       doc.Print( &printer );\r
+       XMLPrinter printer(fp);\r
+       doc.Print(&printer);\r
        @endverbatim\r
 \r
        Or you can use a printer to print to memory:\r
        @verbatim\r
        XMLPrinter printer;\r
-       doc.Print( &printer );\r
+       doc.Print(&printer);\r
        // printer.CStr() has a const char* to the XML\r
        @endverbatim\r
     */\r
-    void Print( XMLPrinter* streamer=0 ) const;\r
-    virtual bool Accept( XMLVisitor* visitor ) const;\r
+    void Print(XMLPrinter* streamer=0) const;\r
+    virtual bool Accept(XMLVisitor* visitor) const;\r
 \r
     /**\r
        Create a new Element associated with\r
        this Document. The memory for the Element\r
        is managed by the Document.\r
     */\r
-    XMLElement* NewElement( const char* name );\r
+    XMLElement* NewElement(const char* name);\r
     /**\r
        Create a new Comment associated with\r
        this Document. The memory for the Comment\r
        is managed by the Document.\r
     */\r
-    XMLComment* NewComment( const char* comment );\r
+    XMLComment* NewComment(const char* comment);\r
     /**\r
        Create a new Text associated with\r
        this Document. The memory for the Text\r
        is managed by the Document.\r
     */\r
-    XMLText* NewText( const char* text );\r
+    XMLText* NewText(const char* text);\r
     /**\r
        Create a new Declaration associated with\r
        this Document. The memory for the object\r
@@ -1664,21 +1664,21 @@ public:
                <?xml version="1.0" encoding="UTF-8"?>\r
        @endverbatim\r
     */\r
-    XMLDeclaration* NewDeclaration( const char* text=0 );\r
+    XMLDeclaration* NewDeclaration(const char* text=0);\r
     /**\r
        Create a new Unknown associated with\r
        this Document. The memory for the object\r
        is managed by the Document.\r
     */\r
-    XMLUnknown* NewUnknown( const char* text );\r
+    XMLUnknown* NewUnknown(const char* text);\r
 \r
     /**\r
        Delete a node associated with this document.\r
        It will be unlinked from the DOM.\r
     */\r
-    void DeleteNode( XMLNode* node );\r
+    void DeleteNode(XMLNode* node);\r
 \r
-    void SetError( XMLError error, const char* str1, const char* str2 );\r
+    void SetError(XMLError error, const char* str1, const char* str2);\r
 \r
     /// Return true if there was an error parsing the document.\r
     bool Error() const {\r
@@ -1705,18 +1705,18 @@ public:
     void Clear();\r
 \r
     // internal\r
-    char* Identify( char* p, XMLNode** node );\r
+    char* Identify(char* p, XMLNode** node);\r
 \r
-    virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const   {\r
+    virtual XMLNode* ShallowClone(XMLDocument* /*document*/) const     {\r
         return 0;\r
     }\r
-    virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const      {\r
+    virtual bool ShallowEqual(const XMLNode* /*compare*/) const        {\r
         return false;\r
     }\r
 \r
 private:\r
-    XMLDocument( const XMLDocument& ); // not supported\r
-    void operator=( const XMLDocument& );      // not supported\r
+    XMLDocument(const XMLDocument&);   // not supported\r
+    void operator=(const XMLDocument&);        // not supported\r
 \r
     bool        _writeBOM;\r
     bool        _processEntities;\r
@@ -1756,17 +1756,17 @@ private:
        easy to write a *lot* of code that looks like:\r
 \r
        @verbatim\r
-       XMLElement* root = document.FirstChildElement( "Document" );\r
-       if ( root )\r
+       XMLElement* root = document.FirstChildElement("Document");\r
+       if (root)\r
        {\r
-               XMLElement* element = root->FirstChildElement( "Element" );\r
-               if ( element )\r
+               XMLElement* element = root->FirstChildElement("Element");\r
+               if (element)\r
                {\r
-                       XMLElement* child = element->FirstChildElement( "Child" );\r
-                       if ( child )\r
+                       XMLElement* child = element->FirstChildElement("Child");\r
+                       if (child)\r
                        {\r
-                               XMLElement* child2 = child->NextSiblingElement( "Child" );\r
-                               if ( child2 )\r
+                               XMLElement* child2 = child->NextSiblingElement("Child");\r
+                               if (child2)\r
                                {\r
                                        // Finally do something useful.\r
        @endverbatim\r
@@ -1776,9 +1776,9 @@ private:
        and correct to use:\r
 \r
        @verbatim\r
-       XMLHandle docHandle( &document );\r
-       XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement();\r
-       if ( child2 )\r
+       XMLHandle docHandle(&document);\r
+       XMLElement* child2 = docHandle.FirstChildElement("Document").FirstChildElement("Element").FirstChildElement().NextSiblingElement();\r
+       if (child2)\r
        {\r
                // do something useful\r
        @endverbatim\r
@@ -1796,54 +1796,54 @@ class TINYXML2_LIB XMLHandle
 {\r
 public:\r
     /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.\r
-    XMLHandle( XMLNode* node )                                                                                         {\r
+    XMLHandle(XMLNode* node)                                                                                           {\r
         _node = node;\r
     }\r
     /// Create a handle from a node.\r
-    XMLHandle( XMLNode& node )                                                                                         {\r
+    XMLHandle(XMLNode& node)                                                                                           {\r
         _node = &node;\r
     }\r
     /// Copy constructor\r
-    XMLHandle( const XMLHandle& ref )                                                                          {\r
+    XMLHandle(const XMLHandle& ref)                                                                            {\r
         _node = ref._node;\r
     }\r
     /// Assignment\r
-    XMLHandle& operator=( const XMLHandle& ref )                                                       {\r
+    XMLHandle& operator=(const XMLHandle& ref)                                                 {\r
         _node = ref._node;\r
         return *this;\r
     }\r
 \r
     /// Get the first child of this handle.\r
     XMLHandle FirstChild()                                                                                                     {\r
-        return XMLHandle( _node ? _node->FirstChild() : 0 );\r
+        return XMLHandle(_node ? _node->FirstChild() : 0);\r
     }\r
     /// Get the first child element of this handle.\r
-    XMLHandle FirstChildElement( const char* name = 0 )                                                {\r
-        return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 );\r
+    XMLHandle FirstChildElement(const char* name = 0)                                          {\r
+        return XMLHandle(_node ? _node->FirstChildElement(name) : 0);\r
     }\r
     /// Get the last child of this handle.\r
     XMLHandle LastChild()                                                                                                      {\r
-        return XMLHandle( _node ? _node->LastChild() : 0 );\r
+        return XMLHandle(_node ? _node->LastChild() : 0);\r
     }\r
     /// Get the last child element of this handle.\r
-    XMLHandle LastChildElement( const char* name = 0 )                                         {\r
-        return XMLHandle( _node ? _node->LastChildElement( name ) : 0 );\r
+    XMLHandle LastChildElement(const char* name = 0)                                           {\r
+        return XMLHandle(_node ? _node->LastChildElement(name) : 0);\r
     }\r
     /// Get the previous sibling of this handle.\r
     XMLHandle PreviousSibling()                                                                                                {\r
-        return XMLHandle( _node ? _node->PreviousSibling() : 0 );\r
+        return XMLHandle(_node ? _node->PreviousSibling() : 0);\r
     }\r
     /// Get the previous sibling element of this handle.\r
-    XMLHandle PreviousSiblingElement( const char* name = 0 )                           {\r
-        return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );\r
+    XMLHandle PreviousSiblingElement(const char* name = 0)                             {\r
+        return XMLHandle(_node ? _node->PreviousSiblingElement(name) : 0);\r
     }\r
     /// Get the next sibling of this handle.\r
     XMLHandle NextSibling()                                                                                                    {\r
-        return XMLHandle( _node ? _node->NextSibling() : 0 );\r
+        return XMLHandle(_node ? _node->NextSibling() : 0);\r
     }\r
     /// Get the next sibling element of this handle.\r
-    XMLHandle NextSiblingElement( const char* name = 0 )                                       {\r
-        return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 );\r
+    XMLHandle NextSiblingElement(const char* name = 0)                                 {\r
+        return XMLHandle(_node ? _node->NextSiblingElement(name) : 0);\r
     }\r
 \r
     /// Safe cast to XMLNode. This can return null.\r
@@ -1852,19 +1852,19 @@ public:
     }\r
     /// Safe cast to XMLElement. This can return null.\r
     XMLElement* ToElement()                                    {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToElement() );\r
+        return ((_node == 0) ? 0 : _node->ToElement());\r
     }\r
     /// Safe cast to XMLText. This can return null.\r
     XMLText* ToText()                                                  {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToText() );\r
+        return ((_node == 0) ? 0 : _node->ToText());\r
     }\r
     /// Safe cast to XMLUnknown. This can return null.\r
     XMLUnknown* ToUnknown()                                    {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToUnknown() );\r
+        return ((_node == 0) ? 0 : _node->ToUnknown());\r
     }\r
     /// Safe cast to XMLDeclaration. This can return null.\r
     XMLDeclaration* ToDeclaration()                    {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToDeclaration() );\r
+        return ((_node == 0) ? 0 : _node->ToDeclaration());\r
     }\r
 \r
 private:\r
@@ -1879,44 +1879,44 @@ private:
 class TINYXML2_LIB XMLConstHandle\r
 {\r
 public:\r
-    XMLConstHandle( const XMLNode* node )                                                                                      {\r
+    XMLConstHandle(const XMLNode* node)                                                                                        {\r
         _node = node;\r
     }\r
-    XMLConstHandle( const XMLNode& node )                                                                                      {\r
+    XMLConstHandle(const XMLNode& node)                                                                                        {\r
         _node = &node;\r
     }\r
-    XMLConstHandle( const XMLConstHandle& ref )                                                                                {\r
+    XMLConstHandle(const XMLConstHandle& ref)                                                                          {\r
         _node = ref._node;\r
     }\r
 \r
-    XMLConstHandle& operator=( const XMLConstHandle& ref )                                                     {\r
+    XMLConstHandle& operator=(const XMLConstHandle& ref)                                                       {\r
         _node = ref._node;\r
         return *this;\r
     }\r
 \r
     const XMLConstHandle FirstChild() const                                                                                    {\r
-        return XMLConstHandle( _node ? _node->FirstChild() : 0 );\r
+        return XMLConstHandle(_node ? _node->FirstChild() : 0);\r
     }\r
-    const XMLConstHandle FirstChildElement( const char* name = 0 ) const                               {\r
-        return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 );\r
+    const XMLConstHandle FirstChildElement(const char* name = 0) const                         {\r
+        return XMLConstHandle(_node ? _node->FirstChildElement(name) : 0);\r
     }\r
     const XMLConstHandle LastChild()   const                                                                           {\r
-        return XMLConstHandle( _node ? _node->LastChild() : 0 );\r
+        return XMLConstHandle(_node ? _node->LastChild() : 0);\r
     }\r
-    const XMLConstHandle LastChildElement( const char* name = 0 ) const                                {\r
-        return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 );\r
+    const XMLConstHandle LastChildElement(const char* name = 0) const                          {\r
+        return XMLConstHandle(_node ? _node->LastChildElement(name) : 0);\r
     }\r
     const XMLConstHandle PreviousSibling() const                                                                       {\r
-        return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );\r
+        return XMLConstHandle(_node ? _node->PreviousSibling() : 0);\r
     }\r
-    const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const          {\r
-        return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );\r
+    const XMLConstHandle PreviousSiblingElement(const char* name = 0) const            {\r
+        return XMLConstHandle(_node ? _node->PreviousSiblingElement(name) : 0);\r
     }\r
     const XMLConstHandle NextSibling() const                                                                           {\r
-        return XMLConstHandle( _node ? _node->NextSibling() : 0 );\r
+        return XMLConstHandle(_node ? _node->NextSibling() : 0);\r
     }\r
-    const XMLConstHandle NextSiblingElement( const char* name = 0 ) const                      {\r
-        return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 );\r
+    const XMLConstHandle NextSiblingElement(const char* name = 0) const                        {\r
+        return XMLConstHandle(_node ? _node->NextSiblingElement(name) : 0);\r
     }\r
 \r
 \r
@@ -1924,16 +1924,16 @@ public:
         return _node;\r
     }\r
     const XMLElement* ToElement() const                        {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToElement() );\r
+        return ((_node == 0) ? 0 : _node->ToElement());\r
     }\r
     const XMLText* ToText() const                              {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToText() );\r
+        return ((_node == 0) ? 0 : _node->ToText());\r
     }\r
     const XMLUnknown* ToUnknown() const                        {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToUnknown() );\r
+        return ((_node == 0) ? 0 : _node->ToUnknown());\r
     }\r
     const XMLDeclaration* ToDeclaration() const        {\r
-        return ( ( _node == 0 ) ? 0 : _node->ToDeclaration() );\r
+        return ((_node == 0) ? 0 : _node->ToDeclaration());\r
     }\r
 \r
 private:\r
@@ -1954,16 +1954,16 @@ private:
 \r
        @verbatim\r
        XMLPrinter printer;\r
-       doc.Print( &printer );\r
-       SomeFunction( printer.CStr() );\r
+       doc.Print(&printer);\r
+       SomeFunction(printer.CStr());\r
        @endverbatim\r
 \r
        Print to a File\r
 \r
        You provide the file pointer.\r
        @verbatim\r
-       XMLPrinter printer( fp );\r
-       doc.Print( &printer );\r
+       XMLPrinter printer(fp);\r
+       doc.Print(&printer);\r
        @endverbatim\r
 \r
        Print without a XMLDocument\r
@@ -1977,9 +1977,9 @@ private:
        an XML document.\r
 \r
        @verbatim\r
-       XMLPrinter printer( fp );\r
-       printer.OpenElement( "foo" );\r
-       printer.PushAttribute( "foo", "bar" );\r
+       XMLPrinter printer(fp);\r
+       printer.OpenElement("foo");\r
+       printer.PushAttribute("foo", "bar");\r
        printer.CloseElement();\r
        @endverbatim\r
 */\r
@@ -1992,55 +1992,55 @@ public:
        If 'compact' is set to true, then output is created\r
        with only required whitespace and newlines.\r
     */\r
-    XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );\r
+    XMLPrinter(FILE* file=0, bool compact = false, int depth = 0);\r
     virtual ~XMLPrinter()      {}\r
 \r
     /** If streaming, write the BOM and declaration. */\r
-    void PushHeader( bool writeBOM, bool writeDeclaration );\r
+    void PushHeader(bool writeBOM, bool writeDeclaration);\r
     /** If streaming, start writing an element.\r
         The element must be closed with CloseElement()\r
     */\r
-    void OpenElement( const char* name, bool compactMode=false );\r
+    void OpenElement(const char* name, bool compactMode=false);\r
     /// If streaming, add an attribute to an open element.\r
-    void PushAttribute( const char* name, const char* value );\r
-    void PushAttribute( const char* name, int value );\r
-    void PushAttribute( const char* name, unsigned value );\r
-    void PushAttribute( const char* name, bool value );\r
-    void PushAttribute( const char* name, double value );\r
+    void PushAttribute(const char* name, const char* value);\r
+    void PushAttribute(const char* name, int value);\r
+    void PushAttribute(const char* name, unsigned value);\r
+    void PushAttribute(const char* name, bool value);\r
+    void PushAttribute(const char* name, double value);\r
     /// If streaming, close the Element.\r
-    virtual void CloseElement( bool compactMode=false );\r
+    virtual void CloseElement(bool compactMode=false);\r
 \r
     /// Add a text node.\r
-    void PushText( const char* text, bool cdata=false );\r
+    void PushText(const char* text, bool cdata=false);\r
     /// Add a text node from an integer.\r
-    void PushText( int value );\r
+    void PushText(int value);\r
     /// Add a text node from an unsigned.\r
-    void PushText( unsigned value );\r
+    void PushText(unsigned value);\r
     /// Add a text node from a bool.\r
-    void PushText( bool value );\r
+    void PushText(bool value);\r
     /// Add a text node from a float.\r
-    void PushText( float value );\r
+    void PushText(float value);\r
     /// Add a text node from a double.\r
-    void PushText( double value );\r
+    void PushText(double value);\r
 \r
     /// Add a comment\r
-    void PushComment( const char* comment );\r
+    void PushComment(const char* comment);\r
 \r
-    void PushDeclaration( const char* value );\r
-    void PushUnknown( const char* value );\r
+    void PushDeclaration(const char* value);\r
+    void PushUnknown(const char* value);\r
 \r
-    virtual bool VisitEnter( const XMLDocument& /*doc*/ );\r
-    virtual bool VisitExit( const XMLDocument& /*doc*/ )                       {\r
+    virtual bool VisitEnter(const XMLDocument& /*doc*/);\r
+    virtual bool VisitExit(const XMLDocument& /*doc*/)                 {\r
         return true;\r
     }\r
 \r
-    virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );\r
-    virtual bool VisitExit( const XMLElement& element );\r
+    virtual bool VisitEnter(const XMLElement& element, const XMLAttribute* attribute);\r
+    virtual bool VisitExit(const XMLElement& element);\r
 \r
-    virtual bool Visit( const XMLText& text );\r
-    virtual bool Visit( const XMLComment& comment );\r
-    virtual bool Visit( const XMLDeclaration& declaration );\r
-    virtual bool Visit( const XMLUnknown& unknown );\r
+    virtual bool Visit(const XMLText& text);\r
+    virtual bool Visit(const XMLComment& comment);\r
+    virtual bool Visit(const XMLDeclaration& declaration);\r
+    virtual bool Visit(const XMLUnknown& unknown);\r
 \r
     /**\r
        If in print to memory mode, return a pointer to\r
@@ -2067,20 +2067,20 @@ public:
     }\r
 \r
 protected:\r
-       virtual bool CompactMode( const XMLElement& )   { return _compactMode; }\r
+       virtual bool CompactMode(const XMLElement&)     { return _compactMode; }\r
 \r
        /** Prints out the space before an element. You may override to change\r
            the space and tabs used. A PrintSpace() override should call Print().\r
        */\r
-    virtual void PrintSpace( int depth );\r
-    void Print( const char* format, ... );\r
+    virtual void PrintSpace(int depth);\r
+    void Print(const char* format, ...);\r
 \r
     void SealElementIfJustOpened();\r
     bool _elementJustOpened;\r
     DynArray< const char*, 10 > _stack;\r
 \r
 private:\r
-    void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities.\r
+    void PrintString(const char*, bool restrictedEntitySet);   // prints out, after detecting entities.\r
 \r
     bool _firstElement;\r
     FILE* _fp;\r
index 6fa245168917f82d44b267c7361da528e97b1bde..5281d3182fd3b02764d03bb7291660bbfbbf1c2f 100644 (file)
@@ -115,10 +115,10 @@ namespace ui {
        void closeBox();
        void waitForDialog(void);
 
-       bool pageExists( void );
-       void drawPage( std::string path );
+       bool pageExists(void);
+       void drawPage(std::string path);
 
-       void dontTypeOut( void );
+       void dontTypeOut(void);
        /*
         *      Draws a larger string in the center of the screen. Drawing is done inside this function.
        */
@@ -133,7 +133,7 @@ namespace ui {
        void draw(void);
 
        void quitGame();
-       
+
 
 
        /*
index 9a51739bfccb4a1adc3f5342da7ea49861334bbf..bfeecba5246dca5ba02194ae1f527ee661a07157 100644 (file)
@@ -56,7 +56,7 @@ namespace ui {
         menuItem createParentButton(vec2 l, dim2 d, Color c, const char* t);
         menuItem createSlider(vec2 l, dim2 d, Color c, float min, float max, const char* t, float* v);
         
-        void draw( void );
+        void draw(void);
     }
 }
 
index cae38083c701fc465b375d4829bffbad330d813e..bee2bcf7caf391d9d5f9297cdcb282bf58b21ecc 100644 (file)
@@ -14,7 +14,6 @@
 #define GROUND_HEIGHT_INITIAL   80
 #define GROUND_HEIGHT_MINIMUM   60
 #define GROUND_HEIGHT_MAXIMUM   110
-
 #define GROUND_HILLINESS        10
 
 #define PLAYER_SPEED_CONSTANT 0.15f
@@ -175,7 +174,7 @@ protected:
         * World::detect(), which is why it is declared private.
         */
 
-       virtual void singleDetect( Entity *e );
+       virtual void singleDetect(Entity *e);
 
        /**
         * Empties all entity vectors.
@@ -187,7 +186,7 @@ protected:
         * call this function.
         */
 
-       void deleteEntities( void );
+       void deleteEntities(void);
 
        /**
         * Number of lines in the world.
@@ -232,8 +231,6 @@ protected:
        std::vector<std::string> bgFiles;
        std::vector<std::string> bgFilesIndoors;
 
-public:
-
        /**
         * The filename of the XML file for the world to the left; NULL if no world
         * is present.
@@ -249,16 +246,34 @@ public:
        std::string toRight;
 
        /**
-        * Sets what XML file to use for loading the world to the left.
+        * Vector of all building textures for the current world style
         */
 
-       std::string setToLeft( std::string file );
+       std::vector<std::string> sTexLoc;
+
+       std::vector<Light>     light;
+       std::vector<Village>   village;
+       std::vector<Particles> particles;
+       std::vector<Object>        object;
+       std::vector<Mob>       mob;
+
+public:
+
+       Light *getLastLight(void);
+       Mob   *getLastMob(void);
+
+       std::string getSTextureLocation(unsigned int index) const;
 
        /**
-        * Sets what XML file to use for loading the world to the right.
+        * These handle accessing/modifying pathnames for worlds linked to the left
+        * and right of this one.
         */
 
-       std::string setToRight( std::string file );
+       std::string setToLeft(std::string file);
+       std::string setToRight(std::string file);
+
+       std::string getToLeft(void) const;
+       std::string getToRight(void) const;
 
        /**
         * A vector of pointers to every NPC, Structure, Mob, and Object in this
@@ -280,46 +295,13 @@ public:
 
        std::vector<Structures  *>      build;
 
-       /**
-        * A vector of all Mobs in this world.
-        */
-
-       std::vector<Mob                 *>      mob;
-
-       /**
-        * A vector of all Objects in this world.
-        */
-
-       std::vector<Object              *>      object;
-
-       /**
-        * A vector of all particles in this world.
-        */
-
-       std::vector<Particles> particles;
-
-
-       std::vector<Village     *>      village;
-
-       /**
-        * A vector of all light elements in this world.
-        */
-
-       std::vector<Light>  light;
-
-       /**
-        * Vector of all building textures for the current world style
-        */
-
-       std::vector<std::string> sTexLoc;
-
        /**
         * NULLifies pointers and allocates necessary memory. This should be
         * followed by some combination of setBackground(), setBGM(), or
         * generate().
         */
 
-       World( void );
+       World(void);
 
        /**
         * Frees resources taken by the world.
@@ -335,6 +317,7 @@ public:
         */
 
        void addStructure(BUILD_SUB subtype,float x,float y, std::string tex, std::string inside);
+       Village *addVillage(std::string name, World *world);
 
        /**
         * Adds a Mob to the world with the specified type and coordinates.
@@ -367,7 +350,7 @@ public:
         * upon object interaction.
         */
 
-       void addObject( std::string in, std::string pickupDialog, float x, float y);
+       void addObject(std::string in, std::string pickupDialog, float x, float y);
 
        /**
         * Adds a particle to the world with the specified coordinates, dimensions,
@@ -375,7 +358,7 @@ public:
         */
 
        void addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d);
-       void addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d, bool gravity );
+       void addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d, unsigned char flags);
 
        /**
         * Adds a light to the world with the specified coordinates and color.
@@ -388,7 +371,7 @@ public:
         * and a velocity. The provided delta time is used for smoother updating.
         */
 
-       void update( Player *p, unsigned int delta );
+       void update(Player *p, unsigned int delta);
 
        /**
         * Generate a world of the provided width. Worlds are drawn centered on the
@@ -445,7 +428,7 @@ public:
         */
 
        World *goWorldLeft(Player *p);
-       bool   goWorldLeft( NPC *e );
+       bool   goWorldLeft(NPC *e);
 
        /**
         * Attempts to let the player enter the right-linked world specified by
@@ -475,7 +458,7 @@ public:
         * hill can be.
         */
 
-       void addHill( ivec2 peak, unsigned int width );
+       void addHill(ivec2 peak, unsigned int width);
 
        /**
         * Gets the world's width.
@@ -497,18 +480,18 @@ private:
        std::vector<std::vector<float>> floor;
        std::vector<float> fstart;
 
-       void singleDetect( Entity *e );
+       void singleDetect(Entity *e);
 
 public:
        IndoorWorld(void);
        ~IndoorWorld(void);
 
-       void addFloor( unsigned int width );
-       void addFloor( unsigned int width, unsigned int start );
-       bool moveToFloor( Entity *e, unsigned int _floor );
+       void addFloor(unsigned int width);
+       void addFloor(unsigned int width, unsigned int start);
+       bool moveToFloor(Entity *e, unsigned int _floor);
 
-       bool isFloorAbove( Entity *e );
-       bool isFloorBelow( Entity *e );
+       bool isFloorAbove(Entity *e);
+       bool isFloorBelow(Entity *e);
 
        void draw(Player *p);                           // Draws the world (ignores layers)
 };
@@ -537,26 +520,26 @@ public:
         * world `leave` upon exit.
         */
 
-       Arena( World *leave, Player *p, Mob *m );
+       Arena(World *leave, Player *p, Mob *m);
 
        /**
         * Frees resources taken by the arena.
         */
 
-       ~Arena( void );
+       ~Arena(void);
 
        /**
         * Attempts to exit the world, returning the player to the world they were
         * last in.
         */
 
-       World *exitArena( Player *p );
+       World *exitArena(Player *p);
 };
 
-bool  isCurrentWorldIndoors( void );
-float getIndoorWorldFloorHeight( void );
+bool  isCurrentWorldIndoors(void);
+float getIndoorWorldFloorHeight(void);
 
-std::string getWorldWeatherStr( WorldWeather ww );
+std::string getWorldWeatherStr(WorldWeather ww);
 
 /**
  * Loads the player into the world created by the given XML file. If a world is
@@ -572,6 +555,6 @@ World *loadWorldFromXML(std::string path);
 
 World *loadWorldFromXMLNoSave(std::string path);
 
-World *loadWorldFromPtr( World *ptr );
+World *loadWorldFromPtr(World *ptr);
 
 #endif // WORLD_H
index 837c785e7a4022c9879299d1213e6c3488f8349b..2be34ca7e534920542f4bb45b0c0c4391c27f835 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -231,7 +231,7 @@ int main(int argc, char *argv[]){
         * (Attempt to) Initialize SDL_mixer libraries for loading and playing music/sound files.
         */
 
-       if(Mix_OpenAudio( 44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0){
+       if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0){
                std::cout << "SDL_mixer could not initialize! Error: " << Mix_GetError() << std::endl;
                return -1;
        }
@@ -268,7 +268,7 @@ int main(int argc, char *argv[]){
                                                          SCREEN_WIDTH,
                                                          SCREEN_HEIGHT,
                                                          SDL_CreateWindowFlags
-                                                         );
+                                                        );
 
     /*
      * Exit if the window cannot be created
@@ -356,7 +356,7 @@ int main(int argc, char *argv[]){
        glGetShaderInfoLog(fragShader, logLength, NULL, &fragShaderError[0]);
        std::cout << &fragShaderError[0] << std::endl;
 
-       if ( bufferln == GL_FALSE )
+       if (bufferln == GL_FALSE)
                UserError("Error compiling shader");
 
        shaderProgram = glCreateProgram();
@@ -366,7 +366,7 @@ int main(int argc, char *argv[]){
 
        glGetProgramiv(shaderProgram, GL_LINK_STATUS, &bufferln);
     glGetProgramiv(shaderProgram, GL_INFO_LOG_LENGTH, &logLength);
-    std::vector<char> programError( (logLength > 1) ? logLength : 1 );
+    std::vector<char> programError((logLength > 1) ? logLength : 1);
     glGetProgramInfoLog(shaderProgram, logLength, NULL, &programError[0]);
     std::cout << &programError[0] << std::endl;
 
@@ -412,7 +412,7 @@ int main(int argc, char *argv[]){
        glClearColor(1,1,1,1);
 
        gameRunning = true;
-       while ( gameRunning )
+       while (gameRunning)
                mainLoop();
 
        /**************************
@@ -468,7 +468,7 @@ void mainLoop(void){
        deltaTime       = currentTime - prevTime;
        prevTime        = currentTime;
 
-       if ( currentMenu )
+       if (currentMenu)
                goto MENU;
 
        /*
@@ -497,19 +497,19 @@ void mainLoop(void){
        /*pool.Enqueue([](){
                currentWorld->update(player,deltaTime);
        });*/
-       currentWorld->update( player, deltaTime );
+       currentWorld->update(player, deltaTime);
        currentWorld->detect(player);
 
        /*
         * Update debug variables if necessary
         */
 
-       if ( ++debugDiv == 20 ) {
+       if (++debugDiv == 20) {
                debugDiv=0;
 
-               if ( deltaTime )
+               if (deltaTime)
                        fps = 1000 / deltaTime;
-               if ( !(debugDiv % 10) )
+               if (!(debugDiv % 10))
                        debugY = player->loc.y;
        }
 MENU:
@@ -600,7 +600,7 @@ void render() {
         *                                      GL_COLOR_BUFFER_BIT allows the matrices to have color on them
         */
 
-       glPushAttrib( GL_DEPTH_BUFFER_BIT);
+       glPushAttrib(GL_DEPTH_BUFFER_BIT);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
        /**************************
@@ -680,10 +680,10 @@ void render() {
                                        tickCount,
                                        handAngle,
                                        VOLUME_MASTER,
-                                       getWorldWeatherStr( weather ).c_str()
+                                       getWorldWeatherStr(weather).c_str()
                                        );
 
-               if ( ui::posFlag ) {
+               if (ui::posFlag) {
                        glBegin(GL_LINES);
                                /*glColor3ub(255,0,0);
                                glVertex2i(0,0);
@@ -692,16 +692,16 @@ void render() {
                                /*glColor3ub(255,255,255);
                                glVertex2i(player->loc.x + player->width/2,0);
                                glVertex2i(player->loc.x + player->width/2,SCREEN_HEIGHT);
-                               glVertex2i( offset.x - SCREEN_WIDTH / 2, player->loc.y + player->height / 2 );
-                               glVertex2i( offset.x + SCREEN_WIDTH / 2, player->loc.y + player->height / 2 );*/
+                               glVertex2i(offset.x - SCREEN_WIDTH / 2, player->loc.y + player->height / 2);
+                               glVertex2i(offset.x + SCREEN_WIDTH / 2, player->loc.y + player->height / 2);*/
 
-                               /*glVertex2i( -SCREEN_WIDTH / 2 + offset.x, player->loc.y );
-                               glVertex2i(  SCREEN_WIDTH / 2 + offset.x, player->loc.y );*/
+                               /*glVertex2i(-SCREEN_WIDTH / 2 + offset.x, player->loc.y);
+                               glVertex2i( SCREEN_WIDTH / 2 + offset.x, player->loc.y);*/
 
                                glColor3ub(100,100,255);
-                               for ( auto &e : currentWorld->entity ) {
-                                       glVertex2i( player->loc.x + player->width / 2, player->loc.y + player->height / 2 );
-                                       glVertex2i( e->loc.x + e->width / 2, e->loc.y + e->height / 2 );
+                               for (auto &e : currentWorld->entity) {
+                                       glVertex2i(player->loc.x + player->width / 2, player->loc.y + player->height / 2);
+                                       glVertex2i(e->loc.x + e->width / 2, e->loc.y + e->height / 2);
                                }
 
                        glEnd();
@@ -709,7 +709,7 @@ void render() {
 
        }
 
-       if ( currentMenu )
+       if (currentMenu)
                ui::menu::draw();
 
        // draw the mouse cursor
@@ -732,21 +732,20 @@ void render() {
        SDL_GL_SwapWindow(window);
 }
 
-static bool objectInteracting = false;
-
 void logic(){
-       static bool NPCSelected = false;
+       static bool NPCSelected    = false;
+       static bool ObjectSelected = false;
 
        // exit the game if the player falls out of the world
-       if ( player->loc.y < 0 )
+       if (player->loc.y < 0)
                gameRunning = false;
 
-       if ( player->inv->usingi ) {
-               for ( auto &e : currentWorld->entity ) {
+       if (player->inv->usingi) {
+               for (auto &e : currentWorld->entity) {
                        e->hit = false;
 
-                       if ( player->inv->usingi && !e->hit &&
-                                player->inv->detectCollision( { e->loc.x, e->loc.y }, { e->loc.x + e->width, e->loc.y + e->height} ) ) {
+                       if (player->inv->usingi && !e->hit &&
+                                player->inv->detectCollision({ e->loc.x, e->loc.y }, { e->loc.x + e->width, e->loc.y + e->height})) {
                                e->health -= 25;
                                e->hit = true;
                                e->forcedMove = true;
@@ -756,7 +755,7 @@ void logic(){
                                break;
                                //for(int r = 0; r < (rand()%5);r++)
                                //      currentWorld->addParticle(rand()%HLINE*3 + n->loc.x - .05f,n->loc.y + n->height*.5, HLINE,HLINE, -(rand()%10)*.01,((rand()%4)*.001-.002), {(rand()%75+10)/100.0f,0,0}, 10000);
-                               //if ( e->health <= 0 ) {
+                               //if (e->health <= 0) {
                                //for(int r = 0; r < (rand()%30)+15;r++)
                                //      currentWorld->addParticle(rand()%HLINE*3 + n->loc.x - .05f,n->loc.y + n->height*.5, HLINE,HLINE, -(rand()%10)*.01,((rand()%10)*.01-.05), {(rand()%75)+10/100.0f,0,0}, 10000);
                        }
@@ -764,126 +763,49 @@ void logic(){
                player->inv->usingi = false;
        }
 
-       /*
-        *      Entity logic: This loop finds every entity that is alive and in the current world. It then
-        *      basically runs their AI functions depending on what type of entity they are. For NPCs,
-        *      click detection is done as well for NPC/player interaction.
-        */
-
-       for(auto &n : currentWorld->npc){
-               if(n->alive){
-
-                       /*
-                        *      Make the NPC 'wander' about the world if they're allowed to do so.
-                        *      Entity->canMove is modified when a player interacts with an NPC so
-                        *      that the NPC doesn't move when it talks to the player.
-                        */
-
-                       if(n->canMove)
-                               n->wander((rand() % 120 + 30));
-
-                       /*
-                        *      Don't bother handling the NPC if another has already been handled.
-                        */
-
-                       if(NPCSelected){
-                               n->near=false;
-                               break;
-                       }
-
-                       /*
-                        *      Check if the NPC is under the mouse.
-                        */
-
-                       if(ui::mouse.x >= n->loc.x                              &&
-                          ui::mouse.x <= n->loc.x + n->width   &&
-                          ui::mouse.y >= n->loc.y                              &&
-                          ui::mouse.y <= n->loc.y + n->width   ){
-
-                               /*
-                                *      Check of the NPC is close enough to the player for interaction to be
-                                *      considered legal. In other words, require the player to be close to
-                                *      the NPC in order to interact with it.
-                                *
-                                *      This uses the Pythagorean theorem to check for NPCs within a certain
-                                */
-
-                               if(pow((n->loc.x - player->loc.x),2) + pow((n->loc.y - player->loc.y),2) <= pow(40*HLINE,2)){
-
-                                       /*
-                                        *      Set Entity->near so that this NPC's name is drawn under them, and toggle NPCSelected
-                                        *      so this NPC is the only one that's clickable.
-                                        */
-
-                                       n->near=true;
-                                       NPCSelected=true;
-
-                                       /*
-                                        *      Check for a right click, and allow the NPC to interact with the
-                                        *      player if one was made.
-                                        */
-
-                                       if(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT)){
-
-                                               if(!ui::dialogBoxExists)
-                                                       n->interact();
-
+       for (auto &e : currentWorld->entity) {
+               if (e->alive) {
+                       if (e->type == NPCT || e->type == MERCHT || e->type == OBJECTT) {
+
+                               if (e->type == OBJECTT && ObjectSelected) {
+                                       e->near = false;
+                                       continue;
+                               } else { // has to be NPC
+                                       if (e->canMove) {
+                                               e->wander((rand() % 120 + 30));
+                                               if (NPCSelected) {
+                                                       e->near = false;
+                                                       continue;
+                                               }
                                        }
                                }
 
-                               /*
-                                *      Hide the NPC's name if the mouse isn't on the NPC.
-                                */
-
-                       }else n->near=false;
-               }
-       }
-
-       for(auto &m : currentWorld->mob){
-               if(m->alive){
-
-                       /*
-                        *      Run the Mob's AI function.
-                        */
-
-                       switch(m->subtype){
-                       case MS_RABBIT:
-                       case MS_BIRD:
-                               m->wander((rand()%240 + 15));   // Make the mob wander
-                               break;
-                       case MS_TRIGGER:
-                       case MS_PAGE:
-                               m->wander(0);
-                               break;
-                       case MS_DOOR:
-                               break;
-                       default:
-                               std::cout<<"Unhandled mob of subtype "<<m->subtype<<"."<<std::endl;
-                               break;
-                       }
-               }
-       }
-
-       if(!objectInteracting){
-               for(auto &o : currentWorld->object){
-                       if(o->alive){
-                               if(ui::mouse.x >= o->loc.x                              &&
-                                  ui::mouse.x <= o->loc.x + o->width   &&
-                                  ui::mouse.y >= o->loc.y                              &&
-                                  ui::mouse.y <= o->loc.y + o->height  ){
-                                       if(pow((o->loc.x - player->loc.x),2) + pow((o->loc.y - player->loc.y),2) <= pow(40*HLINE,2)){
-
-                                               /*
-                                                *      Check for a right click, and allow the Object to interact with the
-                                                *      player if one was made.
-                                               */
-
-                                               if(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT)){
-                                                       objectInteracting=true;
-                                                       o->interact();
-                                                       objectInteracting=false;
-                                               }
-                                       }
+                               if(e->isInside(ui::mouse) && player->isNear(*e)) {
+                                       if (e->type == OBJECTT)
+                                               ObjectSelected = true;
+                                       else
+                                               NPCSelected = true;
+                                       e->near = true;
+
+                                       if ((SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT)) && !ui::dialogBoxExists)
+                                               e->interact();
+                               } else
+                                       e->near = false;
+                       } else if (e->type == MOBT) {
+                               switch (e->subtype) {
+                               case MS_RABBIT:
+                               case MS_BIRD:
+                                       e->wander((rand()%240 + 15));
+                                       break;
+                               case MS_TRIGGER:
+                               case MS_PAGE:
+                                       e->wander(0);
+                                       break;
+                               case MS_DOOR:
+                                       break;
+                               default:
+                                       std::cout<<"Unhandled mob of subtype "<<e->subtype<<"."<<std::endl;
+                                       break;
                                }
                        }
                }
@@ -894,7 +816,7 @@ void logic(){
         */
 
        if(!(tickCount%DAY_CYCLE)||!tickCount){
-               if ( weather == WorldWeather::Sunny )
+               if (weather == WorldWeather::Sunny)
                        weather = WorldWeather::Dark;
                else {
                        weather = WorldWeather::Sunny;
@@ -926,8 +848,8 @@ void logic(){
         * Rain?
         */
 
-        if ( weather == WorldWeather::Rain ) {
-                for ( unsigned int r = (randGet() % 25) + 11; r--; ) {
+        if (weather == WorldWeather::Rain) {
+                for (unsigned int r = (randGet() % 25) + 11; r--;) {
                         currentWorld->addParticle(randGet() % currentWorld->getTheWidth() - (currentWorld->getTheWidth() / 2),
                                                                           offset.y + SCREEN_HEIGHT / 2,
                                                                           HLINE * 1.25,                                                                                // width
@@ -935,12 +857,12 @@ void logic(){
                                                                           randGet() % 7 * .01 * (randGet() % 2 == 0 ? -1 : 1), // vel.x
                                                                           (4 + randGet() % 6) * .05,                                                   // vel.y
                                                                           { 0, 0, 255 },                                                                               // RGB color
-                                                                          2500                                                                                                 // duration (ms)
-                                                                          );
-                       currentWorld->particles.back().bounce = true;
+                                                                          2500,                                                                                                // duration (ms)
+                                                                          (1 << 0) | (1 << 1)                                                                  // gravity and bounce
+                                                                         );
                 }
-        } else if ( weather == WorldWeather::Snowy ) {
-                for ( unsigned int r = (randGet() % 25) + 11; r--; ) {
+        } else if (weather == WorldWeather::Snowy) {
+                for (unsigned int r = (randGet() % 25) + 11; r--;) {
                         currentWorld->addParticle(randGet() % currentWorld->getTheWidth() - (currentWorld->getTheWidth() / 2),
                                                                           offset.y + SCREEN_HEIGHT / 2,
                                                                           HLINE * 1.25,                                                                                // width
@@ -949,8 +871,8 @@ void logic(){
                                                                           (4 + randGet() % 6) * -.03,                                                  // vel.y
                                                                           { 255, 255, 255 },                                                                   // RGB color
                                                                           5000,                                                                                                // duration (ms)
-                                                                          false
-                                                                          );
+                                                                          0                                                                                                    // no gravity, no bounce
+                                                                         );
                 }
         }
 
index 564fa243b75f6176436c339293d7f4d924663261..89bb9c300b564b49d91b45fd4205e9ca29d01d88 100644 (file)
--- a/setup.mk
+++ b/setup.mk
@@ -2,4 +2,4 @@
 TARGET_OS = linux
 
 # Bits setting, 32 or 64
-TARGET_BITS = 64
+TARGET_BITS = 32
index b4258f605e45d5e6146733d466cd70445d9903bf..8f59fba4bd915f406de4ce175210cff540ab084a 100644 (file)
@@ -81,7 +81,7 @@ const char *readFile(const char *path){
        unsigned int size;
        GLchar *buf;
 
-       if ( !in.is_open() )
+       if (!in.is_open())
                UserError("Error reading file " + (std::string)path + "!");
 
        in.seekg(0,in.end);
@@ -95,7 +95,7 @@ const char *readFile(const char *path){
 }
 
 void
-UserError( std::string reason )
+UserError(std::string reason)
 {
     std::cout << "User error: " << reason << "!" << std::endl;
     abort();
index b8a483d39e8b3aa49332606e9f01d50f8a125bbc..a2acc03e6e9b66f09356905eba4af6b1369d2de2 100644 (file)
@@ -21,7 +21,7 @@ XMLElement *vol;
 
 namespace config {
 
-       void read( void ) {
+       void read(void) {
                unsigned int uval;
                float fval;
                bool bval;
@@ -61,19 +61,19 @@ namespace config {
                ui::initFonts();
                ui::setFontFace(xml.FirstChildElement("font")->Attribute("path"));
 
-               if ( xml.FirstChildElement("debug") )
+               if (xml.FirstChildElement("debug"))
                        ui::debug = ui::posFlag = true;
 
                config::update();
        }
 
-       void update( void ) {
+       void update(void) {
                Mix_Volume(0,VOLUME_MASTER);
                Mix_Volume(1,VOLUME_SFX * (VOLUME_MASTER/100.0f));
                Mix_VolumeMusic(VOLUME_MUSIC * (VOLUME_MASTER/100.0f));
        }
 
-       void save( void ) {
+       void save(void) {
                vol->FirstChildElement("master")->SetAttribute("volume",VOLUME_MASTER);
                vol->FirstChildElement("music")->SetAttribute("volume",VOLUME_MUSIC);
                vol->FirstChildElement("sfx")->SetAttribute("volume", VOLUME_SFX);
index df32a5b1d3eb81b7aacbb43a746a180b01c26900..02be6fee2d9316af1b0aa1b0aff2fe882b271a84 100644 (file)
@@ -71,7 +71,7 @@ void getRandomName(Entity *e){
                break;
        }
 
-       strcpy( e->name, bufs + 1 );
+       strcpy(e->name, bufs + 1);
 
        delete[] bufs;
 }
@@ -315,11 +315,15 @@ void Object::reloadTexture(void){
        height = getItemHeight(iname);
 }
 
+bool Entity::isNear(Entity e){
+       return pow(e.loc.x - loc.x, 2) + pow(e.loc.y - loc.y, 2) <= pow(40 * HLINE, 2);
+}
+
 void Entity::draw(void){               //draws the entities
        glPushMatrix();
        glColor3ub(255,255,255);
 
-       if ( !alive )
+       if (!alive)
                return;
 
        if(type==NPCT){
@@ -392,7 +396,7 @@ void Entity::draw(void){            //draws the entities
                break;
        }
 
-       if ( hitCooldown )
+       if (hitCooldown)
                glColor3ub(255,255,0);
        else
                glColor3ub(255,255,255);
@@ -410,11 +414,11 @@ NOPE:
        glDisable(GL_TEXTURE_2D);
        glMatrixMode(GL_MODELVIEW);
        glPopMatrix();
-       if ( near )
+       if (near)
                ui::putStringCentered(loc.x+width/2,loc.y-ui::fontSize-HLINE/2,name);
-       if ( health != maxHealth ) {
-               glColor3ub(150,0,0); glRectf( loc.x, loc.y + height, loc.x + width, loc.y + height + HLINE * 2 );
-               glColor3ub(255,0,0); glRectf( loc.x, loc.y + height, loc.x + width * ( health / maxHealth ), loc.y + height + HLINE * 2 );
+       if (health != maxHealth) {
+               glColor3ub(150,0,0); glRectf(loc.x, loc.y + height, loc.x + width, loc.y + height + HLINE * 2);
+               glColor3ub(255,0,0); glRectf(loc.x, loc.y + height, loc.x + width * (health / maxHealth), loc.y + height + HLINE * 2);
        }
 }
 
@@ -423,46 +427,46 @@ NOPE:
  */
 
 void NPC::
-wander( int timeRun )
+wander(int timeRun)
 {
        static int direction;
 
-       if ( forcedMove )
+       if (forcedMove)
                return;
 
-       if ( hitCooldown )
+       if (hitCooldown)
                hitCooldown--;
 
-       if ( followee ) {
-               if ( loc.x < followee->loc.x - 40 )
+       if (followee) {
+               if (loc.x < followee->loc.x - 40)
                        direction = 1;
-               else if ( loc.x > followee->loc.x + 40 )
+               else if (loc.x > followee->loc.x + 40)
                        direction = -1;
                else
                        direction = 0;
 
                vel.x = .018 * HLINE * direction;
-       } else if ( targetx != 0.9112001f ) {
-               if ( loc.x > targetx + HLINE * 5)
+       } else if (targetx != 0.9112001f) {
+               if (loc.x > targetx + HLINE * 5)
                        vel.x = -0.018 * HLINE;
-               else if ( loc.x < targetx - HLINE * 5)
+               else if (loc.x < targetx - HLINE * 5)
                        vel.x = 0.018 * HLINE;
                else
                        targetx = 0.9112001f;
-       } else if ( ticksToUse == 0 ) {
+       } else if (ticksToUse == 0) {
                ticksToUse = timeRun;
 
                vel.x = .008 * HLINE;
                direction = (getRand() % 3 - 1);
 
-               if ( direction == 0 )
+               if (direction == 0)
                        ticksToUse *= 2;
 
                vel.x *= direction;
        }
 
-       if( vel.x < 0)
-               currentWorld->goWorldLeft( this );
+       if(vel.x < 0)
+               currentWorld->goWorldLeft(this);
 
        ticksToUse--;
 }
@@ -506,29 +510,29 @@ void NPC::interact(){ //have the npc's interact back to the player
 void Merchant::wander(int timeRun){
        static int direction;
 
-       if ( forcedMove )
+       if (forcedMove)
                return;
 
-       if ( ticksToUse == 0 ) {
+       if (ticksToUse == 0) {
                ticksToUse = timeRun;
 
                vel.x = .008 * HLINE;
                direction = (getRand() % 3 - 1);
 
-               if ( direction == 0 )
+               if (direction == 0)
                        ticksToUse *= 2;
 
                vel.x *= direction;
        }
 
-       if( vel.x < 0)
-               currentWorld->goWorldLeft( this );
-       if ( inside != nullptr ) {
+       if(vel.x < 0)
+               currentWorld->goWorldLeft(this);
+       if (inside != nullptr) {
                loc.y = inside->loc.y + HLINE * 2;
                vel.y = GRAVITY_CONSTANT * 5;
-               if ( loc.x <= inside->loc.x + HLINE * 5 )
+               if (loc.x <= inside->loc.x + HLINE * 5)
                        loc.x = inside->loc.x + HLINE * 5;
-               else if ( loc.x + width >= inside->loc.x + inside->width - HLINE * 5 )
+               else if (loc.x + width >= inside->loc.x + inside->width - HLINE * 5)
                        loc.x = inside->loc.x + inside->width - width - HLINE * 5;
        }
        ticksToUse--;
@@ -540,10 +544,10 @@ void Merchant::interact(){
                ui::waitForDialog();
 
                // handle normal dialog options
-               switch ( ui::dialogOptChosen ) {
+               switch (ui::dialogOptChosen) {
                // Accept
                case 1:
-                       if ( !(player->inv->takeItem( trade[currTrade].item[1], trade[currTrade].quantity[1])) )
+                       if (!(player->inv->takeItem(trade[currTrade].item[1], trade[currTrade].quantity[1])))
                                player->inv->addItem(trade[currTrade].item[0],trade[currTrade].quantity[0]);
                        break;
 
@@ -556,10 +560,10 @@ void Merchant::interact(){
                }
 
                // handle merchant-specific dialog options
-               switch ( ui::merchOptChosen ) {
+               switch (ui::merchOptChosen) {
                // left arrow
                case 1:
-                       if ( currTrade )
+                       if (currTrade)
                                currTrade--;
                        ui::dontTypeOut();
                        interact(); // TODO should we nest like this?
@@ -567,7 +571,7 @@ void Merchant::interact(){
 
                // right arrow
                case 2:
-                       if ( currTrade < trade.size() - 1 )
+                       if (currTrade < trade.size() - 1)
                                currTrade++;
                        ui::dontTypeOut();
                        interact();
@@ -582,10 +586,10 @@ void Merchant::interact(){
 void Object::interact(void){
        std::thread([this]{
                if(questObject && alive){
-                       ui::dialogBox( player->name, ":Yes:No", false, pickupDialog.c_str());
+                       ui::dialogBox(player->name, ":Yes:No", false, pickupDialog.c_str());
                        ui::waitForDialog();
                        if(ui::dialogOptChosen == 1){
-                               player->inv->addItem( iname, 1 );
+                               player->inv->addItem(iname, 1);
                                alive = false;
                        }
                }else{
@@ -595,9 +599,14 @@ void Object::interact(void){
        }).detach();
 }
 
-void Entity::
-follow( Entity *e )
-{
+bool Entity::isInside(vec2 coord) const {
+       return coord.x >= loc.x &&
+                  coord.x <= loc.x + width &&
+                  coord.y >= loc.y     &&
+              coord.y <= loc.y + height;
+}
+
+void Entity::follow(Entity *e){
        followee = e;
 }
 
@@ -630,19 +639,19 @@ unsigned int Structures::spawn(BUILD_SUB sub, float x, float y){
 
        //unsigned int tempN = (getRand() % 5 + 2);
 
-       if ( textureLoc.empty() )
-               textureLoc = inWorld->sTexLoc[sub];
+       if (textureLoc.empty())
+               textureLoc = inWorld->getSTextureLocation(sub);
 
        switch(sub){
                case STALL_MARKET:
                        tex = new Texturec({ textureLoc });
-                       dim = Texture::imageDim( textureLoc );
+                       dim = Texture::imageDim(textureLoc);
                        width = dim.x;
                        height = dim.y;
                        break;
                default:
                        tex = new Texturec({ textureLoc });
-                       dim = Texture::imageDim( textureLoc );
+                       dim = Texture::imageDim(textureLoc);
                        width = dim.x;
                        height = dim.y;
                        inv = NULL;
@@ -663,13 +672,13 @@ void Mob::wander(int timeRun){
        static unsigned int heya=0,hi=0;
        static bool YAYA = false;
 
-       if ( forcedMove )
+       if (forcedMove)
                return;
 
-       if ( followee ) {
-               if ( loc.x < followee->loc.x - 40 )
+       if (followee) {
+               if (loc.x < followee->loc.x - 40)
                        direction = 1;
-               else if ( loc.x > followee->loc.x + 40 )
+               else if (loc.x > followee->loc.x + 40)
                        direction = -1;
                else
                        direction = 0;
@@ -680,11 +689,11 @@ void Mob::wander(int timeRun){
 
        if(aggressive && !YAYA &&
           player->loc.x + (width / 2)  > loc.x && player->loc.x + (width / 2)  < loc.x + width  &&
-          player->loc.y + (height / 3) > loc.y && player->loc.y + (height / 3) < loc.y + height ){
-               if ( !ui::dialogBoxExists ) {
+          player->loc.y + (height / 3) > loc.y && player->loc.y + (height / 3) < loc.y + height){
+               if (!ui::dialogBoxExists) {
                        Arena *a = new Arena(currentWorld,player,this);
                        a->setStyle("");
-                       a->setBackground( WorldBGType::Forest );
+                       a->setBackground(WorldBGType::Forest);
                        a->setBGM("assets/music/embark.wav");
 
                        ui::toggleWhiteFast();
@@ -721,7 +730,7 @@ void Mob::wander(int timeRun){
                break;
        case MS_TRIGGER:
                if(player->loc.x + player->width / 2 > loc.x             &&
-                  player->loc.x + player->width / 2 < loc.x + width )
+                  player->loc.x + player->width / 2 < loc.x + width)
                        std::thread([this]{hey(this);}).detach();
                        //hey(this);
                break;
index 7b5b3ba2cf371f973321e9fd85151a400fab32f8..66b7f1db6f4a1cab25418c4404a83ab819f2c120 100644 (file)
@@ -69,10 +69,10 @@ int commonAIFunc(NPC *speaker){
                                if((oxml = exml->FirstChildElement("quest"))){
                                        std::string qname;
 
-                                       while ( oxml ) {
-                                               if ( !(qname = oxml->StrAttribute("assign")).empty() )
+                                       while (oxml) {
+                                               if (!(qname = oxml->StrAttribute("assign")).empty())
                                                        player->qh.assign(qname,"None",(std::string)oxml->GetText());
-                                               else if( !(qname = oxml->StrAttribute("check")).empty() ){
+                                               else if(!(qname = oxml->StrAttribute("check")).empty()){
                                                        if(player->qh.hasQuest(qname) && player->qh.finish(qname)){
                                                                goto CONT;
                                                        }else{
@@ -114,7 +114,7 @@ CONT:
                                 * Handle 'go to' thingy
                                 */
 
-                               if ( (oxml = exml->FirstChildElement("gotox")) )
+                               if ((oxml = exml->FirstChildElement("gotox")))
                                        speaker->targetx = atoi(oxml->GetText());
 
                                /*
@@ -218,8 +218,8 @@ CONT:
        return 0;
 }
 
-void commonPageFunc( Mob *callee ){
-       ui::drawPage( callee->heyid );
+void commonPageFunc(Mob *callee){
+       ui::drawPage(callee->heyid);
        ui::waitForDialog();
        callee->health = 0;
 }
@@ -272,7 +272,7 @@ void initEverything(void){
         * Read the XML directory into an array.
         */
 
-       if ( getdir( std::string("./" + xmlFolder).c_str(), xmlFiles ) )
+       if (getdir(std::string("./" + xmlFolder).c_str(), xmlFiles))
                UserError("Error reading XML files!!!");
 
        /*
@@ -312,7 +312,7 @@ void initEverything(void){
        optionsMenu.items.push_back(ui::menu::createSlider({-200,000}, {512,50}, {0.0f, 0.0f, 0.0f}, 0, 100, "SFX", &VOLUME_SFX));
        optionsMenu.child = NULL;
        optionsMenu.parent = &pauseMenu;
-       // optionsMenu.push_back(ui::menu::createButton({-256/2,-200},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Save and Quit"), );
+       // optionsMenu.push_back(ui::menu::createButton({-256/2,-200},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Save and Quit"),);
 
        /*
         * Spawn the player and begin the game.
index 64254e95e007a559dad8496762ee4372dcd15d3e..1b2d37825c3944a88d617c388cebc2f8e356e74c 100644 (file)
@@ -49,7 +49,7 @@ int Inventory::addItem(std::string name,uint count){
                                        return 0;
                                }
                        }
-                       items.push_back( item_t { count, i });
+                       items.push_back(item_t { count, i });
                        return 0;
                }
        }
@@ -145,11 +145,11 @@ const char *getItemTexturePath(std::string name){
 }
 
 GLuint getItemTexture(std::string name){
-       for ( int i = itemMap.size(); i--; ) {
-               if ( itemMap[i]->name == name )
+       for (int i = itemMap.size(); i--;) {
+               if (itemMap[i]->name == name)
                        return itemtex[i];
        }
-       DEBUG_printf("Failed to find texture for item %s!", name.c_str() );
+       DEBUG_printf("Failed to find texture for item %s!", name.c_str());
        return 0;
 }
 
@@ -182,12 +182,12 @@ void Inventory::setSelection(unsigned int s){
 }
 
 void Inventory::setSelectionUp(){
-       if ( !sel-- )
+       if (!sel--)
                sel++;
 }
 
 void Inventory::setSelectionDown(){
-       if ( ++sel >= numSlot )
+       if (++sel >= numSlot)
                sel = numSlot - 1;
 }
 
@@ -215,79 +215,79 @@ void Inventory::draw(void){
        static vec2 mouseStart = {0,0};
        C("End define");
 
-       for ( auto &r : iray ) {
+       for (auto &r : iray) {
                r.start.x = player->loc.x + (player->width  / 2);
                r.start.y = player->loc.y + (player->height / 2);
                curCoord[a++] = r.start;
        } a = 0;
 
-       for ( auto &cr : curRay ) {
+       for (auto &cr : curRay) {
                cr.start.x = (offset.x + SCREEN_WIDTH / 2);
                cr.start.y =  offset.y - (a * itemWide * 1.5f);
                curCurCoord[a++] = cr.start;
        } a = 0;
 
-       for ( int r = 0; r < 4; r++ ) {
-               for ( int c = 0; c < 8; c++ ) {
-                       massRay[a  ].x = ((offset.x - SCREEN_WIDTH  / 2) + itemWide       ) + c * itemWide * 1.5f;
+       for (int r = 0; r < 4; r++) {
+               for (int c = 0; c < 8; c++) {
+                       massRay[a  ].x = ((offset.x - SCREEN_WIDTH  / 2) + itemWide) + c * itemWide * 1.5f;
                        massRay[a++].y = ((offset.y + SCREEN_HEIGHT / 2) - itemWide * 1.5f) - r * itemWide * 1.5f;
                }
        } a = 0;
 
        ui::fontTransInv = 255 * (averagef(dfp) / range);
-       if ( ui::fontTransInv > 255 )
+       if (ui::fontTransInv > 255)
                ui::fontTransInv = 255;
-       else if ( ui::fontTransInv < 0 )
+       else if (ui::fontTransInv < 0)
                ui::fontTransInv = 0;
 
-       if ( invOpening ) {
-               for ( auto &d : dfp ) {
-                       if ( !a || dfp[a - 1] > 50 )
+       if (invOpening) {
+               for (auto &d : dfp) {
+                       if (!a || dfp[a - 1] > 50)
                                d += 1.65f * deltaTime;
-                       if ( d > range )
+                       if (d > range)
                                d = range;
                        a++;
                } a = 0;
 
-               for ( auto &cd : curdfp ) {
-                       if ( !a || curdfp[a - 1] > 90 )
+               for (auto &cd : curdfp) {
+                       if (!a || curdfp[a - 1] > 90)
                                cd += 1.5f * deltaTime;
-                       if ( cd > curRange )
+                       if (cd > curRange)
                                cd = curRange;
                        a++;
                } a = 0;
 
-               while ( ++a < massOrder.size() ) {
-                       if ( !a || massDfp[ massOrder[a - 1] ] > massRange * 0.75f )
+               while (++a < massOrder.size()) {
+                       if (!a || massDfp[ massOrder[a - 1] ] > massRange * 0.75f)
                                massDfp[ massOrder[a] ] += 5.0f * deltaTime;
-                       if ( massDfp[ massOrder[a] ] > massRange )
+                       if (massDfp[ massOrder[a] ] > massRange)
                                massDfp[ massOrder[a] ] = massRange;
                } a = 0;
 
-               if ( numSlot > 0 )
+               if (numSlot > 0)
                        invOpen = true;
        } else {
-               for ( auto &d : dfp ) {
-                       if ( d > 0 )
+               for (auto &d : dfp) {
+                       if (d > 0)
                                d -= 1.65f * deltaTime;
                }
-               for ( auto &cd : curdfp ) {
-                       if ( cd > 0 )
+               for (auto &cd : curdfp) {
+                       if (cd > 0)
                                cd -= 1.0f * deltaTime;
                }
 
         a = 0;
-               while ( ++a < massRay.size() ) {
-                       if ( !a || massDfp[ massOrderClosing[a - 1] ] <= 0 )
+               while (++a < massRay.size()) {
+                       if (!a || massDfp[ massOrderClosing[a - 1] ] <= 0)
                                massDfp[ massOrderClosing[a] ] -= 10.0f * deltaTime;
-                       if ( massDfp[ massOrderClosing[a - 1] ] < 0 )
+                       if (massDfp[ massOrderClosing[a - 1] ] < 0)
                                massDfp[ massOrderClosing[a - 1] ] = 0;
                } a = 0;
 
-               if ( std::all_of( std::begin(massDfp), std::end(massDfp), [](auto d){ return d <= 0; } ) ) {
+               if (std::all_of(std::begin(massDfp), std::end(massDfp), [](auto d){ return d <= 0; })) {
                        invOpen = false;
-                       for ( auto &md : massDfp ) {
-                               if ( md < 0 )
+                       for (auto &md : massDfp) {
+                               if (md < 0)
                                        md = 0;
                        }
                }
@@ -546,10 +546,10 @@ void itemDraw(Player *p,uint id){
        } else
                hangle = 0;
 
-       if ( p->inv->usingi )
+       if (p->inv->usingi)
                inc = 10;
 
-       if ( inc ) {
+       if (inc) {
                inc--;
                p->inv->useItem();
        }
@@ -574,31 +574,31 @@ void itemDraw(Player *p,uint id){
        glUseProgram(0);
 }
 
-int Inventory::useItem( void )
+int Inventory::useItem(void)
 {
        static bool up = false;
 
-       if ( !invHover ) {
-               if ( itemMap[items[sel].id]->type == "Sword" ) {
-                       if ( swing ) {
+       if (!invHover) {
+               if (itemMap[items[sel].id]->type == "Sword") {
+                       if (swing) {
                                int dir = player->left ? 1 : -1;
 
-                               if ( hangle == 15 * dir ) {
+                               if (hangle == 15 * dir) {
                                        up = true;
-                                       Mix_PlayChannel( 2, swordSwing, 0 );
+                                       Mix_PlayChannel(2, swordSwing, 0);
                                }
 
-                               if ( up )
+                               if (up)
                                        hangle += 0.325f * dir * deltaTime;
 
-                               if ( !player->left ) {
-                                       if ( hangle <= -90 )
+                               if (!player->left) {
+                                       if (hangle <= -90)
                                                hangle = -14;
-                               } else if ( hangle >= 90 )
+                               } else if (hangle >= 90)
                                                hangle = 14;
                        } else {
                                swing = true;
-                               Mix_PlayChannel( 2, swordSwing, 0 );
+                               Mix_PlayChannel(2, swordSwing, 0);
                        }
                }else if(itemMap[items[sel].id]->type == "Cooked Food"){
                        player->health += itemMap[items[sel].id]->attribValue;
index 4ab827fe072e4467b8298f01644b439ef2089c39..afeec6b6bbc4fd8a89c3ac5285a59b615da987f4 100644 (file)
@@ -12,45 +12,45 @@ int QuestHandler::assign(std::string title,std::string desc,std::string req){
        tmp.title = title;\r
        tmp.desc = desc;\r
 \r
-       tok = strtok( &req[0], "\n\r\t," );\r
-       tmp.need.emplace_back( "", 0 );\r
+       tok = strtok(&req[0], "\n\r\t,");\r
+       tmp.need.emplace_back("", 0);\r
 \r
-       while ( tok ) {\r
-               if ( !tmp.need.back().first.empty() ) {\r
-                       tmp.need.back().second = atoi( tok );\r
-                       tmp.need.emplace_back( "", 0 );\r
+       while (tok) {\r
+               if (!tmp.need.back().first.empty()) {\r
+                       tmp.need.back().second = atoi(tok);\r
+                       tmp.need.emplace_back("", 0);\r
                } else\r
                        tmp.need.back().first = tok;\r
 \r
-               tok = strtok( NULL, "\n\r\t," );\r
+               tok = strtok(NULL, "\n\r\t,");\r
        }\r
 \r
        tmp.need.pop_back();\r
-       current.push_back( tmp );\r
+       current.push_back(tmp);\r
 \r
        return 0;\r
 }\r
 \r
 int QuestHandler::drop(std::string title){\r
-       current.erase( std::remove_if( current.begin(),\r
+       current.erase(std::remove_if(current.begin(),\r
                                                                   current.end(),\r
                                                                   [&](Quest q){ return q.title == title; }),\r
-                                  current.end() );\r
+                                  current.end());\r
 \r
        return 0;\r
 }\r
 \r
 int QuestHandler::finish(std::string t){\r
-       for ( auto c = current.begin(); c != current.end(); c++ ) {\r
-               if ( (*c).title == t ) {\r
-                       for ( auto &n : (*c).need ) {\r
-                               if ( player->inv->hasItem( n.first ) < n.second )\r
+       for (auto c = current.begin(); c != current.end(); c++) {\r
+               if ((*c).title == t) {\r
+                       for (auto &n : (*c).need) {\r
+                               if (player->inv->hasItem(n.first) < n.second)\r
                                        return 0;\r
                        }\r
 \r
-                       for ( auto &n : (*c).need )\r
-                               player->inv->takeItem( n.first, n.second );\r
-                       current.erase( c );\r
+                       for (auto &n : (*c).need)\r
+                               player->inv->takeItem(n.first, n.second);\r
+                       current.erase(c);\r
                        return 1;\r
                }\r
        }\r
@@ -59,8 +59,8 @@ int QuestHandler::finish(std::string t){
 }\r
 \r
 bool QuestHandler::hasQuest(std::string t){\r
-       for ( auto &c : current ) {\r
-               if ( c.title == t )\r
+       for (auto &c : current) {\r
+               if (c.title == t)\r
                        return true;\r
        }\r
 \r
index 1f8dca396b9a6b777fd6eba924b3aa92f4752e80..a61d4269c699ce1fabb6f427eb6eeaa54bf905ac 100644 (file)
@@ -78,7 +78,7 @@ namespace Texture{
                                         GL_RGBA,
                                         GL_UNSIGNED_BYTE,
                                         image->pixels
-                                        );
+                                       );
 
                // add texture to LoadedTexture
                LoadedTexture.push_back(texture_t{fileName,object,{image->w,image->h}});
@@ -171,25 +171,25 @@ Texturec::Texturec(uint amt, ...){
        texState = 0;
        va_start(fNames, amt);
        for(unsigned int i = 0; i < amt; i++)
-               image.push_back( Texture::loadTexture(va_arg(fNames, char *)) );
+               image.push_back(Texture::loadTexture(va_arg(fNames, char *)));
        va_end(fNames);
 }
 
-Texturec::Texturec( std::initializer_list<std::string> l )
+Texturec::Texturec(std::initializer_list<std::string> l)
 {
        texState = 0;
-       std::for_each( l.begin(), l.end(), [&](std::string s){ image.push_back( Texture::loadTexture( s ) ); });
+       std::for_each(l.begin(), l.end(), [&](std::string s){ image.push_back(Texture::loadTexture(s)); });
 }
 
 Texturec::Texturec(std::vector<std::string>v){
        texState = 0;
-       std::for_each( v.begin(), v.end(), [&](std::string s){ image.push_back( Texture::loadTexture( s ) ); });
+       std::for_each(v.begin(), v.end(), [&](std::string s){ image.push_back(Texture::loadTexture(s)); });
 }
 
 Texturec::Texturec(uint amt,const char **paths){
        texState = 0;
        for(unsigned int i = 0; i < amt; i++)
-               image.push_back( Texture::loadTexture(paths[i]) );
+               image.push_back(Texture::loadTexture(paths[i]));
 }
 
 Texturec::~Texturec(){
index 6198418f0734a35f6f8213af5d24b7c24ec9dc11..1388489c5b2b2c27775790c11f674988a392adf3 100755 (executable)
@@ -32,7 +32,7 @@ distribution.
 #   include <cstdarg>\r
 #endif\r
 \r
-#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && (!defined WINCE)\r
        // Microsoft Visual Studio, version 2005 and higher. Not WinCE.\r
        /*int _snprintf_s(\r
           char *buffer,\r
@@ -41,18 +41,18 @@ distribution.
           const char *format [,\r
                  argument] ...\r
        );*/\r
-       static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )\r
+       static inline int TIXML_SNPRINTF(char* buffer, size_t size, const char* format, ...)\r
        {\r
                va_list va;\r
-               va_start( va, format );\r
-               int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\r
-               va_end( va );\r
+               va_start(va, format);\r
+               int result = vsnprintf_s(buffer, size, _TRUNCATE, format, va);\r
+               va_end(va);\r
                return result;\r
        }\r
 \r
-       static inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va )\r
+       static inline int TIXML_VSNPRINTF(char* buffer, size_t size, const char* format, va_list va)\r
        {\r
-               int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\r
+               int result = vsnprintf_s(buffer, size, _TRUNCATE, format, va);\r
                return result;\r
        }\r
 \r
@@ -63,12 +63,12 @@ distribution.
        #define TIXML_SNPRINTF  _snprintf\r
        #define TIXML_VSNPRINTF _vsnprintf\r
        #define TIXML_SSCANF    sscanf\r
-       #if (_MSC_VER < 1400 ) && (!defined WINCE)\r
+       #if (_MSC_VER < 1400) && (!defined WINCE)\r
                // Microsoft Visual Studio 2003 and not WinCE.\r
                #define TIXML_VSCPRINTF   _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have.\r
        #else\r
                // Microsoft Visual Studio 2003 and earlier or WinCE.\r
-               static inline int TIXML_VSCPRINTF( const char* format, va_list va )\r
+               static inline int TIXML_VSCPRINTF(const char* format, va_list va)\r
                {\r
                        int len = 512;\r
                        for (;;) {\r
@@ -76,25 +76,25 @@ distribution.
                                char* str = new char[len]();\r
                                const int required = _vsnprintf(str, len, format, va);\r
                                delete[] str;\r
-                               if ( required != -1 ) {\r
-                                       TIXMLASSERT( required >= 0 );\r
+                               if (required != -1) {\r
+                                       TIXMLASSERT(required >= 0);\r
                                        len = required;\r
                                        break;\r
                                }\r
                        }\r
-                       TIXMLASSERT( len >= 0 );\r
+                       TIXMLASSERT(len >= 0);\r
                        return len;\r
                }\r
        #endif\r
 #else\r
        // GCC version 3 and higher\r
-       //#warning( "Using sn* functions." )\r
+       //#warning("Using sn* functions.")\r
        #define TIXML_SNPRINTF  snprintf\r
        #define TIXML_VSNPRINTF vsnprintf\r
-       static inline int TIXML_VSCPRINTF( const char* format, va_list va )\r
+       static inline int TIXML_VSCPRINTF(const char* format, va_list va)\r
        {\r
-               int len = vsnprintf( 0, 0, format, va );\r
-               TIXMLASSERT( len >= 0 );\r
+               int len = vsnprintf(0, 0, format, va);\r
+               TIXMLASSERT(len >= 0);\r
                return len;\r
        }\r
        #define TIXML_SSCANF   sscanf\r
@@ -141,17 +141,17 @@ StrPair::~StrPair()
 }\r
 \r
 \r
-void StrPair::TransferTo( StrPair* other )\r
+void StrPair::TransferTo(StrPair* other)\r
 {\r
-    if ( this == other ) {\r
+    if (this == other) {\r
         return;\r
     }\r
     // This in effect implements the assignment operator by "moving"\r
     // ownership (as in auto_ptr).\r
 \r
-    TIXMLASSERT( other->_flags == 0 );\r
-    TIXMLASSERT( other->_start == 0 );\r
-    TIXMLASSERT( other->_end == 0 );\r
+    TIXMLASSERT(other->_flags == 0);\r
+    TIXMLASSERT(other->_start == 0);\r
+    TIXMLASSERT(other->_end == 0);\r
 \r
     other->Reset();\r
 \r
@@ -166,7 +166,7 @@ void StrPair::TransferTo( StrPair* other )
 \r
 void StrPair::Reset()\r
 {\r
-    if ( _flags & NEEDS_DELETE ) {\r
+    if (_flags & NEEDS_DELETE) {\r
         delete [] _start;\r
     }\r
     _flags = 0;\r
@@ -175,31 +175,31 @@ void StrPair::Reset()
 }\r
 \r
 \r
-void StrPair::SetStr( const char* str, int flags )\r
+void StrPair::SetStr(const char* str, int flags)\r
 {\r
-    TIXMLASSERT( str );\r
+    TIXMLASSERT(str);\r
     Reset();\r
-    size_t len = strlen( str );\r
-    TIXMLASSERT( _start == 0 );\r
+    size_t len = strlen(str);\r
+    TIXMLASSERT(_start == 0);\r
     _start = new char[ len+1 ];\r
-    memcpy( _start, str, len+1 );\r
+    memcpy(_start, str, len+1);\r
     _end = _start + len;\r
     _flags = flags | NEEDS_DELETE;\r
 }\r
 \r
 \r
-char* StrPair::ParseText( char* p, const char* endTag, int strFlags )\r
+char* StrPair::ParseText(char* p, const char* endTag, int strFlags)\r
 {\r
-    TIXMLASSERT( endTag && *endTag );\r
+    TIXMLASSERT(endTag && *endTag);\r
 \r
     char* start = p;\r
     char  endChar = *endTag;\r
-    size_t length = strlen( endTag );\r
+    size_t length = strlen(endTag);\r
 \r
     // Inner loop of text parsing.\r
-    while ( *p ) {\r
-        if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) {\r
-            Set( start, p, strFlags );\r
+    while (*p) {\r
+        if (*p == endChar && strncmp(p, endTag, length) == 0) {\r
+            Set(start, p, strFlags);\r
             return p + length;\r
         }\r
         ++p;\r
@@ -208,22 +208,22 @@ char* StrPair::ParseText( char* p, const char* endTag, int strFlags )
 }\r
 \r
 \r
-char* StrPair::ParseName( char* p )\r
+char* StrPair::ParseName(char* p)\r
 {\r
-    if ( !p || !(*p) ) {\r
+    if (!p || !(*p)) {\r
         return 0;\r
     }\r
-    if ( !XMLUtil::IsNameStartChar( *p ) ) {\r
+    if (!XMLUtil::IsNameStartChar(*p)) {\r
         return 0;\r
     }\r
 \r
     char* const start = p;\r
     ++p;\r
-    while ( *p && XMLUtil::IsNameChar( *p ) ) {\r
+    while (*p && XMLUtil::IsNameChar(*p)) {\r
         ++p;\r
     }\r
 \r
-    Set( start, p, 0 );\r
+    Set(start, p, 0);\r
     return p;\r
 }\r
 \r
@@ -231,18 +231,18 @@ char* StrPair::ParseName( char* p )
 void StrPair::CollapseWhitespace()\r
 {\r
     // Adjusting _start would cause undefined behavior on delete[]\r
-    TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 );\r
+    TIXMLASSERT((_flags & NEEDS_DELETE) == 0);\r
     // Trim leading space.\r
-    _start = XMLUtil::SkipWhiteSpace( _start );\r
+    _start = XMLUtil::SkipWhiteSpace(_start);\r
 \r
-    if ( *_start ) {\r
+    if (*_start) {\r
         char* p = _start;      // the read pointer\r
         char* q = _start;      // the write pointer\r
 \r
-        while( *p ) {\r
-            if ( XMLUtil::IsWhiteSpace( *p )) {\r
-                p = XMLUtil::SkipWhiteSpace( p );\r
-                if ( *p == 0 ) {\r
+        while(*p) {\r
+            if (XMLUtil::IsWhiteSpace(*p)) {\r
+                p = XMLUtil::SkipWhiteSpace(p);\r
+                if (*p == 0) {\r
                     break;    // don't write to q; this trims the trailing space.\r
                 }\r
                 *q = ' ';\r
@@ -259,22 +259,22 @@ void StrPair::CollapseWhitespace()
 \r
 const char* StrPair::GetStr()\r
 {\r
-    TIXMLASSERT( _start );\r
-    TIXMLASSERT( _end );\r
-    if ( _flags & NEEDS_FLUSH ) {\r
+    TIXMLASSERT(_start);\r
+    TIXMLASSERT(_end);\r
+    if (_flags & NEEDS_FLUSH) {\r
         *_end = 0;\r
         _flags ^= NEEDS_FLUSH;\r
 \r
-        if ( _flags ) {\r
+        if (_flags) {\r
             char* p = _start;  // the read pointer\r
             char* q = _start;  // the write pointer\r
 \r
-            while( p < _end ) {\r
-                if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) {\r
+            while(p < _end) {\r
+                if ((_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR) {\r
                     // CR-LF pair becomes LF\r
                     // CR alone becomes LF\r
                     // LF-CR becomes LF\r
-                    if ( *(p+1) == LF ) {\r
+                    if (*(p+1) == LF) {\r
                         p += 2;\r
                     }\r
                     else {\r
@@ -282,8 +282,8 @@ const char* StrPair::GetStr()
                     }\r
                     *q++ = LF;\r
                 }\r
-                else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {\r
-                    if ( *(p+1) == CR ) {\r
+                else if ((_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF) {\r
+                    if (*(p+1) == CR) {\r
                         p += 2;\r
                     }\r
                     else {\r
@@ -291,36 +291,36 @@ const char* StrPair::GetStr()
                     }\r
                     *q++ = LF;\r
                 }\r
-                else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {\r
+                else if ((_flags & NEEDS_ENTITY_PROCESSING) && *p == '&') {\r
                     // Entities handled by tinyXML2:\r
                     // - special entities in the entity table [in/out]\r
                     // - numeric character reference [in]\r
                     //   &#20013; or &#x4e2d;\r
 \r
-                    if ( *(p+1) == '#' ) {\r
+                    if (*(p+1) == '#') {\r
                         const int buflen = 10;\r
                         char buf[buflen] = { 0 };\r
                         int len = 0;\r
-                        char* adjusted = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) );\r
-                        if ( adjusted == 0 ) {\r
+                        char* adjusted = const_cast<char*>(XMLUtil::GetCharacterRef(p, buf, &len));\r
+                        if (adjusted == 0) {\r
                             *q = *p;\r
                             ++p;\r
                             ++q;\r
                         }\r
                         else {\r
-                            TIXMLASSERT( 0 <= len && len <= buflen );\r
-                            TIXMLASSERT( q + len <= adjusted );\r
+                            TIXMLASSERT(0 <= len && len <= buflen);\r
+                            TIXMLASSERT(q + len <= adjusted);\r
                             p = adjusted;\r
-                            memcpy( q, buf, len );\r
+                            memcpy(q, buf, len);\r
                             q += len;\r
                         }\r
                     }\r
                     else {\r
                         bool entityFound = false;\r
-                        for( int i = 0; i < NUM_ENTITIES; ++i ) {\r
+                        for(int i = 0; i < NUM_ENTITIES; ++i) {\r
                             const Entity& entity = entities[i];\r
-                            if ( strncmp( p + 1, entity.pattern, entity.length ) == 0\r
-                                    && *( p + entity.length + 1 ) == ';' ) {\r
+                            if (strncmp(p + 1, entity.pattern, entity.length) == 0\r
+                                    && *(p + entity.length + 1) == ';') {\r
                                 // Found an entity - convert.\r
                                 *q = entity.value;\r
                                 ++q;\r
@@ -329,7 +329,7 @@ const char* StrPair::GetStr()
                                 break;\r
                             }\r
                         }\r
-                        if ( !entityFound ) {\r
+                        if (!entityFound) {\r
                             // fixme: treat as error?\r
                             ++p;\r
                             ++q;\r
@@ -346,12 +346,12 @@ const char* StrPair::GetStr()
         }\r
         // The loop below has plenty going on, and this\r
         // is a less useful mode. Break it out.\r
-        if ( _flags & NEEDS_WHITESPACE_COLLAPSING ) {\r
+        if (_flags & NEEDS_WHITESPACE_COLLAPSING) {\r
             CollapseWhitespace();\r
         }\r
         _flags = (_flags & NEEDS_DELETE);\r
     }\r
-    TIXMLASSERT( _start );\r
+    TIXMLASSERT(_start);\r
     return _start;\r
 }\r
 \r
@@ -360,25 +360,25 @@ const char* StrPair::GetStr()
 \r
 // --------- XMLUtil ----------- //\r
 \r
-const char* XMLUtil::ReadBOM( const char* p, bool* bom )\r
+const char* XMLUtil::ReadBOM(const char* p, bool* bom)\r
 {\r
-    TIXMLASSERT( p );\r
-    TIXMLASSERT( bom );\r
+    TIXMLASSERT(p);\r
+    TIXMLASSERT(bom);\r
     *bom = false;\r
     const unsigned char* pu = reinterpret_cast<const unsigned char*>(p);\r
     // Check for BOM:\r
-    if (    *(pu+0) == TIXML_UTF_LEAD_0\r
+    if (*(pu+0) == TIXML_UTF_LEAD_0\r
             && *(pu+1) == TIXML_UTF_LEAD_1\r
-            && *(pu+2) == TIXML_UTF_LEAD_2 ) {\r
+            && *(pu+2) == TIXML_UTF_LEAD_2) {\r
         *bom = true;\r
         p += 3;\r
     }\r
-    TIXMLASSERT( p );\r
+    TIXMLASSERT(p);\r
     return p;\r
 }\r
 \r
 \r
-void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length )\r
+void XMLUtil::ConvertUTF32ToUTF8(unsigned long input, char* output, int* length)\r
 {\r
     const unsigned long BYTE_MASK = 0xBF;\r
     const unsigned long BYTE_MARK = 0x80;\r
@@ -387,13 +387,13 @@ void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length
     if (input < 0x80) {\r
         *length = 1;\r
     }\r
-    else if ( input < 0x800 ) {\r
+    else if (input < 0x800) {\r
         *length = 2;\r
     }\r
-    else if ( input < 0x10000 ) {\r
+    else if (input < 0x10000) {\r
         *length = 3;\r
     }\r
-    else if ( input < 0x200000 ) {\r
+    else if (input < 0x200000) {\r
         *length = 4;\r
     }\r
     else {\r
@@ -422,61 +422,61 @@ void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length
             *output = (char)(input | FIRST_BYTE_MARK[*length]);\r
             break;\r
         default:\r
-            TIXMLASSERT( false );\r
+            TIXMLASSERT(false);\r
     }\r
 }\r
 \r
 \r
-const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )\r
+const char* XMLUtil::GetCharacterRef(const char* p, char* value, int* length)\r
 {\r
     // Presume an entity, and pull it out.\r
     *length = 0;\r
 \r
-    if ( *(p+1) == '#' && *(p+2) ) {\r
+    if (*(p+1) == '#' && *(p+2)) {\r
         unsigned long ucs = 0;\r
-        TIXMLASSERT( sizeof( ucs ) >= 4 );\r
+        TIXMLASSERT(sizeof(ucs) >= 4);\r
         ptrdiff_t delta = 0;\r
         unsigned mult = 1;\r
         static const char SEMICOLON = ';';\r
 \r
-        if ( *(p+2) == 'x' ) {\r
+        if (*(p+2) == 'x') {\r
             // Hexadecimal.\r
             const char* q = p+3;\r
-            if ( !(*q) ) {\r
+            if (!(*q)) {\r
                 return 0;\r
             }\r
 \r
-            q = strchr( q, SEMICOLON );\r
+            q = strchr(q, SEMICOLON);\r
 \r
-            if ( !q ) {\r
+            if (!q) {\r
                 return 0;\r
             }\r
-            TIXMLASSERT( *q == SEMICOLON );\r
+            TIXMLASSERT(*q == SEMICOLON);\r
 \r
             delta = q-p;\r
             --q;\r
 \r
-            while ( *q != 'x' ) {\r
+            while (*q != 'x') {\r
                 unsigned int digit = 0;\r
 \r
-                if ( *q >= '0' && *q <= '9' ) {\r
+                if (*q >= '0' && *q <= '9') {\r
                     digit = *q - '0';\r
                 }\r
-                else if ( *q >= 'a' && *q <= 'f' ) {\r
+                else if (*q >= 'a' && *q <= 'f') {\r
                     digit = *q - 'a' + 10;\r
                 }\r
-                else if ( *q >= 'A' && *q <= 'F' ) {\r
+                else if (*q >= 'A' && *q <= 'F') {\r
                     digit = *q - 'A' + 10;\r
                 }\r
                 else {\r
                     return 0;\r
                 }\r
-                TIXMLASSERT( digit >= 0 && digit < 16);\r
-                TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\r
+                TIXMLASSERT(digit >= 0 && digit < 16);\r
+                TIXMLASSERT(digit == 0 || mult <= UINT_MAX / digit);\r
                 const unsigned int digitScaled = mult * digit;\r
-                TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\r
+                TIXMLASSERT(ucs <= ULONG_MAX - digitScaled);\r
                 ucs += digitScaled;\r
-                TIXMLASSERT( mult <= UINT_MAX / 16 );\r
+                TIXMLASSERT(mult <= UINT_MAX / 16);\r
                 mult *= 16;\r
                 --q;\r
             }\r
@@ -484,106 +484,106 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )
         else {\r
             // Decimal.\r
             const char* q = p+2;\r
-            if ( !(*q) ) {\r
+            if (!(*q)) {\r
                 return 0;\r
             }\r
 \r
-            q = strchr( q, SEMICOLON );\r
+            q = strchr(q, SEMICOLON);\r
 \r
-            if ( !q ) {\r
+            if (!q) {\r
                 return 0;\r
             }\r
-            TIXMLASSERT( *q == SEMICOLON );\r
+            TIXMLASSERT(*q == SEMICOLON);\r
 \r
             delta = q-p;\r
             --q;\r
 \r
-            while ( *q != '#' ) {\r
-                if ( *q >= '0' && *q <= '9' ) {\r
+            while (*q != '#') {\r
+                if (*q >= '0' && *q <= '9') {\r
                     const unsigned int digit = *q - '0';\r
-                    TIXMLASSERT( digit >= 0 && digit < 10);\r
-                    TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\r
+                    TIXMLASSERT(digit >= 0 && digit < 10);\r
+                    TIXMLASSERT(digit == 0 || mult <= UINT_MAX / digit);\r
                     const unsigned int digitScaled = mult * digit;\r
-                    TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\r
+                    TIXMLASSERT(ucs <= ULONG_MAX - digitScaled);\r
                     ucs += digitScaled;\r
                 }\r
                 else {\r
                     return 0;\r
                 }\r
-                TIXMLASSERT( mult <= UINT_MAX / 10 );\r
+                TIXMLASSERT(mult <= UINT_MAX / 10);\r
                 mult *= 10;\r
                 --q;\r
             }\r
         }\r
         // convert the UCS to UTF-8\r
-        ConvertUTF32ToUTF8( ucs, value, length );\r
+        ConvertUTF32ToUTF8(ucs, value, length);\r
         return p + delta + 1;\r
     }\r
     return p+1;\r
 }\r
 \r
 \r
-void XMLUtil::ToStr( int v, char* buffer, int bufferSize )\r
+void XMLUtil::ToStr(int v, char* buffer, int bufferSize)\r
 {\r
-    TIXML_SNPRINTF( buffer, bufferSize, "%d", v );\r
+    TIXML_SNPRINTF(buffer, bufferSize, "%d", v);\r
 }\r
 \r
 \r
-void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize )\r
+void XMLUtil::ToStr(unsigned v, char* buffer, int bufferSize)\r
 {\r
-    TIXML_SNPRINTF( buffer, bufferSize, "%u", v );\r
+    TIXML_SNPRINTF(buffer, bufferSize, "%u", v);\r
 }\r
 \r
 \r
-void XMLUtil::ToStr( bool v, char* buffer, int bufferSize )\r
+void XMLUtil::ToStr(bool v, char* buffer, int bufferSize)\r
 {\r
-    TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 );\r
+    TIXML_SNPRINTF(buffer, bufferSize, "%d", v ? 1 : 0);\r
 }\r
 \r
 /*\r
        ToStr() of a number is a very tricky topic.\r
        https://github.com/leethomason/tinyxml2/issues/106\r
 */\r
-void XMLUtil::ToStr( float v, char* buffer, int bufferSize )\r
+void XMLUtil::ToStr(float v, char* buffer, int bufferSize)\r
 {\r
-    TIXML_SNPRINTF( buffer, bufferSize, "%.8g", v );\r
+    TIXML_SNPRINTF(buffer, bufferSize, "%.8g", v);\r
 }\r
 \r
 \r
-void XMLUtil::ToStr( double v, char* buffer, int bufferSize )\r
+void XMLUtil::ToStr(double v, char* buffer, int bufferSize)\r
 {\r
-    TIXML_SNPRINTF( buffer, bufferSize, "%.17g", v );\r
+    TIXML_SNPRINTF(buffer, bufferSize, "%.17g", v);\r
 }\r
 \r
 \r
-bool XMLUtil::ToInt( const char* str, int* value )\r
+bool XMLUtil::ToInt(const char* str, int* value)\r
 {\r
-    if ( TIXML_SSCANF( str, "%d", value ) == 1 ) {\r
+    if (TIXML_SSCANF(str, "%d", value) == 1) {\r
         return true;\r
     }\r
     return false;\r
 }\r
 \r
-bool XMLUtil::ToUnsigned( const char* str, unsigned *value )\r
+bool XMLUtil::ToUnsigned(const char* str, unsigned *value)\r
 {\r
-    if ( TIXML_SSCANF( str, "%u", value ) == 1 ) {\r
+    if (TIXML_SSCANF(str, "%u", value) == 1) {\r
         return true;\r
     }\r
     return false;\r
 }\r
 \r
-bool XMLUtil::ToBool( const char* str, bool* value )\r
+bool XMLUtil::ToBool(const char* str, bool* value)\r
 {\r
     int ival = 0;\r
-    if ( ToInt( str, &ival )) {\r
+    if (ToInt(str, &ival)) {\r
         *value = (ival==0) ? false : true;\r
         return true;\r
     }\r
-    if ( StringEqual( str, "true" ) ) {\r
+    if (StringEqual(str, "true")) {\r
         *value = true;\r
         return true;\r
     }\r
-    else if ( StringEqual( str, "false" ) ) {\r
+    else if (StringEqual(str, "false")) {\r
         *value = false;\r
         return true;\r
     }\r
@@ -591,32 +591,32 @@ bool XMLUtil::ToBool( const char* str, bool* value )
 }\r
 \r
 \r
-bool XMLUtil::ToFloat( const char* str, float* value )\r
+bool XMLUtil::ToFloat(const char* str, float* value)\r
 {\r
-    if ( TIXML_SSCANF( str, "%f", value ) == 1 ) {\r
+    if (TIXML_SSCANF(str, "%f", value) == 1) {\r
         return true;\r
     }\r
     return false;\r
 }\r
 \r
-bool XMLUtil::ToDouble( const char* str, double* value )\r
+bool XMLUtil::ToDouble(const char* str, double* value)\r
 {\r
-    if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) {\r
+    if (TIXML_SSCANF(str, "%lf", value) == 1) {\r
         return true;\r
     }\r
     return false;\r
 }\r
 \r
 \r
-char* XMLDocument::Identify( char* p, XMLNode** node )\r
+char* XMLDocument::Identify(char* p, XMLNode** node)\r
 {\r
-    TIXMLASSERT( node );\r
-    TIXMLASSERT( p );\r
+    TIXMLASSERT(node);\r
+    TIXMLASSERT(p);\r
     char* const start = p;\r
-    p = XMLUtil::SkipWhiteSpace( p );\r
-    if( !*p ) {\r
+    p = XMLUtil::SkipWhiteSpace(p);\r
+    if(!*p) {\r
         *node = 0;\r
-        TIXMLASSERT( p );\r
+        TIXMLASSERT(p);\r
         return p;\r
     }\r
 \r
@@ -633,77 +633,77 @@ char* XMLDocument::Identify( char* p, XMLNode** node )
     static const int dtdHeaderLen              = 2;\r
     static const int elementHeaderLen  = 1;\r
 \r
-    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) );               // use same memory pool\r
-    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) );   // use same memory pool\r
+    TIXMLASSERT(sizeof(XMLComment) == sizeof(XMLUnknown));             // use same memory pool\r
+    TIXMLASSERT(sizeof(XMLComment) == sizeof(XMLDeclaration)); // use same memory pool\r
     XMLNode* returnNode = 0;\r
-    if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {\r
-        TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );\r
-        returnNode = new (_commentPool.Alloc()) XMLDeclaration( this );\r
+    if (XMLUtil::StringEqual(p, xmlHeader, xmlHeaderLen)) {\r
+        TIXMLASSERT(sizeof(XMLDeclaration) == _commentPool.ItemSize());\r
+        returnNode = new (_commentPool.Alloc()) XMLDeclaration(this);\r
         returnNode->_memPool = &_commentPool;\r
         p += xmlHeaderLen;\r
     }\r
-    else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) {\r
-        TIXMLASSERT( sizeof( XMLComment ) == _commentPool.ItemSize() );\r
-        returnNode = new (_commentPool.Alloc()) XMLComment( this );\r
+    else if (XMLUtil::StringEqual(p, commentHeader, commentHeaderLen)) {\r
+        TIXMLASSERT(sizeof(XMLComment) == _commentPool.ItemSize());\r
+        returnNode = new (_commentPool.Alloc()) XMLComment(this);\r
         returnNode->_memPool = &_commentPool;\r
         p += commentHeaderLen;\r
     }\r
-    else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) {\r
-        TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
-        XMLText* text = new (_textPool.Alloc()) XMLText( this );\r
+    else if (XMLUtil::StringEqual(p, cdataHeader, cdataHeaderLen)) {\r
+        TIXMLASSERT(sizeof(XMLText) == _textPool.ItemSize());\r
+        XMLText* text = new (_textPool.Alloc()) XMLText(this);\r
         returnNode = text;\r
         returnNode->_memPool = &_textPool;\r
         p += cdataHeaderLen;\r
-        text->SetCData( true );\r
+        text->SetCData(true);\r
     }\r
-    else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) {\r
-        TIXMLASSERT( sizeof( XMLUnknown ) == _commentPool.ItemSize() );\r
-        returnNode = new (_commentPool.Alloc()) XMLUnknown( this );\r
+    else if (XMLUtil::StringEqual(p, dtdHeader, dtdHeaderLen)) {\r
+        TIXMLASSERT(sizeof(XMLUnknown) == _commentPool.ItemSize());\r
+        returnNode = new (_commentPool.Alloc()) XMLUnknown(this);\r
         returnNode->_memPool = &_commentPool;\r
         p += dtdHeaderLen;\r
     }\r
-    else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) {\r
-        TIXMLASSERT( sizeof( XMLElement ) == _elementPool.ItemSize() );\r
-        returnNode = new (_elementPool.Alloc()) XMLElement( this );\r
+    else if (XMLUtil::StringEqual(p, elementHeader, elementHeaderLen)) {\r
+        TIXMLASSERT(sizeof(XMLElement) == _elementPool.ItemSize());\r
+        returnNode = new (_elementPool.Alloc()) XMLElement(this);\r
         returnNode->_memPool = &_elementPool;\r
         p += elementHeaderLen;\r
     }\r
     else {\r
-        TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
-        returnNode = new (_textPool.Alloc()) XMLText( this );\r
+        TIXMLASSERT(sizeof(XMLText) == _textPool.ItemSize());\r
+        returnNode = new (_textPool.Alloc()) XMLText(this);\r
         returnNode->_memPool = &_textPool;\r
         p = start;     // Back it up, all the text counts.\r
     }\r
 \r
-    TIXMLASSERT( returnNode );\r
-    TIXMLASSERT( p );\r
+    TIXMLASSERT(returnNode);\r
+    TIXMLASSERT(p);\r
     *node = returnNode;\r
     return p;\r
 }\r
 \r
 \r
-bool XMLDocument::Accept( XMLVisitor* visitor ) const\r
+bool XMLDocument::Accept(XMLVisitor* visitor) const\r
 {\r
-    TIXMLASSERT( visitor );\r
-    if ( visitor->VisitEnter( *this ) ) {\r
-        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\r
-            if ( !node->Accept( visitor ) ) {\r
+    TIXMLASSERT(visitor);\r
+    if (visitor->VisitEnter(*this)) {\r
+        for (const XMLNode* node=FirstChild(); node; node=node->NextSibling()) {\r
+            if (!node->Accept(visitor)) {\r
                 break;\r
             }\r
         }\r
     }\r
-    return visitor->VisitExit( *this );\r
+    return visitor->VisitExit(*this);\r
 }\r
 \r
 \r
 // --------- XMLNode ----------- //\r
 \r
-XMLNode::XMLNode( XMLDocument* doc ) :\r
-    _document( doc ),\r
-    _parent( 0 ),\r
-    _firstChild( 0 ), _lastChild( 0 ),\r
-    _prev( 0 ), _next( 0 ),\r
-    _memPool( 0 )\r
+XMLNode::XMLNode(XMLDocument* doc) :\r
+    _document(doc),\r
+    _parent(0),\r
+    _firstChild(0), _lastChild(0),\r
+    _prev(0), _next(0),\r
+    _memPool(0)\r
 {\r
 }\r
 \r
@@ -711,88 +711,88 @@ XMLNode::XMLNode( XMLDocument* doc ) :
 XMLNode::~XMLNode()\r
 {\r
     DeleteChildren();\r
-    if ( _parent ) {\r
-        _parent->Unlink( this );\r
+    if (_parent) {\r
+        _parent->Unlink(this);\r
     }\r
 }\r
 \r
 const char* XMLNode::Value() const \r
 {\r
     // Catch an edge case: XMLDocuments don't have a a Value. Carefully return nullptr.\r
-    if ( this->ToDocument() )\r
+    if (this->ToDocument())\r
         return 0;\r
     return _value.GetStr();\r
 }\r
 \r
-void XMLNode::SetValue( const char* str, bool staticMem )\r
+void XMLNode::SetValue(const char* str, bool staticMem)\r
 {\r
-    if ( staticMem ) {\r
-        _value.SetInternedStr( str );\r
+    if (staticMem) {\r
+        _value.SetInternedStr(str);\r
     }\r
     else {\r
-        _value.SetStr( str );\r
+        _value.SetStr(str);\r
     }\r
 }\r
 \r
 \r
 void XMLNode::DeleteChildren()\r
 {\r
-    while( _firstChild ) {\r
-        TIXMLASSERT( _lastChild );\r
-        TIXMLASSERT( _firstChild->_document == _document );\r
+    while(_firstChild) {\r
+        TIXMLASSERT(_lastChild);\r
+        TIXMLASSERT(_firstChild->_document == _document);\r
         XMLNode* node = _firstChild;\r
-        Unlink( node );\r
+        Unlink(node);\r
 \r
-        DeleteNode( node );\r
+        DeleteNode(node);\r
     }\r
     _firstChild = _lastChild = 0;\r
 }\r
 \r
 \r
-void XMLNode::Unlink( XMLNode* child )\r
+void XMLNode::Unlink(XMLNode* child)\r
 {\r
-    TIXMLASSERT( child );\r
-    TIXMLASSERT( child->_document == _document );\r
-    TIXMLASSERT( child->_parent == this );\r
-    if ( child == _firstChild ) {\r
+    TIXMLASSERT(child);\r
+    TIXMLASSERT(child->_document == _document);\r
+    TIXMLASSERT(child->_parent == this);\r
+    if (child == _firstChild) {\r
         _firstChild = _firstChild->_next;\r
     }\r
-    if ( child == _lastChild ) {\r
+    if (child == _lastChild) {\r
         _lastChild = _lastChild->_prev;\r
     }\r
 \r
-    if ( child->_prev ) {\r
+    if (child->_prev) {\r
         child->_prev->_next = child->_next;\r
     }\r
-    if ( child->_next ) {\r
+    if (child->_next) {\r
         child->_next->_prev = child->_prev;\r
     }\r
        child->_parent = 0;\r
 }\r
 \r
 \r
-void XMLNode::DeleteChild( XMLNode* node )\r
+void XMLNode::DeleteChild(XMLNode* node)\r
 {\r
-    TIXMLASSERT( node );\r
-    TIXMLASSERT( node->_document == _document );\r
-    TIXMLASSERT( node->_parent == this );\r
-    Unlink( node );\r
-    DeleteNode( node );\r
+    TIXMLASSERT(node);\r
+    TIXMLASSERT(node->_document == _document);\r
+    TIXMLASSERT(node->_parent == this);\r
+    Unlink(node);\r
+    DeleteNode(node);\r
 }\r
 \r
 \r
-XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )\r
+XMLNode* XMLNode::InsertEndChild(XMLNode* addThis)\r
 {\r
-    TIXMLASSERT( addThis );\r
-    if ( addThis->_document != _document ) {\r
-        TIXMLASSERT( false );\r
+    TIXMLASSERT(addThis);\r
+    if (addThis->_document != _document) {\r
+        TIXMLASSERT(false);\r
         return 0;\r
     }\r
-    InsertChildPreamble( addThis );\r
+    InsertChildPreamble(addThis);\r
 \r
-    if ( _lastChild ) {\r
-        TIXMLASSERT( _firstChild );\r
-        TIXMLASSERT( _lastChild->_next == 0 );\r
+    if (_lastChild) {\r
+        TIXMLASSERT(_firstChild);\r
+        TIXMLASSERT(_lastChild->_next == 0);\r
         _lastChild->_next = addThis;\r
         addThis->_prev = _lastChild;\r
         _lastChild = addThis;\r
@@ -800,7 +800,7 @@ XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )
         addThis->_next = 0;\r
     }\r
     else {\r
-        TIXMLASSERT( _firstChild == 0 );\r
+        TIXMLASSERT(_firstChild == 0);\r
         _firstChild = _lastChild = addThis;\r
 \r
         addThis->_prev = 0;\r
@@ -811,18 +811,18 @@ XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )
 }\r
 \r
 \r
-XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )\r
+XMLNode* XMLNode::InsertFirstChild(XMLNode* addThis)\r
 {\r
-    TIXMLASSERT( addThis );\r
-    if ( addThis->_document != _document ) {\r
-        TIXMLASSERT( false );\r
+    TIXMLASSERT(addThis);\r
+    if (addThis->_document != _document) {\r
+        TIXMLASSERT(false);\r
         return 0;\r
     }\r
-    InsertChildPreamble( addThis );\r
+    InsertChildPreamble(addThis);\r
 \r
-    if ( _firstChild ) {\r
-        TIXMLASSERT( _lastChild );\r
-        TIXMLASSERT( _firstChild->_prev == 0 );\r
+    if (_firstChild) {\r
+        TIXMLASSERT(_lastChild);\r
+        TIXMLASSERT(_firstChild->_prev == 0);\r
 \r
         _firstChild->_prev = addThis;\r
         addThis->_next = _firstChild;\r
@@ -831,7 +831,7 @@ XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )
         addThis->_prev = 0;\r
     }\r
     else {\r
-        TIXMLASSERT( _lastChild == 0 );\r
+        TIXMLASSERT(_lastChild == 0);\r
         _firstChild = _lastChild = addThis;\r
 \r
         addThis->_prev = 0;\r
@@ -842,26 +842,26 @@ XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )
 }\r
 \r
 \r
-XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )\r
+XMLNode* XMLNode::InsertAfterChild(XMLNode* afterThis, XMLNode* addThis)\r
 {\r
-    TIXMLASSERT( addThis );\r
-    if ( addThis->_document != _document ) {\r
-        TIXMLASSERT( false );\r
+    TIXMLASSERT(addThis);\r
+    if (addThis->_document != _document) {\r
+        TIXMLASSERT(false);\r
         return 0;\r
     }\r
 \r
-    TIXMLASSERT( afterThis );\r
+    TIXMLASSERT(afterThis);\r
 \r
-    if ( afterThis->_parent != this ) {\r
-        TIXMLASSERT( false );\r
+    if (afterThis->_parent != this) {\r
+        TIXMLASSERT(false);\r
         return 0;\r
     }\r
 \r
-    if ( afterThis->_next == 0 ) {\r
+    if (afterThis->_next == 0) {\r
         // The last node or the only node.\r
-        return InsertEndChild( addThis );\r
+        return InsertEndChild(addThis);\r
     }\r
-    InsertChildPreamble( addThis );\r
+    InsertChildPreamble(addThis);\r
     addThis->_prev = afterThis;\r
     addThis->_next = afterThis->_next;\r
     afterThis->_next->_prev = addThis;\r
@@ -873,12 +873,12 @@ XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )
 \r
 \r
 \r
-const XMLElement* XMLNode::FirstChildElement( const char* name ) const\r
+const XMLElement* XMLNode::FirstChildElement(const char* name) const\r
 {\r
-    for( const XMLNode* node = _firstChild; node; node = node->_next ) {\r
+    for(const XMLNode* node = _firstChild; node; node = node->_next) {\r
         const XMLElement* element = node->ToElement();\r
-        if ( element ) {\r
-            if ( !name || XMLUtil::StringEqual( element->Name(), name ) ) {\r
+        if (element) {\r
+            if (!name || XMLUtil::StringEqual(element->Name(), name)) {\r
                 return element;\r
             }\r
         }\r
@@ -887,12 +887,12 @@ const XMLElement* XMLNode::FirstChildElement( const char* name ) const
 }\r
 \r
 \r
-const XMLElement* XMLNode::LastChildElement( const char* name ) const\r
+const XMLElement* XMLNode::LastChildElement(const char* name) const\r
 {\r
-    for( const XMLNode* node = _lastChild; node; node = node->_prev ) {\r
+    for(const XMLNode* node = _lastChild; node; node = node->_prev) {\r
         const XMLElement* element = node->ToElement();\r
-        if ( element ) {\r
-            if ( !name || XMLUtil::StringEqual( element->Name(), name ) ) {\r
+        if (element) {\r
+            if (!name || XMLUtil::StringEqual(element->Name(), name)) {\r
                 return element;\r
             }\r
         }\r
@@ -901,12 +901,12 @@ const XMLElement* XMLNode::LastChildElement( const char* name ) const
 }\r
 \r
 \r
-const XMLElement* XMLNode::NextSiblingElement( const char* name ) const\r
+const XMLElement* XMLNode::NextSiblingElement(const char* name) const\r
 {\r
-    for( const XMLNode* node = _next; node; node = node->_next ) {\r
+    for(const XMLNode* node = _next; node; node = node->_next) {\r
         const XMLElement* element = node->ToElement();\r
-        if ( element\r
-                && (!name || XMLUtil::StringEqual( name, element->Name() ))) {\r
+        if (element\r
+                && (!name || XMLUtil::StringEqual(name, element->Name()))) {\r
             return element;\r
         }\r
     }\r
@@ -914,12 +914,12 @@ const XMLElement* XMLNode::NextSiblingElement( const char* name ) const
 }\r
 \r
 \r
-const XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const\r
+const XMLElement* XMLNode::PreviousSiblingElement(const char* name) const\r
 {\r
-    for( const XMLNode* node = _prev; node; node = node->_prev ) {\r
+    for(const XMLNode* node = _prev; node; node = node->_prev) {\r
         const XMLElement* element = node->ToElement();\r
-        if ( element\r
-                && (!name || XMLUtil::StringEqual( name, element->Name() ))) {\r
+        if (element\r
+                && (!name || XMLUtil::StringEqual(name, element->Name()))) {\r
             return element;\r
         }\r
     }\r
@@ -927,7 +927,7 @@ const XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const
 }\r
 \r
 \r
-char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )\r
+char* XMLNode::ParseDeep(char* p, StrPair* parentEnd)\r
 {\r
     // This is a recursive method, but thinking about it "at the current level"\r
     // it is a pretty simple flat list:\r
@@ -946,152 +946,152 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
     // 'endTag' is the end tag for this node, it is returned by a call to a child.\r
     // 'parentEnd' is the end tag for the parent, which is filled in and returned.\r
 \r
-    while( p && *p ) {\r
+    while(p && *p) {\r
         XMLNode* node = 0;\r
 \r
-        p = _document->Identify( p, &node );\r
-        if ( node == 0 ) {\r
+        p = _document->Identify(p, &node);\r
+        if (node == 0) {\r
             break;\r
         }\r
 \r
         StrPair endTag;\r
-        p = node->ParseDeep( p, &endTag );\r
-        if ( !p ) {\r
-            DeleteNode( node );\r
-            if ( !_document->Error() ) {\r
-                _document->SetError( XML_ERROR_PARSING, 0, 0 );\r
+        p = node->ParseDeep(p, &endTag);\r
+        if (!p) {\r
+            DeleteNode(node);\r
+            if (!_document->Error()) {\r
+                _document->SetError(XML_ERROR_PARSING, 0, 0);\r
             }\r
             break;\r
         }\r
 \r
         XMLDeclaration* decl = node->ToDeclaration();\r
-        if ( decl ) {\r
+        if (decl) {\r
                 // A declaration can only be the first child of a document.\r
                 // Set error, if document already has children.\r
-                if ( !_document->NoChildren() ) {\r
-                        _document->SetError( XML_ERROR_PARSING_DECLARATION, decl->Value(), 0);\r
-                        DeleteNode( decl );\r
+                if (!_document->NoChildren()) {\r
+                        _document->SetError(XML_ERROR_PARSING_DECLARATION, decl->Value(), 0);\r
+                        DeleteNode(decl);\r
                         break;\r
                 }\r
         }\r
 \r
         XMLElement* ele = node->ToElement();\r
-        if ( ele ) {\r
+        if (ele) {\r
             // We read the end tag. Return it to the parent.\r
-            if ( ele->ClosingType() == XMLElement::CLOSING ) {\r
-                if ( parentEnd ) {\r
-                    ele->_value.TransferTo( parentEnd );\r
+            if (ele->ClosingType() == XMLElement::CLOSING) {\r
+                if (parentEnd) {\r
+                    ele->_value.TransferTo(parentEnd);\r
                 }\r
                 node->_memPool->SetTracked();   // created and then immediately deleted.\r
-                DeleteNode( node );\r
+                DeleteNode(node);\r
                 return p;\r
             }\r
 \r
             // Handle an end tag returned to this level.\r
             // And handle a bunch of annoying errors.\r
             bool mismatch = false;\r
-            if ( endTag.Empty() ) {\r
-                if ( ele->ClosingType() == XMLElement::OPEN ) {\r
+            if (endTag.Empty()) {\r
+                if (ele->ClosingType() == XMLElement::OPEN) {\r
                     mismatch = true;\r
                 }\r
             }\r
             else {\r
-                if ( ele->ClosingType() != XMLElement::OPEN ) {\r
+                if (ele->ClosingType() != XMLElement::OPEN) {\r
                     mismatch = true;\r
                 }\r
-                else if ( !XMLUtil::StringEqual( endTag.GetStr(), ele->Name() ) ) {\r
+                else if (!XMLUtil::StringEqual(endTag.GetStr(), ele->Name())) {\r
                     mismatch = true;\r
                 }\r
             }\r
-            if ( mismatch ) {\r
-                _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, ele->Name(), 0 );\r
-                DeleteNode( node );\r
+            if (mismatch) {\r
+                _document->SetError(XML_ERROR_MISMATCHED_ELEMENT, ele->Name(), 0);\r
+                DeleteNode(node);\r
                 break;\r
             }\r
         }\r
-        InsertEndChild( node );\r
+        InsertEndChild(node);\r
     }\r
     return 0;\r
 }\r
 \r
-void XMLNode::DeleteNode( XMLNode* node )\r
+void XMLNode::DeleteNode(XMLNode* node)\r
 {\r
-    if ( node == 0 ) {\r
+    if (node == 0) {\r
         return;\r
     }\r
     MemPool* pool = node->_memPool;\r
     node->~XMLNode();\r
-    pool->Free( node );\r
+    pool->Free(node);\r
 }\r
 \r
-void XMLNode::InsertChildPreamble( XMLNode* insertThis ) const\r
+void XMLNode::InsertChildPreamble(XMLNode* insertThis) const\r
 {\r
-    TIXMLASSERT( insertThis );\r
-    TIXMLASSERT( insertThis->_document == _document );\r
+    TIXMLASSERT(insertThis);\r
+    TIXMLASSERT(insertThis->_document == _document);\r
 \r
-    if ( insertThis->_parent )\r
-        insertThis->_parent->Unlink( insertThis );\r
+    if (insertThis->_parent)\r
+        insertThis->_parent->Unlink(insertThis);\r
     else\r
         insertThis->_memPool->SetTracked();\r
 }\r
 \r
 // --------- XMLText ---------- //\r
-char* XMLText::ParseDeep( char* p, StrPair* )\r
+char* XMLText::ParseDeep(char* p, StrPair*)\r
 {\r
     const char* start = p;\r
-    if ( this->CData() ) {\r
-        p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
-        if ( !p ) {\r
-            _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 );\r
+    if (this->CData()) {\r
+        p = _value.ParseText(p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION);\r
+        if (!p) {\r
+            _document->SetError(XML_ERROR_PARSING_CDATA, start, 0);\r
         }\r
         return p;\r
     }\r
     else {\r
         int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES;\r
-        if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) {\r
+        if (_document->WhitespaceMode() == COLLAPSE_WHITESPACE) {\r
             flags |= StrPair::NEEDS_WHITESPACE_COLLAPSING;\r
         }\r
 \r
-        p = _value.ParseText( p, "<", flags );\r
-        if ( p && *p ) {\r
+        p = _value.ParseText(p, "<", flags);\r
+        if (p && *p) {\r
             return p-1;\r
         }\r
-        if ( !p ) {\r
-            _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 );\r
+        if (!p) {\r
+            _document->SetError(XML_ERROR_PARSING_TEXT, start, 0);\r
         }\r
     }\r
     return 0;\r
 }\r
 \r
 \r
-XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const\r
+XMLNode* XMLText::ShallowClone(XMLDocument* doc) const\r
 {\r
-    if ( !doc ) {\r
+    if (!doc) {\r
         doc = _document;\r
     }\r
-    XMLText* text = doc->NewText( Value() );   // fixme: this will always allocate memory. Intern?\r
-    text->SetCData( this->CData() );\r
+    XMLText* text = doc->NewText(Value());     // fixme: this will always allocate memory. Intern?\r
+    text->SetCData(this->CData());\r
     return text;\r
 }\r
 \r
 \r
-bool XMLText::ShallowEqual( const XMLNode* compare ) const\r
+bool XMLText::ShallowEqual(const XMLNode* compare) const\r
 {\r
     const XMLText* text = compare->ToText();\r
-    return ( text && XMLUtil::StringEqual( text->Value(), Value() ) );\r
+    return (text && XMLUtil::StringEqual(text->Value(), Value()));\r
 }\r
 \r
 \r
-bool XMLText::Accept( XMLVisitor* visitor ) const\r
+bool XMLText::Accept(XMLVisitor* visitor) const\r
 {\r
-    TIXMLASSERT( visitor );\r
-    return visitor->Visit( *this );\r
+    TIXMLASSERT(visitor);\r
+    return visitor->Visit(*this);\r
 }\r
 \r
 \r
 // --------- XMLComment ---------- //\r
 \r
-XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc )\r
+XMLComment::XMLComment(XMLDocument* doc) : XMLNode(doc)\r
 {\r
 }\r
 \r
@@ -1101,96 +1101,96 @@ XMLComment::~XMLComment()
 }\r
 \r
 \r
-char* XMLComment::ParseDeep( char* p, StrPair* )\r
+char* XMLComment::ParseDeep(char* p, StrPair*)\r
 {\r
     // Comment parses as text.\r
     const char* start = p;\r
-    p = _value.ParseText( p, "-->", StrPair::COMMENT );\r
-    if ( p == 0 ) {\r
-        _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 );\r
+    p = _value.ParseText(p, "-->", StrPair::COMMENT);\r
+    if (p == 0) {\r
+        _document->SetError(XML_ERROR_PARSING_COMMENT, start, 0);\r
     }\r
     return p;\r
 }\r
 \r
 \r
-XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const\r
+XMLNode* XMLComment::ShallowClone(XMLDocument* doc) const\r
 {\r
-    if ( !doc ) {\r
+    if (!doc) {\r
         doc = _document;\r
     }\r
-    XMLComment* comment = doc->NewComment( Value() );  // fixme: this will always allocate memory. Intern?\r
+    XMLComment* comment = doc->NewComment(Value());    // fixme: this will always allocate memory. Intern?\r
     return comment;\r
 }\r
 \r
 \r
-bool XMLComment::ShallowEqual( const XMLNode* compare ) const\r
+bool XMLComment::ShallowEqual(const XMLNode* compare) const\r
 {\r
-    TIXMLASSERT( compare );\r
+    TIXMLASSERT(compare);\r
     const XMLComment* comment = compare->ToComment();\r
-    return ( comment && XMLUtil::StringEqual( comment->Value(), Value() ));\r
+    return (comment && XMLUtil::StringEqual(comment->Value(), Value()));\r
 }\r
 \r
 \r
-bool XMLComment::Accept( XMLVisitor* visitor ) const\r
+bool XMLComment::Accept(XMLVisitor* visitor) const\r
 {\r
-    TIXMLASSERT( visitor );\r
-    return visitor->Visit( *this );\r
+    TIXMLASSERT(visitor);\r
+    return visitor->Visit(*this);\r
 }\r
 \r
 \r
 // --------- XMLDeclaration ---------- //\r
 \r
-XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc )\r
+XMLDeclaration::XMLDeclaration(XMLDocument* doc) : XMLNode(doc)\r
 {\r
 }\r
 \r
 \r
 XMLDeclaration::~XMLDeclaration()\r
 {\r
-    //printf( "~XMLDeclaration\n" );\r
+    //printf("~XMLDeclaration\n");\r
 }\r
 \r
 \r
-char* XMLDeclaration::ParseDeep( char* p, StrPair* )\r
+char* XMLDeclaration::ParseDeep(char* p, StrPair*)\r
 {\r
     // Declaration parses as text.\r
     const char* start = p;\r
-    p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
-    if ( p == 0 ) {\r
-        _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 );\r
+    p = _value.ParseText(p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION);\r
+    if (p == 0) {\r
+        _document->SetError(XML_ERROR_PARSING_DECLARATION, start, 0);\r
     }\r
     return p;\r
 }\r
 \r
 \r
-XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const\r
+XMLNode* XMLDeclaration::ShallowClone(XMLDocument* doc) const\r
 {\r
-    if ( !doc ) {\r
+    if (!doc) {\r
         doc = _document;\r
     }\r
-    XMLDeclaration* dec = doc->NewDeclaration( Value() );      // fixme: this will always allocate memory. Intern?\r
+    XMLDeclaration* dec = doc->NewDeclaration(Value());        // fixme: this will always allocate memory. Intern?\r
     return dec;\r
 }\r
 \r
 \r
-bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const\r
+bool XMLDeclaration::ShallowEqual(const XMLNode* compare) const\r
 {\r
-    TIXMLASSERT( compare );\r
+    TIXMLASSERT(compare);\r
     const XMLDeclaration* declaration = compare->ToDeclaration();\r
-    return ( declaration && XMLUtil::StringEqual( declaration->Value(), Value() ));\r
+    return (declaration && XMLUtil::StringEqual(declaration->Value(), Value()));\r
 }\r
 \r
 \r
 \r
-bool XMLDeclaration::Accept( XMLVisitor* visitor ) const\r
+bool XMLDeclaration::Accept(XMLVisitor* visitor) const\r
 {\r
-    TIXMLASSERT( visitor );\r
-    return visitor->Visit( *this );\r
+    TIXMLASSERT(visitor);\r
+    return visitor->Visit(*this);\r
 }\r
 \r
 // --------- XMLUnknown ---------- //\r
 \r
-XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc )\r
+XMLUnknown::XMLUnknown(XMLDocument* doc) : XMLNode(doc)\r
 {\r
 }\r
 \r
@@ -1200,41 +1200,41 @@ XMLUnknown::~XMLUnknown()
 }\r
 \r
 \r
-char* XMLUnknown::ParseDeep( char* p, StrPair* )\r
+char* XMLUnknown::ParseDeep(char* p, StrPair*)\r
 {\r
     // Unknown parses as text.\r
     const char* start = p;\r
 \r
-    p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
-    if ( !p ) {\r
-        _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 );\r
+    p = _value.ParseText(p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION);\r
+    if (!p) {\r
+        _document->SetError(XML_ERROR_PARSING_UNKNOWN, start, 0);\r
     }\r
     return p;\r
 }\r
 \r
 \r
-XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const\r
+XMLNode* XMLUnknown::ShallowClone(XMLDocument* doc) const\r
 {\r
-    if ( !doc ) {\r
+    if (!doc) {\r
         doc = _document;\r
     }\r
-    XMLUnknown* text = doc->NewUnknown( Value() );     // fixme: this will always allocate memory. Intern?\r
+    XMLUnknown* text = doc->NewUnknown(Value());       // fixme: this will always allocate memory. Intern?\r
     return text;\r
 }\r
 \r
 \r
-bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const\r
+bool XMLUnknown::ShallowEqual(const XMLNode* compare) const\r
 {\r
-    TIXMLASSERT( compare );\r
+    TIXMLASSERT(compare);\r
     const XMLUnknown* unknown = compare->ToUnknown();\r
-    return ( unknown && XMLUtil::StringEqual( unknown->Value(), Value() ));\r
+    return (unknown && XMLUtil::StringEqual(unknown->Value(), Value()));\r
 }\r
 \r
 \r
-bool XMLUnknown::Accept( XMLVisitor* visitor ) const\r
+bool XMLUnknown::Accept(XMLVisitor* visitor) const\r
 {\r
-    TIXMLASSERT( visitor );\r
-    return visitor->Visit( *this );\r
+    TIXMLASSERT(visitor);\r
+    return visitor->Visit(*this);\r
 }\r
 \r
 // --------- XMLAttribute ---------- //\r
@@ -1249,163 +1249,163 @@ const char* XMLAttribute::Value() const
     return _value.GetStr();\r
 }\r
 \r
-char* XMLAttribute::ParseDeep( char* p, bool processEntities )\r
+char* XMLAttribute::ParseDeep(char* p, bool processEntities)\r
 {\r
     // Parse using the name rules: bug fix, was using ParseText before\r
-    p = _name.ParseName( p );\r
-    if ( !p || !*p ) {\r
+    p = _name.ParseName(p);\r
+    if (!p || !*p) {\r
         return 0;\r
     }\r
 \r
     // Skip white space before =\r
-    p = XMLUtil::SkipWhiteSpace( p );\r
-    if ( *p != '=' ) {\r
+    p = XMLUtil::SkipWhiteSpace(p);\r
+    if (*p != '=') {\r
         return 0;\r
     }\r
 \r
     ++p;       // move up to opening quote\r
-    p = XMLUtil::SkipWhiteSpace( p );\r
-    if ( *p != '\"' && *p != '\'' ) {\r
+    p = XMLUtil::SkipWhiteSpace(p);\r
+    if (*p != '\"' && *p != '\'') {\r
         return 0;\r
     }\r
 \r
     char endTag[2] = { *p, 0 };\r
     ++p;       // move past opening quote\r
 \r
-    p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES );\r
+    p = _value.ParseText(p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES);\r
     return p;\r
 }\r
 \r
 \r
-void XMLAttribute::SetName( const char* n )\r
+void XMLAttribute::SetName(const char* n)\r
 {\r
-    _name.SetStr( n );\r
+    _name.SetStr(n);\r
 }\r
 \r
 \r
-XMLError XMLAttribute::QueryIntValue( int* value ) const\r
+XMLError XMLAttribute::QueryIntValue(int* value) const\r
 {\r
-    if ( XMLUtil::ToInt( Value(), value )) {\r
+    if (XMLUtil::ToInt(Value(), value)) {\r
         return XML_NO_ERROR;\r
     }\r
     return XML_WRONG_ATTRIBUTE_TYPE;\r
 }\r
 \r
 \r
-XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const\r
+XMLError XMLAttribute::QueryUnsignedValue(unsigned int* value) const\r
 {\r
-    if ( XMLUtil::ToUnsigned( Value(), value )) {\r
+    if (XMLUtil::ToUnsigned(Value(), value)) {\r
         return XML_NO_ERROR;\r
     }\r
     return XML_WRONG_ATTRIBUTE_TYPE;\r
 }\r
 \r
 \r
-XMLError XMLAttribute::QueryBoolValue( bool* value ) const\r
+XMLError XMLAttribute::QueryBoolValue(bool* value) const\r
 {\r
-    if ( XMLUtil::ToBool( Value(), value )) {\r
+    if (XMLUtil::ToBool(Value(), value)) {\r
         return XML_NO_ERROR;\r
     }\r
     return XML_WRONG_ATTRIBUTE_TYPE;\r
 }\r
 \r
 \r
-XMLError XMLAttribute::QueryFloatValue( float* value ) const\r
+XMLError XMLAttribute::QueryFloatValue(float* value) const\r
 {\r
-    if ( XMLUtil::ToFloat( Value(), value )) {\r
+    if (XMLUtil::ToFloat(Value(), value)) {\r
         return XML_NO_ERROR;\r
     }\r
     return XML_WRONG_ATTRIBUTE_TYPE;\r
 }\r
 \r
 \r
-XMLError XMLAttribute::QueryDoubleValue( double* value ) const\r
+XMLError XMLAttribute::QueryDoubleValue(double* value) const\r
 {\r
-    if ( XMLUtil::ToDouble( Value(), value )) {\r
+    if (XMLUtil::ToDouble(Value(), value)) {\r
         return XML_NO_ERROR;\r
     }\r
     return XML_WRONG_ATTRIBUTE_TYPE;\r
 }\r
 \r
 \r
-void XMLAttribute::SetAttribute( const char* v )\r
+void XMLAttribute::SetAttribute(const char* v)\r
 {\r
-    _value.SetStr( v );\r
+    _value.SetStr(v);\r
 }\r
 \r
 \r
-void XMLAttribute::SetAttribute( int v )\r
+void XMLAttribute::SetAttribute(int v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    _value.SetStr( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    _value.SetStr(buf);\r
 }\r
 \r
 \r
-void XMLAttribute::SetAttribute( unsigned v )\r
+void XMLAttribute::SetAttribute(unsigned v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    _value.SetStr( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    _value.SetStr(buf);\r
 }\r
 \r
 \r
-void XMLAttribute::SetAttribute( bool v )\r
+void XMLAttribute::SetAttribute(bool v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    _value.SetStr( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    _value.SetStr(buf);\r
 }\r
 \r
-void XMLAttribute::SetAttribute( double v )\r
+void XMLAttribute::SetAttribute(double v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    _value.SetStr( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    _value.SetStr(buf);\r
 }\r
 \r
-void XMLAttribute::SetAttribute( float v )\r
+void XMLAttribute::SetAttribute(float v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    _value.SetStr( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    _value.SetStr(buf);\r
 }\r
 \r
 \r
 // --------- XMLElement ---------- //\r
-XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ),\r
-    _closingType( 0 ),\r
-    _rootAttribute( 0 )\r
+XMLElement::XMLElement(XMLDocument* doc) : XMLNode(doc),\r
+    _closingType(0),\r
+    _rootAttribute(0)\r
 {\r
 }\r
 \r
 \r
 XMLElement::~XMLElement()\r
 {\r
-    while( _rootAttribute ) {\r
+    while(_rootAttribute) {\r
         XMLAttribute* next = _rootAttribute->_next;\r
-        DeleteAttribute( _rootAttribute );\r
+        DeleteAttribute(_rootAttribute);\r
         _rootAttribute = next;\r
     }\r
 }\r
 \r
 \r
-const XMLAttribute* XMLElement::FindAttribute( const char* name ) const\r
+const XMLAttribute* XMLElement::FindAttribute(const char* name) const\r
 {\r
-    for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) {\r
-        if ( XMLUtil::StringEqual( a->Name(), name ) ) {\r
+    for(XMLAttribute* a = _rootAttribute; a; a = a->_next) {\r
+        if (XMLUtil::StringEqual(a->Name(), name)) {\r
             return a;\r
         }\r
     }\r
     return 0;\r
 }\r
 \r
-std::string XMLElement::StrAttribute( const char* name, const char* value ) const\r
+std::string XMLElement::StrAttribute(const char* name, const char* value) const\r
 {\r
        std::string str;\r
-    const XMLAttribute* a = FindAttribute( name );\r
-    if ( a ) {\r
-               if ( !value || XMLUtil::StringEqual( a->Value(), value )) {\r
+    const XMLAttribute* a = FindAttribute(name);\r
+    if (a) {\r
+               if (!value || XMLUtil::StringEqual(a->Value(), value)) {\r
                        str = a->Value();\r
                        return str;\r
                }\r
@@ -1413,13 +1413,13 @@ std::string XMLElement::StrAttribute( const char* name, const char* value ) cons
     return str;\r
 }\r
 \r
-const char* XMLElement::Attribute( const char* name, const char* value ) const\r
+const char* XMLElement::Attribute(const char* name, const char* value) const\r
 {\r
-    const XMLAttribute* a = FindAttribute( name );\r
-    if ( !a ) {\r
+    const XMLAttribute* a = FindAttribute(name);\r
+    if (!a) {\r
         return 0;\r
     }\r
-    if ( !value || XMLUtil::StringEqual( a->Value(), value )) {\r
+    if (!value || XMLUtil::StringEqual(a->Value(), value)) {\r
         return a->Value();\r
     }\r
     return 0;\r
@@ -1427,69 +1427,69 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const
 \r
 const char* XMLElement::GetText() const\r
 {\r
-    if ( FirstChild() && FirstChild()->ToText() ) {\r
+    if (FirstChild() && FirstChild()->ToText()) {\r
         return FirstChild()->Value();\r
     }\r
     return 0;\r
 }\r
 \r
 \r
-void   XMLElement::SetText( const char* inText )\r
+void   XMLElement::SetText(const char* inText)\r
 {\r
-       if ( FirstChild() && FirstChild()->ToText() )\r
-               FirstChild()->SetValue( inText );\r
+       if (FirstChild() && FirstChild()->ToText())\r
+               FirstChild()->SetValue(inText);\r
        else {\r
-               XMLText*        theText = GetDocument()->NewText( inText );\r
-               InsertFirstChild( theText );\r
+               XMLText*        theText = GetDocument()->NewText(inText);\r
+               InsertFirstChild(theText);\r
        }\r
 }\r
 \r
 \r
-void XMLElement::SetText( int v \r
+void XMLElement::SetText(int v\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    SetText( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    SetText(buf);\r
 }\r
 \r
 \r
-void XMLElement::SetText( unsigned v \r
+void XMLElement::SetText(unsigned v\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    SetText( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    SetText(buf);\r
 }\r
 \r
 \r
-void XMLElement::SetText( bool v \r
+void XMLElement::SetText(bool v\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    SetText( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    SetText(buf);\r
 }\r
 \r
 \r
-void XMLElement::SetText( float v \r
+void XMLElement::SetText(float v\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    SetText( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    SetText(buf);\r
 }\r
 \r
 \r
-void XMLElement::SetText( double v \r
+void XMLElement::SetText(double v\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    SetText( buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    SetText(buf);\r
 }\r
 \r
 \r
-XMLError XMLElement::QueryIntText( int* ival ) const\r
+XMLError XMLElement::QueryIntText(int* ival) const\r
 {\r
-    if ( FirstChild() && FirstChild()->ToText() ) {\r
+    if (FirstChild() && FirstChild()->ToText()) {\r
         const char* t = FirstChild()->Value();\r
-        if ( XMLUtil::ToInt( t, ival ) ) {\r
+        if (XMLUtil::ToInt(t, ival)) {\r
             return XML_SUCCESS;\r
         }\r
         return XML_CAN_NOT_CONVERT_TEXT;\r
@@ -1498,11 +1498,11 @@ XMLError XMLElement::QueryIntText( int* ival ) const
 }\r
 \r
 \r
-XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const\r
+XMLError XMLElement::QueryUnsignedText(unsigned* uval) const\r
 {\r
-    if ( FirstChild() && FirstChild()->ToText() ) {\r
+    if (FirstChild() && FirstChild()->ToText()) {\r
         const char* t = FirstChild()->Value();\r
-        if ( XMLUtil::ToUnsigned( t, uval ) ) {\r
+        if (XMLUtil::ToUnsigned(t, uval)) {\r
             return XML_SUCCESS;\r
         }\r
         return XML_CAN_NOT_CONVERT_TEXT;\r
@@ -1511,11 +1511,11 @@ XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const
 }\r
 \r
 \r
-XMLError XMLElement::QueryBoolText( bool* bval ) const\r
+XMLError XMLElement::QueryBoolText(bool* bval) const\r
 {\r
-    if ( FirstChild() && FirstChild()->ToText() ) {\r
+    if (FirstChild() && FirstChild()->ToText()) {\r
         const char* t = FirstChild()->Value();\r
-        if ( XMLUtil::ToBool( t, bval ) ) {\r
+        if (XMLUtil::ToBool(t, bval)) {\r
             return XML_SUCCESS;\r
         }\r
         return XML_CAN_NOT_CONVERT_TEXT;\r
@@ -1524,11 +1524,11 @@ XMLError XMLElement::QueryBoolText( bool* bval ) const
 }\r
 \r
 \r
-XMLError XMLElement::QueryDoubleText( double* dval ) const\r
+XMLError XMLElement::QueryDoubleText(double* dval) const\r
 {\r
-    if ( FirstChild() && FirstChild()->ToText() ) {\r
+    if (FirstChild() && FirstChild()->ToText()) {\r
         const char* t = FirstChild()->Value();\r
-        if ( XMLUtil::ToDouble( t, dval ) ) {\r
+        if (XMLUtil::ToDouble(t, dval)) {\r
             return XML_SUCCESS;\r
         }\r
         return XML_CAN_NOT_CONVERT_TEXT;\r
@@ -1537,11 +1537,11 @@ XMLError XMLElement::QueryDoubleText( double* dval ) const
 }\r
 \r
 \r
-XMLError XMLElement::QueryFloatText( float* fval ) const\r
+XMLError XMLElement::QueryFloatText(float* fval) const\r
 {\r
-    if ( FirstChild() && FirstChild()->ToText() ) {\r
+    if (FirstChild() && FirstChild()->ToText()) {\r
         const char* t = FirstChild()->Value();\r
-        if ( XMLUtil::ToFloat( t, fval ) ) {\r
+        if (XMLUtil::ToFloat(t, fval)) {\r
             return XML_SUCCESS;\r
         }\r
         return XML_CAN_NOT_CONVERT_TEXT;\r
@@ -1551,46 +1551,46 @@ XMLError XMLElement::QueryFloatText( float* fval ) const
 \r
 \r
 \r
-XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name )\r
+XMLAttribute* XMLElement::FindOrCreateAttribute(const char* name)\r
 {\r
     XMLAttribute* last = 0;\r
     XMLAttribute* attrib = 0;\r
-    for( attrib = _rootAttribute;\r
+    for(attrib = _rootAttribute;\r
             attrib;\r
-            last = attrib, attrib = attrib->_next ) {\r
-        if ( XMLUtil::StringEqual( attrib->Name(), name ) ) {\r
+            last = attrib, attrib = attrib->_next) {\r
+        if (XMLUtil::StringEqual(attrib->Name(), name)) {\r
             break;\r
         }\r
     }\r
-    if ( !attrib ) {\r
-        TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\r
-        attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\r
+    if (!attrib) {\r
+        TIXMLASSERT(sizeof(XMLAttribute) == _document->_attributePool.ItemSize());\r
+        attrib = new (_document->_attributePool.Alloc()) XMLAttribute();\r
         attrib->_memPool = &_document->_attributePool;\r
-        if ( last ) {\r
+        if (last) {\r
             last->_next = attrib;\r
         }\r
         else {\r
             _rootAttribute = attrib;\r
         }\r
-        attrib->SetName( name );\r
+        attrib->SetName(name);\r
         attrib->_memPool->SetTracked(); // always created and linked.\r
     }\r
     return attrib;\r
 }\r
 \r
 \r
-void XMLElement::DeleteAttribute( const char* name )\r
+void XMLElement::DeleteAttribute(const char* name)\r
 {\r
     XMLAttribute* prev = 0;\r
-    for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) {\r
-        if ( XMLUtil::StringEqual( name, a->Name() ) ) {\r
-            if ( prev ) {\r
+    for(XMLAttribute* a=_rootAttribute; a; a=a->_next) {\r
+        if (XMLUtil::StringEqual(name, a->Name())) {\r
+            if (prev) {\r
                 prev->_next = a->_next;\r
             }\r
             else {\r
                 _rootAttribute = a->_next;\r
             }\r
-            DeleteAttribute( a );\r
+            DeleteAttribute(a);\r
             break;\r
         }\r
         prev = a;\r
@@ -1598,30 +1598,30 @@ void XMLElement::DeleteAttribute( const char* name )
 }\r
 \r
 \r
-char* XMLElement::ParseAttributes( char* p )\r
+char* XMLElement::ParseAttributes(char* p)\r
 {\r
     const char* start = p;\r
     XMLAttribute* prevAttribute = 0;\r
 \r
     // Read the attributes.\r
-    while( p ) {\r
-        p = XMLUtil::SkipWhiteSpace( p );\r
-        if ( !(*p) ) {\r
-            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() );\r
+    while(p) {\r
+        p = XMLUtil::SkipWhiteSpace(p);\r
+        if (!(*p)) {\r
+            _document->SetError(XML_ERROR_PARSING_ELEMENT, start, Name());\r
             return 0;\r
         }\r
 \r
         // attribute.\r
-        if (XMLUtil::IsNameStartChar( *p ) ) {\r
-            TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\r
-            XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\r
+        if (XMLUtil::IsNameStartChar(*p)) {\r
+            TIXMLASSERT(sizeof(XMLAttribute) == _document->_attributePool.ItemSize());\r
+            XMLAttribute* attrib = new (_document->_attributePool.Alloc()) XMLAttribute();\r
             attrib->_memPool = &_document->_attributePool;\r
                        attrib->_memPool->SetTracked();\r
 \r
-            p = attrib->ParseDeep( p, _document->ProcessEntities() );\r
-            if ( !p || Attribute( attrib->Name() ) ) {\r
-                DeleteAttribute( attrib );\r
-                _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p );\r
+            p = attrib->ParseDeep(p, _document->ProcessEntities());\r
+            if (!p || Attribute(attrib->Name())) {\r
+                DeleteAttribute(attrib);\r
+                _document->SetError(XML_ERROR_PARSING_ATTRIBUTE, start, p);\r
                 return 0;\r
             }\r
             // There is a minor bug here: if the attribute in the source xml\r
@@ -1629,7 +1629,7 @@ char* XMLElement::ParseAttributes( char* p )
             // attribute will be doubly added. However, tracking the 'prevAttribute'\r
             // avoids re-scanning the attribute list. Preferring performance for\r
             // now, may reconsider in the future.\r
-            if ( prevAttribute ) {\r
+            if (prevAttribute) {\r
                 prevAttribute->_next = attrib;\r
             }\r
             else {\r
@@ -1638,96 +1638,96 @@ char* XMLElement::ParseAttributes( char* p )
             prevAttribute = attrib;\r
         }\r
         // end of the tag\r
-        else if ( *p == '>' ) {\r
+        else if (*p == '>') {\r
             ++p;\r
             break;\r
         }\r
         // end of the tag\r
-        else if ( *p == '/' && *(p+1) == '>' ) {\r
+        else if (*p == '/' && *(p+1) == '>') {\r
             _closingType = CLOSED;\r
             return p+2;        // done; sealed element.\r
         }\r
         else {\r
-            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p );\r
+            _document->SetError(XML_ERROR_PARSING_ELEMENT, start, p);\r
             return 0;\r
         }\r
     }\r
     return p;\r
 }\r
 \r
-void XMLElement::DeleteAttribute( XMLAttribute* attribute )\r
+void XMLElement::DeleteAttribute(XMLAttribute* attribute)\r
 {\r
-    if ( attribute == 0 ) {\r
+    if (attribute == 0) {\r
         return;\r
     }\r
     MemPool* pool = attribute->_memPool;\r
     attribute->~XMLAttribute();\r
-    pool->Free( attribute );\r
+    pool->Free(attribute);\r
 }\r
 \r
 //\r
 //     <ele></ele>\r
 //     <ele>foo<b>bar</b></ele>\r
 //\r
-char* XMLElement::ParseDeep( char* p, StrPair* strPair )\r
+char* XMLElement::ParseDeep(char* p, StrPair* strPair)\r
 {\r
     // Read the element name.\r
-    p = XMLUtil::SkipWhiteSpace( p );\r
+    p = XMLUtil::SkipWhiteSpace(p);\r
 \r
     // The closing element is the </element> form. It is\r
     // parsed just like a regular element then deleted from\r
     // the DOM.\r
-    if ( *p == '/' ) {\r
+    if (*p == '/') {\r
         _closingType = CLOSING;\r
         ++p;\r
     }\r
 \r
-    p = _value.ParseName( p );\r
-    if ( _value.Empty() ) {\r
+    p = _value.ParseName(p);\r
+    if (_value.Empty()) {\r
         return 0;\r
     }\r
 \r
-    p = ParseAttributes( p );\r
-    if ( !p || !*p || _closingType ) {\r
+    p = ParseAttributes(p);\r
+    if (!p || !*p || _closingType) {\r
         return p;\r
     }\r
 \r
-    p = XMLNode::ParseDeep( p, strPair );\r
+    p = XMLNode::ParseDeep(p, strPair);\r
     return p;\r
 }\r
 \r
 \r
 \r
-XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const\r
+XMLNode* XMLElement::ShallowClone(XMLDocument* doc) const\r
 {\r
-    if ( !doc ) {\r
+    if (!doc) {\r
         doc = _document;\r
     }\r
-    XMLElement* element = doc->NewElement( Value() );                                  // fixme: this will always allocate memory. Intern?\r
-    for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) {\r
-        element->SetAttribute( a->Name(), a->Value() );                                        // fixme: this will always allocate memory. Intern?\r
+    XMLElement* element = doc->NewElement(Value());                                    // fixme: this will always allocate memory. Intern?\r
+    for(const XMLAttribute* a=FirstAttribute(); a; a=a->Next()) {\r
+        element->SetAttribute(a->Name(), a->Value());                                  // fixme: this will always allocate memory. Intern?\r
     }\r
     return element;\r
 }\r
 \r
 \r
-bool XMLElement::ShallowEqual( const XMLNode* compare ) const\r
+bool XMLElement::ShallowEqual(const XMLNode* compare) const\r
 {\r
-    TIXMLASSERT( compare );\r
+    TIXMLASSERT(compare);\r
     const XMLElement* other = compare->ToElement();\r
-    if ( other && XMLUtil::StringEqual( other->Name(), Name() )) {\r
+    if (other && XMLUtil::StringEqual(other->Name(), Name())) {\r
 \r
         const XMLAttribute* a=FirstAttribute();\r
         const XMLAttribute* b=other->FirstAttribute();\r
 \r
-        while ( a && b ) {\r
-            if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) {\r
+        while (a && b) {\r
+            if (!XMLUtil::StringEqual(a->Value(), b->Value())) {\r
                 return false;\r
             }\r
             a = a->Next();\r
             b = b->Next();\r
         }\r
-        if ( a || b ) {\r
+        if (a || b) {\r
             // different count\r
             return false;\r
         }\r
@@ -1737,17 +1737,17 @@ bool XMLElement::ShallowEqual( const XMLNode* compare ) const
 }\r
 \r
 \r
-bool XMLElement::Accept( XMLVisitor* visitor ) const\r
+bool XMLElement::Accept(XMLVisitor* visitor) const\r
 {\r
-    TIXMLASSERT( visitor );\r
-    if ( visitor->VisitEnter( *this, _rootAttribute ) ) {\r
-        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\r
-            if ( !node->Accept( visitor ) ) {\r
+    TIXMLASSERT(visitor);\r
+    if (visitor->VisitEnter(*this, _rootAttribute)) {\r
+        for (const XMLNode* node=FirstChild(); node; node=node->NextSibling()) {\r
+            if (!node->Accept(visitor)) {\r
                 break;\r
             }\r
         }\r
     }\r
-    return visitor->VisitExit( *this );\r
+    return visitor->VisitExit(*this);\r
 }\r
 \r
 \r
@@ -1778,15 +1778,15 @@ const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = {
 };\r
 \r
 \r
-XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) :\r
-    XMLNode( 0 ),\r
-    _writeBOM( false ),\r
-    _processEntities( processEntities ),\r
-    _errorID( XML_NO_ERROR ),\r
-    _whitespace( whitespace ),\r
-    _errorStr1( 0 ),\r
-    _errorStr2( 0 ),\r
-    _charBuffer( 0 )\r
+XMLDocument::XMLDocument(bool processEntities, Whitespace whitespace) :\r
+    XMLNode(0),\r
+    _writeBOM(false),\r
+    _processEntities(processEntities),\r
+    _errorID(XML_NO_ERROR),\r
+    _whitespace(whitespace),\r
+    _errorStr1(0),\r
+    _errorStr2(0),\r
+    _charBuffer(0)\r
 {\r
     // avoid VC++ C4355 warning about 'this' in initializer list (C4355 is off by default in VS2012+)\r
     _document = this;\r
@@ -1814,93 +1814,93 @@ void XMLDocument::Clear()
     _charBuffer = 0;\r
 \r
 #if 0\r
-    _textPool.Trace( "text" );\r
-    _elementPool.Trace( "element" );\r
-    _commentPool.Trace( "comment" );\r
-    _attributePool.Trace( "attribute" );\r
+    _textPool.Trace("text");\r
+    _elementPool.Trace("element");\r
+    _commentPool.Trace("comment");\r
+    _attributePool.Trace("attribute");\r
 #endif\r
     \r
 #ifdef DEBUG\r
-    if ( !hadError ) {\r
-        TIXMLASSERT( _elementPool.CurrentAllocs()   == _elementPool.Untracked() );\r
-        TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );\r
-        TIXMLASSERT( _textPool.CurrentAllocs()      == _textPool.Untracked() );\r
-        TIXMLASSERT( _commentPool.CurrentAllocs()   == _commentPool.Untracked() );\r
+    if (!hadError) {\r
+        TIXMLASSERT(_elementPool.CurrentAllocs()   == _elementPool.Untracked());\r
+        TIXMLASSERT(_attributePool.CurrentAllocs() == _attributePool.Untracked());\r
+        TIXMLASSERT(_textPool.CurrentAllocs()      == _textPool.Untracked());\r
+        TIXMLASSERT(_commentPool.CurrentAllocs()   == _commentPool.Untracked());\r
     }\r
 #endif\r
 }\r
 \r
 \r
-XMLElement* XMLDocument::NewElement( const char* name )\r
+XMLElement* XMLDocument::NewElement(const char* name)\r
 {\r
-    TIXMLASSERT( sizeof( XMLElement ) == _elementPool.ItemSize() );\r
-    XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this );\r
+    TIXMLASSERT(sizeof(XMLElement) == _elementPool.ItemSize());\r
+    XMLElement* ele = new (_elementPool.Alloc()) XMLElement(this);\r
     ele->_memPool = &_elementPool;\r
-    ele->SetName( name );\r
+    ele->SetName(name);\r
     return ele;\r
 }\r
 \r
 \r
-XMLComment* XMLDocument::NewComment( const char* str )\r
+XMLComment* XMLDocument::NewComment(const char* str)\r
 {\r
-    TIXMLASSERT( sizeof( XMLComment ) == _commentPool.ItemSize() );\r
-    XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this );\r
+    TIXMLASSERT(sizeof(XMLComment) == _commentPool.ItemSize());\r
+    XMLComment* comment = new (_commentPool.Alloc()) XMLComment(this);\r
     comment->_memPool = &_commentPool;\r
-    comment->SetValue( str );\r
+    comment->SetValue(str);\r
     return comment;\r
 }\r
 \r
 \r
-XMLText* XMLDocument::NewText( const char* str )\r
+XMLText* XMLDocument::NewText(const char* str)\r
 {\r
-    TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
-    XMLText* text = new (_textPool.Alloc()) XMLText( this );\r
+    TIXMLASSERT(sizeof(XMLText) == _textPool.ItemSize());\r
+    XMLText* text = new (_textPool.Alloc()) XMLText(this);\r
     text->_memPool = &_textPool;\r
-    text->SetValue( str );\r
+    text->SetValue(str);\r
     return text;\r
 }\r
 \r
 \r
-XMLDeclaration* XMLDocument::NewDeclaration( const char* str )\r
+XMLDeclaration* XMLDocument::NewDeclaration(const char* str)\r
 {\r
-    TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );\r
-    XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this );\r
+    TIXMLASSERT(sizeof(XMLDeclaration) == _commentPool.ItemSize());\r
+    XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration(this);\r
     dec->_memPool = &_commentPool;\r
-    dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" );\r
+    dec->SetValue(str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"");\r
     return dec;\r
 }\r
 \r
 \r
-XMLUnknown* XMLDocument::NewUnknown( const char* str )\r
+XMLUnknown* XMLDocument::NewUnknown(const char* str)\r
 {\r
-    TIXMLASSERT( sizeof( XMLUnknown ) == _commentPool.ItemSize() );\r
-    XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this );\r
+    TIXMLASSERT(sizeof(XMLUnknown) == _commentPool.ItemSize());\r
+    XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown(this);\r
     unk->_memPool = &_commentPool;\r
-    unk->SetValue( str );\r
+    unk->SetValue(str);\r
     return unk;\r
 }\r
 \r
-static FILE* callfopen( const char* filepath, const char* mode )\r
+static FILE* callfopen(const char* filepath, const char* mode)\r
 {\r
-    TIXMLASSERT( filepath );\r
-    TIXMLASSERT( mode );\r
-#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\r
+    TIXMLASSERT(filepath);\r
+    TIXMLASSERT(mode);\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && (!defined WINCE)\r
     FILE* fp = 0;\r
-    errno_t err = fopen_s( &fp, filepath, mode );\r
-    if ( err ) {\r
+    errno_t err = fopen_s(&fp, filepath, mode);\r
+    if (err) {\r
         return 0;\r
     }\r
 #else\r
-    FILE* fp = fopen( filepath, mode );\r
+    FILE* fp = fopen(filepath, mode);\r
 #endif\r
     return fp;\r
 }\r
     \r
-void XMLDocument::DeleteNode( XMLNode* node )  {\r
-    TIXMLASSERT( node );\r
-    TIXMLASSERT(node->_document == this );\r
+void XMLDocument::DeleteNode(XMLNode* node)    {\r
+    TIXMLASSERT(node);\r
+    TIXMLASSERT(node->_document == this);\r
     if (node->_parent) {\r
-        node->_parent->DeleteChild( node );\r
+        node->_parent->DeleteChild(node);\r
     }\r
     else {\r
         // Isn't in the tree.\r
@@ -1914,16 +1914,16 @@ void XMLDocument::DeleteNode( XMLNode* node )   {
 }\r
 \r
 \r
-XMLError XMLDocument::LoadFile( const char* filename )\r
+XMLError XMLDocument::LoadFile(const char* filename)\r
 {\r
     Clear();\r
-    FILE* fp = callfopen( filename, "rb" );\r
-    if ( !fp ) {\r
-        SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 );\r
+    FILE* fp = callfopen(filename, "rb");\r
+    if (!fp) {\r
+        SetError(XML_ERROR_FILE_NOT_FOUND, filename, 0);\r
         return _errorID;\r
     }\r
-    LoadFile( fp );\r
-    fclose( fp );\r
+    LoadFile(fp);\r
+    fclose(fp);\r
     return _errorID;\r
 }\r
 \r
@@ -1936,53 +1936,53 @@ XMLError XMLDocument::LoadFile( const char* filename )
 template\r
 <bool = (sizeof(unsigned long) >= sizeof(size_t))>\r
 struct LongFitsIntoSizeTMinusOne {\r
-    static bool Fits( unsigned long value )\r
+    static bool Fits(unsigned long value)\r
     {\r
         return value < (size_t)-1;\r
     }\r
 };\r
 \r
 template <>\r
-bool LongFitsIntoSizeTMinusOne<false>::Fits( unsigned long /*value*/ )\r
+bool LongFitsIntoSizeTMinusOne<false>::Fits(unsigned long /*value*/)\r
 {\r
     return true;\r
 }\r
 \r
-XMLError XMLDocument::LoadFile( FILE* fp )\r
+XMLError XMLDocument::LoadFile(FILE* fp)\r
 {\r
     Clear();\r
 \r
-    fseek( fp, 0, SEEK_SET );\r
-    if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) {\r
-        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+    fseek(fp, 0, SEEK_SET);\r
+    if (fgetc(fp) == EOF && ferror(fp) != 0) {\r
+        SetError(XML_ERROR_FILE_READ_ERROR, 0, 0);\r
         return _errorID;\r
     }\r
 \r
-    fseek( fp, 0, SEEK_END );\r
-    const long filelength = ftell( fp );\r
-    fseek( fp, 0, SEEK_SET );\r
-    if ( filelength == -1L ) {\r
-        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+    fseek(fp, 0, SEEK_END);\r
+    const long filelength = ftell(fp);\r
+    fseek(fp, 0, SEEK_SET);\r
+    if (filelength == -1L) {\r
+        SetError(XML_ERROR_FILE_READ_ERROR, 0, 0);\r
         return _errorID;\r
     }\r
 \r
-    if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) {\r
+    if (!LongFitsIntoSizeTMinusOne<>::Fits(filelength)) {\r
         // Cannot handle files which won't fit in buffer together with null terminator\r
-        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        SetError(XML_ERROR_FILE_READ_ERROR, 0, 0);\r
         return _errorID;\r
     }\r
 \r
-    if ( filelength == 0 ) {\r
-        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+    if (filelength == 0) {\r
+        SetError(XML_ERROR_EMPTY_DOCUMENT, 0, 0);\r
         return _errorID;\r
     }\r
 \r
     const size_t size = filelength;\r
-    TIXMLASSERT( _charBuffer == 0 );\r
+    TIXMLASSERT(_charBuffer == 0);\r
     _charBuffer = new char[size+1];\r
-    size_t read = fread( _charBuffer, 1, size, fp );\r
-    if ( read != size ) {\r
-        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+    size_t read = fread(_charBuffer, 1, size, fp);\r
+    if (read != size) {\r
+        SetError(XML_ERROR_FILE_READ_ERROR, 0, 0);\r
         return _errorID;\r
     }\r
 \r
@@ -1993,48 +1993,48 @@ XMLError XMLDocument::LoadFile( FILE* fp )
 }\r
 \r
 \r
-XMLError XMLDocument::SaveFile( const char* filename, bool compact )\r
+XMLError XMLDocument::SaveFile(const char* filename, bool compact)\r
 {\r
-    FILE* fp = callfopen( filename, "w" );\r
-    if ( !fp ) {\r
-        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );\r
+    FILE* fp = callfopen(filename, "w");\r
+    if (!fp) {\r
+        SetError(XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0);\r
         return _errorID;\r
     }\r
     SaveFile(fp, compact);\r
-    fclose( fp );\r
+    fclose(fp);\r
     return _errorID;\r
 }\r
 \r
 \r
-XMLError XMLDocument::SaveFile( FILE* fp, bool compact )\r
+XMLError XMLDocument::SaveFile(FILE* fp, bool compact)\r
 {\r
     // Clear any error from the last save, otherwise it will get reported\r
     // for *this* call.\r
-    SetError( XML_NO_ERROR, 0, 0 );\r
-    XMLPrinter stream( fp, compact );\r
-    Print( &stream );\r
+    SetError(XML_NO_ERROR, 0, 0);\r
+    XMLPrinter stream(fp, compact);\r
+    Print(&stream);\r
     return _errorID;\r
 }\r
 \r
 \r
-XMLError XMLDocument::Parse( const char* p, size_t len )\r
+XMLError XMLDocument::Parse(const char* p, size_t len)\r
 {\r
     Clear();\r
 \r
-    if ( len == 0 || !p || !*p ) {\r
-        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+    if (len == 0 || !p || !*p) {\r
+        SetError(XML_ERROR_EMPTY_DOCUMENT, 0, 0);\r
         return _errorID;\r
     }\r
-    if ( len == (size_t)(-1) ) {\r
-        len = strlen( p );\r
+    if (len == (size_t)(-1)) {\r
+        len = strlen(p);\r
     }\r
-    TIXMLASSERT( _charBuffer == 0 );\r
+    TIXMLASSERT(_charBuffer == 0);\r
     _charBuffer = new char[ len+1 ];\r
-    memcpy( _charBuffer, p, len );\r
+    memcpy(_charBuffer, p, len);\r
     _charBuffer[len] = 0;\r
 \r
     Parse();\r
-    if ( Error() ) {\r
+    if (Error()) {\r
         // clean up now essentially dangling memory.\r
         // and the parse fail can put objects in the\r
         // pools that are dead and inaccessible.\r
@@ -2048,21 +2048,21 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
 }\r
 \r
 \r
-void XMLDocument::Print( XMLPrinter* streamer ) const\r
+void XMLDocument::Print(XMLPrinter* streamer) const\r
 {\r
-    if ( streamer ) {\r
-        Accept( streamer );\r
+    if (streamer) {\r
+        Accept(streamer);\r
     }\r
     else {\r
-        XMLPrinter stdoutStreamer( stdout );\r
-        Accept( &stdoutStreamer );\r
+        XMLPrinter stdoutStreamer(stdout);\r
+        Accept(&stdoutStreamer);\r
     }\r
 }\r
 \r
 \r
-void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )\r
+void XMLDocument::SetError(XMLError error, const char* str1, const char* str2)\r
 {\r
-    TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );\r
+    TIXMLASSERT(error >= 0 && error < XML_ERROR_COUNT);\r
     _errorID = error;\r
     _errorStr1 = str1;\r
     _errorStr2 = str2;\r
@@ -2070,246 +2070,246 @@ void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )
 \r
 const char* XMLDocument::ErrorName() const\r
 {\r
-       TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );\r
+       TIXMLASSERT(_errorID >= 0 && _errorID < XML_ERROR_COUNT);\r
     const char* errorName = _errorNames[_errorID];\r
-    TIXMLASSERT( errorName && errorName[0] );\r
+    TIXMLASSERT(errorName && errorName[0]);\r
     return errorName;\r
 }\r
 \r
 void XMLDocument::PrintError() const\r
 {\r
-    if ( Error() ) {\r
+    if (Error()) {\r
         static const int LEN = 20;\r
         char buf1[LEN] = { 0 };\r
         char buf2[LEN] = { 0 };\r
 \r
-        if ( _errorStr1 ) {\r
-            TIXML_SNPRINTF( buf1, LEN, "%s", _errorStr1 );\r
+        if (_errorStr1) {\r
+            TIXML_SNPRINTF(buf1, LEN, "%s", _errorStr1);\r
         }\r
-        if ( _errorStr2 ) {\r
-            TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 );\r
+        if (_errorStr2) {\r
+            TIXML_SNPRINTF(buf2, LEN, "%s", _errorStr2);\r
         }\r
 \r
         // Should check INT_MIN <= _errorID && _errorId <= INT_MAX, but that\r
         // causes a clang "always true" -Wtautological-constant-out-of-range-compare warning\r
-        TIXMLASSERT( 0 <= _errorID && XML_ERROR_COUNT - 1 <= INT_MAX );\r
-        printf( "XMLDocument error id=%d '%s' str1=%s str2=%s\n",\r
-                static_cast<int>( _errorID ), ErrorName(), buf1, buf2 );\r
+        TIXMLASSERT(0 <= _errorID && XML_ERROR_COUNT - 1 <= INT_MAX);\r
+        printf("XMLDocument error id=%d '%s' str1=%s str2=%s\n",\r
+                static_cast<int>(_errorID), ErrorName(), buf1, buf2);\r
     }\r
 }\r
 \r
 void XMLDocument::Parse()\r
 {\r
-    TIXMLASSERT( NoChildren() ); // Clear() must have been called previously\r
-    TIXMLASSERT( _charBuffer );\r
+    TIXMLASSERT(NoChildren()); // Clear() must have been called previously\r
+    TIXMLASSERT(_charBuffer);\r
     char* p = _charBuffer;\r
-    p = XMLUtil::SkipWhiteSpace( p );\r
-    p = const_cast<char*>( XMLUtil::ReadBOM( p, &_writeBOM ) );\r
-    if ( !*p ) {\r
-        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+    p = XMLUtil::SkipWhiteSpace(p);\r
+    p = const_cast<char*>(XMLUtil::ReadBOM(p, &_writeBOM));\r
+    if (!*p) {\r
+        SetError(XML_ERROR_EMPTY_DOCUMENT, 0, 0);\r
         return;\r
     }\r
-    ParseDeep(p, 0 );\r
+    ParseDeep(p, 0);\r
 }\r
 \r
-XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :\r
-    _elementJustOpened( false ),\r
-    _firstElement( true ),\r
-    _fp( file ),\r
-    _depth( depth ),\r
-    _textDepth( -1 ),\r
-    _processEntities( true ),\r
-    _compactMode( compact )\r
+XMLPrinter::XMLPrinter(FILE* file, bool compact, int depth) :\r
+    _elementJustOpened(false),\r
+    _firstElement(true),\r
+    _fp(file),\r
+    _depth(depth),\r
+    _textDepth(-1),\r
+    _processEntities(true),\r
+    _compactMode(compact)\r
 {\r
-    for( int i=0; i<ENTITY_RANGE; ++i ) {\r
+    for(int i=0; i<ENTITY_RANGE; ++i) {\r
         _entityFlag[i] = false;\r
         _restrictedEntityFlag[i] = false;\r
     }\r
-    for( int i=0; i<NUM_ENTITIES; ++i ) {\r
+    for(int i=0; i<NUM_ENTITIES; ++i) {\r
         const char entityValue = entities[i].value;\r
-        TIXMLASSERT( 0 <= entityValue && entityValue < ENTITY_RANGE );\r
+        TIXMLASSERT(0 <= entityValue && entityValue < ENTITY_RANGE);\r
         _entityFlag[ (unsigned char)entityValue ] = true;\r
     }\r
     _restrictedEntityFlag[(unsigned char)'&'] = true;\r
     _restrictedEntityFlag[(unsigned char)'<'] = true;\r
     _restrictedEntityFlag[(unsigned char)'>'] = true;  // not required, but consistency is nice\r
-    _buffer.Push( 0 );\r
+    _buffer.Push(0);\r
 }\r
 \r
 \r
-void XMLPrinter::Print( const char* format, ... )\r
+void XMLPrinter::Print(const char* format, ...)\r
 {\r
     va_list     va;\r
-    va_start( va, format );\r
+    va_start(va, format);\r
 \r
-    if ( _fp ) {\r
-        vfprintf( _fp, format, va );\r
+    if (_fp) {\r
+        vfprintf(_fp, format, va);\r
     }\r
     else {\r
-        const int len = TIXML_VSCPRINTF( format, va );\r
+        const int len = TIXML_VSCPRINTF(format, va);\r
         // Close out and re-start the va-args\r
-        va_end( va );\r
-        TIXMLASSERT( len >= 0 );\r
-        va_start( va, format );\r
-        TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 );\r
-        char* p = _buffer.PushArr( len ) - 1;  // back up over the null terminator.\r
-               TIXML_VSNPRINTF( p, len+1, format, va );\r
+        va_end(va);\r
+        TIXMLASSERT(len >= 0);\r
+        va_start(va, format);\r
+        TIXMLASSERT(_buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0);\r
+        char* p = _buffer.PushArr(len) - 1;    // back up over the null terminator.\r
+               TIXML_VSNPRINTF(p, len+1, format, va);\r
     }\r
-    va_end( va );\r
+    va_end(va);\r
 }\r
 \r
 \r
-void XMLPrinter::PrintSpace( int depth )\r
+void XMLPrinter::PrintSpace(int depth)\r
 {\r
-    for( int i=0; i<depth; ++i ) {\r
-        Print( "    " );\r
+    for(int i=0; i<depth; ++i) {\r
+        Print("    ");\r
     }\r
 }\r
 \r
 \r
-void XMLPrinter::PrintString( const char* p, bool restricted )\r
+void XMLPrinter::PrintString(const char* p, bool restricted)\r
 {\r
     // Look for runs of bytes between entities to print.\r
     const char* q = p;\r
 \r
-    if ( _processEntities ) {\r
+    if (_processEntities) {\r
         const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;\r
-        while ( *q ) {\r
-            TIXMLASSERT( p <= q );\r
+        while (*q) {\r
+            TIXMLASSERT(p <= q);\r
             // Remember, char is sometimes signed. (How many times has that bitten me?)\r
-            if ( *q > 0 && *q < ENTITY_RANGE ) {\r
+            if (*q > 0 && *q < ENTITY_RANGE) {\r
                 // Check for entities. If one is found, flush\r
                 // the stream up until the entity, write the\r
                 // entity, and keep looking.\r
-                if ( flag[(unsigned char)(*q)] ) {\r
-                    while ( p < q ) {\r
+                if (flag[(unsigned char)(*q)]) {\r
+                    while (p < q) {\r
                         const size_t delta = q - p;\r
                         // %.*s accepts type int as "precision"\r
-                        const int toPrint = ( INT_MAX < delta ) ? INT_MAX : (int)delta;\r
-                        Print( "%.*s", toPrint, p );\r
+                        const int toPrint = (INT_MAX < delta) ? INT_MAX : (int)delta;\r
+                        Print("%.*s", toPrint, p);\r
                         p += toPrint;\r
                     }\r
                     bool entityPatternPrinted = false;\r
-                    for( int i=0; i<NUM_ENTITIES; ++i ) {\r
-                        if ( entities[i].value == *q ) {\r
-                            Print( "&%s;", entities[i].pattern );\r
+                    for(int i=0; i<NUM_ENTITIES; ++i) {\r
+                        if (entities[i].value == *q) {\r
+                            Print("&%s;", entities[i].pattern);\r
                             entityPatternPrinted = true;\r
                             break;\r
                         }\r
                     }\r
-                    if ( !entityPatternPrinted ) {\r
-                        // TIXMLASSERT( entityPatternPrinted ) causes gcc -Wunused-but-set-variable in release\r
-                        TIXMLASSERT( false );\r
+                    if (!entityPatternPrinted) {\r
+                        // TIXMLASSERT(entityPatternPrinted) causes gcc -Wunused-but-set-variable in release\r
+                        TIXMLASSERT(false);\r
                     }\r
                     ++p;\r
                 }\r
             }\r
             ++q;\r
-            TIXMLASSERT( p <= q );\r
+            TIXMLASSERT(p <= q);\r
         }\r
     }\r
     // Flush the remaining string. This will be the entire\r
     // string if an entity wasn't found.\r
-    TIXMLASSERT( p <= q );\r
-    if ( !_processEntities || ( p < q ) ) {\r
-        Print( "%s", p );\r
+    TIXMLASSERT(p <= q);\r
+    if (!_processEntities || (p < q)) {\r
+        Print("%s", p);\r
     }\r
 }\r
 \r
 \r
-void XMLPrinter::PushHeader( bool writeBOM, bool writeDec )\r
+void XMLPrinter::PushHeader(bool writeBOM, bool writeDec)\r
 {\r
-    if ( writeBOM ) {\r
+    if (writeBOM) {\r
         static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };\r
-        Print( "%s", bom );\r
+        Print("%s", bom);\r
     }\r
-    if ( writeDec ) {\r
-        PushDeclaration( "xml version=\"1.0\"" );\r
+    if (writeDec) {\r
+        PushDeclaration("xml version=\"1.0\"");\r
     }\r
 }\r
 \r
 \r
-void XMLPrinter::OpenElement( const char* name, bool compactMode )\r
+void XMLPrinter::OpenElement(const char* name, bool compactMode)\r
 {\r
     SealElementIfJustOpened();\r
-    _stack.Push( name );\r
+    _stack.Push(name);\r
 \r
-    if ( _textDepth < 0 && !_firstElement && !compactMode ) {\r
-        Print( "\n" );\r
+    if (_textDepth < 0 && !_firstElement && !compactMode) {\r
+        Print("\n");\r
     }\r
-    if ( !compactMode ) {\r
-        PrintSpace( _depth );\r
+    if (!compactMode) {\r
+        PrintSpace(_depth);\r
     }\r
 \r
-    Print( "<%s", name );\r
+    Print("<%s", name);\r
     _elementJustOpened = true;\r
     _firstElement = false;\r
     ++_depth;\r
 }\r
 \r
 \r
-void XMLPrinter::PushAttribute( const char* name, const char* value )\r
+void XMLPrinter::PushAttribute(const char* name, const char* value)\r
 {\r
-    TIXMLASSERT( _elementJustOpened );\r
-    Print( " %s=\"", name );\r
-    PrintString( value, false );\r
-    Print( "\"" );\r
+    TIXMLASSERT(_elementJustOpened);\r
+    Print(" %s=\"", name);\r
+    PrintString(value, false);\r
+    Print("\"");\r
 }\r
 \r
 \r
-void XMLPrinter::PushAttribute( const char* name, int v )\r
+void XMLPrinter::PushAttribute(const char* name, int v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    PushAttribute( name, buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    PushAttribute(name, buf);\r
 }\r
 \r
 \r
-void XMLPrinter::PushAttribute( const char* name, unsigned v )\r
+void XMLPrinter::PushAttribute(const char* name, unsigned v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    PushAttribute( name, buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    PushAttribute(name, buf);\r
 }\r
 \r
 \r
-void XMLPrinter::PushAttribute( const char* name, bool v )\r
+void XMLPrinter::PushAttribute(const char* name, bool v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    PushAttribute( name, buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    PushAttribute(name, buf);\r
 }\r
 \r
 \r
-void XMLPrinter::PushAttribute( const char* name, double v )\r
+void XMLPrinter::PushAttribute(const char* name, double v)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
-    PushAttribute( name, buf );\r
+    XMLUtil::ToStr(v, buf, BUF_SIZE);\r
+    PushAttribute(name, buf);\r
 }\r
 \r
 \r
-void XMLPrinter::CloseElement( bool compactMode )\r
+void XMLPrinter::CloseElement(bool compactMode)\r
 {\r
     --_depth;\r
     const char* name = _stack.Pop();\r
 \r
-    if ( _elementJustOpened ) {\r
-        Print( "/>" );\r
+    if (_elementJustOpened) {\r
+        Print("/>");\r
     }\r
     else {\r
-        if ( _textDepth < 0 && !compactMode) {\r
-            Print( "\n" );\r
-            PrintSpace( _depth );\r
+        if (_textDepth < 0 && !compactMode) {\r
+            Print("\n");\r
+            PrintSpace(_depth);\r
         }\r
-        Print( "</%s>", name );\r
+        Print("</%s>", name);\r
     }\r
 \r
-    if ( _textDepth == _depth ) {\r
+    if (_textDepth == _depth) {\r
         _textDepth = -1;\r
     }\r
-    if ( _depth == 0 && !compactMode) {\r
-        Print( "\n" );\r
+    if (_depth == 0 && !compactMode) {\r
+        Print("\n");\r
     }\r
     _elementJustOpened = false;\r
 }\r
@@ -2317,159 +2317,159 @@ void XMLPrinter::CloseElement( bool compactMode )
 \r
 void XMLPrinter::SealElementIfJustOpened()\r
 {\r
-    if ( !_elementJustOpened ) {\r
+    if (!_elementJustOpened) {\r
         return;\r
     }\r
     _elementJustOpened = false;\r
-    Print( ">" );\r
+    Print(">");\r
 }\r
 \r
 \r
-void XMLPrinter::PushText( const char* text, bool cdata )\r
+void XMLPrinter::PushText(const char* text, bool cdata)\r
 {\r
     _textDepth = _depth-1;\r
 \r
     SealElementIfJustOpened();\r
-    if ( cdata ) {\r
-        Print( "<![CDATA[%s]]>", text );\r
+    if (cdata) {\r
+        Print("<![CDATA[%s]]>", text);\r
     }\r
     else {\r
-        PrintString( text, true );\r
+        PrintString(text, true);\r
     }\r
 }\r
 \r
-void XMLPrinter::PushText( int value )\r
+void XMLPrinter::PushText(int value)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
-    PushText( buf, false );\r
+    XMLUtil::ToStr(value, buf, BUF_SIZE);\r
+    PushText(buf, false);\r
 }\r
 \r
 \r
-void XMLPrinter::PushText( unsigned value )\r
+void XMLPrinter::PushText(unsigned value)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
-    PushText( buf, false );\r
+    XMLUtil::ToStr(value, buf, BUF_SIZE);\r
+    PushText(buf, false);\r
 }\r
 \r
 \r
-void XMLPrinter::PushText( bool value )\r
+void XMLPrinter::PushText(bool value)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
-    PushText( buf, false );\r
+    XMLUtil::ToStr(value, buf, BUF_SIZE);\r
+    PushText(buf, false);\r
 }\r
 \r
 \r
-void XMLPrinter::PushText( float value )\r
+void XMLPrinter::PushText(float value)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
-    PushText( buf, false );\r
+    XMLUtil::ToStr(value, buf, BUF_SIZE);\r
+    PushText(buf, false);\r
 }\r
 \r
 \r
-void XMLPrinter::PushText( double value )\r
+void XMLPrinter::PushText(double value)\r
 {\r
     char buf[BUF_SIZE];\r
-    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
-    PushText( buf, false );\r
+    XMLUtil::ToStr(value, buf, BUF_SIZE);\r
+    PushText(buf, false);\r
 }\r
 \r
 \r
-void XMLPrinter::PushComment( const char* comment )\r
+void XMLPrinter::PushComment(const char* comment)\r
 {\r
     SealElementIfJustOpened();\r
-    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
-        Print( "\n" );\r
-        PrintSpace( _depth );\r
+    if (_textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print("\n");\r
+        PrintSpace(_depth);\r
     }\r
     _firstElement = false;\r
-    Print( "<!--%s-->", comment );\r
+    Print("<!--%s-->", comment);\r
 }\r
 \r
 \r
-void XMLPrinter::PushDeclaration( const char* value )\r
+void XMLPrinter::PushDeclaration(const char* value)\r
 {\r
     SealElementIfJustOpened();\r
-    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
-        Print( "\n" );\r
-        PrintSpace( _depth );\r
+    if (_textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print("\n");\r
+        PrintSpace(_depth);\r
     }\r
     _firstElement = false;\r
-    Print( "<?%s?>", value );\r
+    Print("<?%s?>", value);\r
 }\r
 \r
 \r
-void XMLPrinter::PushUnknown( const char* value )\r
+void XMLPrinter::PushUnknown(const char* value)\r
 {\r
     SealElementIfJustOpened();\r
-    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
-        Print( "\n" );\r
-        PrintSpace( _depth );\r
+    if (_textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print("\n");\r
+        PrintSpace(_depth);\r
     }\r
     _firstElement = false;\r
-    Print( "<!%s>", value );\r
+    Print("<!%s>", value);\r
 }\r
 \r
 \r
-bool XMLPrinter::VisitEnter( const XMLDocument& doc )\r
+bool XMLPrinter::VisitEnter(const XMLDocument& doc)\r
 {\r
     _processEntities = doc.ProcessEntities();\r
-    if ( doc.HasBOM() ) {\r
-        PushHeader( true, false );\r
+    if (doc.HasBOM()) {\r
+        PushHeader(true, false);\r
     }\r
     return true;\r
 }\r
 \r
 \r
-bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute )\r
+bool XMLPrinter::VisitEnter(const XMLElement& element, const XMLAttribute* attribute)\r
 {\r
     const XMLElement* parentElem = 0;\r
-    if ( element.Parent() ) {\r
+    if (element.Parent()) {\r
         parentElem = element.Parent()->ToElement();\r
     }\r
-    const bool compactMode = parentElem ? CompactMode( *parentElem ) : _compactMode;\r
-    OpenElement( element.Name(), compactMode );\r
-    while ( attribute ) {\r
-        PushAttribute( attribute->Name(), attribute->Value() );\r
+    const bool compactMode = parentElem ? CompactMode(*parentElem) : _compactMode;\r
+    OpenElement(element.Name(), compactMode);\r
+    while (attribute) {\r
+        PushAttribute(attribute->Name(), attribute->Value());\r
         attribute = attribute->Next();\r
     }\r
     return true;\r
 }\r
 \r
 \r
-bool XMLPrinter::VisitExit( const XMLElement& element )\r
+bool XMLPrinter::VisitExit(const XMLElement& element)\r
 {\r
-    CloseElement( CompactMode(element) );\r
+    CloseElement(CompactMode(element));\r
     return true;\r
 }\r
 \r
 \r
-bool XMLPrinter::Visit( const XMLText& text )\r
+bool XMLPrinter::Visit(const XMLText& text)\r
 {\r
-    PushText( text.Value(), text.CData() );\r
+    PushText(text.Value(), text.CData());\r
     return true;\r
 }\r
 \r
 \r
-bool XMLPrinter::Visit( const XMLComment& comment )\r
+bool XMLPrinter::Visit(const XMLComment& comment)\r
 {\r
-    PushComment( comment.Value() );\r
+    PushComment(comment.Value());\r
     return true;\r
 }\r
 \r
-bool XMLPrinter::Visit( const XMLDeclaration& declaration )\r
+bool XMLPrinter::Visit(const XMLDeclaration& declaration)\r
 {\r
-    PushDeclaration( declaration.Value() );\r
+    PushDeclaration(declaration.Value());\r
     return true;\r
 }\r
 \r
 \r
-bool XMLPrinter::Visit( const XMLUnknown& unknown )\r
+bool XMLPrinter::Visit(const XMLUnknown& unknown)\r
 {\r
-    PushUnknown( unknown.Value() );\r
+    PushUnknown(unknown.Value());\r
     return true;\r
 }\r
 \r
index 731d18bffacc54d84cba9f3de4984d9be32755ab..a78686c7e72c701dd45cdd1ee7a75900c2a5ab67 100644 (file)
@@ -12,6 +12,8 @@ extern SDL_Window *window;
 
 extern Player *player;
 extern World  *currentWorld;
+extern World  *currentWorldToLeft;
+extern World  *currentWorldToRight;
 extern WorldWeather weather;
 
 /*
@@ -42,12 +44,12 @@ typedef struct {
        vec2 ad;
 } FT_Info;
 
-static std::vector<FT_Info> ftdat16 ( 93, { { 0, 0 }, { 0, 0 }, { 0, 0 } } );
-static std::vector<GLuint>  ftex16  ( 93, 0 );
+static std::vector<FT_Info> ftdat16 (93, { { 0, 0 }, { 0, 0 }, { 0, 0 } });
+static std::vector<GLuint>  ftex16  (93, 0);
 static bool ft16loaded = false;
 
-static std::vector<FT_Info> ftdat24 ( 93, { { 0, 0 }, { 0, 0 }, { 0, 0 } } );
-static std::vector<GLuint>  ftex24  ( 93, 0 );
+static std::vector<FT_Info> ftdat24 (93, { { 0, 0 }, { 0, 0 }, { 0, 0 } });
+static std::vector<GLuint>  ftex24  (93, 0);
 static bool ft24loaded = false;
 
 static auto *ftdat = &ftdat16;
@@ -61,7 +63,7 @@ static unsigned char fontColor[4] = {255,255,255,255};
 
 static std::vector<std::pair<std::string,vec3>> dialogOptText;
 static std::string dialogBoxText;
-static std::vector<vec3> merchArrowLoc ( 2, vec3 { 0, 0, 0 } );
+static std::vector<vec3> merchArrowLoc (2, vec3 { 0, 0, 0 });
 static bool typeOutDone = true;
 static bool typeOutSustain = false;
 
@@ -86,7 +88,7 @@ Mix_Chunk *sanic;
 static GLuint pageTex = 0;
 static bool   pageTexReady = false;
 
-void loadFontSize( unsigned int size, std::vector<GLuint> &tex, std::vector<FT_Info> &dat )
+void loadFontSize(unsigned int size, std::vector<GLuint> &tex, std::vector<FT_Info> &dat)
 {
        FT_Set_Pixel_Sizes(ftf,0,size);
 
@@ -94,8 +96,8 @@ void loadFontSize( unsigned int size, std::vector<GLuint> &tex, std::vector<FT_I
         *      Pre-render 'all' the characters.
        */
 
-       glDeleteTextures( 93, tex.data() );
-       glGenTextures( 93, tex.data() );                //      Generate new texture name/locations?
+       glDeleteTextures(93, tex.data());
+       glGenTextures(93, tex.data());          //      Generate new texture name/locations?
 
        for(char i=33;i<126;i++){
 
@@ -103,8 +105,8 @@ void loadFontSize( unsigned int size, std::vector<GLuint> &tex, std::vector<FT_I
                 *      Load the character from the font family file.
                */
 
-               if ( FT_Load_Char ( ftf, i, FT_LOAD_RENDER ) )
-                       UserError( "Error! Unsupported character " + i );
+               if (FT_Load_Char (ftf, i, FT_LOAD_RENDER))
+                       UserError("Error! Unsupported character " + i);
 
                /*
                 *      Transfer the character's bitmap (?) to a texture for rendering.
@@ -113,8 +115,8 @@ void loadFontSize( unsigned int size, std::vector<GLuint> &tex, std::vector<FT_I
                glBindTexture(GL_TEXTURE_2D,tex[i-33]);
                glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S         ,GL_CLAMP_TO_EDGE);
                glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T         ,GL_CLAMP_TO_EDGE);
-               glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER     ,GL_LINEAR               );
-               glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER     ,GL_LINEAR               );
+               glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER     ,GL_LINEAR              );
+               glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER     ,GL_LINEAR              );
                glPixelStorei(GL_UNPACK_ALIGNMENT,1);
 
                /*
@@ -124,9 +126,9 @@ void loadFontSize( unsigned int size, std::vector<GLuint> &tex, std::vector<FT_I
                */
 
 
-               std::vector<uint32_t> buf ( ftf->glyph->bitmap.width * ftf->glyph->bitmap.rows, 0xFFFFFFFF );
+               std::vector<uint32_t> buf (ftf->glyph->bitmap.width * ftf->glyph->bitmap.rows, 0xFFFFFFFF);
 
-               for( unsigned int j = buf.size(); j--; )
+               for(unsigned int j = buf.size(); j--;)
                        buf[j] ^= !ftf->glyph->bitmap.buffer[j] ? buf[j] : 0;
 
                dat[i - 33].wh.x = ftf->glyph->bitmap.width;
@@ -136,8 +138,8 @@ void loadFontSize( unsigned int size, std::vector<GLuint> &tex, std::vector<FT_I
                dat[i - 33].ad.x = ftf->glyph->advance.x >> 6;
                dat[i - 33].ad.y = ftf->glyph->advance.y >> 6;
 
-               glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, ftf->glyph->bitmap.width, ftf->glyph->bitmap.rows,
-                                 0, GL_RGBA, GL_UNSIGNED_BYTE, buf.data() );
+               glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ftf->glyph->bitmap.width, ftf->glyph->bitmap.rows,
+                                 0, GL_RGBA, GL_UNSIGNED_BYTE, buf.data());
        }
 }
 
@@ -193,7 +195,7 @@ namespace ui {
        */
 
        void initFonts(void){
-               if ( FT_Init_FreeType(&ftl) )
+               if (FT_Init_FreeType(&ftl))
                        UserError("Couldn't initialize freetype.");
 
 #ifdef DEBUG
@@ -221,7 +223,7 @@ namespace ui {
        */
 
        void setFontFace(const char *ttf){
-               if ( FT_New_Face( ftl, ttf, 0, &ftf ) )
+               if (FT_New_Face(ftl, ttf, 0, &ftf))
                        UserError("Error! Couldn't open " + (std::string)ttf + ".");
 
 #ifdef DEBUG
@@ -236,17 +238,17 @@ namespace ui {
        */
 
        void setFontSize(unsigned int size){
-               if ( size == 16 ) {
-                       if( !ft16loaded ) {
-                               loadFontSize( fontSize = size, ftex16, ftdat16 );
+               if (size == 16) {
+                       if(!ft16loaded) {
+                               loadFontSize(fontSize = size, ftex16, ftdat16);
                                ft16loaded = true;
                        }
                        ftex = &ftex16;
                        ftdat = &ftdat16;
                        fontSize = 16;
-               } else if ( size == 24 ) {
-                       if ( !ft24loaded ) {
-                               loadFontSize( fontSize = size, ftex24, ftdat24 );
+               } else if (size == 24) {
+                       if (!ft24loaded) {
+                               loadFontSize(fontSize = size, ftex24, ftdat24);
                                ft24loaded = true;
                        }
                        ftex = &ftex24;
@@ -316,7 +318,7 @@ namespace ui {
         *      Draw a string at the specified coordinates.
        */
 
-       float putString( const float x, const float y, std::string s ) {
+       float putString(const float x, const float y, std::string s) {
                unsigned int i=0;
                vec2 add, o = {x, y};
 
@@ -341,7 +343,7 @@ namespace ui {
                                        i++;
                        }
 
-                       switch ( s[i] ) {
+                       switch (s[i]) {
                        case '\n':
                                o.y -= fontSize * 1.05f;
                                o.x = x;
@@ -357,7 +359,7 @@ namespace ui {
                                o.x += fontSize / 2;
                                break;
                        default:
-                               add = putChar( floor(o.x), floor(o.y), s[i] );
+                               add = putChar(floor(o.x), floor(o.y), s[i]);
                                o.x += add.x;
                                o.y += add.y;
                                break;
@@ -368,12 +370,12 @@ namespace ui {
                return o.x;     // i.e. the string width
        }
 
-       float putStringCentered( const float x, const float y, std::string s ) {
+       float putStringCentered(const float x, const float y, std::string s) {
                unsigned int i = 0;
                float width = 0;
 
                do {
-                       switch ( s[i] ) {
+                       switch (s[i]) {
                        case '\n':
                                // TODO
                                break;
@@ -395,7 +397,7 @@ namespace ui {
         * Prevents typeOut from typing the next string it's given.
         */
 
-        void dontTypeOut( void ) {
+        void dontTypeOut(void) {
                 typeOutSustain = true;
         }
 
@@ -405,31 +407,31 @@ namespace ui {
        */
 
        std::string ret;
-       std::string typeOut( std::string str ) {
+       std::string typeOut(std::string str) {
                static unsigned int tadv = TICKS_PER_SEC / 12;
                static unsigned int tickk,
                                                        linc=0, //      Contains the number of letters that should be drawn.
                                                        size=0; //      Contains the full size of the current string.
 
                // reset values if a new string is being passed.
-               if ( !linc || ret.substr( 0, linc ) != str.substr( 0, linc ) ) {
+               if (!linc || ret.substr(0, linc) != str.substr(0, linc)) {
                        tickk = tickCount + tadv;
-                       ret  = str.substr( 0, 1 );
+                       ret  = str.substr(0, 1);
                        size = str.size();                      //      Set the new target string size
                        linc = 1;                                       //      Reset the incrementers
-                       if ( (typeOutDone = typeOutSustain) )
+                       if ((typeOutDone = typeOutSustain))
                                typeOutSustain = false;
                }
 
-               if ( typeOutDone )
+               if (typeOutDone)
                        return str;
 
                // Draw the next letter if necessary.
-               else if ( tickk <= tickCount ) {
+               else if (tickk <= tickCount) {
                        tickk = tickCount + tadv;
                        ret += str[linc];
 
-                       if ( linc < size )
+                       if (linc < size)
                                linc++;
                        else
                                typeOutDone = true;
@@ -442,7 +444,7 @@ namespace ui {
         *      Draw a formatted string to the specified coordinates.
        */
 
-       float putText( const float x, const float y, const char *str, ... ) {
+       float putText(const float x, const float y, const char *str, ...) {
                va_list args;
                std::unique_ptr<char[]> buf (new char[512]);
 
@@ -458,10 +460,10 @@ namespace ui {
                va_end(args);
 
                // draw the string and return the width
-               return putString( x, y, buf.get() );
+               return putString(x, y, buf.get());
        }
 
-       void dialogBox( const char *name, const char *opt, bool passive, const char *text, ... ) {
+       void dialogBox(const char *name, const char *opt, bool passive, const char *text, ...) {
                va_list dialogArgs;
                std::unique_ptr<char[]> printfbuf (new char[512]);
 
@@ -483,13 +485,13 @@ namespace ui {
 
                dialogOptChosen = 0;
 
-               if ( opt ) {
+               if (opt) {
                        std::string soptbuf = opt;
                        char *sopt = strtok(&soptbuf[0], ":");
 
                        // cycle through options
                        while(sopt){
-                               dialogOptText.push_back(std::make_pair((std::string)sopt, vec3 {0,0,0}) );
+                               dialogOptText.push_back(std::make_pair((std::string)sopt, vec3 {0,0,0}));
                                sopt = strtok(NULL,":");
                        }
                }
@@ -533,7 +535,7 @@ namespace ui {
 
                        // cycle through options
                        while(sopt){
-                               dialogOptText.push_back(std::make_pair((std::string)sopt, vec3 {0,0,0}) );
+                               dialogOptText.push_back(std::make_pair((std::string)sopt, vec3 {0,0,0}));
                                sopt = strtok(NULL,":");
                        }
                }
@@ -556,19 +558,19 @@ namespace ui {
         * Wait for a dialog box to be dismissed.
         */
 
-       void waitForDialog ( void ) {
-               while ( dialogBoxExists );
+       void waitForDialog (void) {
+               while (dialogBoxExists);
        }
 
-       void waitForCover ( void ) {
-               while ( fadeIntensity < 255 )
+       void waitForCover (void) {
+               while (fadeIntensity < 255)
                        mainLoop();
                fadeIntensity = 255;
        }
 
-       void waitForNothing ( unsigned int ms ) {
+       void waitForNothing (unsigned int ms) {
                unsigned int target = millis() + ms;
-               while ( millis() < target );
+               while (millis() < target);
        }
 
        void importantText(const char *text,...){
@@ -608,8 +610,8 @@ namespace ui {
        }
 
 
-       void drawPage( std::string path ) {
-               pageTex = Texture::loadTexture( path );
+       void drawPage(std::string path) {
+               pageTex = Texture::loadTexture(path);
                pageTexReady = true;
        }
 
@@ -618,16 +620,16 @@ namespace ui {
                float x,y,tmp;
                std::string rtext;
 
-               if ( pageTexReady ) {
-                       glEnable( GL_TEXTURE_2D );
-                       glBindTexture( GL_TEXTURE_2D, pageTex );
-                       glBegin( GL_QUADS );
-                               glTexCoord2i( 0, 0 ); glVertex2i( offset.x - 300, SCREEN_HEIGHT - 100 );
-                               glTexCoord2i( 1, 0 ); glVertex2i( offset.x + 300, SCREEN_HEIGHT - 100 );
-                               glTexCoord2i( 1, 1 ); glVertex2i( offset.x + 300, SCREEN_HEIGHT - 600 );
-                               glTexCoord2i( 0, 1 ); glVertex2i( offset.x - 300, SCREEN_HEIGHT - 600 );
+               if (pageTexReady) {
+                       glEnable(GL_TEXTURE_2D);
+                       glBindTexture(GL_TEXTURE_2D, pageTex);
+                       glBegin(GL_QUADS);
+                               glTexCoord2i(0, 0); glVertex2i(offset.x - 300, SCREEN_HEIGHT - 100);
+                               glTexCoord2i(1, 0); glVertex2i(offset.x + 300, SCREEN_HEIGHT - 100);
+                               glTexCoord2i(1, 1); glVertex2i(offset.x + 300, SCREEN_HEIGHT - 600);
+                               glTexCoord2i(0, 1); glVertex2i(offset.x - 300, SCREEN_HEIGHT - 600);
                        glEnd();
-                       glDisable( GL_TEXTURE_2D );
+                       glDisable(GL_TEXTURE_2D);
 
                } else if (dialogBoxExists) {
 
@@ -648,7 +650,7 @@ namespace ui {
                                        putStringCentered(offset.x,offset.y,rtext.c_str());
                                        setFontSize(16);
                                }
-                       }else if ( dialogMerchant ) {
+                       }else if (dialogMerchant) {
                                x=offset.x-SCREEN_WIDTH/6;
                                y=(offset.y+SCREEN_HEIGHT/2)-HLINE*8;
 
@@ -711,8 +713,8 @@ namespace ui {
                                for(i = 0; i < 2; i++){
                                        if(((merchArrowLoc[i].x < merchArrowLoc[i].z) ?
                                                (mouse.x > merchArrowLoc[i].x     && mouse.x < merchArrowLoc[i].z) :
-                                               (mouse.x < merchArrowLoc[i].x     && mouse.x > merchArrowLoc[i].z)    ) &&
-                                            mouse.y > merchArrowLoc[i].y - 8 && mouse.y < merchArrowLoc[i].y + 8 ) {
+                                               (mouse.x < merchArrowLoc[i].x     && mouse.x > merchArrowLoc[i].z)) &&
+                                            mouse.y > merchArrowLoc[i].y - 8 && mouse.y < merchArrowLoc[i].y + 8) {
                                                glColor3ub(255,255, 0);
                                        }else{
                                                glColor3ub(255,255,255);
@@ -739,7 +741,7 @@ namespace ui {
 
                                        // make text yellow if the mouse hovers over the text
                                        if(mouse.x > dialogOptText[i].second.x && mouse.x < dialogOptText[i].second.z &&
-                                          mouse.y > dialogOptText[i].second.y && mouse.y < dialogOptText[i].second.y + 16 ){
+                                          mouse.y > dialogOptText[i].second.y && mouse.y < dialogOptText[i].second.y + 16){
                                                  setFontColor(255, 255, 0);
                                                  putStringCentered(offset.x, dialogOptText[i].second.y, dialogOptText[i].first);
                                        }
@@ -778,7 +780,7 @@ namespace ui {
                                        if(mouse.x > dialogOptText[i].second.x &&
                                           mouse.x < dialogOptText[i].second.z &&
                                           mouse.y > dialogOptText[i].second.y &&
-                                          mouse.y < dialogOptText[i].second.y + 16 ){ // fontSize
+                                          mouse.y < dialogOptText[i].second.y + 16){ // fontSize
                                                  setFontColor(255,255,0);
                                                  putStringCentered(offset.x,dialogOptText[i].second.y,dialogOptText[i].first);
                                        }
@@ -787,9 +789,9 @@ namespace ui {
                        }
 
                        static unsigned int rtext_oldsize = 0;
-                       if ( rtext_oldsize != rtext.size() ) {
-                               if ( !isspace( rtext[(rtext_oldsize = rtext.size()) - 1] ) )
-                                       Mix_PlayChannel( 1, dialogClick, 0 );
+                       if (rtext_oldsize != rtext.size()) {
+                               if (!isspace(rtext[(rtext_oldsize = rtext.size()) - 1]))
+                                       Mix_PlayChannel(1, dialogClick, 0);
                        }
 
                }if(!fadeIntensity){
@@ -861,8 +863,8 @@ namespace ui {
        void dialogAdvance(void){
                unsigned char i;
 
-               if ( pageTex ) {
-                       glDeleteTextures( 1, &pageTex );
+               if (pageTex) {
+                       glDeleteTextures(1, &pageTex);
                        pageTex = 0;
                        pageTexReady = false;
                        return;
@@ -877,14 +879,14 @@ namespace ui {
                        if(mouse.x > dialogOptText[i].second.x &&
                           mouse.x < dialogOptText[i].second.z &&
                           mouse.y > dialogOptText[i].second.y &&
-                          mouse.y < dialogOptText[i].second.y + 16 ){ // fontSize
+                          mouse.y < dialogOptText[i].second.y + 16){ // fontSize
                                dialogOptChosen = i + 1;
                                goto EXIT;
                        }
                }
 
-               if ( dialogMerchant ) {
-                       for ( i = 0; i < merchArrowLoc.size(); i++ ) {
+               if (dialogMerchant) {
+                       for (i = 0; i < merchArrowLoc.size(); i++) {
 
                                // TODO neaten this if statement
 
@@ -922,8 +924,8 @@ EXIT:
                SDL_Event e;
 
                // update mouse coords
-               mouse.x = premouse.x + offset.x - ( SCREEN_WIDTH / 2 );
-               mouse.y = ( offset.y + SCREEN_HEIGHT / 2 ) - premouse.y;
+               mouse.x = premouse.x + offset.x - (SCREEN_WIDTH / 2);
+               mouse.y = (offset.y + SCREEN_HEIGHT / 2) - premouse.y;
 
                static vec2 fr;
                static Entity *ig;
@@ -943,7 +945,7 @@ EXIT:
                                break;
 
                        case SDL_MOUSEBUTTONUP:
-                               if ( ig ) {
+                               if (ig) {
                                        ig->vel.x = (fr.x - mouse.x) / 50.0f;
                                        ig->vel.y = (fr.y - mouse.y) / 50.0f;
                     //ig->forcedMove = true; // kills vel.x too quickly
@@ -955,22 +957,22 @@ EXIT:
                        case SDL_MOUSEBUTTONDOWN:
 
                                // right click advances dialog
-                               if ( ( e.button.button & SDL_BUTTON_RIGHT ) && (dialogBoxExists | pageTexReady) )
+                               if ((e.button.button & SDL_BUTTON_RIGHT) && (dialogBoxExists | pageTexReady))
                                        dialogAdvance();
 
                                // left click uses item
-                               if ( ( e.button.button & SDL_BUTTON_LEFT ) && !dialogBoxExists )
+                               if ((e.button.button & SDL_BUTTON_LEFT) && !dialogBoxExists)
                                        player->inv->usingi = true;
 
-                               if( mouse.x > player->loc.x && mouse.x < player->loc.x + player->width &&
-                                       mouse.y > player->loc.y && mouse.y < player->loc.y + player->height ) {
+                               if(mouse.x > player->loc.x && mouse.x < player->loc.x + player->width &&
+                                       mouse.y > player->loc.y && mouse.y < player->loc.y + player->height) {
                                        player->vel.y = .05;
                                        fr = mouse;
                                        ig = player;
                                } else {
-                                       for ( auto &e : currentWorld->entity ) {
-                                               if( mouse.x > e->loc.x && mouse.x < e->loc.x + e->width &&
-                                                       mouse.y > e->loc.y && mouse.y < e->loc.y + e->height ) {
+                                       for (auto &e : currentWorld->entity) {
+                                               if(mouse.x > e->loc.x && mouse.x < e->loc.x + e->width &&
+                                                       mouse.y > e->loc.y && mouse.y < e->loc.y + e->height) {
                                                        e->vel.y = .05;
                                                        fr = mouse;
                                                        ig = e;
@@ -997,8 +999,8 @@ EXIT:
                        case SDL_KEYDOWN:
 
                                // space - make player jump
-                               if ( SDL_KEY == SDLK_SPACE ) {
-                                       if ( player->ground ) {
+                               if (SDL_KEY == SDLK_SPACE) {
+                                       if (player->ground) {
                                                player->loc.y += HLINE * 2;
                                                player->vel.y = .4;
                                                player->ground = false;
@@ -1006,7 +1008,7 @@ EXIT:
                                        break;
 
                                // only let other keys be handled if dialog allows it
-                               } else if ( !dialogBoxExists || dialogPassive ) {
+                               } else if (!dialogBoxExists || dialogPassive) {
                                        tmp = currentWorld;
                                        switch(SDL_KEY){
                                        case SDLK_t:
@@ -1017,7 +1019,7 @@ EXIT:
                                                player->vel.x = -PLAYER_SPEED_CONSTANT;
                                                player->left = left = true;
                                                player->right = right = false;
-                                               if ( !currentWorld->toLeft.empty() ) {
+                                               if (currentWorldToLeft) {
                                                        oldpos = player->loc;
                                                        if((tmp = currentWorld->goWorldLeft(player)) != currentWorld){
                                                                tmppos = player->loc;
@@ -1037,7 +1039,7 @@ EXIT:
                                                player->vel.x = PLAYER_SPEED_CONSTANT;
                                                player->right = right = true;
                                                player->left = left = false;
-                                               if ( !currentWorld->toRight.empty() ) {
+                                               if (currentWorldToRight) {
                                                        oldpos = player->loc;
                                                        if((tmp = currentWorld->goWorldRight(player)) != currentWorld){
                                                                tmppos = player->loc;
@@ -1055,12 +1057,12 @@ EXIT:
                                        case SDLK_s:
                                                break;
                                        case SDLK_w:
-                                               if ( inBattle ) {
+                                               if (inBattle) {
                                                        tmp = currentWorld;
-                                                       currentWorld = ((Arena *)currentWorld)->exitArena( player );
-                                                       if ( tmp != currentWorld )
+                                                       currentWorld = ((Arena *)currentWorld)->exitArena(player);
+                                                       if (tmp != currentWorld)
                                                                toggleBlackFast();
-                                               } else if ( (tmp = currentWorld->goInsideStructure( player )) != currentWorld )
+                                               } else if ((tmp = currentWorld->goInsideStructure(player)) != currentWorld)
                                                        currentWorld = tmp;
                                                break;
                                        case SDLK_LSHIFT:
@@ -1099,12 +1101,12 @@ EXIT:
                        */
 
                        case SDL_KEYUP:
-                               if ( SDL_KEY == SDLK_ESCAPE ) {
+                               if (SDL_KEY == SDLK_ESCAPE) {
                                        currentMenu = &pauseMenu;
                                        player->save();
                                        return;
                                }
-                               switch ( SDL_KEY ) {
+                               switch (SDL_KEY) {
                                case SDLK_F3:
                                        debug ^= true;
                                        break;
@@ -1112,13 +1114,13 @@ EXIT:
                                        weather = WorldWeather::Rain;
                                        break;
                                case SDLK_i:
-                                       if ( isCurrentWorldIndoors() && Indoorp(currentWorld)->isFloorAbove( player ) ) {
+                                       if (isCurrentWorldIndoors() && Indoorp(currentWorld)->isFloorAbove(player)) {
                                                player->loc.y += getIndoorWorldFloorHeight();
                                                player->ground = false;
                                        }
                                        break;
                                case SDLK_k:
-                                       if ( isCurrentWorldIndoors() && Indoorp(currentWorld)->isFloorBelow( player ) ) {
+                                       if (isCurrentWorldIndoors() && Indoorp(currentWorld)->isFloorBelow(player)) {
                                                player->loc.y -= getIndoorWorldFloorHeight();
                                                player->ground = false;
                                        }
@@ -1151,20 +1153,20 @@ EXIT:
                                        break;
                                case SDLK_l:
                                        currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
-                                       currentWorld->light.back().follow(player);
-                                       currentWorld->light.back().makeFlame();
+                                       currentWorld->getLastLight()->follow(player);
+                                       currentWorld->getLastLight()->makeFlame();
                                        break;
                                case SDLK_f:
                                        currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
                                        break;
                                case SDLK_b:
-                                       if ( debug )
+                                       if (debug)
                                                posFlag ^= true;
                                        else {
                                                currentWorld->addStructure(FIRE_PIT, player->loc.x, player->loc.y, "", "");
                                                currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
-                                               currentWorld->light.back().follow(currentWorld->build.back());
-                                               currentWorld->light.back().makeFlame();
+                                               currentWorld->getLastLight()->follow(currentWorld->build.back());
+                                               currentWorld->getLastLight()->makeFlame();
                                        }
                                        break;
                                case SDLK_F12:
@@ -1196,11 +1198,11 @@ EXIT:
                }
 
                // Flush preloaded AI functions if necessary
-               if ( !dialogBoxExists && AIpreaddr.size() ) {
-                       while ( !AIpreaddr.empty() ) {
-                               AIpreaddr.front()->addAIFunc( AIpreload.front(), false );
-                               AIpreaddr.erase( AIpreaddr.begin() );
-                               AIpreload.erase( AIpreload.begin() );
+               if (!dialogBoxExists && AIpreaddr.size()) {
+                       while (!AIpreaddr.empty()) {
+                               AIpreaddr.front()->addAIFunc(AIpreload.front(), false);
+                               AIpreaddr.erase(AIpreaddr.begin());
+                               AIpreload.erase(AIpreload.begin());
                        }
                }
        }
@@ -1225,9 +1227,9 @@ EXIT:
                fadeWhite   = true;
                fadeFast    = true;
 
-               Mix_PlayChannel( 1, battleStart, 0 );
+               Mix_PlayChannel(1, battleStart, 0);
        }
-    
+
     void takeScreenshot(GLubyte* pixels){
                std::vector<GLubyte> bgr (SCREEN_WIDTH * SCREEN_HEIGHT * 3, 0);
 
index 775ea816c7ab8ce6a4ca56cb6000f7096ccbea0e..9c7fc9da781ddaf8502fc6288a46bb8edc72dc2e 100644 (file)
@@ -6,9 +6,9 @@ extern Menu *currentMenu;
 extern Menu pauseMenu;
 
 void Menu::
-gotoParent( void )
+gotoParent(void)
 {
-       if ( !parent ) {
+       if (!parent) {
                currentMenu = NULL;
                config::update();
        } else
@@ -16,7 +16,7 @@ gotoParent( void )
 }
 
 void Menu::
-gotoChild( void )
+gotoChild(void)
 {
        currentMenu = child;
 }
@@ -78,7 +78,7 @@ namespace ui {
             return temp;
         }
 
-        void draw( void ) {
+        void draw(void) {
             SDL_Event e;
             
             setFontSize(24);
index be8e6821f5a67a9a1d58dca5c24b31489422644b..434f61979edfdf68564307f7f4afad80ee3f18c9 100644 (file)
@@ -98,20 +98,20 @@ const float bgDraw[4][3]={
  */
 
 void World::
-setBackground( WorldBGType bgt )
+setBackground(WorldBGType bgt)
 {
     // load textures with a limit check
-       switch ( (bgType = bgt) ) {
+       switch ((bgType = bgt)) {
        case WorldBGType::Forest:
-               bgTex = new Texturec( bgFiles );
+               bgTex = new Texturec(bgFiles);
                break;
 
        case WorldBGType::WoodHouse:
-               bgTex = new Texturec( bgFilesIndoors );
+               bgTex = new Texturec(bgFilesIndoors);
                break;
 
     default:
-        UserError( "Invalid world background type" );
+        UserError("Invalid world background type");
         break;
        }
 }
@@ -124,23 +124,23 @@ setBackground( WorldBGType bgt )
  */
 
 void World::
-setStyle( std::string pre )
+setStyle(std::string pre)
 {
     unsigned int i;
 
     // get folder prefix
        std::string prefix = pre.empty() ? "assets/style/classic/" : pre;
 
-       for ( i = 0; i < arrAmt(buildPaths); i++ )
-               sTexLoc.push_back( prefix + buildPaths[i] );
+       for (i = 0; i < arrAmt(buildPaths); i++)
+               sTexLoc.push_back(prefix + buildPaths[i]);
 
        prefix += "bg/";
 
-       for ( i = 0; i < arrAmt(bgPaths[0]); i++ )
-               bgFiles.push_back( prefix + bgPaths[0][i] );
+       for (i = 0; i < arrAmt(bgPaths[0]); i++)
+               bgFiles.push_back(prefix + bgPaths[0][i]);
 
-       for ( i = 0; i < arrAmt(bgPaths[1]); i++ )
-               bgFilesIndoors.push_back( prefix + bgPaths[1][i] );
+       for (i = 0; i < arrAmt(bgPaths[1]); i++)
+               bgFilesIndoors.push_back(prefix + bgPaths[1][i]);
 }
 
 /**
@@ -152,7 +152,7 @@ setStyle( std::string pre )
  */
 
 World::
-World( void )
+World(void)
 {
     bgmObj = NULL;
 }
@@ -165,13 +165,10 @@ World( void )
  */
 
 void World::
-deleteEntities( void )
+deleteEntities(void)
 {
     // free mobs
-       while ( !mob.empty() ) {
-               delete mob.back();
-               mob.pop_back();
-       }
+       mob.clear();
 
        merchant.clear();
        while(!npc.empty()){
@@ -180,16 +177,13 @@ deleteEntities( void )
        }
 
     // free structures
-       while ( !build.empty() ) {
+       while (!build.empty()) {
                delete build.back();
                build.pop_back();
        }
 
     // free objects
-       while ( !object.empty() ) {
-               delete object.back();
-               object.pop_back();
-       }
+       object.clear();
 
     // clear entity array
        entity.clear();
@@ -201,10 +195,7 @@ deleteEntities( void )
        light.clear();
 
     // free villages
-       while ( !village.empty() ) {
-               delete village.back();
-               village.pop_back();
-       }
+       village.clear();
 }
 
 /**
@@ -215,7 +206,7 @@ deleteEntities( void )
  */
 
 World::
-~World( void )
+~World(void)
 {
     // sdl2_mixer's object
        if(bgmObj)
@@ -233,7 +224,7 @@ World::
  */
 
 void World::
-generate( unsigned int width )
+generate(unsigned int width)
 {
     // iterator for `for` loops
        std::vector<WorldData>::iterator wditer;
@@ -242,7 +233,7 @@ generate( unsigned int width )
     float geninc = 0;
 
     // check for valid width
-    if ( (int)width <= 0 )
+    if ((int)width <= 0)
         UserError("Invalid world dimensions");
 
     // allocate space for world
@@ -260,9 +251,9 @@ generate( unsigned int width )
     // create slopes from the points that were just defined, populate the rest of the WorldData structure
 
     for(wditer = worldData.begin() + 1; wditer != worldData.end(); wditer++){
-        if ( (*wditer).groundHeight && wditer + GROUND_HILLINESS < worldData.end() )
+        if ((*wditer).groundHeight && wditer + GROUND_HILLINESS < worldData.end())
                        // wditer + GROUND_HILLINESS can go out of bounds (invalid read)
-            geninc = ( (*(wditer + GROUND_HILLINESS)).groundHeight - (*wditer).groundHeight ) / (float)GROUND_HILLINESS;
+            geninc = ((*(wditer + GROUND_HILLINESS)).groundHeight - (*wditer).groundHeight) / (float)GROUND_HILLINESS;
         else
             (*wditer).groundHeight = (*(wditer - 1)).groundHeight + geninc;
 
@@ -272,12 +263,12 @@ generate( unsigned int width )
         (*wditer).grassHeight[1] = (randGet() % 16) / 3 + 2;
 
         // bound checks
-        if ( (*wditer).groundHeight < GROUND_HEIGHT_MINIMUM )
+        if ((*wditer).groundHeight < GROUND_HEIGHT_MINIMUM)
             (*wditer).groundHeight = GROUND_HEIGHT_MINIMUM;
-        else if ( (*wditer).groundHeight > GROUND_HEIGHT_MAXIMUM )
+        else if ((*wditer).groundHeight > GROUND_HEIGHT_MAXIMUM)
                        (*wditer).groundHeight = GROUND_HEIGHT_MAXIMUM;
 
-               if( (*wditer).groundHeight <= 0 )
+               if((*wditer).groundHeight <= 0)
                        (*wditer).groundHeight = GROUND_HEIGHT_MINIMUM;
 
     }
@@ -286,8 +277,8 @@ generate( unsigned int width )
     worldStart = (width - GROUND_HILLINESS) * HLINE / 2 * -1;
 
     // create empty star array, should be filled here as well...
-       star = std::vector<vec2> (100, vec2 { 0, 400 } );
-       for ( auto &s : star ) {
+       star = std::vector<vec2> (100, vec2 { 0, 400 });
+       for (auto &s : star) {
                s.x = (getRand() % (-worldStart * 2)) + worldStart;
                s.y = (getRand() % SCREEN_HEIGHT) + 100.0f;
        }
@@ -300,43 +291,43 @@ generate( unsigned int width )
  */
 
 void World::
-update( Player *p, unsigned int delta )
+update(Player *p, unsigned int delta)
 {
     // update player coords
        p->loc.y += p->vel.y                     * delta;
        p->loc.x +=(p->vel.x * p->speed) * delta;
 
-       if ( p->loc.y > 5000 )
+       if (p->loc.y > 5000)
         UserError("Too high for me m8.");
 
        // update entity coords
-       for ( auto &e : entity ) {
+       for (auto &e : entity) {
 
         // dont let structures move?
-               if ( e->type != STRUCTURET && e->canMove ) {
+               if (e->type != STRUCTURET && e->canMove) {
                        e->loc.x += e->vel.x * delta;
             e->loc.y += e->vel.y * delta;
 
             // update boolean directions
-                       if ( e->vel.x < 0 )
+                       if (e->vel.x < 0)
                 e->left = true;
-                       else if ( e->vel.x > 0 )
+                       else if (e->vel.x > 0)
                 e->left = false;
-               } else if ( e->vel.y < 0 )
+               } else if (e->vel.y < 0)
             e->loc.y += e->vel.y * delta;
        }
     // iterate through particles
-    particles.erase( std::remove_if( particles.begin(), particles.end(), [&delta](Particles &part){return part.kill(delta);}), particles.end());
-    for ( auto part = particles.begin(); part != particles.end(); part++ ) {
-               if ( (*part).canMove ) {
+    particles.erase(std::remove_if(particles.begin(), particles.end(), [&delta](Particles &part){return part.kill(delta);}), particles.end());
+    for (auto part = particles.begin(); part != particles.end(); part++) {
+               if ((*part).canMove) {
                        (*part).loc.y += (*part).vel.y * delta;
                        (*part).loc.x += (*part).vel.x * delta;
 
-                       for ( auto &b : build ) {
-                               if ( b->bsubtype == FOUNTAIN ) {
-                                       if ( (*part).loc.x >= b->loc.x && (*part).loc.x <= b->loc.x + b->width ) {
-                                               if ( (*part).loc.y <= b->loc.y + b->height * .25)
-                                                       particles.erase( part );
+                       for (auto &b : build) {
+                               if (b->bsubtype == FOUNTAIN) {
+                                       if ((*part).loc.x >= b->loc.x && (*part).loc.x <= b->loc.x + b->width) {
+                                               if ((*part).loc.y <= b->loc.y + b->height * .25)
+                                                       particles.erase(part);
 
                                        }
                                }
@@ -345,9 +336,9 @@ update( Player *p, unsigned int delta )
        }
 
     // handle music fades
-       if ( ui::dialogImportant ) {
+       if (ui::dialogImportant) {
                //Mix_FadeOutMusic(2000);
-       } else if( !Mix_PlayingMusic() )
+       } else if(!Mix_PlayingMusic())
                Mix_FadeInMusic(bgmObj,-1,2000);
 }
 
@@ -359,10 +350,10 @@ update( Player *p, unsigned int delta )
  */
 
 void World::
-setBGM( std::string path )
+setBGM(std::string path)
 {
-       if( !path.empty() )
-               bgmObj = Mix_LoadMUS( (bgm = path).c_str() );
+       if(!path.empty())
+               bgmObj = Mix_LoadMUS((bgm = path).c_str());
 }
 
 /**
@@ -372,18 +363,18 @@ setBGM( std::string path )
  */
 
 void World::
-bgmPlay( World *prev ) const
+bgmPlay(World *prev) const
 {
-       if ( prev ) {
-               if ( bgm != prev->bgm ) {
+       if (prev) {
+               if (bgm != prev->bgm) {
             // new world, new music
-                       Mix_FadeOutMusic( 800 );
-                       Mix_PlayMusic( bgmObj, -1 );
+                       Mix_FadeOutMusic(800);
+                       Mix_PlayMusic(bgmObj, -1);
                }
        } else {
         // first call
-               Mix_FadeOutMusic( 800 );
-               Mix_PlayMusic( bgmObj, -1 );
+               Mix_FadeOutMusic(800);
+               Mix_PlayMusic(bgmObj, -1);
        }
 }
 
@@ -409,22 +400,22 @@ void World::draw(Player *p){
 
        // shade value for GLSL
        float shadeAmbient = -worldShade / 50.0f + 0.5f; // -0.5f to 1.5f
-       if ( shadeAmbient < 0 )
+       if (shadeAmbient < 0)
                shadeAmbient = 0;
-       else if ( shadeAmbient > 0.9f )
+       else if (shadeAmbient > 0.9f)
                shadeAmbient = 1;
 
        /*
      * Draw background images.
      */
 
-       glEnable( GL_TEXTURE_2D );
+       glEnable(GL_TEXTURE_2D);
 
        // the sunny wallpaper is faded with the night depending on tickCount
 
-       bgTex->bind( 0 );
+       bgTex->bind(0);
     int alpha;
-    switch( weather ) {
+    switch(weather) {
     case WorldWeather::Snowy:
         alpha = 150;
         break;
@@ -435,36 +426,36 @@ void World::draw(Player *p){
         alpha = 255 - worldShade * 4;
         break;
     }
-       safeSetColorA( 255, 255, 255, alpha );
+       safeSetColorA(255, 255, 255, alpha);
 
-       glBegin( GL_QUADS );
-               glTexCoord2i( 0, 0 ); glVertex2i( offset.x - SCREEN_WIDTH/2-5, offset.y + SCREEN_HEIGHT/2 );
-               glTexCoord2i( 1, 0 ); glVertex2i( offset.x + SCREEN_WIDTH/2+5, offset.y + SCREEN_HEIGHT/2 );
-               glTexCoord2i( 1, 1 ); glVertex2i( offset.x + SCREEN_WIDTH/2+5, offset.y - SCREEN_HEIGHT/2 );
-               glTexCoord2i( 0, 1 ); glVertex2i( offset.x - SCREEN_WIDTH/2-5, offset.y - SCREEN_HEIGHT/2 );
+       glBegin(GL_QUADS);
+               glTexCoord2i(0, 0); glVertex2i(offset.x - SCREEN_WIDTH/2-5, offset.y + SCREEN_HEIGHT/2);
+               glTexCoord2i(1, 0); glVertex2i(offset.x + SCREEN_WIDTH/2+5, offset.y + SCREEN_HEIGHT/2);
+               glTexCoord2i(1, 1); glVertex2i(offset.x + SCREEN_WIDTH/2+5, offset.y - SCREEN_HEIGHT/2);
+               glTexCoord2i(0, 1); glVertex2i(offset.x - SCREEN_WIDTH/2-5, offset.y - SCREEN_HEIGHT/2);
        glEnd();
 
        bgTex->bindNext();
-       safeSetColorA( 255, 255, 255, !alpha ? 255 : worldShade * 4);
+       safeSetColorA(255, 255, 255, !alpha ? 255 : worldShade * 4);
 
-       glBegin( GL_QUADS );
-        glTexCoord2i( 0, 0 ); glVertex2i( offset.x - SCREEN_WIDTH/2-5, offset.y + SCREEN_HEIGHT/2 );
-        glTexCoord2i( 1, 0 ); glVertex2i( offset.x + SCREEN_WIDTH/2+5, offset.y + SCREEN_HEIGHT/2 );
-        glTexCoord2i( 1, 1 ); glVertex2i( offset.x + SCREEN_WIDTH/2+5, offset.y - SCREEN_HEIGHT/2 );
-        glTexCoord2i( 0, 1 ); glVertex2i( offset.x - SCREEN_WIDTH/2-5, offset.y - SCREEN_HEIGHT/2 );
+       glBegin(GL_QUADS);
+        glTexCoord2i(0, 0); glVertex2i(offset.x - SCREEN_WIDTH/2-5, offset.y + SCREEN_HEIGHT/2);
+        glTexCoord2i(1, 0); glVertex2i(offset.x + SCREEN_WIDTH/2+5, offset.y + SCREEN_HEIGHT/2);
+        glTexCoord2i(1, 1); glVertex2i(offset.x + SCREEN_WIDTH/2+5, offset.y - SCREEN_HEIGHT/2);
+        glTexCoord2i(0, 1); glVertex2i(offset.x - SCREEN_WIDTH/2-5, offset.y - SCREEN_HEIGHT/2);
        glEnd();
 
-       glDisable( GL_TEXTURE_2D );
+       glDisable(GL_TEXTURE_2D);
 
        // draw the stars if the time deems it appropriate
 
-       //if (((( weather == WorldWeather::Dark  ) & ( tickCount % DAY_CYCLE )) < DAY_CYCLE / 2)   ||
-       //    ((( weather == WorldWeather::Sunny ) & ( tickCount % DAY_CYCLE )) > DAY_CYCLE * .75) ){
-       if ( worldShade > 0 ) {
+       //if ((((weather == WorldWeather::Dark) & (tickCount % DAY_CYCLE)) < DAY_CYCLE / 2)   ||
+       //    (((weather == WorldWeather::Sunny) & (tickCount % DAY_CYCLE)) > DAY_CYCLE * .75)){
+       if (worldShade > 0) {
 
-               safeSetColorA( 255, 255, 255, 255 - (getRand() % 30 - 15) );
+               safeSetColorA(255, 255, 255, 255 - (getRand() % 30 - 15));
 
-               for ( i = 0; i < 100; i++ ) {
+               for (i = 0; i < 100; i++) {
                        glRectf(star[i].x + offset.x * .9,
                                        star[i].y,
                                        star[i].x + offset.x * .9 + HLINE,
@@ -475,40 +466,40 @@ void World::draw(Player *p){
 
        // draw remaining background items
 
-       glEnable( GL_TEXTURE_2D );
+       glEnable(GL_TEXTURE_2D);
 
        bgTex->bindNext();
-       safeSetColorA( 150 + shadeBackground * 2, 150 + shadeBackground * 2, 150 + shadeBackground * 2, 255 );
-
-       glBegin( GL_QUADS );
-               for ( i = 0; i <= (int)(worldData.size() * HLINE / 1920); i++ ) {
-                       glTexCoord2i( 0, 1 ); glVertex2i( width / 2 * -1 + (1920 * i      ) + offset.x * .85, GROUND_HEIGHT_MINIMUM        );
-                       glTexCoord2i( 1, 1 ); glVertex2i( width / 2 * -1 + (1920 * (i + 1)) + offset.x * .85, GROUND_HEIGHT_MINIMUM        );
-                       glTexCoord2i( 1, 0 ); glVertex2i( width / 2 * -1 + (1920 * (i + 1)) + offset.x * .85, GROUND_HEIGHT_MINIMUM + 1080 );
-                       glTexCoord2i( 0, 0 ); glVertex2i( width / 2 * -1 + (1920 * i      ) + offset.x * .85, GROUND_HEIGHT_MINIMUM + 1080 );
+       safeSetColorA(150 + shadeBackground * 2, 150 + shadeBackground * 2, 150 + shadeBackground * 2, 255);
+
+       glBegin(GL_QUADS);
+               for (i = 0; i <= (int)(worldData.size() * HLINE / 1920); i++) {
+                       glTexCoord2i(0, 1); glVertex2i(width / 2 * -1 + (1920 * i) + offset.x * .85, GROUND_HEIGHT_MINIMUM);
+                       glTexCoord2i(1, 1); glVertex2i(width / 2 * -1 + (1920 * (i + 1)) + offset.x * .85, GROUND_HEIGHT_MINIMUM);
+                       glTexCoord2i(1, 0); glVertex2i(width / 2 * -1 + (1920 * (i + 1)) + offset.x * .85, GROUND_HEIGHT_MINIMUM + 1080);
+                       glTexCoord2i(0, 0); glVertex2i(width / 2 * -1 + (1920 * i) + offset.x * .85, GROUND_HEIGHT_MINIMUM + 1080);
                }
        glEnd();
 
-       for ( i = 0; i < 4; i++ ) {
+       for (i = 0; i < 4; i++) {
                bgTex->bindNext();
-               safeSetColorA( bgDraw[i][0] + shadeBackground * 2, bgDraw[i][0] + shadeBackground * 2, bgDraw[i][0] + shadeBackground * 2, bgDraw[i][1] );
-
-               glBegin( GL_QUADS );
-                       for( int j = worldStart; j <= -worldStart; j += 600 ){
-                               glTexCoord2i( 0, 1 ); glVertex2i(  j        + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM       );
-                               glTexCoord2i( 1, 1 ); glVertex2i( (j + 600) + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM       );
-                               glTexCoord2i( 1, 0 ); glVertex2i( (j + 600) + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM + 400 );
-                               glTexCoord2i( 0, 0 ); glVertex2i(  j        + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM + 400 );
+               safeSetColorA(bgDraw[i][0] + shadeBackground * 2, bgDraw[i][0] + shadeBackground * 2, bgDraw[i][0] + shadeBackground * 2, bgDraw[i][1]);
+
+               glBegin(GL_QUADS);
+                       for(int j = worldStart; j <= -worldStart; j += 600){
+                               glTexCoord2i(0, 1); glVertex2i(j        + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM);
+                               glTexCoord2i(1, 1); glVertex2i((j + 600) + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM);
+                               glTexCoord2i(1, 0); glVertex2i((j + 600) + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM + 400);
+                               glTexCoord2i(0, 0); glVertex2i(j        + offset.x * bgDraw[i][2], GROUND_HEIGHT_MINIMUM + 400);
                        }
                glEnd();
        }
 
-       glDisable( GL_TEXTURE_2D );
+       glDisable(GL_TEXTURE_2D);
 
        // draw black under backgrounds
 
-       glColor3ub( 0, 0, 0 );
-       glRectf( worldStart, GROUND_HEIGHT_MINIMUM, -worldStart, 0 );
+       glColor3ub(0, 0, 0);
+       glRectf(worldStart, GROUND_HEIGHT_MINIMUM, -worldStart, 0);
 
        pOffset = (offset.x + p->width / 2 - worldStart) / HLINE;
 
@@ -534,14 +525,14 @@ void World::draw(Player *p){
     glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
     glUseProgram(shaderProgram);
 
-    std::for_each( particles.begin(), particles.end(), [](Particles part) { if ( part.behind ) part.draw(); });
+    std::for_each(particles.begin(), particles.end(), [](Particles part) { if (part.behind) part.draw(); });
 
     glUseProgram(0);
 
-       for ( auto &b : build ) {
-        if ( b->bsubtype == STALL_MARKET ) {
-            for ( auto &n : npc ) {
-                if ( n->type == MERCHT && ((Merchant *)n)->inside == b ) {
+       for (auto &b : build) {
+        if (b->bsubtype == STALL_MARKET) {
+            for (auto &n : npc) {
+                if (n->type == MERCHT && ((Merchant *)n)->inside == b) {
                     n->draw();
                     break;
                 }
@@ -552,9 +543,9 @@ void World::draw(Player *p){
 
        // draw light elements?
 
-       glEnable( GL_TEXTURE_2D );
+       glEnable(GL_TEXTURE_2D);
 
-       glActiveTexture( GL_TEXTURE0 );
+       glActiveTexture(GL_TEXTURE0);
        bgTex->bindNext();
 
     for(auto &l : light){
@@ -585,22 +576,22 @@ void World::draw(Player *p){
         }
        }
 
-    for ( uint i = 0; i < light.size(); i++ )
+    for (uint i = 0; i < light.size(); i++)
         flameArray[i] = light[i].fireFlicker;
 
-       glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
-       glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
 
-       glUseProgram( shaderProgram );
-       glUniform1i( glGetUniformLocation( shaderProgram, "sampler"), 0 );
-       glUniform1f( glGetUniformLocation( shaderProgram, "amb"    ), shadeAmbient );
+       glUseProgram(shaderProgram);
+       glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
+       glUniform1f(glGetUniformLocation(shaderProgram, "amb"), shadeAmbient);
 
-       if ( light.size() == 0)
-               glUniform1i( glGetUniformLocation( shaderProgram, "numLight"), 0);
+       if (light.size() == 0)
+               glUniform1i(glGetUniformLocation(shaderProgram, "numLight"), 0);
        else {
-               glUniform1i ( glGetUniformLocation( shaderProgram, "numLight"     ), light.size());
-               glUniform2fv( glGetUniformLocation( shaderProgram, "lightLocation"), light.size(), pointArray );
-               glUniform3f ( glGetUniformLocation( shaderProgram, "lightColor"   ), 1.0f, 1.0f, 1.0f );
+               glUniform1i (glGetUniformLocation(shaderProgram, "numLight"), light.size());
+               glUniform2fv(glGetUniformLocation(shaderProgram, "lightLocation"), light.size(), pointArray);
+               glUniform3f (glGetUniformLocation(shaderProgram, "lightColor"), 1.0f, 1.0f, 1.0f);
         glUniform1fv(glGetUniformLocation(shaderProgram,"fireFlicker"), light.size(),flameArray);
        }
 
@@ -608,7 +599,7 @@ void World::draw(Player *p){
      * Draw the dirt.
      */
 
-       glBegin( GL_QUADS );
+       glBegin(GL_QUADS);
 
         // faulty
         /*glTexCoord2i(0 ,0);glVertex2i(pOffset - (SCREEN_WIDTH / 1.5),0);
@@ -616,20 +607,20 @@ void World::draw(Player *p){
         glTexCoord2i(64,1);glVertex2i(pOffset + (SCREEN_WIDTH / 1.5),GROUND_HEIGHT_MINIMUM);
         glTexCoord2i(0 ,1);glVertex2i(pOffset - (SCREEN_WIDTH / 1.5),GROUND_HEIGHT_MINIMUM);*/
 
-        for ( i = iStart; i < iEnd; i++ ) {
-            if ( worldData[i].groundHeight <= 0 ) {
+        for (i = iStart; i < iEnd; i++) {
+            if (worldData[i].groundHeight <= 0) {
                 worldData[i].groundHeight = GROUND_HEIGHT_MINIMUM - 1;
-                glColor4ub( 0, 0, 0, 255 );
+                glColor4ub(0, 0, 0, 255);
             } else
-                safeSetColorA( 150, 150, 150, 255 );
+                safeSetColorA(150, 150, 150, 255);
 
-            glTexCoord2i( 0, 0 ); glVertex2i(worldStart + i * HLINE         , worldData[i].groundHeight - GRASS_HEIGHT );
-            glTexCoord2i( 1, 0 ); glVertex2i(worldStart + i * HLINE + HLINE , worldData[i].groundHeight - GRASS_HEIGHT );
+            glTexCoord2i(0, 0); glVertex2i(worldStart + i * HLINE         , worldData[i].groundHeight - GRASS_HEIGHT);
+            glTexCoord2i(1, 0); glVertex2i(worldStart + i * HLINE + HLINE , worldData[i].groundHeight - GRASS_HEIGHT);
 
-            glTexCoord2i( 1, (int)(worldData[i].groundHeight / 64) + worldData[i].groundColor ); glVertex2i(worldStart + i * HLINE + HLINE, 0 );
-            glTexCoord2i( 0, (int)(worldData[i].groundHeight / 64) + worldData[i].groundColor ); glVertex2i(worldStart + i * HLINE           , 0 );
+            glTexCoord2i(1, (int)(worldData[i].groundHeight / 64) + worldData[i].groundColor); glVertex2i(worldStart + i * HLINE + HLINE, 0);
+            glTexCoord2i(0, (int)(worldData[i].groundHeight / 64) + worldData[i].groundColor); glVertex2i(worldStart + i * HLINE             , 0);
 
-            if ( worldData[i].groundHeight == GROUND_HEIGHT_MINIMUM - 1 )
+            if (worldData[i].groundHeight == GROUND_HEIGHT_MINIMUM - 1)
                 worldData[i].groundHeight = 0;
         }
 
@@ -642,42 +633,42 @@ void World::draw(Player *p){
         *      Draw the grass/the top of the ground.
         */
 
-       glEnable( GL_TEXTURE_2D );
+       glEnable(GL_TEXTURE_2D);
 
-       glActiveTexture( GL_TEXTURE0 );
+       glActiveTexture(GL_TEXTURE0);
        bgTex->bindNext();
 
-       glUseProgram( shaderProgram );
-       glUniform1i( glGetUniformLocation( shaderProgram, "sampler"), 0);
+       glUseProgram(shaderProgram);
+       glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
 
        float cgh[2];
-       for ( i = iStart; i < iEnd - GROUND_HILLINESS; i++ ) {
+       for (i = iStart; i < iEnd - GROUND_HILLINESS; i++) {
 
                // load the current line's grass values
-               if ( worldData[i].groundHeight )
-                       memcpy( cgh, worldData[i].grassHeight, 2 * sizeof( float ));
+               if (worldData[i].groundHeight)
+                       memcpy(cgh, worldData[i].grassHeight, 2 * sizeof(float));
                else
-                       memset( cgh, 0 , 2 * sizeof( float ));
+                       memset(cgh, 0 , 2 * sizeof(float));
 
                // flatten the grass if the player is standing on it.
-               if( !worldData[i].grassUnpressed ){
+               if(!worldData[i].grassUnpressed){
                        cgh[0] /= 4;
                        cgh[1] /= 4;
                }
 
                // actually draw the grass.
 
-               safeSetColorA( 255, 255, 255, 255 );
-
-               glBegin( GL_QUADS );
-                       glTexCoord2i( 0, 0 ); glVertex2i( worldStart + i * HLINE            , worldData[i].groundHeight + cgh[0] );
-                       glTexCoord2i( 1, 0 ); glVertex2i( worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight + cgh[0] );
-                       glTexCoord2i( 1, 1 ); glVertex2i( worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight - GRASS_HEIGHT );
-                       glTexCoord2i( 0, 1 ); glVertex2i( worldStart + i * HLINE                    , worldData[i].groundHeight - GRASS_HEIGHT );
-                       glTexCoord2i( 0, 0 ); glVertex2i( worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight + cgh[1] );
-                       glTexCoord2i( 1, 0 ); glVertex2i( worldStart + i * HLINE + HLINE    , worldData[i].groundHeight + cgh[1] );
-                       glTexCoord2i( 1, 1 ); glVertex2i( worldStart + i * HLINE + HLINE    , worldData[i].groundHeight - GRASS_HEIGHT );
-                       glTexCoord2i( 0, 1 ); glVertex2i( worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight - GRASS_HEIGHT );
+               safeSetColorA(255, 255, 255, 255);
+
+               glBegin(GL_QUADS);
+                       glTexCoord2i(0, 0); glVertex2i(worldStart + i * HLINE            , worldData[i].groundHeight + cgh[0]);
+                       glTexCoord2i(1, 0); glVertex2i(worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight + cgh[0]);
+                       glTexCoord2i(1, 1); glVertex2i(worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight - GRASS_HEIGHT);
+                       glTexCoord2i(0, 1); glVertex2i(worldStart + i * HLINE               , worldData[i].groundHeight - GRASS_HEIGHT);
+                       glTexCoord2i(0, 0); glVertex2i(worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight + cgh[1]);
+                       glTexCoord2i(1, 0); glVertex2i(worldStart + i * HLINE + HLINE    , worldData[i].groundHeight + cgh[1]);
+                       glTexCoord2i(1, 1); glVertex2i(worldStart + i * HLINE + HLINE    , worldData[i].groundHeight - GRASS_HEIGHT);
+                       glTexCoord2i(0, 1); glVertex2i(worldStart + i * HLINE + HLINE / 2, worldData[i].groundHeight - GRASS_HEIGHT);
                glEnd();
        }
 
@@ -695,34 +686,34 @@ void World::draw(Player *p){
     glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
     glUseProgram(shaderProgram);
 
-       std::for_each( particles.begin(), particles.end(), [](Particles part) { if ( !part.behind ) part.draw(); });
+       std::for_each(particles.begin(), particles.end(), [](Particles part) { if (!part.behind) part.draw(); });
 
     glUseProgram(0);
 
-       for ( auto &n : npc ) {
-               if ( n->type != MERCHT )
+       for (auto &n : npc) {
+               if (n->type != MERCHT)
             n->draw();
     }
 
-       for ( auto &m : mob )
-               m->draw();
+       for (auto &m : mob)
+               m.draw();
 
-       for ( auto &o : object )
-               o->draw();
+       for (auto &o : object)
+               o.draw();
 
     /*
      * Handle grass-squishing.
      */
 
        // calculate the line that the player is on
-       int ph = ( p->loc.x + p->width / 2 - worldStart ) / HLINE;
+       int ph = (p->loc.x + p->width / 2 - worldStart) / HLINE;
 
        // flatten grass under the player if the player is on the ground
-       if ( p->ground ) {
-               for ( i = 0; i < (int)(worldData.size() - GROUND_HILLINESS); i++ )
-                       worldData[i].grassUnpressed = !( i < ph + 6 && i > ph - 6 );
+       if (p->ground) {
+               for (i = 0; i < (int)(worldData.size() - GROUND_HILLINESS); i++)
+                       worldData[i].grassUnpressed = !(i < ph + 6 && i > ph - 6);
        } else {
-               for ( i = 0; i < (int)(worldData.size() - GROUND_HILLINESS); i++ )
+               for (i = 0; i < (int)(worldData.size() - GROUND_HILLINESS); i++)
                        worldData[i].grassUnpressed = true;
        }
 
@@ -741,7 +732,7 @@ void World::draw(Player *p){
  */
 
 void World::
-singleDetect( Entity *e )
+singleDetect(Entity *e)
 {
        std::string killed;
        unsigned int i,j;
@@ -751,12 +742,12 @@ singleDetect( Entity *e )
         *      Kill any dead entities.
        */
 
-       if ( e->alive && e->health <= 0 ) {
+       if (e->alive && e->health <= 0) {
         e->alive = false;
         e->health = 0;
-               for ( i = 0; i < entity.size(); i++) {
-                       if ( entity[i] == e ){
-                               switch ( e->type ) {
+               for (i = 0; i < entity.size(); i++) {
+                       if (entity[i] == e){
+                               switch (e->type) {
                                case STRUCTURET:
                                        killed = "structure";
                                        for(j=0;j<build.size();j++){
@@ -789,13 +780,12 @@ singleDetect( Entity *e )
                                        break;
                                case OBJECTT:
                                        killed = "object";
-                                       for(j=0;j<object.size();j++){
-                                               if(object[j]==e){
-                                                       delete object[j];
-                                                       object.erase(object.begin()+j);
-                                                       break;
-                                               }
-                                       }
+                    for (auto o = std::begin(object); o != std::end(object); o++) {
+                        if (&(*o) == e) {
+                            object.erase(o);
+                            break;
+                        }
+                    }
                                        break;
                                default:
                                        break;
@@ -806,36 +796,36 @@ singleDetect( Entity *e )
                        }
                }
                std::cout << "RIP " << e->name << "." << std::endl;
-               exit( 0 );
+               exit(0);
        }
 
        // handle only living entities
-       if ( e->alive ) {
+       if (e->alive) {
 
         // forced movement gravity
-        if ( e->forcedMove ) {
-            if ( e->vel.x > .0005 || e->vel.x < -.0005 )
+        if (e->forcedMove) {
+            if (e->vel.x > .0005 || e->vel.x < -.0005)
                 e->vel.x *= .6;
             else
                 e->forcedMove = false;
         }
 
-               if ( e->type == MOBT && Mobp(e)->subtype == MS_TRIGGER )
+               if (e->type == MOBT && Mobp(e)->subtype == MS_TRIGGER)
                        return;
 
                // calculate the line that this entity is currently standing on
                l = (e->loc.x + e->width / 2 - worldStart) / HLINE;
-               if ( l < 0 )
+               if (l < 0)
             l = 0;
                i = l;
-               if ( i > lineCount - 1 )
+               if (i > lineCount - 1)
             i = lineCount - 1;
 
                // if the entity is under the world/line, pop it back to the surface
-               if ( e->loc.y < worldData[i].groundHeight ) {
+               if (e->loc.y < worldData[i].groundHeight) {
             int dir = e->vel.x < 0 ? -1 : 1;
-            if ( i + (dir * 2) < worldData.size() && worldData[i + (dir * 2)].groundHeight - 30 > worldData[i + dir].groundHeight ) {
-                e->loc.x -= ( PLAYER_SPEED_CONSTANT + 2.7 ) * e->speed * 2 * dir;
+            if (i + (dir * 2) < worldData.size() && worldData[i + (dir * 2)].groundHeight - 30 > worldData[i + dir].groundHeight) {
+                e->loc.x -= (PLAYER_SPEED_CONSTANT + 2.7) * e->speed * 2 * dir;
                 e->vel.x = 0;
             } else {
                 e->loc.y = worldData[i].groundHeight - .001 * deltaTime;
@@ -848,12 +838,12 @@ singleDetect( Entity *e )
         // handle gravity if the entity is above the line
         else {
 
-                       if ( e->type == STRUCTURET ) {
+                       if (e->type == STRUCTURET) {
                                e->loc.y = worldData[i].groundHeight;
                                e->vel.y = 0;
                                e->ground = true;
                                return;
-                       } else if ( e->vel.y > -2 )
+                       } else if (e->vel.y > -2)
                 e->vel.y -= GRAVITY_CONSTANT * deltaTime;
                }
 
@@ -880,37 +870,37 @@ singleDetect( Entity *e )
  */
 
 void World::
-detect( Player *p )
+detect(Player *p)
 {
        int l;
 
        // handle the player
-       std::thread( &World::singleDetect, this, p ).detach();
+       std::thread(&World::singleDetect, this, p).detach();
 
     // handle other entities
-       for ( auto &e : entity )
-               std::thread( &World::singleDetect, this, e ).detach();
+       for (auto &e : entity)
+               std::thread(&World::singleDetect, this, e).detach();
 
     // handle particles
-       for ( auto &part : particles ) {
+       for (auto &part : particles) {
 
                // get particle's current world line
                l = (part.loc.x + part.width / 2 - worldStart) / HLINE;
 
-               if ( l < 0 )
+               if (l < 0)
                        l = 0;
 
-               if ( l > (int)(lineCount - 1) )
+               if (l > (int)(lineCount - 1))
                        l = lineCount - 1;
 
-               part.update( GRAVITY_CONSTANT, worldData[l].groundHeight );
+               part.update(GRAVITY_CONSTANT, worldData[l].groundHeight);
        }
 
        // handle particle creation
-       for ( auto &b : build ) {
-               switch ( b->bsubtype ) {
+       for (auto &b : build) {
+               switch (b->bsubtype) {
                case FOUNTAIN:
-                       for ( unsigned int r = (randGet() % 25) + 11; r--; ) {
+                       for (unsigned int r = (randGet() % 25) + 11; r--;) {
                                addParticle(randGet() % HLINE * 3 + b->loc.x + b->width / 2,    // x
                                                        b->loc.y + b->height,                                                           // y
                                                        HLINE * 1.25,                                                                           // width
@@ -926,7 +916,7 @@ detect( Player *p )
                        break;
 
                case FIRE_PIT:
-                       for(unsigned int r = (randGet() % 20) + 11; r--; ) {
+                       for(unsigned int r = (randGet() % 20) + 11; r--;) {
                                addParticle(randGet() % (int)(b->width / 2) + b->loc.x + b->width / 4,  // x
                                                        b->loc.y + 3 * HLINE,                                                                           // y
                                                        HLINE,                                                                                                          // width
@@ -948,14 +938,14 @@ detect( Player *p )
        }
 
        // draws the village welcome message if the player enters the village bounds
-       for ( auto &v : village ) {
-               if ( p->loc.x > v->start.x && p->loc.x < v->end.x ) {
-                       if ( !v->in ) {
-                               ui::passiveImportantText( 5000, "Welcome to %s", v->name.c_str() );
-                               v->in = true;
+       for (auto &v : village) {
+               if (p->loc.x > v.start.x && p->loc.x < v.end.x) {
+                       if (!v.in) {
+                               ui::passiveImportantText(5000, "Welcome to %s", v.name.c_str());
+                               v.in = true;
                        }
                } else
-                       v->in = false;
+                       v.in = false;
        }
 }
 
@@ -971,19 +961,26 @@ void World::addStructure(BUILD_SUB sub, float x,float y, std::string tex, std::s
        entity.push_back(build.back());
 }
 
+Village *World::
+addVillage(std::string name, World *world)
+{
+    village.emplace_back(name.c_str(), world);
+    return &village.back();
+}
+
 void World::addMob(int t,float x,float y){
-       mob.push_back(new Mob(t));
-       mob.back()->spawn(x,y);
+       mob.emplace_back(t);
+       mob.back().spawn(x,y);
 
-       entity.push_back(mob.back());
+       entity.push_back(&mob.back());
 }
 
 void World::addMob(int t,float x,float y,void (*hey)(Mob *)){
-       mob.push_back(new Mob(t));
-       mob.back()->spawn(x,y);
-       mob.back()->hey = hey;
+       mob.emplace_back(t);
+       mob.back().spawn(x,y);
+       mob.back().hey = hey;
 
-       entity.push_back(mob.back());
+       entity.push_back(&mob.back());
 }
 
 void World::addNPC(float x,float y){
@@ -1001,57 +998,91 @@ void World::addMerchant(float x, float y){
        entity.push_back(npc.back());
 }
 
-void World::addObject( std::string in, std::string p, float x, float y){
-       object.push_back(new Object(in,p));
-       object.back()->spawn(x,y);
+void World::addObject(std::string in, std::string p, float x, float y){
+       object.emplace_back(in, p);
+       object.back().spawn(x, y);
 
-       entity.push_back(object.back());
+       entity.push_back(&object.back());
 }
 
 void World::
-addParticle( float x, float y, float w, float h, float vx, float vy, Color color, int d )
+addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d)
 {
-       particles.emplace_back( x, y, w, h, vx, vy, color, d );
+       particles.emplace_back(x, y, w, h, vx, vy, color, d);
        particles.back().canMove = true;
 }
 
 void World::
-addParticle( float x, float y, float w, float h, float vx, float vy, Color color, int d, bool gravity )
+addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d, unsigned char flags)
 {
-       particles.emplace_back( x, y, w, h, vx, vy, color, d );
+       particles.emplace_back(x, y, w, h, vx, vy, color, d);
        particles.back().canMove = true;
-    particles.back().gravity = gravity;
+    particles.back().gravity = flags & (1 << 0);
+    particles.back().bounce  = flags & (1 << 1);
 }
 
 void World::
-addLight( vec2 loc, Color color )
+addLight(vec2 loc, Color color)
+{
+       if (light.size() < 64)
+        light.push_back(Light(loc, color, 1));
+}
+
+Light *World::
+getLastLight(void)
+{
+    return &light.back();
+}
+
+Mob *World::
+getLastMob(void)
+{
+    return &mob.back();
+}
+
+std::string World::
+getSTextureLocation(unsigned int index) const
 {
-       if ( light.size() < 64 )
-        light.push_back( Light( loc, color, 1 ) );
+    if (index > sTexLoc.size())
+        return "";
+
+    return sTexLoc[ index ];
 }
 
 std::string World::
-setToLeft( std::string file )
+setToLeft(std::string file)
 {
     return (toLeft = file);
 }
 
 std::string World::
-setToRight( std::string file )
+setToRight(std::string file)
 {
        return (toRight = file);
 }
 
+std::string World::
+getToLeft(void) const
+{
+    return toLeft;
+}
+
+std::string World::
+getToRight(void) const
+{
+    return toRight;
+}
+
 World *World::
-goWorldLeft( Player *p )
+goWorldLeft(Player *p)
 {
        World *tmp;
 
     // check if player is at world edge
-       if( !toLeft.empty() && p->loc.x < worldStart + HLINE * 15.0f ) {
+       if(!toLeft.empty() && p->loc.x < worldStart + HLINE * 15.0f) {
 
         // load world (`toLeft` conditional confirms existance)
-           tmp = loadWorldFromPtr( currentWorldToLeft );
+           tmp = loadWorldFromPtr(currentWorldToLeft);
 
         // adjust player location
                p->loc.x = tmp->worldStart + HLINE * 20;
@@ -1064,10 +1095,10 @@ goWorldLeft( Player *p )
 }
 
 bool World::
-goWorldLeft( NPC *e )
+goWorldLeft(NPC *e)
 {
        // check if entity is at world edge
-       if( !toLeft.empty() && e->loc.x < worldStart + HLINE * 15.0f ) {
+       if(!toLeft.empty() && e->loc.x < worldStart + HLINE * 15.0f) {
 
         currentWorldToLeft->addNPC(e->loc.x,e->loc.y);
         e->alive = false;
@@ -1082,12 +1113,12 @@ goWorldLeft( NPC *e )
 }
 
 World *World::
-goWorldRight( Player *p )
+goWorldRight(Player *p)
 {
        World *tmp;
 
-       if( !toRight.empty() && p->loc.x + p->width > -worldStart - HLINE * 15 ) {
-               tmp = loadWorldFromPtr( currentWorldToRight );
+       if(!toRight.empty() && p->loc.x + p->width > -worldStart - HLINE * 15) {
+               tmp = loadWorldFromPtr(currentWorldToRight);
 
                p->loc.x = tmp->worldStart - HLINE * -15.0f;
                p->loc.y = GROUND_HEIGHT_MINIMUM;
@@ -1099,22 +1130,22 @@ goWorldRight( Player *p )
 }
 
 World *World::
-goInsideStructure( Player *p )
+goInsideStructure(Player *p)
 {
        World *tmp;
        std::string current;
 
-       if ( inside.empty() ) {
-               for ( auto &b : build ) {
-                       if ( p->loc.x            > b->loc.x            &&
-                            p->loc.x + p->width < b->loc.x + b->width ) {
+       if (inside.empty()) {
+               for (auto &b : build) {
+                       if (p->loc.x            > b->loc.x            &&
+                            p->loc.x + p->width < b->loc.x + b->width) {
 
-                if ( b->inside.empty() )
+                if (b->inside.empty())
                     return this;
 
                                inside.push_back(currentXML.c_str() + xmlFolder.size());
 
-                               tmp = loadWorldFromXML( b->inside );
+                               tmp = loadWorldFromXML(b->inside);
 
                                ui::toggleBlackFast();
                                ui::waitForCover();
@@ -1127,9 +1158,9 @@ goInsideStructure( Player *p )
                }
        } else {
         current = currentXML.c_str() + xmlFolder.size();
-               tmp = loadWorldFromXML( inside.back() );
-               for ( auto &b : tmp->build ) {
-                       if ( current == b->inside ) {
+               tmp = loadWorldFromXML(inside.back());
+               for (auto &b : tmp->build) {
+                       if (current == b->inside) {
                                inside.pop_back();
 
                                ui::toggleBlackFast();
@@ -1150,39 +1181,39 @@ goInsideStructure( Player *p )
 }
 
 void World::
-addHole( unsigned int start, unsigned int end )
+addHole(unsigned int start, unsigned int end)
 {
-    if ( end > worldData.size() )
+    if (end > worldData.size())
         end = worldData.size();
-    
-       for ( unsigned int i = start; i < end; i++ )
+
+       for (unsigned int i = start; i < end; i++)
                worldData[i].groundHeight = 0;
 }
 
 void World::
-addHill( const ivec2 peak, const unsigned int width )
+addHill(const ivec2 peak, const unsigned int width)
 {
        int start = peak.x - width / 2, end = start + width, offset = 0;
        const float thing = peak.y - worldData[start].groundHeight;
     const float period = PI / width;
 
-       if ( start < 0 ) {
+       if (start < 0) {
         offset = -start;
         start = 0;
     }
 
-       if ( end > (signed)worldData.size() )
+       if (end > (signed)worldData.size())
          end = worldData.size();
 
-       for ( int i = start; i < end; i++ ) {
+       for (int i = start; i < end; i++) {
                worldData[i].groundHeight += thing * sin((i - start + offset) * period);
-               if ( worldData[i].groundHeight > peak.y )
+               if (worldData[i].groundHeight > peak.y)
                        worldData[i].groundHeight = peak.y;
        }
 }
 
 int World::
-getTheWidth( void ) const
+getTheWidth(void) const
 {
        return worldStart * -2;
 }
@@ -1207,9 +1238,9 @@ void World::save(void){
        }
 
        for(auto &m : mob){
-               data.append(std::to_string((int)m->loc.x) + "\n");
-               data.append(std::to_string((int)m->loc.y) + "\n");
-               data.append(std::to_string((int)m->alive) + "\n");
+               data.append(std::to_string((int)m.loc.x) + "\n");
+               data.append(std::to_string((int)m.loc.y) + "\n");
+               data.append(std::to_string((int)m.alive) + "\n");
        }
 
        data.append("dOnE\0");
@@ -1253,13 +1284,13 @@ void World::load(void){
        for(auto &m : mob){
                std::getline(iss,line);
                if(line == "dOnE")return;
-               m->loc.x = std::stoi(line);
+               m.loc.x = std::stoi(line);
                std::getline(iss,line);
                if(line == "dOnE")return;
-               m->loc.y = std::stoi(line);
+               m.loc.y = std::stoi(line);
                std::getline(iss,line);
                if(line == "dOnE")return;
-               m->alive = std::stoi(line);
+               m.alive = std::stoi(line);
        }
 
        while(std::getline(iss,line)){
@@ -1270,12 +1301,12 @@ void World::load(void){
        delete[] filedata;
 }
 
-float getIndoorWorldFloorHeight( void )
+float getIndoorWorldFloorHeight(void)
 {
     return INDOOR_FLOOR_HEIGHTT + INDOOR_FLOOR_THICKNESS;
 }
 
-bool isCurrentWorldIndoors( void ) {
+bool isCurrentWorldIndoors(void) {
     return !inside.empty();
 }
 
@@ -1289,28 +1320,28 @@ IndoorWorld::~IndoorWorld(void){
 }
 
 void IndoorWorld::
-addFloor( unsigned int width )
+addFloor(unsigned int width)
 {
-    if ( floor.empty() )
-        generate( width );
-    floor.emplace_back( width, floor.size() * INDOOR_FLOOR_HEIGHTT + INDOOR_FLOOR_THICKNESS );
-    fstart.push_back( 0 );
+    if (floor.empty())
+        generate(width);
+    floor.emplace_back(width, floor.size() * INDOOR_FLOOR_HEIGHTT + INDOOR_FLOOR_THICKNESS);
+    fstart.push_back(0);
 }
 
 
 void IndoorWorld::
-addFloor( unsigned int width, unsigned int start )
+addFloor(unsigned int width, unsigned int start)
 {
-    if ( floor.empty() )
-        generate( width );
-    floor.emplace_back( width, floor.size() * INDOOR_FLOOR_HEIGHTT + INDOOR_FLOOR_THICKNESS );
-    fstart.push_back( start );
+    if (floor.empty())
+        generate(width);
+    floor.emplace_back(width, floor.size() * INDOOR_FLOOR_HEIGHTT + INDOOR_FLOOR_THICKNESS);
+    fstart.push_back(start);
 }
 
 bool IndoorWorld::
-moveToFloor( Entity *e, unsigned int _floor )
+moveToFloor(Entity *e, unsigned int _floor)
 {
-    if ( _floor > floor.size() )
+    if (_floor > floor.size())
         return false;
 
     e->loc.y = floor[_floor - 1][0];
@@ -1318,39 +1349,39 @@ moveToFloor( Entity *e, unsigned int _floor )
 }
 
 bool IndoorWorld::
-isFloorAbove( Entity *e )
+isFloorAbove(Entity *e)
 {
-    for ( unsigned int i = 0; i < floor.size(); i++ ) {
-        if ( floor[i][0] + INDOOR_FLOOR_HEIGHTT - 100 > e->loc.y )
+    for (unsigned int i = 0; i < floor.size(); i++) {
+        if (floor[i][0] + INDOOR_FLOOR_HEIGHTT - 100 > e->loc.y)
             return (i + 1) != floor.size();
     }
     return false;
 }
 
 bool IndoorWorld::
-isFloorBelow( Entity *e )
+isFloorBelow(Entity *e)
 {
-    for ( unsigned int i = 0; i < floor.size(); i++ ) {
-        if ( floor[i][0] + INDOOR_FLOOR_HEIGHTT - 100 > e->loc.y )
+    for (unsigned int i = 0; i < floor.size(); i++) {
+        if (floor[i][0] + INDOOR_FLOOR_HEIGHTT - 100 > e->loc.y)
             return i > 0;
     }
     return false;
 }
 
 void IndoorWorld::
-singleDetect( Entity *e )
+singleDetect(Entity *e)
 {
     unsigned int floornum = 0;
     float start, end;
 
-    if ( !e->alive )
+    if (!e->alive)
         return;
-    if ( e->type == MOBT && Mobp(e)->subtype == MS_TRIGGER )
+    if (e->type == MOBT && Mobp(e)->subtype == MS_TRIGGER)
         return;
 
-    for ( ; floornum < floor.size(); floornum++ ) {
-        if ( floor[floornum][0] + INDOOR_FLOOR_HEIGHTT - 100 > e->loc.y ) {
-            if ( e->loc.y < floor[floornum][0] ) {
+    for (; floornum < floor.size(); floornum++) {
+        if (floor[floornum][0] + INDOOR_FLOOR_HEIGHTT - 100 > e->loc.y) {
+            if (e->loc.y < floor[floornum][0]) {
                 e->loc.y = floor[floornum][0];
                 e->vel.y = 0;
                 e->ground = true;
@@ -1359,21 +1390,21 @@ singleDetect( Entity *e )
         }
     }
 
-    if ( e->vel.y > -2 )
+    if (e->vel.y > -2)
         e->vel.y -= GRAVITY_CONSTANT * deltaTime;
 
-    if ( e->ground ) {
-        e->loc.y = ceil( e->loc.y );
+    if (e->ground) {
+        e->loc.y = ceil(e->loc.y);
         e->vel.y = 0;
     }
 
     start = worldStart + fstart[floornum] * HLINE;
     end = start + floor[floornum].size() * HLINE;
 
-    if ( e->loc.x < start ) {
+    if (e->loc.x < start) {
         e->vel.x = 0;
         e->loc.x = start + HLINE / 2;
-    } else if ( e->loc.x + e->width + HLINE > end ) {
+    } else if (e->loc.x + e->width + HLINE > end) {
         e->vel.x = 0;
         e->loc.x = end - e->width - HLINE;
     }
@@ -1381,19 +1412,19 @@ singleDetect( Entity *e )
 }
 
 void IndoorWorld::
-draw( Player *p )
+draw(Player *p)
 {
        unsigned int i,f;
        int x;
 
     // draw lights
-    for ( auto &l : light ) {
-        if ( l.belongsTo ) {
+    for (auto &l : light) {
+        if (l.belongsTo) {
             l.loc.x = l.following->loc.x + SCREEN_WIDTH / 2;
-            l.loc.y = ( l.following->loc.y > SCREEN_HEIGHT / 2 ) ? SCREEN_HEIGHT / 2 : l.following->loc.y;
+            l.loc.y = (l.following->loc.y > SCREEN_HEIGHT / 2) ? SCREEN_HEIGHT / 2 : l.following->loc.y;
         }
-        if ( l.flame ) {
-            l.fireFlicker = .9 + ( (rand() % 2) / 10.0f );
+        if (l.flame) {
+            l.fireFlicker = .9 + ((rand() % 2) / 10.0f);
             l.fireLoc.x = l.loc.x + (rand() % 2 - 1) * 3;
             l.fireLoc.y = l.loc.y + (rand() % 2 - 1) * 3;
         } else
@@ -1420,16 +1451,16 @@ draw( Player *p )
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
 
-       glUseProgram( shaderProgram );
+       glUseProgram(shaderProgram);
        glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
-       glUniform1f(glGetUniformLocation(shaderProgram, "amb"    ), 0.02f + light.size()/50.0f);
+       glUniform1f(glGetUniformLocation(shaderProgram, "amb"), 0.02f + light.size()/50.0f);
 
-       if ( light.empty() )
+       if (light.empty())
                glUniform1i(glGetUniformLocation(shaderProgram, "numLight"), 0);
        else {
-               glUniform1i (glGetUniformLocation(shaderProgram, "numLight"     ), light.size());
+               glUniform1i (glGetUniformLocation(shaderProgram, "numLight"), light.size());
                glUniform2fv(glGetUniformLocation(shaderProgram, "lightLocation"), light.size(), pointArray);
-               glUniform3f (glGetUniformLocation(shaderProgram, "lightColor"   ), 1.0f, 1.0f, 1.0f);
+               glUniform3f (glGetUniformLocation(shaderProgram, "lightColor"), 1.0f, 1.0f, 1.0f);
         glUniform1fv(glGetUniformLocation(shaderProgram, "fireFlicker"), light.size(), flameArray);
        }
 
@@ -1439,10 +1470,10 @@ draw( Player *p )
        glColor4ub(255,255,255,255);
 
     glBegin(GL_QUADS);
-        glTexCoord2i(0,1);                                                          glVertex2i( worldStart - SCREEN_WIDTH / 2,0);
+        glTexCoord2i(0,1);                                                          glVertex2i(worldStart - SCREEN_WIDTH / 2,0);
                glTexCoord2i((-worldStart*2+SCREEN_WIDTH)/512,1);glVertex2i(-worldStart + SCREEN_WIDTH / 2,0);
                glTexCoord2i((-worldStart*2+SCREEN_WIDTH)/512,0);glVertex2i(-worldStart + SCREEN_WIDTH / 2,SCREEN_HEIGHT);
-               glTexCoord2i(0,0);                                                           glVertex2i( worldStart - SCREEN_WIDTH / 2,SCREEN_HEIGHT);
+               glTexCoord2i(0,0);                                                           glVertex2i(worldStart - SCREEN_WIDTH / 2,SCREEN_HEIGHT);
     glEnd();
 
     glUseProgram(0);
@@ -1451,18 +1482,18 @@ draw( Player *p )
         *      Draw the ground.
        */
 
-       glUseProgram( shaderProgram );
-       glUniform1i( glGetUniformLocation(shaderProgram, "sampler"), 0 );
-       glBegin( GL_QUADS );
-        safeSetColor( 150, 100, 50 );
-        for ( f = 0; f < floor.size(); f++ ) {
+       glUseProgram(shaderProgram);
+       glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
+       glBegin(GL_QUADS);
+        safeSetColor(150, 100, 50);
+        for (f = 0; f < floor.size(); f++) {
             i = 0;
-               for ( h : floor[f] ) {
+               for (h : floor[f]) {
                        x = worldStart + fstart[f] * HLINE + (i * HLINE);
-                       glVertex2i( x        , h                          );
-                       glVertex2i( x + HLINE, h                          );
-                       glVertex2i( x + HLINE, h - INDOOR_FLOOR_THICKNESS );
-                       glVertex2i( x        , h - INDOOR_FLOOR_THICKNESS );
+                       glVertex2i(x        , h            );
+                       glVertex2i(x + HLINE, h            );
+                       glVertex2i(x + HLINE, h - INDOOR_FLOOR_THICKNESS);
+                       glVertex2i(x        , h - INDOOR_FLOOR_THICKNESS);
                 i++;
                }
         }
@@ -1478,14 +1509,14 @@ draw( Player *p )
     glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
     glUseProgram(shaderProgram);
 
-    std::for_each( particles.begin(), particles.end(), [](Particles &part) { part.draw(); });
+    std::for_each(particles.begin(), particles.end(), [](Particles &part) { part.draw(); });
 
     glUseProgram(0);
 
-       /*for ( auto &part : particles )
+       /*for (auto &part : particles)
                part.draw();*/
 
-       for ( auto &e : entity )
+       for (auto &e : entity)
                e->draw();
 
        p->draw();
@@ -1499,8 +1530,8 @@ Arena::Arena(World *leave,Player *p,Mob *m){
        mmob = m;
        mmob->aggressive = false;
 
-       mob.push_back(m);
-       entity.push_back(m);
+       mob.push_back(*m);
+       entity.push_back(&mob.back());
 
        battleNest.push_back(leave);
        battleNestLoc.push_back(p->loc);
@@ -1512,9 +1543,9 @@ Arena::~Arena(void){
 
 World *Arena::exitArena(Player *p){
        World *tmp;
-       if ( !mmob->alive &&
-         p->loc.x + p->width / 2 > mob[0]->loc.x &&
-            p->loc.x + p->width / 2 < mob[0]->loc.x + HLINE * 12 ) {
+       if (!mmob->alive &&
+         p->loc.x + p->width / 2 > mob[0].loc.x &&
+            p->loc.x + p->width / 2 < mob[0].loc.x + HLINE * 12) {
                tmp = battleNest.front();
                battleNest.erase(battleNest.begin());
 
@@ -1534,9 +1565,9 @@ World *Arena::exitArena(Player *p){
        }
 }
 
-std::string getWorldWeatherStr( WorldWeather ww )
+std::string getWorldWeatherStr(WorldWeather ww)
 {
-    switch ( ww ) {
+    switch (ww) {
     case WorldWeather::Sunny:
         return "Sunny";
         break;
@@ -1556,22 +1587,22 @@ static bool loadedLeft = false;
 static bool loadedRight = false;
 
 World *loadWorldFromXML(std::string path){
-       if ( !currentXML.empty() )
+       if (!currentXML.empty())
                currentWorld->save();
 
        return loadWorldFromXMLNoSave(path);
 }
 
-World *loadWorldFromPtr( World *ptr )
+World *loadWorldFromPtr(World *ptr)
 {
     World *tmp = ptr;
 
     loadedLeft = true;
-    currentWorldToLeft = loadWorldFromXML( tmp->toLeft );
+    currentWorldToLeft = loadWorldFromXML(tmp->getToLeft());
     loadedLeft = false;
 
     loadedRight = true;
-    currentWorldToRight = loadWorldFromXML( tmp->toRight );
+    currentWorldToRight = loadWorldFromXML(tmp->getToRight());
     loadedRight = false;
 
     return tmp;
@@ -1582,7 +1613,7 @@ World *loadWorldFromPtr( World *ptr )
  */
 
 World *
-loadWorldFromXMLNoSave( std::string path ) {
+loadWorldFromXMLNoSave(std::string path) {
        XMLDocument xml;
        XMLElement *wxml;
        XMLElement *vil;
@@ -1596,14 +1627,14 @@ loadWorldFromXMLNoSave( std::string path ) {
        std::string name, sptr;
 
     // no file? -> no world
-    if ( path.empty() )
+    if (path.empty())
         return NULL;
 
     currentXML = std::string(xmlFolder + path);
-       xml.LoadFile( currentXML.c_str() );
+       xml.LoadFile(currentXML.c_str());
 
     // attempt to load a <World> tag
-       if ( (wxml = xml.FirstChildElement("World")) ) {
+       if ((wxml = xml.FirstChildElement("World"))) {
                wxml = wxml->FirstChildElement();
                vil = xml.FirstChildElement("World")->FirstChildElement("village");
                tmp = new World();
@@ -1611,7 +1642,7 @@ loadWorldFromXMLNoSave( std::string path ) {
        }
 
     // attempt to load an <IndoorWorld> tag
-    else if( (wxml = xml.FirstChildElement("IndoorWorld")) ) {
+    else if((wxml = xml.FirstChildElement("IndoorWorld"))) {
                wxml = wxml->FirstChildElement();
                vil = NULL;
                tmp = new IndoorWorld();
@@ -1623,39 +1654,39 @@ loadWorldFromXMLNoSave( std::string path ) {
         UserError("XML Error: Cannot find a <World> or <IndoorWorld> tag in " + currentXML + "!");
 
     // iterate through world tags
-       while ( wxml ) {
+       while (wxml) {
                name = wxml->Name();
 
         // world linkage
-               if ( name == "link" ) {
+               if (name == "link") {
 
             // links world to the left
-                       if ( (ptr = wxml->Attribute("left")) ) {
-                               tmp->setToLeft( ptr );
+                       if ((ptr = wxml->Attribute("left"))) {
+                               tmp->setToLeft(ptr);
 
                 // load the left world if it isn't
-                if ( !loadedLeft ) {
+                if (!loadedLeft) {
                     loadedLeft = true;
-                    currentWorldToLeft = loadWorldFromXMLNoSave( ptr );
+                    currentWorldToLeft = loadWorldFromXMLNoSave(ptr);
                     loadedLeft = false;
                 }
                        }
 
             // links world to the right
-            else if ( (ptr = wxml->Attribute("right")) ) {
-                               tmp->setToRight( ptr );
+            else if ((ptr = wxml->Attribute("right"))) {
+                               tmp->setToRight(ptr);
 
                 // load the right world if it isn't
-                if ( !loadedRight ) {
+                if (!loadedRight) {
                     loadedRight = true;
-                    currentWorldToRight = loadWorldFromXMLNoSave( ptr );
+                    currentWorldToRight = loadWorldFromXMLNoSave(ptr);
                     loadedRight = false;
                 }
                        }
 
                        // tells what world is outside, if in a structure
-                       else if ( Indoor && (ptr = wxml->Attribute("outside")) )
-                               inside.push_back( ptr );
+                       else if (Indoor && (ptr = wxml->Attribute("outside")))
+                               inside.push_back(ptr);
 
             // error, invalid link tag
             else
@@ -1664,26 +1695,26 @@ loadWorldFromXMLNoSave( std::string path ) {
                }
 
         // style tags
-        else if ( name == "style" ) {
+        else if (name == "style") {
             // set style folder
-                       tmp->setStyle( wxml->StrAttribute("folder") );
+                       tmp->setStyle(wxml->StrAttribute("folder"));
 
             // set background folder
-            if ( wxml->QueryUnsignedAttribute("background", &flooor) != XML_NO_ERROR )
+            if (wxml->QueryUnsignedAttribute("background", &flooor) != XML_NO_ERROR)
                 UserError("XML Error: No background given in <style> in " + currentXML + "!");
-                       tmp->setBackground( (WorldBGType)flooor );
+                       tmp->setBackground((WorldBGType)flooor);
 
             // set BGM file
-            tmp->setBGM( wxml->StrAttribute("bgm") );
+            tmp->setBGM(wxml->StrAttribute("bgm"));
                }
 
         // world generation (for outdoor areas)
-        else if ( name == "generation" ) {
+        else if (name == "generation") {
             // random gen.
-                       if ( !Indoor && wxml->StrAttribute("type") == "Random" )
-                               tmp->generate( wxml->UnsignedAttribute("width") );
+                       if (!Indoor && wxml->StrAttribute("type") == "Random")
+                               tmp->generate(wxml->UnsignedAttribute("width"));
             else {
-                if ( Indoor )
+                if (Indoor)
                     UserError("XML Error: <generation> tags can't be in <IndoorWorld> tags (in " + currentXML + ")!");
                 else
                     UserError("XML Error: Invalid <generation> tag in " + currentXML + "!");
@@ -1691,86 +1722,86 @@ loadWorldFromXMLNoSave( std::string path ) {
                }
 
         // mob creation
-        else if ( name == "mob" ) {
+        else if (name == "mob") {
             // type info
-            if ( wxml->QueryUnsignedAttribute("type", &flooor) != XML_NO_ERROR )
+            if (wxml->QueryUnsignedAttribute("type", &flooor) != XML_NO_ERROR)
                 UserError("XML Error: Invalid type value in <mob> in " + currentXML + "!");
 
             // spawn at coordinate if desired
-                       if ( wxml->QueryFloatAttribute( "x", &spawnx ) == XML_NO_ERROR )
-                               tmp->addMob( flooor, spawnx, wxml->FloatAttribute("y"));
+                       if (wxml->QueryFloatAttribute("x", &spawnx) == XML_NO_ERROR)
+                               tmp->addMob(flooor, spawnx, wxml->FloatAttribute("y"));
                        else
-                               tmp->addMob( flooor, 0, 100 );
+                               tmp->addMob(flooor, 0, 100);
 
             // aggressive tag
-                       if ( wxml->QueryBoolAttribute( "aggressive", &dialog ) == XML_NO_ERROR )
-                               tmp->mob.back()->aggressive = dialog;
+                       if (wxml->QueryBoolAttribute("aggressive", &dialog) == XML_NO_ERROR)
+                               tmp->getLastMob()->aggressive = dialog;
 
             // indoor spawning floor selection
-            if ( Indoor && wxml->QueryUnsignedAttribute( "floor", &flooor ) == XML_NO_ERROR )
-                Indoorp(tmp)->moveToFloor( tmp->npc.back(), flooor );
+            if (Indoor && wxml->QueryUnsignedAttribute("floor", &flooor) == XML_NO_ERROR)
+                Indoorp(tmp)->moveToFloor(tmp->npc.back(), flooor);
 
             // custom health value
-            if ( wxml->QueryFloatAttribute( "health", &spawnx) == XML_NO_ERROR )
-                tmp->mob.back()->health = tmp->mob.back()->maxHealth = spawnx;
+            if (wxml->QueryFloatAttribute("health", &spawnx) == XML_NO_ERROR)
+                tmp->getLastMob()->health = tmp->getLastMob()->maxHealth = spawnx;
                }
 
         // npc creation
-        else if ( name == "npc" ) {
+        else if (name == "npc") {
                        const char *npcname;
 
             // spawn at coordinates if desired
-                       if ( wxml->QueryFloatAttribute( "x", &spawnx ) == XML_NO_ERROR)
-                               tmp->addNPC( spawnx, 100 );
+                       if (wxml->QueryFloatAttribute("x", &spawnx) == XML_NO_ERROR)
+                               tmp->addNPC(spawnx, 100);
                        else
-                               tmp->addNPC( 0, 100 );
+                               tmp->addNPC(0, 100);
 
             // name override
-                       if ( (npcname = wxml->Attribute("name")) ) {
+                       if ((npcname = wxml->Attribute("name"))) {
                 delete[] tmp->npc.back()->name;
                                tmp->npc.back()->name = new char[strlen(npcname) + 1];
-                               strcpy( tmp->npc.back()->name, npcname );
+                               strcpy(tmp->npc.back()->name, npcname);
                        }
 
             // dialog enabling
                        dialog = false;
-                       if ( wxml->QueryBoolAttribute( "hasDialog", &dialog ) == XML_NO_ERROR && dialog )
-                               tmp->npc.back()->addAIFunc( commonAIFunc, false );
+                       if (wxml->QueryBoolAttribute("hasDialog", &dialog) == XML_NO_ERROR && dialog)
+                               tmp->npc.back()->addAIFunc(commonAIFunc, false);
                        else
                 tmp->npc.back()->dialogIndex = 9999;
 
-            if ( Indoor && wxml->QueryUnsignedAttribute( "floor", &flooor ) == XML_NO_ERROR )
-                Indoorp(tmp)->moveToFloor( tmp->npc.back(), flooor );
+            if (Indoor && wxml->QueryUnsignedAttribute("floor", &flooor) == XML_NO_ERROR)
+                Indoorp(tmp)->moveToFloor(tmp->npc.back(), flooor);
 
             // custom health value
-            if ( wxml->QueryFloatAttribute( "health", &spawnx) == XML_NO_ERROR )
-                tmp->mob.back()->health = tmp->mob.back()->maxHealth = spawnx;
+            if (wxml->QueryFloatAttribute("health", &spawnx) == XML_NO_ERROR)
+                tmp->npc.back()->health = tmp->npc.back()->maxHealth = spawnx;
                }
 
         // structure creation
-        else if ( name == "structure" ) {
-                       tmp->addStructure( (BUILD_SUB) wxml->UnsignedAttribute("type"),
-                                                          wxml->QueryFloatAttribute( "x", &spawnx ) != XML_NO_ERROR ?
+        else if (name == "structure") {
+                       tmp->addStructure((BUILD_SUB) wxml->UnsignedAttribute("type"),
+                                                          wxml->QueryFloatAttribute("x", &spawnx) != XML_NO_ERROR ?
                                                               getRand() % tmp->getTheWidth() / 2.0f : spawnx,
                                                           100,
                                                           wxml->StrAttribute("texture"),
                                                           wxml->StrAttribute("inside")
-                             );
-               } else if ( name == "trigger" ) {
-                       tmp->addMob( MS_TRIGGER, wxml->FloatAttribute("x"), 0, commonTriggerFunc );
-                       tmp->mob.back()->heyid = wxml->Attribute("id");
-               } else if ( name == "page" ) {
-                       tmp->addMob( MS_PAGE, wxml->FloatAttribute("x"), 0, commonPageFunc );
-                       tmp->mob.back()->heyid = wxml->Attribute("id");
-               } else if ( name == "hill" ) {
-                       tmp->addHill( ivec2 { wxml->IntAttribute("peakx"), wxml->IntAttribute("peaky") }, wxml->UnsignedAttribute("width") );
-               } else if ( name == "time" ) {
-            tickCount = std::stoi( wxml->GetText() );
-        } else if ( Indoor && name == "floor" ) {
-            if ( wxml->QueryFloatAttribute("start",&spawnx) == XML_NO_ERROR )
-                Indoorp(tmp)->addFloor( wxml->UnsignedAttribute("width"), spawnx );
+               );
+               } else if (name == "trigger") {
+                       tmp->addMob(MS_TRIGGER, wxml->FloatAttribute("x"), 0, commonTriggerFunc);
+                       tmp->getLastMob()->heyid = wxml->Attribute("id");
+               } else if (name == "page") {
+                       tmp->addMob(MS_PAGE, wxml->FloatAttribute("x"), 0, commonPageFunc);
+                       tmp->getLastMob()->heyid = wxml->Attribute("id");
+               } else if (name == "hill") {
+                       tmp->addHill(ivec2 { wxml->IntAttribute("peakx"), wxml->IntAttribute("peaky") }, wxml->UnsignedAttribute("width"));
+               } else if (name == "time") {
+            tickCount = std::stoi(wxml->GetText());
+        } else if (Indoor && name == "floor") {
+            if (wxml->QueryFloatAttribute("start",&spawnx) == XML_NO_ERROR)
+                Indoorp(tmp)->addFloor(wxml->UnsignedAttribute("width"), spawnx);
             else
-                Indoorp(tmp)->addFloor( wxml->UnsignedAttribute("width") );
+                Indoorp(tmp)->addFloor(wxml->UnsignedAttribute("width"));
         }
 
         spawnx = 0;
@@ -1779,10 +1810,8 @@ loadWorldFromXMLNoSave( std::string path ) {
 
        Village *vptr;
 
-       if(vil){
-               tmp->village.push_back(new Village(vil->Attribute("name"), tmp));
-               vptr = tmp->village.back();
-
+       if (vil) {
+               vptr = tmp->addVillage(vil->Attribute("name"), tmp);
                vil = vil->FirstChildElement();
        }
 
@@ -1795,56 +1824,56 @@ loadWorldFromXMLNoSave( std::string path ) {
                 *      READS DATA ABOUT STRUCTURE CONTAINED IN VILLAGE
                 */
 
-               if ( name == "structure" ) {
+               if (name == "structure") {
                        tmp->addStructure((BUILD_SUB)vil->UnsignedAttribute("type"),
                                                           vil->QueryFloatAttribute("x", &spawnx) != XML_NO_ERROR ? randx : spawnx,
                                                           100,
                                                           vil->StrAttribute("texture"),
                                                           vil->StrAttribute("inside"));
-               } else if ( name == "stall" ) {
+               } else if (name == "stall") {
             sptr = vil->StrAttribute("type");
 
             // handle markets
-            if ( sptr == "market" ) {
+            if (sptr == "market") {
 
                 // create a structure and a merchant, and pair them
-                tmp->addStructure( STALL_MARKET,
+                tmp->addStructure(STALL_MARKET,
                                    vil->QueryFloatAttribute("x", &spawnx) != XML_NO_ERROR ? randx : spawnx,
                                    100,
                                                               vil->StrAttribute("texture"),
                                                               vil->StrAttribute("inside")
-                                 );
-                               tmp->addMerchant( 0, 100 );
+                   );
+                               tmp->addMerchant(0, 100);
 
                 tmp->merchant.back()->inside = tmp->build.back();
             }
 
             // handle traders
-            else if ( sptr == "trader") {
-                               tmp->addStructure( STALL_TRADER,
+            else if (sptr == "trader") {
+                               tmp->addStructure(STALL_TRADER,
                                                               vil->QueryFloatAttribute("x", &spawnx) != XML_NO_ERROR ? randx : spawnx,
                                                               100,
                                                               vil->StrAttribute("texture"),
                                                               vil->StrAttribute("inside")
-                                 );
+                   );
                        }
 
             // loop through buy/sell/trade tags
             XMLElement *sxml = vil->FirstChildElement();
             std::string tag;
-            while ( sxml ) {
+            while (sxml) {
                 tag = sxml->Name();
 
-                if ( tag == "buy" ) {
+                if (tag == "buy") {
                     // TODO
-                } else if ( tag == "sell" ) {
+                } else if (tag == "sell") {
                     // TODO
-                } else if ( tag == "trade" ) {
-                       tmp->merchant.back()->trade.push_back( Trade( sxml->IntAttribute("quantity"),
+                } else if (tag == "trade") {
+                       tmp->merchant.back()->trade.push_back(Trade(sxml->IntAttribute("quantity"),
                                                                                                                                  sxml->StrAttribute("item"),
                                                                                                                                  sxml->IntAttribute("quantity1"),
                                                                                                                                  sxml->StrAttribute("item1")
-                                                         ));
+                                           ));
                                }
 
                 sxml = sxml->NextSiblingElement();