Move packaging -> pkg
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4061 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
36027bc88b
commit
7e93a664b8
|
@ -15,9 +15,9 @@ noinst_LIBRARIES = libframework.a
|
|||
noinst_HEADERS = configfile.h cursors.h cursors16.h debug.h frame.h frameint.h \
|
||||
frameresource.h input.h listmacs.h math-help.h printf_ext.h resly.h \
|
||||
strlfuncs.h strnlen1.h strres.h strresly.h treap.h treapint.h trig.h \
|
||||
types.h tagfile.h
|
||||
types.h tagfile.h i18n.h
|
||||
|
||||
libframework_a_SOURCES = SDL_framerate.c configfile.c debug.c exceptionhandler.c \
|
||||
frame.c frameresource.c input.c printf_ext.c resource_lexer.lex.c \
|
||||
resource_parser.tab.c strnlen1.c strres.c strres_lexer.lex.c \
|
||||
strres_parser.tab.c treap.c trig.c tagfile.c
|
||||
strres_parser.tab.c treap.c trig.c tagfile.c i18n.c
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
/* Check the header files have been included from frame.h if they
|
||||
* are used outside of the framework library.
|
||||
*/
|
||||
|
||||
#if !defined(_frame_h) && !defined(FRAME_LIB_INCLUDE)
|
||||
# error Framework header files MUST be included from Frame.h ONLY.
|
||||
#endif
|
||||
|
|
|
@ -25,43 +25,22 @@
|
|||
|
||||
#include "wzglobal.h"
|
||||
|
||||
/* This one must be invoked *after* wzglobal.h to get _GNU_SOURCE! */
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <physfs.h>
|
||||
|
||||
// Provides the safer functions strlcpy and strlcat
|
||||
#include "strlfuncs.h"
|
||||
#include "printf_ext.h"
|
||||
|
||||
#include "gettext.h"
|
||||
|
||||
#if !defined(LC_MESSAGES)
|
||||
# define LC_MESSAGES 0
|
||||
#endif
|
||||
|
||||
#define _(String) gettext(String)
|
||||
#define N_(String) gettext_noop(String)
|
||||
|
||||
// Context sensitive strings
|
||||
#define P_(Context, String) pgettext(Context, String)
|
||||
// Non literal context sensitive strings
|
||||
#define PE_(Context, String) pgettext_expr(Context, String)
|
||||
// Make xgettext recognize the context
|
||||
#define NP_(Context, String) gettext_noop(String)
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "types.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "treap.h"
|
||||
#include "printf_ext.h"
|
||||
|
||||
#include "trig.h"
|
||||
|
||||
#include <physfs.h>
|
||||
|
||||
extern UDWORD selectedPlayer;
|
||||
#define MAX_PLAYERS 8 /**< Maximum number of players in the game. */
|
||||
|
||||
|
|
|
@ -23,15 +23,16 @@
|
|||
* Framework Resource file processing functions
|
||||
*
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include "frame.h"
|
||||
|
||||
#include "frameresource.h"
|
||||
#include "resly.h"
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#include <physfs.h>
|
||||
|
||||
#include "resly.h"
|
||||
|
||||
// Local prototypes
|
||||
static RES_TYPE *psResTypes=NULL;
|
||||
|
||||
|
@ -360,47 +361,6 @@ static inline RES_DATA* resDataInit(const char *DebugName, UDWORD DataIDHash, vo
|
|||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
/*!
|
||||
* Return the language part of the selected locale
|
||||
*/
|
||||
static WZ_DECL_CONST const char* getLanguage(void)
|
||||
{
|
||||
static char language[4] = { '\0' }; // ISO639 language code has to fit in!
|
||||
static BOOL haveLanguage = FALSE;
|
||||
|
||||
if ( ! haveLanguage ) // only get language name once for speed optimization
|
||||
{
|
||||
char *localeName = setlocale(LC_MESSAGES, NULL);
|
||||
char *delim = NULL;
|
||||
|
||||
haveLanguage = TRUE;
|
||||
|
||||
if ( !localeName )
|
||||
{
|
||||
return language; // Return empty string on errors
|
||||
}
|
||||
|
||||
strlcpy(language, localeName, sizeof(language));
|
||||
|
||||
delim = strchr(language, '_');
|
||||
|
||||
if ( !delim )
|
||||
{
|
||||
delim = strchr(language, '.');
|
||||
}
|
||||
|
||||
if ( delim )
|
||||
{
|
||||
*delim = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
return language;
|
||||
}
|
||||
#endif // ENABLE_NLS
|
||||
|
||||
|
||||
/*!
|
||||
* check if given file exists in a locale dependend subdir
|
||||
* if so, modify given fileName to hold the locale dep. file,
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
* \brief Resource file processing functions
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDED_LIB_FRAMEWORK_RESOURCE_H__
|
||||
#define __INCLUDED_LIB_FRAMEWORK_RESOURCE_H__
|
||||
#ifndef _frameresource_h
|
||||
#define _frameresource_h
|
||||
|
||||
#include "lib/framework/frame.h"
|
||||
|
||||
|
@ -147,4 +147,4 @@ void SetLastResourceFilename(const char *pName);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_FRAMEWORK_RESOURCE_H__
|
||||
#endif // _frameresource_h
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "frame.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/** A variant on snprintf which appends its output string to the given string
|
||||
* buffer, rather than to replace it.
|
||||
* \param str the string to append to
|
||||
|
|
|
@ -331,7 +331,7 @@ char *strresGetString(STR_RES *psRes, UDWORD id)
|
|||
// find the block the string is in
|
||||
for(psBlock = psRes->psStrings; psBlock && psBlock->idEnd < id;
|
||||
psBlock = psBlock->psNext)
|
||||
;
|
||||
{}
|
||||
|
||||
if (!psBlock)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#ifndef WZ_NOSOUND
|
||||
# include <vorbis/vorbisfile.h>
|
||||
# if defined(OV_CALLBACKS_DEFAULT) && defined(OV_CALLBACKS_NOCLOSE) && defined(OV_CALLBACKS_STREAMONLY) && defined(OV_CALLBACKS_STREAMONLY_NOCLOSE)
|
||||
//# if defined(OV_CALLBACKS_DEFAULT) && defined(OV_CALLBACKS_NOCLOSE) && defined(OV_CALLBACKS_STREAMONLY) && defined(OV_CALLBACKS_STREAMONLY_NOCLOSE)
|
||||
/* HACK: Dummy reference vorbisfile.h symbols to prevent warnings */
|
||||
static WZ_DECL_UNUSED void MKID(dummy)(void)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ static WZ_DECL_UNUSED void MKID(dummy)(void)
|
|||
(void)OV_CALLBACKS_STREAMONLY;
|
||||
(void)OV_CALLBACKS_STREAMONLY_NOCLOSE;
|
||||
}
|
||||
# endif
|
||||
//# endif
|
||||
#endif
|
||||
|
||||
#ifdef __BIG_ENDIAN__
|
||||
|
|
|
@ -134,6 +134,21 @@ BOOL loadConfig(void)
|
|||
{
|
||||
showFPS = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
showFPS = FALSE;
|
||||
setWarzoneKeyNumeric("showFPS", FALSE);
|
||||
}
|
||||
|
||||
if (getWarzoneKeyString("language", sBuf))
|
||||
{
|
||||
setLanguage(sBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
setLanguage(WZ_SYSTEM_LOCALE);
|
||||
setWarzoneKeyString("language", WZ_SYSTEM_LOCALE);
|
||||
}
|
||||
|
||||
// //////////////////////////
|
||||
// gamma
|
||||
|
@ -524,7 +539,7 @@ BOOL loadRenderMode(void)
|
|||
{
|
||||
bad_resolution = true;
|
||||
}
|
||||
|
||||
|
||||
if (getWarzoneKeyNumeric("height", &val)
|
||||
&& val > 0)
|
||||
{
|
||||
|
@ -543,7 +558,7 @@ BOOL loadRenderMode(void)
|
|||
war_SetWidth(640);
|
||||
war_SetHeight(480);
|
||||
}
|
||||
|
||||
|
||||
if (getWarzoneKeyNumeric("bpp", &val))
|
||||
{
|
||||
pie_SetVideoBufferDepth(val);
|
||||
|
|
18
src/main.c
18
src/main.c
|
@ -51,6 +51,7 @@
|
|||
|
||||
#include <SDL.h>
|
||||
#include <physfs.h>
|
||||
#include <locale.h>
|
||||
|
||||
#if defined(WZ_OS_WIN)
|
||||
// FIXME HACK Workaround DATADIR definition in objbase.h
|
||||
|
@ -862,22 +863,7 @@ int main(int argc, char *argv[])
|
|||
initialize_PhysicsFS(argv[0]);
|
||||
|
||||
/*** Initialize translations ***/
|
||||
setlocale(LC_ALL, "");
|
||||
setlocale(LC_NUMERIC, "C"); // set radix character to the period (".")
|
||||
#if defined(WZ_OS_WIN)
|
||||
{
|
||||
// Retrieve an absolute path to the locale directory
|
||||
char localeDir[PATH_MAX];
|
||||
strlcpy(localeDir, PHYSFS_getBaseDir(), sizeof(localeDir));
|
||||
strlcat(localeDir, "\\" LOCALEDIR, sizeof(localeDir));
|
||||
|
||||
// Set locale directory and translation domain name
|
||||
(void)bindtextdomain(PACKAGE, localeDir);
|
||||
}
|
||||
#else
|
||||
(void)bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
#endif
|
||||
(void)textdomain(PACKAGE);
|
||||
initI18n();
|
||||
|
||||
// find early boot info
|
||||
if ( !ParseCommandLineEarly(argc, (const char**)argv) ) {
|
||||
|
|
Loading…
Reference in New Issue