summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-10-12 06:26:57 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-10-12 06:29:52 -0700
commit73caeb4198e8321a6de37934b1120779469cae89 (patch)
treeb84044a47f45ac9306c1cb33df8f0fef35f3cd30
parent48a7ef0bd95493853b8481eccfda76c169d04381 (diff)
downloadcrawl-ref-73caeb4198e8321a6de37934b1120779469cae89.tar.gz
crawl-ref-73caeb4198e8321a6de37934b1120779469cae89.zip
project-wide: fix msvc compile breakage
MSVC is like a chimp with Down's syndrome. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
-rw-r--r--crawl-ref/source/AppHdr.cc3
-rw-r--r--crawl-ref/source/effects.cc2
-rw-r--r--crawl-ref/source/files.cc2
-rw-r--r--crawl-ref/source/initfile.cc20
-rw-r--r--crawl-ref/source/luadgn.cc12
-rw-r--r--crawl-ref/source/tilebuf.cc4
-rw-r--r--crawl-ref/source/tilefont.cc4
-rw-r--r--crawl-ref/source/tilemcache.cc4
-rw-r--r--crawl-ref/source/tilereg.cc4
-rw-r--r--crawl-ref/source/tilesdl.cc4
-rw-r--r--crawl-ref/source/tiletex.cc3
11 files changed, 44 insertions, 18 deletions
diff --git a/crawl-ref/source/AppHdr.cc b/crawl-ref/source/AppHdr.cc
new file mode 100644
index 0000000000..91e3e9f392
--- /dev/null
+++ b/crawl-ref/source/AppHdr.cc
@@ -0,0 +1,3 @@
+
+/* This file is for MSVC to generate a precompiled header */
+#include "AppHdr.h" \ No newline at end of file
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 6c4dc207bc..975cd9b593 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -4196,7 +4196,7 @@ struct greater_second
// out which arc the input point pos falls on.
static int _arc_decomposition(const coord_def & pos, int n_arcs)
{
- float theta = atan2(pos.y, pos.x);
+ float theta = atan2((float)pos.y, (float)pos.x);
if (pos.x == 0 && pos.y != 0)
theta = pos.y > 0 ? PI / 2 : -PI / 2;
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 2e627db619..303ea417d6 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -482,7 +482,7 @@ bool is_read_safe_path(const std::string &path)
{
assert_read_safe_path(path);
}
- catch (const std::string &err)
+ catch (const std::string &)
{
return (false);
}
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index cf175bc4db..2a796af899 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -9,16 +9,6 @@ REVISION("$Rev$");
#include "initfile.h"
-// For finding the executable's path
-#if defined ( WIN32CONSOLE ) || defined ( WIN32TILES )
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#elif defined ( __linux__ )
-#include <unistd.h>
-#elif defined ( __MACH__ )
-extern char **NXArgv;
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string>
@@ -52,6 +42,16 @@ extern char **NXArgv;
#include "items.h"
#include "view.h"
+// For finding the executable's path
+#if defined ( WIN32CONSOLE ) || defined ( WIN32TILES )
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#elif defined ( __linux__ )
+#include <unistd.h>
+#elif defined ( __MACH__ )
+extern char **NXArgv;
+#endif
+
const std::string game_options::interrupt_prefix = "interrupt_";
game_options Options;
diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc
index f377397337..deb089d3f0 100644
--- a/crawl-ref/source/luadgn.cc
+++ b/crawl-ref/source/luadgn.cc
@@ -669,8 +669,8 @@ static int dgn_set_random_mon_list(lua_State *ls)
}
else if (nargs == 2)
{
- map_def **_map(
- clua_get_userdata<map_def*>(ls, MAP_METATABLE, 1));
+ map_def **_map =
+ clua_get_userdata<map_def*>(ls, MAP_METATABLE, 1);
map = *_map;
}
@@ -3466,8 +3466,8 @@ static mons_list _lua_get_mlist(lua_State *ls, int ndx)
}
else
{
- mons_list **mlist(
- clua_get_userdata<mons_list*>(ls, MONSLIST_METATABLE, ndx));
+ mons_list **mlist =
+ clua_get_userdata<mons_list*>(ls, MONSLIST_METATABLE, ndx);
if (mlist)
return (**mlist);
@@ -3491,8 +3491,8 @@ static item_list _lua_get_ilist(lua_State *ls, int ndx)
}
else
{
- item_list **ilist(
- clua_get_userdata<item_list*>(ls, ITEMLIST_METATABLE, ndx));
+ item_list **ilist =
+ clua_get_userdata<item_list*>(ls, ITEMLIST_METATABLE, ndx);
if (ilist)
return (**ilist);
diff --git a/crawl-ref/source/tilebuf.cc b/crawl-ref/source/tilebuf.cc
index 470e8fa549..2699502717 100644
--- a/crawl-ref/source/tilebuf.cc
+++ b/crawl-ref/source/tilebuf.cc
@@ -8,6 +8,8 @@
#include "AppHdr.h"
REVISION("$Rev$");
+#ifdef USE_TILE
+
#include "tilebuf.h"
#include "tilefont.h"
#include "tilesdl.h"
@@ -323,3 +325,5 @@ void LineBuffer::add_square(float sx, float sy, float ex, float ey,
add(ex, ey, sx, ey, col);
add(sx, ey, sx, sy, col);
}
+
+#endif
diff --git a/crawl-ref/source/tilefont.cc b/crawl-ref/source/tilefont.cc
index b92a499aa9..6c2c9e2d5a 100644
--- a/crawl-ref/source/tilefont.cc
+++ b/crawl-ref/source/tilefont.cc
@@ -6,6 +6,8 @@
#include "AppHdr.h"
REVISION("$Rev$");
+#ifdef USE_TILE
+
#include "tilebuf.h"
#include "tilefont.h"
#include "defines.h"
@@ -759,3 +761,5 @@ void FTFont::store(FontBuffer &buf, float &x, float &y,
x += m_glyphs[c].advance;
}
+
+#endif
diff --git a/crawl-ref/source/tilemcache.cc b/crawl-ref/source/tilemcache.cc
index 5811bdb94c..9e1c403456 100644
--- a/crawl-ref/source/tilemcache.cc
+++ b/crawl-ref/source/tilemcache.cc
@@ -1,6 +1,8 @@
#include "AppHdr.h"
REVISION("$Rev$");
+#ifdef USE_TILE
+
#include "tilemcache.h"
#include "tags.h"
#include "ghost.h"
@@ -865,3 +867,5 @@ void mcache_demon::construct(writer &th)
marshallDemon(th, m_demon);
}
+
+#endif
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 3a7650eac5..447c7af8e2 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -8,6 +8,8 @@
#include "AppHdr.h"
REVISION("$Rev$");
+#ifdef USE_TILE
+
#include "cio.h"
#include "debug.h"
#include "describe.h"
@@ -4167,3 +4169,5 @@ void ImageManager::unload_textures()
for (int i = 0; i < TEX_MAX; i++)
m_textures[i].unload_texture();
}
+
+#endif
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 953c5ba563..7945b80124 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -1,6 +1,8 @@
#include "AppHdr.h"
REVISION("$Rev$");
+#ifdef USE_TILE
+
#include "artefact.h"
#include "cio.h"
#include "itemname.h"
@@ -1758,3 +1760,5 @@ bool TilesFramework::need_redraw() const
{
return m_need_redraw;
}
+
+#endif
diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc
index 39993ca9e0..83c76c50b2 100644
--- a/crawl-ref/source/tiletex.cc
+++ b/crawl-ref/source/tiletex.cc
@@ -1,6 +1,8 @@
#include "AppHdr.h"
REVISION("$Rev$");
+#ifdef USE_TILE
+
#include "files.h"
#include "tiletex.h"
@@ -270,3 +272,4 @@ void TilesTexture::set_info(int tile_max, tile_info_func *info_func)
m_info_func = info_func;
}
+#endif