Menu

Win32 binaries or build scripts

2009-02-19
2013-05-08
  • Alexander Faucher

    I've been attempting to build my tuxcap game on win32.  I showed it to a friend and the first thing he asked was for a windows version.

    I am attempting to build it with mingw as it doesn't appear msvc 9 likes any syntax at all.  It would prefer I feed it cookies.  I fixed a few places in SexyApp that needed to pull in <windows.h> and I think I got it spitting out something that looks like a PE file, but it gets "setup_exception_record stack overflow" running in wine, and appears to do nothing at all in windows.  I have never used mingw before so I am afraid it isn't telling me anything about what could be wrong.

    I was wondering if anyone else had successfully gotten win32 binaries of tuxcap (w/ chipmunk and hgeparticle) built, or at least had the build scripts to do so.

    Thanks,
    Alex

     
    • W.P. van Paassen

      Hey that's great to hear that you made a game using tuxcap! Can I see it?

      I have never tried to build tuxcap using mingw. But another user draxd (see help forum) was, as far as I know, successfull in building tuxcap using visual studio 2008. (https://sourceforge.net/forum/message.php?msg_id=5192600)

      As a last resort you can build the game on windows using the popcap framework (with chipmunk and hgeparticle) added.

      Let me know how it all goes.

      Good luck and cheers
      WP

       
    • Alexander Faucher

      I just posted the win32 binaries at http://executedata.blogspot.com/2009/02/tanktank-for-windows.html

      msvc 9 didn't like my syntax, I gave up and went with mingw.  The biggest problem was building the dependencies.  I couldn't get ImageMagick to link and SDL_mixer just crashed the linker.  After that, mingw's win32api provided all the windows headers and I just remove the linux specific things from SexyAppBase.  Like usleep, the HOME env var, and running glxinfo and parsing the output.

      I will post a diff if I can get it cleaned up, I left a lot of cruft that wouldn't diff cleanly.  This is also on tuxcap 1.3.09.

       
    • W.P. van Paassen

      Good to hear you've succeeded in building tuxcap on win32 with mingw, nice!

      A diff would be great.

       
    • Alexander Faucher

      Looks like I couldn't find the time to clean up my diff.  I decided to post it here anyways.  At least it can be used as a reference if someone else wants to attempt this.

      Note: Some of these changes are likely to break compiling with MSVC even more.  This was to get it compiling with mingw and the win32api library.

      Image Magick was disabled for this diff only because at the time I couldn't build image magic in mingw.  Once I got it built, I only had to turn it on in tuxcap.

      I also added an explicit SDL_mixer enable to disable sound entirely.  I have not yet attempted to build that for windows.

      I hope it is helpful.  Good luck.

      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/LICENSE.txt b/./tuxcap/chipmunk/LICENSE.txt
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/chipmunk.c b/./tuxcap/chipmunk/chipmunk.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/chipmunk.h b/./tuxcap/chipmunk/chipmunk.h
      index 125ac03..3ab4a04 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/chipmunk.h
      +++ b/./tuxcap/chipmunk/chipmunk.h
      @@ -39,18 +39,26 @@ cpfmin(cpFloat a, cpFloat b)

      #ifndef INFINITY
           #ifdef _WIN32
      -        union MSVC_EVIL_FLOAT_HACK
      +        /*union MSVC_EVIL_FLOAT_HACK
               {
                   unsigned __int8 Bytes[4];
                   float Value;
               };
      -        static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};
      -        #define INFINITY (INFINITY_HACK.Value)
      +        static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};*/
      +        //#define INFINITY (INFINITY_HACK.Value)
           #else
               #define INFINITY (1e1000)
           #endif
      #endif

      +#ifndef M_PI
      +#define M_PI    3.14159265358979323846f
      +#define M_PI_2    1.57079632679489661923f
      +#define M_PI_4    0.785398163397448309616f
      +#define M_1_PI    0.318309886183790671538f
      +#define M_2_PI    0.636619772367581343076f
      +#endif
      +
      #include "cpVect.h"
      #include "cpBB.h"
      #include "cpBody.h"
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpArbiter.c b/./tuxcap/chipmunk/cpArbiter.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpArbiter.h b/./tuxcap/chipmunk/cpArbiter.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpArray.c b/./tuxcap/chipmunk/cpArray.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpArray.h b/./tuxcap/chipmunk/cpArray.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpBB.c b/./tuxcap/chipmunk/cpBB.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpBB.h b/./tuxcap/chipmunk/cpBB.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpBody.c b/./tuxcap/chipmunk/cpBody.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpBody.h b/./tuxcap/chipmunk/cpBody.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpCollision.c b/./tuxcap/chipmunk/cpCollision.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpCollision.h b/./tuxcap/chipmunk/cpCollision.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpHashSet.c b/./tuxcap/chipmunk/cpHashSet.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpHashSet.h b/./tuxcap/chipmunk/cpHashSet.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpJoint.c b/./tuxcap/chipmunk/cpJoint.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpJoint.h b/./tuxcap/chipmunk/cpJoint.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpPolyShape.c b/./tuxcap/chipmunk/cpPolyShape.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpPolyShape.h b/./tuxcap/chipmunk/cpPolyShape.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpShape.c b/./tuxcap/chipmunk/cpShape.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpShape.h b/./tuxcap/chipmunk/cpShape.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpSpace.c b/./tuxcap/chipmunk/cpSpace.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpSpace.h b/./tuxcap/chipmunk/cpSpace.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpSpaceHash.c b/./tuxcap/chipmunk/cpSpaceHash.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpSpaceHash.h b/./tuxcap/chipmunk/cpSpaceHash.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpVect.c b/./tuxcap/chipmunk/cpVect.c
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/cpVect.h b/./tuxcap/chipmunk/cpVect.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/chipmunk/prime.h b/./tuxcap/chipmunk/prime.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/LICENSE.TXT b/./tuxcap/hgeparticle/LICENSE.TXT
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgeRandom.cpp b/./tuxcap/hgeparticle/hgeRandom.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgeRandom.h b/./tuxcap/hgeparticle/hgeRandom.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgecolor.h b/./tuxcap/hgeparticle/hgecolor.h
      index dad1d66..a07910b 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgecolor.h
      +++ b/./tuxcap/hgeparticle/hgecolor.h
      @@ -21,7 +21,8 @@ namespace    HGE
      #ifndef WIN32
      typedef    unsigned long DWORD;
      #else
      -#define PATH_MAX MAX_PATH
      +typedef    unsigned long DWORD;
      +//#define PATH_MAX MAX_PATH
      #endif

      inline void ColorClamp(float &x) { if(x<0.0f) x=0.0f; if(x>1.0f) x=1.0f; }
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgeparticle.cpp b/./tuxcap/hgeparticle/hgeparticle.cpp
      index 9ddde3b..c9639ed 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgeparticle.cpp
      +++ b/./tuxcap/hgeparticle/hgeparticle.cpp
      @@ -65,7 +65,7 @@ hgeParticleSystem::hgeParticleSystem(const char *filename, DDImage *sprite, floa
               if (bytes != sizeof(hgeParticleSystemInfo))
                 return;

      -        mbAdditiveBlend = ((((unsigned int)info.sprite) >> 16) & 2) == 0;
      +        mbAdditiveBlend = ((((unsigned int)(long)info.sprite) >> 16) & 2) == 0;

           info.sprite = sprite;

      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgeparticle.h b/./tuxcap/hgeparticle/hgeparticle.h
      index 6021424..951a519 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgeparticle.h
      +++ b/./tuxcap/hgeparticle/hgeparticle.h
      @@ -15,6 +15,10 @@
      #ifndef HGEPARTICLE_H
      #define HGEPARTICLE_H

      +#ifdef _WIN32
      +typedef void *iconv_t;
      +#endif
      +
      #include "Graphics.h"
      #include "Physics.h"
      #include "Point.h"
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgepmanager.cpp b/./tuxcap/hgeparticle/hgepmanager.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgerect.cpp b/./tuxcap/hgeparticle/hgerect.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgerect.h b/./tuxcap/hgeparticle/hgerect.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgevector.cpp b/./tuxcap/hgeparticle/hgevector.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/hgeparticle/hgevector.h b/./tuxcap/hgeparticle/hgevector.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/AudiereLoader.h b/./tuxcap/include/AudiereLoader.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/AudiereMusicInterface.h b/./tuxcap/include/AudiereMusicInterface.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/AudiereSoundInstance.h b/./tuxcap/include/AudiereSoundInstance.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/AudiereSoundManager.h b/./tuxcap/include/AudiereSoundManager.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/BltRotatedHelper.inc b/./tuxcap/include/BltRotatedHelper.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Buffer.h b/./tuxcap/include/Buffer.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ButtonListener.h b/./tuxcap/include/ButtonListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ButtonWidget.h b/./tuxcap/include/ButtonWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Checkbox.h b/./tuxcap/include/Checkbox.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/CheckboxListener.h b/./tuxcap/include/CheckboxListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Color.h b/./tuxcap/include/Color.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Common.h b/./tuxcap/include/Common.h
      index 23104b9..1b8f34c 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Common.h
      +++ b/./tuxcap/include/Common.h
      @@ -1,6 +1,10 @@
      #ifndef __SEXYAPPFRAMEWORK_COMMON_H__
      #define __SEXYAPPFRAMEWORK_COMMON_H__

      +#ifdef _WIN32
      +typedef void *iconv_t;
      +#endif
      +
      #include <string>
      #include <vector>
      #include <set>
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/CursorWidget.h b/./tuxcap/include/CursorWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/D3DInterface.h b/./tuxcap/include/D3DInterface.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_Additive.inc b/./tuxcap/include/DDI_Additive.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_AlphaBlt.inc b/./tuxcap/include/DDI_AlphaBlt.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_BltRotated.inc b/./tuxcap/include/DDI_BltRotated.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_BltRotated_Additive.inc b/./tuxcap/include/DDI_BltRotated_Additive.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_FastBlt_NoAlpha.inc b/./tuxcap/include/DDI_FastBlt_NoAlpha.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_FastStretch.inc b/./tuxcap/include/DDI_FastStretch.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_FastStretch_Additive.inc b/./tuxcap/include/DDI_FastStretch_Additive.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDI_NormalBlt_Volatile.inc b/./tuxcap/include/DDI_NormalBlt_Volatile.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDImage.h b/./tuxcap/include/DDImage.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDInterface.h b/./tuxcap/include/DDInterface.h
      index fa13cb1..75654f4 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DDInterface.h
      +++ b/./tuxcap/include/DDInterface.h
      @@ -12,6 +12,8 @@

      #ifndef WIN32
      #define HWND void*
      +#else
      +#include <windows.h>
      #endif

      #if 0
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DescParser.h b/./tuxcap/include/DescParser.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Dialog.h b/./tuxcap/include/Dialog.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DialogButton.h b/./tuxcap/include/DialogButton.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/DialogListener.h b/./tuxcap/include/DialogListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/EditListener.h b/./tuxcap/include/EditListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/EditWidget.h b/./tuxcap/include/EditWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Flags.h b/./tuxcap/include/Flags.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Font.h b/./tuxcap/include/Font.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/GENERIC_DrawLineAA.inc b/./tuxcap/include/GENERIC_DrawLineAA.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Graphics.h b/./tuxcap/include/Graphics.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/HyperlinkWidget.h b/./tuxcap/include/HyperlinkWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Image.h b/./tuxcap/include/Image.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ImageFont.h b/./tuxcap/include/ImageFont.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ImageLib.h b/./tuxcap/include/ImageLib.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Insets.h b/./tuxcap/include/Insets.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/KeyCodes.h b/./tuxcap/include/KeyCodes.h
      index ba87bd0..609b3e1 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/KeyCodes.h
      +++ b/./tuxcap/include/KeyCodes.h
      @@ -16,6 +16,13 @@
      #define KEYCODE_UP SDLK_UP
      #define KEYCODE_DOWN SDLK_DOWN

      +#define KEYCODE_RSHIFT SDLK_RSHIFT
      +#define KEYCODE_LSHIFT SDLK_LSHIFT
      +#define KEYCODE_RCTRL SDLK_RCTRL
      +#define KEYCODE_LCTRL SDLK_LCTRL
      +#define KEYCODE_RALT SDLK_RALT
      +#define KEYCODE_LALT SDLK_LALT
      +
      namespace Sexy
      {
      #if 0
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ListListener.h b/./tuxcap/include/ListListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ListWidget.h b/./tuxcap/include/ListWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_AdditiveBlt.inc b/./tuxcap/include/MI_AdditiveBlt.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_BltRotated.inc b/./tuxcap/include/MI_BltRotated.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_BltRotated_Additive.inc b/./tuxcap/include/MI_BltRotated_Additive.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_GetNativeAlphaData.inc b/./tuxcap/include/MI_GetNativeAlphaData.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_GetRLAlphaData.inc b/./tuxcap/include/MI_GetRLAlphaData.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_NormalBlt.inc b/./tuxcap/include/MI_NormalBlt.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MI_SlowStretchBlt.inc b/./tuxcap/include/MI_SlowStretchBlt.inc
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MTRand.h b/./tuxcap/include/MTRand.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MemoryImage.h b/./tuxcap/include/MemoryImage.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/MusicInterface.h b/./tuxcap/include/MusicInterface.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/NativeDisplay.h b/./tuxcap/include/NativeDisplay.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/NaturalCubicSpline.h b/./tuxcap/include/NaturalCubicSpline.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ParticlePhysicsSystem.h b/./tuxcap/include/ParticlePhysicsSystem.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Physics.h b/./tuxcap/include/Physics.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/PhysicsListener.h b/./tuxcap/include/PhysicsListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Point.h b/./tuxcap/include/Point.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/PropertiesParser.h b/./tuxcap/include/PropertiesParser.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Quantize.h b/./tuxcap/include/Quantize.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Ratio.h b/./tuxcap/include/Ratio.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Rect.h b/./tuxcap/include/Rect.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ResourceManager.h b/./tuxcap/include/ResourceManager.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SDLMain.h b/./tuxcap/include/SDLMain.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SDLMixerMusicInterface.h b/./tuxcap/include/SDLMixerMusicInterface.h
      index 98f82f0..c6e90ac 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SDLMixerMusicInterface.h
      +++ b/./tuxcap/include/SDLMixerMusicInterface.h
      @@ -29,6 +29,8 @@

      #ifndef WIN32
      #define HWND void*
      +#else
      +#include <windows.h>
      #endif

      namespace Sexy
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SDLMixerSoundInstance.h b/./tuxcap/include/SDLMixerSoundInstance.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SDLMixerSoundManager.h b/./tuxcap/include/SDLMixerSoundManager.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SWTri.h b/./tuxcap/include/SWTri.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ScrollListener.h b/./tuxcap/include/ScrollListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ScrollbarWidget.h b/./tuxcap/include/ScrollbarWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/ScrollbuttonWidget.h b/./tuxcap/include/ScrollbuttonWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SexyAppBase.h b/./tuxcap/include/SexyAppBase.h
      index d8715d0..088d8b6 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SexyAppBase.h
      +++ b/./tuxcap/include/SexyAppBase.h
      @@ -1,6 +1,21 @@
      #ifndef __SEXYAPPBASE_H__
      #define __SEXYAPPBASE_H__

      +
      +#ifndef WIN32
      +#define HWND void*
      +enum {
      +   REG_SZ,
      +   REG_DWORD,
      +   REG_BINARY,
      +   HKEY_CURRENT_USER
      + };
      +typedef int HKEY;
      +#else
      +#include <windows.h>
      +#include <winbase.h>
      +#endif
      +
      #include <string>
      #include <vector>
      #include <map>
      @@ -23,17 +38,8 @@
      #endif
      #include "Ratio.h"

      -#ifndef WIN32
      -#define HWND void*
      - enum {
      -   REG_SZ,
      -   REG_DWORD,
      -   REG_BINARY,
      -   HKEY_CURRENT_USER
      - };

      - typedef int HKEY;
      -#endif
      +

      namespace ImageLib
      {
      @@ -500,7 +506,7 @@ public:
      protected:   
           // Registry helpers
           bool                    RegistryRead(const std::string& theValueName, ulong* theType, uchar* theValue, ulong* theLength);
      -    bool                    RegistryReadKey(const std::string& theValueName, ulong* theType, uchar* theValue, ulong* theLength, HKEY theMainKey = HKEY_CURRENT_USER);
      +    bool                    RegistryReadKey(const std::string& theValueName, ulong* theType, uchar* theValue, ulong* theLength, HKEY theMainKey = (HKEY)HKEY_CURRENT_USER);
           bool                    RegistryWrite(const std::string& theValueName, ulong theType, const uchar* theValue, ulong theLength);

           virtual bool            DoUpdateFrames();
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SexyMatrix.h b/./tuxcap/include/SexyMatrix.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SexyVector.h b/./tuxcap/include/SexyVector.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SharedImage.h b/./tuxcap/include/SharedImage.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Slider.h b/./tuxcap/include/Slider.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SliderListener.h b/./tuxcap/include/SliderListener.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SoundInstance.h b/./tuxcap/include/SoundInstance.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/SoundManager.h b/./tuxcap/include/SoundManager.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/TextWidget.h b/./tuxcap/include/TextWidget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/TriVertex.h b/./tuxcap/include/TriVertex.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/Widget.h b/./tuxcap/include/Widget.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/WidgetContainer.h b/./tuxcap/include/WidgetContainer.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/WidgetManager.h b/./tuxcap/include/WidgetManager.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/XMLParser.h b/./tuxcap/include/XMLParser.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/include/XMLWriter.h b/./tuxcap/include/XMLWriter.h
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/AudiereLoader.cpp b/./tuxcap/lib/AudiereLoader.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/AudiereMusicInterface.cpp b/./tuxcap/lib/AudiereMusicInterface.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/AudiereSoundInstance.cpp b/./tuxcap/lib/AudiereSoundInstance.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/AudiereSoundManager.cpp b/./tuxcap/lib/AudiereSoundManager.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Buffer.cpp b/./tuxcap/lib/Buffer.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ButtonWidget.cpp b/./tuxcap/lib/ButtonWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/CMakeLists.txt b/./tuxcap/lib/CMakeLists.txt
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Checkbox.cpp b/./tuxcap/lib/Checkbox.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Color.cpp b/./tuxcap/lib/Color.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Common.cpp b/./tuxcap/lib/Common.cpp
      index 47bfaca..59d86fa 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Common.cpp
      +++ b/./tuxcap/lib/Common.cpp
      @@ -1302,13 +1302,21 @@ void Sexy::MkDir(const std::string& theDir)
               int aSlashPos = aPath.find_first_of("\\/", aCurPos);
               if (aSlashPos == -1)
               {
      +#ifdef WIN32
      +            mkdir(aPath.c_str());
      +#else
                         mkdir(aPath.c_str(),0777);
      +#endif
                   break;
               }

               aCurPos = aSlashPos+1;

               std::string aCurPath = aPath.substr(0, aSlashPos);
      +#ifdef WIN32
      +        mkdir(aCurPath.c_str());
      +#else
               mkdir(aCurPath.c_str(),0777);
      +#endif
           }
      }
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/CursorWidget.cpp b/./tuxcap/lib/CursorWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/D3DInterface.cpp b/./tuxcap/lib/D3DInterface.cpp
      index 9c20ffd..8c28eb8 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/D3DInterface.cpp
      +++ b/./tuxcap/lib/D3DInterface.cpp
      @@ -26,7 +26,7 @@ static const int MAX_TEXTURE_SIZE = 1024;
      static bool gLinearFilter = false;

      -#ifndef WIN32
      +#if defined(__MINGW32__) || !defined(WIN32)
      typedef struct {
         GLfloat  tu;
         GLfloat tv;
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/DDImage.cpp b/./tuxcap/lib/DDImage.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/DDInterface.cpp b/./tuxcap/lib/DDInterface.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/DescParser.cpp b/./tuxcap/lib/DescParser.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Dialog.cpp b/./tuxcap/lib/Dialog.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/DialogButton.cpp b/./tuxcap/lib/DialogButton.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/EditWidget.cpp b/./tuxcap/lib/EditWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Flags.cpp b/./tuxcap/lib/Flags.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Font.cpp b/./tuxcap/lib/Font.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Graphics.cpp b/./tuxcap/lib/Graphics.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/HyperlinkWidget.cpp b/./tuxcap/lib/HyperlinkWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Image.cpp b/./tuxcap/lib/Image.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ImageFont.cpp b/./tuxcap/lib/ImageFont.cpp
      index 02f79e5..f3e4d70 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ImageFont.cpp
      +++ b/./tuxcap/lib/ImageFont.cpp
      @@ -1591,8 +1591,9 @@ void ImageFont::DrawStringEx(Graphics* g, int theX, int theY, const SexyString&
                   if (aRenderCommand->mMode != -1)
                       g->SetDrawMode(aRenderCommand->mMode);           
                   g->SetColor(Color(aRenderCommand->mColor));
      -            if (aRenderCommand->mImage != NULL)
      +            if (aRenderCommand->mImage != NULL) {
                       g->DrawImage(aRenderCommand->mImage, aRenderCommand->mDest[0], aRenderCommand->mDest[1], Rect(aRenderCommand->mSrc[0], aRenderCommand->mSrc[1], aRenderCommand->mSrc[2], aRenderCommand->mSrc[3]));               
      +            }
                   g->SetDrawMode(anOldDrawMode);

                   aRenderCommand = aRenderCommand->mNext;
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ImageLib.cpp b/./tuxcap/lib/ImageLib.cpp
      index ac574f8..2515fb9 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ImageLib.cpp
      +++ b/./tuxcap/lib/ImageLib.cpp
      @@ -1,6 +1,14 @@
      #define XMD_H

      +#ifdef WIN32
      +#define USE_IMAGE_MAGICK 0
      +#else
      +#define USE_IMAGE_MAGICK 1
      +#endif
      +
      +#if USE_IMAGE_MAGICK
      #include <Magick++.h>
      +#endif
      #include "ImageLib.h"
      #include <math.h>
      #include "Common.h"
      @@ -12,7 +20,7 @@
      #endif

      using namespace ImageLib;
      -using namespace Magick;
      +//using namespace Magick;

      ImageLib::Image::Image()
      {
      @@ -311,9 +319,11 @@ int ImageLib::gAlphaComposeColor = 0xFFFFFF;
      bool ImageLib::gAutoLoadAlpha = true;
      bool ImageLib::gIgnoreJPEG2000Alpha = true;

      -ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaImage)
      -{
      -
      +ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaImage) {
      +#if !USE_IMAGE_MAGICK
      +    printf("Hit %s\n", theFilename.c_str());
      +    return NULL;
      +#else
           if (!gAutoLoadAlpha)
               lookForAlphaImage = false;

      @@ -325,12 +335,10 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
           std::string anExt;
           std::string aFilename;

      -    if (aLastDotPos > aLastSlashPos)
      -    {
      +    if (aLastDotPos > aLastSlashPos) {
               anExt = theFilename.substr(aLastDotPos, theFilename.length() - aLastDotPos);
               aFilename = theFilename.substr(0, aLastDotPos);
      -    }
      -    else {
      +    } else {
                 aFilename = theFilename;
              
               }
      @@ -340,8 +348,7 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
               Magick::Image mImage;
               bool ok = false;

      -        if (anExt.length() == 0)
      -          {
      +    if (anExt.length() == 0) {
                   std::list<std::string> coderList;

                   coderList.push_back("jpg");
      @@ -353,70 +360,61 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
                   coderList.push_back("bmp");

                   std::list<std::string>::const_iterator entry = coderList.begin();
      -            while( entry != coderList.end() )
      -              {
      +        while (entry != coderList.end()) {
                           try {
                               if (Sexy::gSexyAppBase->FileExists(theFilename + "." + *entry))  {
                                 // Read a file into image object
      -                          mImage.read( theFilename + "." + *entry);
      +                    std::string look_for = "" + *entry + ":" + theFilename + "." + *entry;
      +                    mImage.read(look_for);
                                 ok  = true;
                                 break;
      -                        }
      -                        else if (Sexy::gSexyAppBase->FileExists(theFilename + "." + Sexy::Upper(*entry))) {
      +                } else if (Sexy::gSexyAppBase->FileExists(theFilename + "." + Sexy::Upper(*entry))) {
                                 // Read a file into image object
      -                          mImage.read( theFilename + "." + Sexy::Upper(*entry));
      +                    std::string look_for = "" + *entry + ":" + theFilename + "." + Sexy::Upper(*entry);
      +                    mImage.read(look_for);
                                 ok  = true;
                                 break;
                               }
      -                    }
      -                    catch( Magick::Exception &error_ )
      -                      {
      +            } catch (Magick::Exception &error_) {
      +                printf("%s\n", error_.what());
                               return NULL;
      -                      }
      -                    catch (std::exception &error) {
      +            } catch (std::exception &error) {
      +                printf("%s\n", error.what());
                             return NULL;

      -                    }
      -                    catch ( ...) {
      +            } catch (...) {
                             return NULL;
                           }
                       ++entry;
                     }
      -          }
      -        else
      -          {
      +    } else {

                   try {
                     // Read a file into image object
                     if (Sexy::gSexyAppBase->FileExists(theFilename)) {
                       mImage.read( theFilename );
                       ok = true;
      -              }
      -              else if (Sexy::gSexyAppBase->FileExists(aFilename + Sexy::Lower(anExt))) {
      +            } else if (Sexy::gSexyAppBase->FileExists(aFilename + Sexy::Lower(anExt))) {
                       mImage.read( aFilename + Sexy::Lower(anExt));
                       ok = true;
      -              }
      -              else if (Sexy::gSexyAppBase->FileExists(aFilename + Sexy::Upper(anExt))) {
      +            } else if (Sexy::gSexyAppBase->FileExists(aFilename + Sexy::Upper(anExt))) {
                       mImage.read( aFilename + Sexy::Upper(anExt) );
                       ok = true;
                     }
      -            }
      -            catch( Magick::Exception &error_ )
      -              {
      +        } catch (Magick::Exception &error_) {
      +            printf("%s\n", error_.what());
                       return NULL;
      -              }
      -            catch (std::exception &error) {
      +        } catch (std::exception &error) {
      +            printf("%s\n", error.what());
                     return NULL;
      -            }
      -            catch ( ...) {
      +        } catch (...) {
                     return NULL;
                   }
                 }
             
           // Check for alpha images
           Image* anAlphaImage = NULL;
      -    if(lookForAlphaImage)
      -    {
      +    if (lookForAlphaImage) {
                 // Check _ImageName
                 anAlphaImage = GetImage(aFilename + "_", false);

      @@ -427,8 +425,7 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
           }

           // Compose alpha channel with image
      -    if (anAlphaImage != NULL)
      -    {
      +    if (anAlphaImage != NULL) {

                 if (ok && anImage == NULL) {
                   //TODO put this in a function
      @@ -448,17 +445,14 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
                   }
                 }

      -          if (anImage != NULL)
      -            {
      +        if (anImage != NULL) {
                     if ((anImage->mWidth == anAlphaImage->mWidth) &&
      -                  (anImage->mHeight == anAlphaImage->mHeight))
      -                {
      +                (anImage->mHeight == anAlphaImage->mHeight)) {
                         unsigned long* aBits1 = anImage->mBits;
                         unsigned long* aBits2 = anAlphaImage->mBits;
                         int aSize = anImage->mWidth*anImage->mHeight;

      -                  for (int i = 0; i < aSize; i++)
      -                    {
      +                for (int i = 0; i < aSize; i++) {
                             *aBits1 = (*aBits1 & 0x00FFFFFF) | ((*aBits2 & 0xFF) << 24);
                             ++aBits1;
                             ++aBits2;
      @@ -466,30 +460,24 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
                       }

                     delete anAlphaImage;
      -            }
      -          else if (gAlphaComposeColor==0xFFFFFF)
      -            {
      +        } else if (gAlphaComposeColor == 0xFFFFFF) {
                     anImage = anAlphaImage;

                     unsigned long* aBits1 = anImage->mBits;

                     int aSize = anImage->mWidth*anImage->mHeight;
      -              for (int i = 0; i < aSize; i++)
      -                {
      +            for (int i = 0; i < aSize; i++) {
                         *aBits1 = (0x00FFFFFF) | ((*aBits1 & 0xFF) << 24);
                         ++aBits1;
                       }
      -            }
      -          else
      -            {
      +        } else {
                     const int aColor = gAlphaComposeColor;
                     anImage = anAlphaImage;

                     unsigned long* aBits1 = anImage->mBits;

                     int aSize = anImage->mWidth*anImage->mHeight;
      -              for (int i = 0; i < aSize; i++)
      -                {
      +            for (int i = 0; i < aSize; i++) {
                         *aBits1 = aColor | ((*aBits1 & 0xFF) << 24);
                         ++aBits1;
                       }
      @@ -499,6 +487,7 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
               if (anImage == NULL && ok) {
                 anImage = new ImageLib::Image(mImage.baseColumns(), mImage.baseRows());

      +        if (anImage) {
                 const Magick::PixelPacket* pixels = mImage.getConstPixels(0,0,mImage.baseColumns(), mImage.baseRows());

                 for(int i = 0; i < mImage.baseColumns() * mImage.baseRows(); ++i) {
      @@ -512,7 +501,8 @@ ImageLib::Image* ImageLib::GetImage(std::string theFilename, bool lookForAlphaIm
                   *((unsigned char*)anImage->mBits + i * sizeof(ulong) + 3) = 255 - (unsigned char)(c.alpha() * 255.0f);
                 }
               }
      -
      +    }
           return anImage;
      +#endif
      }

      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Insets.cpp b/./tuxcap/lib/Insets.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/KeyCodes.cpp b/./tuxcap/lib/KeyCodes.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ListWidget.cpp b/./tuxcap/lib/ListWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/MTRand.cpp b/./tuxcap/lib/MTRand.cpp
      index 664ce69..b145795 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/MTRand.cpp
      +++ b/./tuxcap/lib/MTRand.cpp
      @@ -41,6 +41,7 @@ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
      #endif
      #include <assert.h>
      #include <stdio.h>
      +#include <string.h>

      using namespace Sexy;

      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/MemoryImage.cpp b/./tuxcap/lib/MemoryImage.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/MusicInterface.cpp b/./tuxcap/lib/MusicInterface.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/NativeDisplay.cpp b/./tuxcap/lib/NativeDisplay.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/NaturalCubicSpline.cpp b/./tuxcap/lib/NaturalCubicSpline.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ParticlePhysicsSystem.cpp b/./tuxcap/lib/ParticlePhysicsSystem.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Physics.cpp b/./tuxcap/lib/Physics.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/PropertiesParser.cpp b/./tuxcap/lib/PropertiesParser.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Quantize.cpp b/./tuxcap/lib/Quantize.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Ratio.cpp b/./tuxcap/lib/Ratio.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ResourceManager.cpp b/./tuxcap/lib/ResourceManager.cpp
      index 45460aa..3d51224 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ResourceManager.cpp
      +++ b/./tuxcap/lib/ResourceManager.cpp
      @@ -4,7 +4,7 @@
      #include "SoundManager.h"
      #ifdef USE_AUDIERE
      #include "AudiereSoundManager.h"
      -#else
      +#elif defined(USE_SDL_MIXER)
      #include "SDLMixerSoundManager.h"
      #endif
      #include "DDImage.h"
      @@ -18,6 +18,7 @@
      #include "ImageFont.h"
      #include "ImageLib.h"

      +#include <memory>

      using namespace Sexy;

      @@ -32,8 +33,11 @@ void ResourceManager::ImageRes::DeleteResource()
      ///////////////////////////////////////////////////////////////////////////////
      void ResourceManager::SoundRes::DeleteResource()
      {
      -    if (mSoundId >= 0)
      +    if (mSoundId >= 0) {
      +        if (gSexyAppBase->mSoundManager) {
               gSexyAppBase->mSoundManager->ReleaseSound(mSoundId);
      +        }
      +    }

           mSoundId = -1;
      }
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SDLMain.m b/./tuxcap/lib/SDLMain.m
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SDLMixerMusicInterface.cpp b/./tuxcap/lib/SDLMixerMusicInterface.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SDLMixerSoundInstance.cpp b/./tuxcap/lib/SDLMixerSoundInstance.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SDLMixerSoundManager.cpp b/./tuxcap/lib/SDLMixerSoundManager.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri.cpp b/./tuxcap/lib/SWTri.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_DrawTriangle.cpp b/./tuxcap/lib/SWTri_DrawTriangle.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_DrawTriangleInc1.cpp b/./tuxcap/lib/SWTri_DrawTriangleInc1.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_DrawTriangleInc2.cpp b/./tuxcap/lib/SWTri_DrawTriangleInc2.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_GetTexel.cpp b/./tuxcap/lib/SWTri_GetTexel.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_Loop.cpp b/./tuxcap/lib/SWTri_Loop.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_Pixel555.cpp b/./tuxcap/lib/SWTri_Pixel555.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_Pixel565.cpp b/./tuxcap/lib/SWTri_Pixel565.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_Pixel888.cpp b/./tuxcap/lib/SWTri_Pixel888.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_Pixel8888.cpp b/./tuxcap/lib/SWTri_Pixel8888.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SWTri_TexelARGB.cpp b/./tuxcap/lib/SWTri_TexelARGB.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ScrollbarWidget.cpp b/./tuxcap/lib/ScrollbarWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/ScrollbuttonWidget.cpp b/./tuxcap/lib/ScrollbuttonWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SexyAppBase.cpp b/./tuxcap/lib/SexyAppBase.cpp
      index e177ec3..1a126df 100644
      --- a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SexyAppBase.cpp
      +++ b/./tuxcap/lib/SexyAppBase.cpp
      @@ -26,7 +26,7 @@
      #ifdef USE_AUDIERE
      #include "AudiereMusicInterface.h"
      #include "AudiereSoundManager.h"
      -#else
      +#elif defined(USE_SDL_MIXER)
      #include "SDL_mixer.h"
      #include "SDLMixerMusicInterface.h"
      #include "SDLMixerSoundManager.h"
      @@ -207,6 +207,8 @@ void* GetSHGetFolderPath(const char* theDLL, HMODULE* theMod)

      SexyAppBase::SexyAppBase()
      {
      +   
      +   
           gSexyAppBase = this;

             if( SDL_Init( SDL_INIT_VIDEO) < 0 )
      @@ -221,16 +223,22 @@ SexyAppBase::SexyAppBase()
                      SDL_GetError( ) );         
                 }   

      -#ifndef USE_AUDIERE
      +#ifdef USE_SDL_MIXER
                 if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) {
                 fprintf( stderr, "Audio initialization failed: %s\n",
                      SDL_GetError( ) );         
                 }   
      #endif

      +         
               const char* path = getenv("HOME");
      +        if (!path) {
      +            path = ".";
      +        }
               SetAppDataFolder(path);

      +   
      +
           mMutex = NULL;
           mNotifyGameMessage = 0;

      @@ -436,6 +444,8 @@ SexyAppBase::SexyAppBase()

           gSEHCatcher.mApp = this;   
      #endif
      +   
      +   
      }

      SexyAppBase::~SexyAppBase()
      @@ -3346,6 +3356,7 @@ void SexyAppBase::ShowMemoryUsage()
           aStr += StrFormat("3D-Mode is %s (3D is %s on this system)\r\n\r\n",Is3DAccelerated()?"On":"Off",aDesc);

           aStr += StrFormat("Num Images: %d\r\n",(int)mMemoryImageSet.size());
      +    printf("%s:%d HIT\n", __FUNCTION__, __LINE__);
           aStr += StrFormat("Num Sounds: %d\r\n",mSoundManager->GetNumSounds());
           aStr += StrFormat("Video Memory: %s/%s KB\r\n", SexyStringToString(CommaSeperate((aTotal-aFree)/1024)).c_str(), SexyStringToString(CommaSeperate(aTotal/1024)).c_str());
           aStr += StrFormat("Texture Memory: %s KB\r\n",CommaSeperate(aTextureMemory/1024).c_str());
      @@ -4260,15 +4271,23 @@ static void ConvertCursorToSDL(unsigned char* data) {

      void SexyAppBase::Init()
      {
      +   
      +   
           mPrimaryThreadId = SDL_ThreadID();
          
      +   
      +   
           if (mShutdown)
               return;

               SetAppDataFolder(GetAppDataFolder() + "." + mRegKey + "/");

      +   
      +
           InitPropertiesHook();

      +   
      +
               surface = NULL;

           ReadFromRegistry();   
      @@ -4295,6 +4314,9 @@ void SexyAppBase::Init()
           mMutex = SDL_CreateMutex();
           mRandSeed = SDL_GetTicks();
           SRand(mRandSeed);   
      +   
      +   
      +   
      #if 0

           // Set up demo recording stuff
      @@ -4325,6 +4347,8 @@ void SexyAppBase::Init()
           // PreDisplayHook must call mWidgetManager->Resize if it changes mWidth or mHeight.
           PreDisplayHook();

      +   
      +
           mWidgetManager->Resize(Rect(0, 0, mWidth, mHeight), Rect(0, 0, mWidth, mHeight));

           // Check to see if we CAN run windowed or not...
      @@ -4369,8 +4393,12 @@ void SexyAppBase::Init()
               }
           }

      +   
      +
           MakeWindow();

      +   
      +
      #if 0
           if (mPlayingDemoBuffer)
           {
      @@ -4387,10 +4415,12 @@ void SexyAppBase::Init()
           }
      #endif

      +   
      +
               if (mSoundManager == NULL)       
      #ifdef USE_AUDIERE
                 mSoundManager = new AudiereSoundManager();
      -#else
      +#elif defined(USE_SDL_MIXER)
                 mSoundManager = new SDLMixerSoundManager();
      #endif
           SetSfxVolume(mSfxVolume);
      @@ -4410,6 +4440,8 @@ void SexyAppBase::Init()
               SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);

           mInitialized = true;
      +   
      +   
      }

      @@ -4669,12 +4701,16 @@ bool SexyAppBase::UpdateAppStep(bool* updated)
               {
                   if (mStepMode==2)
                   {
      +#ifndef WIN32
                       struct timespec timeOut,remains;

                       timeOut.tv_sec = 0;
                       timeOut.tv_nsec = mFrameTime * 1000000;

                       nanosleep(&timeOut, &remains);
      +#else
      +                Sleep(mFrameTime);
      +#endif

                       mUpdateAppState = UPDATESTATE_PROCESS_DONE; // skip actual update until next step
                   }
      @@ -4727,8 +4763,11 @@ void SexyAppBase::UpdateFrames()
                   ++mFPSDirtyCount;
           }

      +    if (mMusicInterface) {
           mMusicInterface->Update();   
      +    }
           CleanSharedImages();
      +   
      }

      bool gIsFailing = false;
      @@ -4811,12 +4850,16 @@ bool SexyAppBase::DrawDirtyStuff()
                   Uint32 aTick = SDL_GetTicks();
                   if (aTick-mLastDrawTick < mDDInterface->mMillisecondsPerFrame)
                                 {
      +#ifndef WIN32
                           struct timespec timeOut,remains;

                           timeOut.tv_sec = 0;
                           timeOut.tv_nsec =(mDDInterface->mMillisecondsPerFrame - (aTick-mLastDrawTick)) *  1000000;

                           nanosleep(&timeOut, &remains);
      +#else
      +                    Sleep((mDDInterface->mMillisecondsPerFrame - (aTick-mLastDrawTick)));
      +#endif
                                 }
               }

      @@ -4973,6 +5016,7 @@ bool SexyAppBase::Process(bool allowSleep)
               if (mDemoMute)
               {
                   mDemoMute = false;
      +            printf("%s:%d HIT\n", __FUNCTION__, __LINE__);
                   mSoundManager->StopAllSounds();
                   Unmute(true);
               }
      @@ -5117,12 +5161,16 @@ bool SexyAppBase::Process(bool allowSleep)

                           // Wait till next processing cycle
                           ++mSleepCount;
      +#ifndef WIN32
                           struct timespec timeOut,remains;

                           timeOut.tv_sec = 0;
                           timeOut.tv_nsec = aTimeToNextFrame * 1000000;

                           nanosleep(&timeOut, &remains);
      +#else
      +                    Sleep(aTimeToNextFrame);
      +#endif

                           aCumSleepTime += aTimeToNextFrame;                   
                       }
      @@ -5490,12 +5538,19 @@ void SexyAppBase::SetSfxVolume(double theVolume)

      double SexyAppBase::GetMasterVolume()
      {
      +    if (!mSoundManager)
      +        return 0.0;
      +   
           return mSoundManager->GetMasterVolume();
      }

      void SexyAppBase::SetMasterVolume(double theMasterVolume)
      {
           mSfxVolume = theMasterVolume;
      +   
      +    if (!mSoundManager)
      +        return;
      +   
           mSoundManager->SetMasterVolume(mSfxVolume);
      }

      @@ -5505,8 +5560,10 @@ MusicInterface* SexyAppBase::CreateMusicInterface()
           return new MusicInterface;
      #ifdef USE_AUDIERE
               return new AudiereMusicInterface(mInvisHWnd);
      -#else
      +#elif defined(USE_SDL_MIXER)
               return new SDLMixerMusicInterface(mInvisHWnd);
      +#else
      +    return NULL;
      #endif
      }

      @@ -5975,22 +6032,34 @@ void SexyAppBase::PrecacheNative(MemoryImage* theImage)

      void SexyAppBase::MakeWindow()
      {
      +   
      +   
           if (mDDInterface == NULL)
           {
               mDDInterface = new DDInterface(this);

      +       
      +
               // Enable 3d setting
               bool is3D = false, tested3D = false;
                       RegistryReadBoolean("Is3D", &is3D);
                       RegistryReadBoolean("Tested3D", &tested3D);

      -#ifndef APPLE
      +       
      +
      +#ifdef WIN32
      +        is3D = true;
      +#elif !defined(APPLE)
                         if (!tested3D) {
      +                     
      +                     
                           //run glxinfo to get direct rendering info from driver

                           FILE* info = popen("glxinfo | grep rendering", "r");
                           std::string s;
                          
      +                     
      +                   
                           if (info != NULL) {
                             int c;

      @@ -5998,8 +6067,12 @@ void SexyAppBase::MakeWindow()
                               s += (unsigned char)c;
                             }
           
      +                     
      +    
                           pclose(info);              

      +                     
      +
                           if (s.find("Yes", 0) != std::string::npos) {
                             is3D = true;
                           }
      @@ -6010,11 +6083,15 @@ void SexyAppBase::MakeWindow()
                            RegistryWriteBoolean("Tested3D", true);
                         }
      #else
      +                 
                         is3D = true;       
      #endif
                         mDDInterface->mIs3D = is3D;
      +                 
               }

      +       
      +
         if (mDDInterface->mIs3D) {
           //FIXME hardcoded values
           SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
      @@ -6126,6 +6203,7 @@ void SexyAppBase::MakeWindow()
      #if 0
           SetTimer(mHWnd, 100, mFrameTime, NULL);
      #endif
      +   
      }

      int SexyAppBase::InitDDInterface()
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SexyMatrix.cpp b/./tuxcap/lib/SexyMatrix.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/SharedImage.cpp b/./tuxcap/lib/SharedImage.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Slider.cpp b/./tuxcap/lib/Slider.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/TextWidget.cpp b/./tuxcap/lib/TextWidget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/Widget.cpp b/./tuxcap/lib/Widget.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/WidgetContainer.cpp b/./tuxcap/lib/WidgetContainer.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/WidgetManager.cpp b/./tuxcap/lib/WidgetManager.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/XMLParser.cpp b/./tuxcap/lib/XMLParser.cpp
      diff --git a/home/afaucher/Downloads/Firefox/tanktank/libtuxcap-1.3.09/tuxcap/lib/XMLWriter.cpp b/./tuxcap/lib/XMLWriter.cpp

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.