made Windows version compile again

This commit is contained in:
Dave White 2004-08-22 01:30:07 +00:00
parent f2f6081907
commit 1eb02e3bef
18 changed files with 120 additions and 47 deletions

View file

@ -11,6 +11,11 @@
See the COPYING file for more details.
*/
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include "array.hpp"
#include "display.hpp"
#include "log.hpp"

View file

@ -10,6 +10,12 @@
See the COPYING file for more details.
*/
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include <algorithm>
#include <cassert>
#include <cctype>

10
src/config.h Normal file
View file

@ -0,0 +1,10 @@
#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED
#define VERSION "0.8.2"
#define WESNOTH_DEFAULT_SERVER "devsrv.wesnoth.org"
#define PACKAGE "wesnoth"
#define LOCALEDIR "libintl"
#endif

View file

@ -14,7 +14,7 @@
#define CONFIG_HPP_INCLUDED
//disable the very annoying VC++ warning 4786
#ifdef _WIN32
#ifdef WIN32
#pragma warning(disable:4786)
#endif
@ -96,8 +96,9 @@ struct compression_schema
//a config object defines a single node in a WML file, with access to
//child nodes.
struct config
class config
{
public:
//create an empty node.
config() {}

View file

@ -1,3 +1,8 @@
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include "clipboard.hpp"
#include "cursor.hpp"
#include "events.hpp"

View file

@ -10,6 +10,12 @@
See the COPYING file for more details.
*/
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
//include files for opendir(3), readdir(3), etc. These files may vary
//from platform to platform, since these functions are NOT ANSI-conforming
//functions. They may have to be altered to port to new platforms

View file

@ -92,7 +92,7 @@ std::string directory_name(const std::string& file);
///Binaries will be searched for in [wesnoth-path]/data/<path>/images/
struct binary_paths_manager
{
binary_paths_manager(const struct config& cfg);
binary_paths_manager(const class config& cfg);
~binary_paths_manager();
private:

View file

@ -11,6 +11,11 @@
See the COPYING file for more details.
*/
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include "SDL.h"
#include "about.hpp"
@ -405,7 +410,6 @@ int play_game(int argc, char** argv)
std::cerr << "unknown option: " << val << "\n";
return 0;
} else {
char buf[256];
if(val[0] == '/') {
game_config::path = val;

View file

@ -142,24 +142,24 @@ namespace {
return ss.str();
}
typedef std::vector<std::vector<std::pair<std::string, unsigned> > > table_spec;
typedef std::vector<std::vector<std::pair<std::string, unsigned int > > > table_spec;
// Create a table using the table specs. Return markup with jumps
// that create a table. The table spec contains a vector with
// vectors with pairs. The pairs are the markup string that should
// be in a cell, and the width of that cell.
std::string generate_table(const table_spec &tab, const unsigned spacing=20) {
std::string generate_table(const table_spec &tab, const unsigned int spacing=20) {
table_spec::const_iterator row_it;
std::vector<std::pair<std::string, unsigned> >::const_iterator col_it;
unsigned num_cols = 0;
unsigned int num_cols = 0;
for (row_it = tab.begin(); row_it != tab.end(); row_it++) {
if (row_it->size() > num_cols) {
num_cols = row_it->size();
}
}
std::vector<unsigned> col_widths(num_cols, 0);
std::vector<unsigned int> col_widths(num_cols, 0);
// Calculate the width of all columns, including spacing.
for (row_it = tab.begin(); row_it != tab.end(); row_it++) {
unsigned col = 0;
unsigned int col = 0;
for (col_it = row_it->begin(); col_it != row_it->end(); col_it++) {
if (col_widths[col] < col_it->second + spacing) {
col_widths[col] = col_it->second + spacing;
@ -167,18 +167,18 @@ namespace {
col++;
}
}
std::vector<unsigned> col_starts(num_cols);
std::vector<unsigned int> col_starts(num_cols);
// Calculate the starting positions of all columns
for (unsigned i = 0; i < num_cols; i++) {
unsigned this_col_start = 0;
for (unsigned j = 0; j < i; j++) {
for (unsigned int i = 0; i < num_cols; i++) {
unsigned int this_col_start = 0;
for (unsigned int j = 0; j < i; j++) {
this_col_start += col_widths[j];
}
col_starts[i] = this_col_start;
}
std::stringstream ss;
for (row_it = tab.begin(); row_it != tab.end(); row_it++) {
unsigned col = 0;
unsigned int col = 0;
for (col_it = row_it->begin(); col_it != row_it->end(); col_it++) {
ss << jump_to(col_starts[col]) << col_it->first;
col++;
@ -191,14 +191,14 @@ namespace {
// Return the width for the image with filename.
unsigned image_width(const std::string &filename) {
image::locator loc(filename);
surface surf(get_image(loc, image::UNSCALED));
surface surf(image::get_image(loc, image::UNSCALED));
if (surf != NULL) {
return surf->w;
}
return 0;
}
void push_tab_pair(std::vector<std::pair<std::string, unsigned> > &v, const std::string &s) {
void push_tab_pair(std::vector<std::pair<std::string, unsigned int> > &v, const std::string &s) {
v.push_back(std::make_pair(s, font::line_width(s, normal_font_size)));
}
}
@ -632,30 +632,32 @@ std::vector<topic> generate_unit_topics() {
ss << "\n\n<header>text='" << escape(cap(_("attacks")))
<< "'</header>\n\n";
table_spec table;
std::vector<std::pair<std::string, unsigned> > first_row;
typedef std::pair<std::string,unsigned int> item;
std::vector<item> first_row;
// Dummy element, icons are below.
first_row.push_back(std::make_pair("", 0));
first_row.push_back(std::make_pair(bold(_("Name")),
first_row.push_back(item("", 0));
first_row.push_back(item(bold(_("Name")),
font::line_width(cap(_("Name")),
normal_font_size,
TTF_STYLE_BOLD)));
first_row.push_back(std::make_pair(bold(_("Type")),
first_row.push_back(item(bold(_("Type")),
font::line_width(_("Type"),
normal_font_size,
TTF_STYLE_BOLD)));
first_row.push_back(std::make_pair(bold(_("Dmg")),
first_row.push_back(item(bold(_("Dmg")),
font::line_width(_("Dmg"),
normal_font_size,
TTF_STYLE_BOLD)));
first_row.push_back(std::make_pair(bold(_("Strikes")),
first_row.push_back(item(bold(_("Strikes")),
font::line_width(_("Strikes"),
normal_font_size,
TTF_STYLE_BOLD)));
first_row.push_back(std::make_pair(bold(_("Range")),
first_row.push_back(item(bold(_("Range")),
font::line_width(_("Range"),
normal_font_size,
TTF_STYLE_BOLD)));
first_row.push_back(std::make_pair(bold(_("Special")),
first_row.push_back(item(bold(_("Special")),
font::line_width(_("Special"),
normal_font_size,
TTF_STYLE_BOLD)));

View file

@ -27,26 +27,26 @@ namespace {
}
language_def known_languages[] = {
{ "", N_("System default language") },
{ "es_ES", "Castellano" },
{ "ca_ES", "Català" },
{ "cs_CZ", "Čeština" },
{ "da_DK", "Dansk" },
{ "de_DE", "Deutsch" },
{ "C", "English" },
{ "fr_FR", "Français" },
{ "hu_HU", "Hungarian" },
{ "it_IT", "Italiano" },
{ "nl_NL", "Nederlands" },
{ "no_NO", "Norsk" },
{ "pl_PL", "Polski" },
{ "pt_BR", "Português do Brasil" },
{ "sk_SK", "Slovenčina" },
{ "fi_FI", "Suomi" },
{ "sv_SE", "Swedish" },
language_def("", N_("System default language")),
language_def("es_ES", "Castellano"),
language_def("ca_ES", "Català"),
language_def("cs_CZ", "Čeština"),
language_def("da_DK", "Dansk"),
language_def("de_DE", "Deutsch"),
language_def("C", "English"),
language_def("fr_FR", "Français"),
language_def("hu_HU", "Hungarian"),
language_def("it_IT", "Italiano"),
language_def("nl_NL", "Nederlands"),
language_def("no_NO", "Norsk"),
language_def("pl_PL", "Polski"),
language_def("pt_BR", "Português do Brasil"),
language_def("sk_SK", "Slovenčina"),
language_def("fi_FI", "Suomi"),
language_def("sv_SE", "Swedish"),
// end of list marker, do not remove
{ "", "" }
language_def("", "")
};
std::string languagedef_name (const language_def& def)

View file

@ -27,6 +27,9 @@ typedef std::vector<wchar_t> wide_string;
struct language_def
{
language_def() {}
language_def(const std::string& name, const std::string& lang) : localename(name), language(lang)
{}
std::string localename;
std::string language;
bool operator== (const language_def&);

View file

@ -1,3 +1,8 @@
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include <algorithm>
#include <cctype>
#include <cmath>

View file

@ -1,3 +1,8 @@
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include "race.hpp"
#include "replay.hpp"

View file

@ -11,6 +11,11 @@
See the COPYING file for more details.
*/
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include "filesystem.hpp"
#include "game_config.hpp"
#include "log.hpp"

View file

@ -205,7 +205,7 @@ private:
bool calculate_is_enemy(size_t index) const;
mutable std::vector<bool> enemies_;
mutable std::vector<const team::shroud_map*> ally_shroud_, ally_fog_;
mutable std::vector<const shroud_map*> ally_shroud_, ally_fog_;
};
struct teams_manager {

View file

@ -10,6 +10,12 @@
See the COPYING file for more details.
*/
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include <stdio.h>
#include <iostream>
#include <vector>

View file

@ -1,3 +1,8 @@
//disable the very annoying VC++ warning 4786
#ifdef WIN32
#pragma warning(disable:4786)
#endif
#include "menu.hpp"
#include "../font.hpp"

View file

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /Ot /Oa /Ow /Og /Oi /Op /Oy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /Ot /Oa /Ow /Og /Oi /Op /Oy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_CONFIG_H" /FR /YX /FD /c
# SUBTRACT CPP /Ox
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib SDL.lib SDLmain.lib SDL_ttf.lib SDL_mixer.lib SDL_net.lib SDL_image.lib /nologo /subsystem:windows /machine:I386 /out:"wesnoth.exe"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib SDL.lib SDLmain.lib SDL_ttf.lib SDL_mixer.lib SDL_net.lib SDL_image.lib libintl.lib /nologo /subsystem:windows /machine:I386 /out:"wesnoth.exe"
!ELSEIF "$(CFG)" == "wesnoth - Win32 Debug"
@ -67,9 +67,10 @@ LINK32=link.exe
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@ -79,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib SDL.lib SDLmain.lib SDL_ttf.lib SDL_mixer.lib SDL_net.lib SDL_image.lib libintl.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
@ -180,6 +181,10 @@ SOURCE=.\src\gamestatus.cpp
# End Source File
# Begin Source File
SOURCE=.\src\gettext.cpp
# End Source File
# Begin Source File
SOURCE=.\src\halo.cpp
# End Source File
# Begin Source File