Skip to content
Browse files

More Windows porting

  • Loading branch information...
1 parent 607738a commit b9989aa38a46cf1d383766f7490868f27cbfaf3e unknown committed Jun 6, 2009
Showing with 26 additions and 24 deletions.
  1. BIN msvc9/Lander/Lander.suo
  2. +2 −2 msvc9/Lander/Lander/Lander.vcproj
  3. +14 −14 src/Fade.cpp
  4. +3 −3 src/Fade.hpp
  5. +1 −1 src/Main.cpp
  6. +6 −4 src/Platform.hpp
View
BIN msvc9/Lander/Lander.suo
Binary file not shown.
View
4 msvc9/Lander/Lander/Lander.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""C:\Documents and Settings\Nick\My Documents\SDL-1.2.13\include";"C:\Documents and Settings\Nick\My Documents\SDL_image-1.2.7\include";"C:\Documents and Settings\Nick\My Documents\SDL_mixer-1.2.8\include";"C:\Program Files\GnuWin32\include\freetype2";"C:\Program Files\GnuWin32\include""
- PreprocessorDefinitions="WIN32;_DEBUG;VERSION=\"0.5.3\""
+ PreprocessorDefinitions="WIN32;_DEBUG;VERSION=\"0.6.0\""
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -137,7 +137,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib glu32.lib SDL.lib freetype.lib SDL_mixer.lib SDL_image.lib SDLmain.lib"
+ AdditionalDependencies="opengl32.lib glu32.lib SDL.lib freetype.lib SDL_mixer.lib SDL_image.lib SDLmain.lib libboost_filesystem-vc90-mt-1_37.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;C:\Documents and Settings\Nick\My Documents\SDL-1.2.13\lib&quot;;&quot;C:\Documents and Settings\Nick\My Documents\SDL_image-1.2.7\lib&quot;;&quot;C:\Documents and Settings\Nick\My Documents\SDL_mixer-1.2.8\lib&quot;;&quot;C:\Program Files\GnuWin32\lib&quot;"
GenerateDebugInformation="true"
View
28 src/Fade.cpp
@@ -20,10 +20,10 @@
#include <cassert>
-const double Fade::DEFAULT_FADE_SPEED(0.05);
+const float Fade::DEFAULT_FADE_SPEED(0.05f);
-Fade::Fade(double s)
- : state(fNone), alpha(0.0), speed(s)
+Fade::Fade(float s)
+ : state(fNone), alpha(0.0f), speed(s)
{
}
@@ -33,31 +33,31 @@ void Fade::BeginFadeIn()
assert(state == fNone);
state = fIn;
- alpha = 1.0;
+ alpha = 1.0f;
}
void Fade::BeginFadeOut()
{
assert(state == fNone);
state = fOut;
- alpha = 0.0;
+ alpha = 0.0f;
}
bool Fade::Process()
{
switch (state) {
case fOut:
alpha += speed;
- if (alpha >= 1.0) {
+ if (alpha >= 1.0f) {
state = fNone;
return true;
}
else
return false;
case fIn:
alpha -= speed;
- if (alpha <= 0.0) {
+ if (alpha <= 0.0f) {
state = fNone;
return true;
}
@@ -70,17 +70,17 @@ bool Fade::Process()
void Fade::Display()
{
- double w = OpenGL::GetInstance().GetWidth();
- double h = OpenGL::GetInstance().GetHeight();
+ const int w = OpenGL::GetInstance().GetWidth();
+ const int h = OpenGL::GetInstance().GetHeight();
glEnable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
- glColor4d(0.0, 0.0, 0.0, alpha);
+ glColor4f(0.0f, 0.0f, 0.0f, alpha);
glLoadIdentity();
glBegin(GL_QUADS);
- glVertex3d(0.0, 0.0, 0.0);
- glVertex3d(0.0, h, 0.0);
- glVertex3d(w, h, 0.0);
- glVertex3d(w, 0.0, 0.0);
+ glVertex3i(0, 0, 0);
+ glVertex3i(0, h, 0);
+ glVertex3i(w, h, 0);
+ glVertex3i(w, 0, 0);
glEnd();
}
View
6 src/Fade.hpp
@@ -22,9 +22,9 @@
class Fade {
public:
- static const double DEFAULT_FADE_SPEED;
+ static const float DEFAULT_FADE_SPEED;
- Fade(double s = DEFAULT_FADE_SPEED);
+ Fade(float s = DEFAULT_FADE_SPEED);
void BeginFadeIn();
void BeginFadeOut();
@@ -34,7 +34,7 @@ class Fade {
enum State { fNone, fIn, fOut };
State state;
- double alpha, speed;
+ float alpha, speed;
};
#endif
View
2 src/Main.cpp
@@ -169,7 +169,7 @@ string LocateResource(const string& file)
cfBase = CFStringCreateWithCString(NULL, copy, kCFStringEncodingASCII);
cfExt = CFStringCreateWithCString(NULL, ext, kCFStringEncodingASCII);
- free(copy);
+ free(copy);
mainBundle = CFBundleGetMainBundle();
View
10 src/Platform.hpp
@@ -1,5 +1,5 @@
//
-// Platform.hpp -- Platform specific includes.
+// Platform.hpp -- Platform specific hacks.
// Copyright (C) 2006-2009 Nick Gasson
//
// This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
#define DATADIR "."
#endif
-// Windows specific constants and includes */
+// Windows specific constants and includes
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
@@ -49,15 +49,15 @@
#define PATH_MAX 256
-// Don't have these on Windows for some reason */
+// Don't have these on Windows for some reason
#ifndef GL_BGRA
#define GL_BGRA 0
#endif
#ifndef GL_BGR
#define GL_BGR 0
#endif
-// Define safe snprintf, etc. for MSCV8 */
+// Define safe snprintf, etc. for MSCV8
#if (_MSC_VER >= 1400)
#define USE_FOPEN_S
@@ -124,6 +124,8 @@
#endif /* #ifdef LINUX */
+#include <string>
+
using namespace std;
using namespace std::tr1;

0 comments on commit b9989aa

Please sign in to comment.
Something went wrong with that request. Please try again.