+/*
+Copyright (C) 2003, 2010 - Wolfire Games
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
#ifdef WIN32
#include <vld.h>
#endif
-#include "Game.h"
-
#ifndef USE_DEVIL
# ifdef WIN32
# define USE_DEVIL
#include "IL/il.h"
#include "IL/ilu.h"
#include "IL/ilut.h"
+ #include "Game.h"
#else
- // just use libpng and libjpg directly; it's lighter-weight and easier
- // to manage the dependencies on Linux...
- extern "C" {
- #include "png.h"
- #include "jpeglib.h"
- }
+
+ #include <zlib.h>
+ #include <png.h>
+ #include <jpeglib.h>
+ #include "Game.h"
static bool load_image(const char * fname, TGAImageRec & tex);
static bool load_png(const char * fname, TGAImageRec & tex);
static bool load_jpg(const char * fname, TGAImageRec & tex);
char *arg = _argv[i];
while (*arg == '-')
arg++;
- if (stricmp(arg, cmd) == 0)
+ if (strcasecmp(arg, cmd) == 0)
return true;
}
char *retval;
char *envr;
- char *ptr = strrchr(argv0, '/');
+ char *ptr = strrchr((char *)argv0, '/');
if (strchr(argv0, '/'))
{
retval = strdup(argv0);
#if !USE_DEVIL
static bool load_image(const char *file_name, TGAImageRec &tex)
{
- char *ptr = strrchr(file_name, '.');
+ char *ptr = strrchr((char *)file_name, '.');
if (ptr)
{
- if (stricmp(ptr+1, "png") == 0)
+ if (strcasecmp(ptr+1, "png") == 0)
return load_png(file_name, tex);
- else if (stricmp(ptr+1, "jpg") == 0)
+ else if (strcasecmp(ptr+1, "jpg") == 0)
return load_jpg(file_name, tex);
}
static bool save_image(const char *file_name)
{
- char *ptr = strrchr(file_name, '.');
+ char *ptr = strrchr((char *)file_name, '.');
if (ptr)
{
- if (stricmp(ptr+1, "png") == 0)
+ if (strcasecmp(ptr+1, "png") == 0)
return save_png(file_name);
}