Conflicts:
	src/engine/server/server.cpp
	src/engine/shared/console.cpp
	src/engine/shared/storage.cpp
	src/game/server/gamecontext.cpp
Alterations:
	src/engine/shared/console.h  | made StoreCommands(,)take also the client id
	src/engine/console.h  | made StoreCommands(,)take also the client id

Signed-off-by: GreYFoXGTi <GreYFoXGTi@Gmail.com>
This commit is contained in:
GreYFoXGTi 2010-08-09 17:54:42 +03:00
commit 60b5acbb15
50 changed files with 501 additions and 201 deletions

View file

@ -28,7 +28,7 @@ FreeType = {
settings.link.flags:Add("`freetype-config --libs`") settings.link.flags:Add("`freetype-config --libs`")
elseif option.use_win32lib == true then elseif option.use_win32lib == true then
settings.link.libs:Add(FreeType.basepath .. "/lib/freetype2311MT") settings.link.libs:Add(FreeType.basepath .. "/lib/freetype241MT")
end end
end end

View file

@ -4,7 +4,7 @@
/* */ /* */
/* ANSI-specific configuration file (specification only). */ /* ANSI-specific configuration file (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -35,7 +35,6 @@
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTCONFIG_H__ #ifndef __FTCONFIG_H__
#define __FTCONFIG_H__ #define __FTCONFIG_H__
@ -306,9 +305,38 @@ FT_BEGIN_HEADER
/* Provide assembler fragments for performance-critical functions. */ /* Provide assembler fragments for performance-critical functions. */
/* These must be defined `static __inline__' with GCC. */ /* These must be defined `static __inline__' with GCC. */
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
/* documentation is in freetype.h */
static __inline FT_Int32
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 t, t2;
__asm
{
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
mov a, t, asr #31 /* a = (hi >> 31) */
add a, a, #0x8000 /* a += 0x8000 */
adds t2, t2, a /* t2 += a */
adc t, t, #0 /* t += carry */
mov a, t2, lsr #16 /* a = t2 >> 16 */
orr a, a, t, lsl #16 /* a |= t << 16 */
}
return a;
}
#endif /* __CC_ARM || __ARMCC__ */
#ifdef __GNUC__ #ifdef __GNUC__
#if defined( __arm__ ) && !defined( __thumb__ ) #if defined( __arm__ ) && !defined( __thumb__ ) && \
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
/* documentation is in freetype.h */ /* documentation is in freetype.h */
@ -333,7 +361,7 @@ FT_BEGIN_HEADER
return a; return a;
} }
#endif /* __arm__ && !__thumb__ */ #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
#if defined( i386 ) #if defined( i386 )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386

View file

@ -4,7 +4,8 @@
/* */ /* */
/* User-selectable configuration macros (specification only). */ /* User-selectable configuration macros (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -85,9 +86,9 @@ FT_BEGIN_HEADER
/* */ /* */
/* This macro has no impact on the FreeType API, only on its */ /* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times larger than */ /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
/* the original size; the difference will be that each triplet of */ /* the original size in case this macro isn't defined; however, each */
/* subpixels has R=G=B. */ /* triplet of subpixels has R=G=B. */
/* */ /* */
/* This is done to allow FreeType clients to run unmodified, forcing */ /* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */ /* them to display normal gray-level anti-aliased glyphs. */
@ -312,10 +313,11 @@ FT_BEGIN_HEADER
/* */ /* */
/* Allow the use of FT_Incremental_Interface to load typefaces that */ /* Allow the use of FT_Incremental_Interface to load typefaces that */
/* contain no glyph data, but supply it via a callback function. */ /* contain no glyph data, but supply it via a callback function. */
/* This allows FreeType to be used with the PostScript language, using */ /* This is required by clients supporting document formats which */
/* the GhostScript interpreter. */ /* supply font data incrementally as the document is parsed, such */
/* as the Ghostscript interpreter for the PostScript language. */
/* */ /* */
/* #define FT_CONFIG_OPTION_INCREMENTAL */ #define FT_CONFIG_OPTION_INCREMENTAL
/*************************************************************************/ /*************************************************************************/
@ -401,7 +403,7 @@ FT_BEGIN_HEADER
/* Position Independent Code */ /* Position Independent Code */
/* */ /* */
/* If this macro is set (which is _not_ the default), FreeType2 will */ /* If this macro is set (which is _not_ the default), FreeType2 will */
/* avoid creating constants that require address fixups. Instead the */ /* avoid creating constants that require address fixups. Instead the */
/* constants will be moved into a struct and additional intialization */ /* constants will be moved into a struct and additional intialization */
/* code will be used. */ /* code will be used. */
/* */ /* */
@ -486,8 +488,7 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
/* a bytecode interpreter in the TrueType driver. Note that there are */ /* a bytecode interpreter in the TrueType driver. */
/* important patent issues related to the use of the interpreter. */
/* */ /* */
/* By undefining this, you will only compile the code necessary to load */ /* By undefining this, you will only compile the code necessary to load */
/* TrueType glyphs without hinting. */ /* TrueType glyphs without hinting. */
@ -495,17 +496,20 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here, since the build system might */ /* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */ /* define it for certain configurations only. */
/* */ /* */
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */ /* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. Note that the */ /* any of the patented opcodes and algorithms. The patents related to */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ /* TrueType hinting have expired worldwide since May 2010; this option */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ /* is now deprecated. */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* */
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */ /* */
/* This macro is only useful for a small number of font files (mostly */ /* This macro is only useful for a small number of font files (mostly */
@ -542,7 +546,7 @@ FT_BEGIN_HEADER
/* ... */ /* ... */
/* } */ /* } */
/* */ /* */
#define TT_CONFIG_OPTION_UNPATENTED_HINTING /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
/*************************************************************************/ /*************************************************************************/
@ -688,6 +692,27 @@ FT_BEGIN_HEADER
#define FT_CONFIG_OPTION_OLD_INTERNALS #define FT_CONFIG_OPTION_OLD_INTERNALS
/*
* To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
* we restrict the number of charmaps in a font. The current API of
* FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
* takes charcode only. To determine the passed value is for cmap_index
* or charcode, the possible cmap_index is restricted not to exceed
* the minimum possible charcode by a rogue client. It is also very
* unlikely that a rogue client is interested in Unicode values 0 to 15.
*
* NOTE: The original threshold was 4 deduced from popular number of
* cmap subtables in UCS-4 TrueType fonts, but now it is not
* irregular for OpenType fonts to have more than 4 subtables,
* because variation selector subtables are available for Apple
* and Microsoft platforms.
*/
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_MAX_CHARMAP_CACHEABLE 15
#endif
/* /*
* This macro is defined if either unpatented or native TrueType * This macro is defined if either unpatented or native TrueType
* hinting is requested by the definitions above. * hinting is requested by the definitions above.

View file

@ -4,7 +4,8 @@
/* */ /* */
/* FreeType high-level API and common types (specification only). */ /* FreeType high-level API and common types (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -231,6 +232,10 @@ FT_BEGIN_HEADER
/* vertAdvance :: */ /* vertAdvance :: */
/* Advance height for vertical layout. */ /* Advance height for vertical layout. */
/* */ /* */
/* <Note> */
/* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
/* dimensions of the hinted glyph (in case hinting is applicable). */
/* */
typedef struct FT_Glyph_Metrics_ typedef struct FT_Glyph_Metrics_
{ {
FT_Pos width; FT_Pos width;
@ -1477,8 +1482,13 @@ FT_BEGIN_HEADER
/* important to perform correct WYSIWYG layout. */ /* important to perform correct WYSIWYG layout. */
/* Only relevant for outline glyphs. */ /* Only relevant for outline glyphs. */
/* */ /* */
/* advance :: This is the transformed advance width for the */ /* advance :: This shorthand is, depending on */
/* glyph (in 26.6 fractional pixel format). */ /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
/* advance width for the glyph (in 26.6 */
/* fractional pixel format). As specified with */
/* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
/* `horiAdvance' or the `vertAdvance' value of */
/* `metrics' field. */
/* */ /* */
/* format :: This field indicates the format of the image */ /* format :: This field indicates the format of the image */
/* contained in the glyph slot. Typically */ /* contained in the glyph slot. Typically */
@ -1743,7 +1753,8 @@ FT_BEGIN_HEADER
/* data :: A pointer to the parameter data. */ /* data :: A pointer to the parameter data. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The ID and function of parameters are driver-specific. */ /* The ID and function of parameters are driver-specific. See the */
/* various FT_PARAM_TAG_XXX flags for more information. */
/* */ /* */
typedef struct FT_Parameter_ typedef struct FT_Parameter_
{ {
@ -2986,7 +2997,7 @@ FT_BEGIN_HEADER
* *
* @return: * @return:
* The index into the array of character maps within the face to which * The index into the array of character maps within the face to which
* `charmap' belongs. * `charmap' belongs. If an error occurs, -1 is returned.
* *
*/ */
FT_EXPORT( FT_Int ) FT_EXPORT( FT_Int )
@ -3762,8 +3773,8 @@ FT_BEGIN_HEADER
* *
*/ */
#define FREETYPE_MAJOR 2 #define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 3 #define FREETYPE_MINOR 4
#define FREETYPE_PATCH 11 #define FREETYPE_PATCH 1
/*************************************************************************/ /*************************************************************************/
@ -3823,6 +3834,9 @@ FT_BEGIN_HEADER
/* 1~if this is a TrueType font that uses one of the patented */ /* 1~if this is a TrueType font that uses one of the patented */
/* opcodes, 0~otherwise. */ /* opcodes, 0~otherwise. */
/* */ /* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
/* */
/* <Since> */ /* <Since> */
/* 2.3.5 */ /* 2.3.5 */
/* */ /* */
@ -3850,6 +3864,9 @@ FT_BEGIN_HEADER
/* an SFNT font, or if the unpatented hinter is not compiled in this */ /* an SFNT font, or if the unpatented hinter is not compiled in this */
/* instance of the library. */ /* instance of the library. */
/* */ /* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
/* */
/* <Since> */ /* <Since> */
/* 2.3.5 */ /* 2.3.5 */
/* */ /* */

View file

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType Cache subsystem (specification). */ /* FreeType Cache subsystem (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -263,10 +263,10 @@ FT_BEGIN_HEADER
/* reference-counted. A node with a count of~0 might be flushed */ /* reference-counted. A node with a count of~0 might be flushed */
/* out of a full cache whenever a lookup request is performed. */ /* out of a full cache whenever a lookup request is performed. */
/* */ /* */
/* If you lookup nodes, you have the ability to `acquire' them, i.e., */ /* If you look up nodes, you have the ability to `acquire' them, */
/* to increment their reference count. This will prevent the node */ /* i.e., to increment their reference count. This will prevent the */
/* from being flushed out of the cache until you explicitly `release' */ /* node from being flushed out of the cache until you explicitly */
/* it (see @FTC_Node_Unref). */ /* `release' it (see @FTC_Node_Unref). */
/* */ /* */
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
/* */ /* */

View file

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType error codes (specification). */ /* FreeType error codes (specification). */
/* */ /* */
/* Copyright 2002, 2004, 2006, 2007 by */ /* Copyright 2002, 2004, 2006, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -211,6 +211,9 @@
"argument stack underflow" ) "argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2, \ FT_ERRORDEF_( Ignore, 0xA2, \
"ignore" ) "ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
"no Unicode glyph name found" )
/* BDF errors */ /* BDF errors */
@ -220,19 +223,21 @@
"`FONT' field missing" ) "`FONT' field missing" )
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
"`SIZE' field missing" ) "`SIZE' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \ FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
"`FONTBOUNDINGBOX' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
"`CHARS' field missing" ) "`CHARS' field missing" )
FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \ FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
"`STARTCHAR' field missing" ) "`STARTCHAR' field missing" )
FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \ FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
"`ENCODING' field missing" ) "`ENCODING' field missing" )
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \ FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
"`BBX' field missing" ) "`BBX' field missing" )
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \ FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
"`BBX' too big" ) "`BBX' too big" )
FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \ FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
"Font header corrupted or missing fields" ) "Font header corrupted or missing fields" )
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \ FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
"Font glyphs corrupted or missing fields" ) "Font glyphs corrupted or missing fields" )

View file

@ -468,7 +468,7 @@ FT_BEGIN_HEADER
/* // convert to a bitmap (default render mode + destroying old) */ /* // convert to a bitmap (default render mode + destroying old) */
/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
/* { */ /* { */
/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */ /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
/* 0, 1 ); */ /* 0, 1 ); */
/* if ( error ) // `glyph' unchanged */ /* if ( error ) // `glyph' unchanged */
/* ... */ /* ... */

View file

@ -5,7 +5,8 @@
/* FreeType glyph image formats and default raster interface */ /* FreeType glyph image formats and default raster interface */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -51,10 +52,9 @@ FT_BEGIN_HEADER
/* FT_Pos */ /* FT_Pos */
/* */ /* */
/* <Description> */ /* <Description> */
/* The type FT_Pos is a 32-bit integer used to store vectorial */ /* The type FT_Pos is used to store vectorial coordinates. Depending */
/* coordinates. Depending on the context, these can represent */ /* on the context, these can represent distances in integer font */
/* distances in integer font units, or 16.16, or 26.6 fixed float */ /* units, or 16.16, or 26.6 fixed float pixel coordinates. */
/* pixel coordinates. */
/* */ /* */
typedef signed long FT_Pos; typedef signed long FT_Pos;
@ -99,6 +99,20 @@ FT_BEGIN_HEADER
/* */ /* */
/* yMax :: The vertical maximum (top-most). */ /* yMax :: The vertical maximum (top-most). */
/* */ /* */
/* <Note> */
/* The bounding box is specified with the coordinates of the lower */
/* left and the upper right corner. In PostScript, those values are */
/* often called (llx,lly) and (urx,ury), respectively. */
/* */
/* If `yMin' is negative, this value gives the glyph's descender. */
/* Otherwise, the glyph doesn't descend below the baseline. */
/* Similarly, if `ymax' is positive, this value gives the glyph's */
/* ascender. */
/* */
/* `xMin' gives the horizontal distance from the glyph's origin to */
/* the left edge of the glyph's bounding box. If `xMin' is negative, */
/* the glyph extends to the left of the origin. */
/* */
typedef struct FT_BBox_ typedef struct FT_BBox_
{ {
FT_Pos xMin, yMin; FT_Pos xMin, yMin;
@ -254,6 +268,9 @@ FT_BEGIN_HEADER
/* flow. In all cases, the pitch is an offset to add */ /* flow. In all cases, the pitch is an offset to add */
/* to a bitmap pointer in order to go down one row. */ /* to a bitmap pointer in order to go down one row. */
/* */ /* */
/* For the B/W rasterizer, `pitch' is always an even */
/* number. */
/* */
/* buffer :: A typeless pointer to the bitmap buffer. This */ /* buffer :: A typeless pointer to the bitmap buffer. This */
/* value should be aligned on 32-bit boundaries in */ /* value should be aligned on 32-bit boundaries in */
/* most cases. */ /* most cases. */
@ -563,8 +580,8 @@ FT_BEGIN_HEADER
/* FT_Outline_ConicToFunc */ /* FT_Outline_ConicToFunc */
/* */ /* */
/* <Description> */ /* <Description> */
/* A function pointer type use to describe the signature of a `conic */ /* A function pointer type used to describe the signature of a `conic */
/* to' function during outline walking/decomposition. */ /* to' function during outline walking or decomposition. */
/* */ /* */
/* A `conic to' is emitted to indicate a second-order Bézier arc in */ /* A `conic to' is emitted to indicate a second-order Bézier arc in */
/* the outline. */ /* the outline. */
@ -596,7 +613,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A function pointer type used to describe the signature of a `cubic */ /* A function pointer type used to describe the signature of a `cubic */
/* to' function during outline walking/decomposition. */ /* to' function during outline walking or decomposition. */
/* */ /* */
/* A `cubic to' is emitted to indicate a third-order Bézier arc. */ /* A `cubic to' is emitted to indicate a third-order Bézier arc. */
/* */ /* */
@ -629,8 +646,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure to hold various function pointers used during outline */ /* A structure to hold various function pointers used during outline */
/* decomposition in order to emit segments, conic, and cubic Béziers, */ /* decomposition in order to emit segments, conic, and cubic Béziers. */
/* as well as `move to' and `close to' operations. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* move_to :: The `move to' emitter. */ /* move_to :: The `move to' emitter. */
@ -657,7 +673,7 @@ FT_BEGIN_HEADER
/* y' = (x << shift) - delta */ /* y' = (x << shift) - delta */
/* } */ /* } */
/* */ /* */
/* Set the value of `shift' and `delta' to~0 to get the original */ /* Set the values of `shift' and `delta' to~0 to get the original */
/* point coordinates. */ /* point coordinates. */
/* */ /* */
typedef struct FT_Outline_Funcs_ typedef struct FT_Outline_Funcs_

View file

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType incremental loading (specification). */ /* FreeType incremental loading (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2006, 2007, 2008 by */ /* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -101,7 +101,10 @@ FT_BEGIN_HEADER
* Top bearing, in font units. * Top bearing, in font units.
* *
* advance :: * advance ::
* Glyph advance, in font units. * Horizontal component of glyph advance, in font units.
*
* advance_v ::
* Vertical component of glyph advance, in font units.
* *
* @note: * @note:
* These correspond to horizontal or vertical metrics depending on the * These correspond to horizontal or vertical metrics depending on the
@ -114,6 +117,7 @@ FT_BEGIN_HEADER
FT_Long bearing_x; FT_Long bearing_x;
FT_Long bearing_y; FT_Long bearing_y;
FT_Long advance; FT_Long advance;
FT_Long advance_v; /* since 2.3.12 */
} FT_Incremental_MetricsRec; } FT_Incremental_MetricsRec;

View file

@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */ /* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 2006, 2007, 2008 by */ /* Copyright 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -161,6 +161,47 @@ FT_BEGIN_HEADER
FT_Library_SetLcdFilter( FT_Library library, FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter ); FT_LcdFilter filter );
/**************************************************************************
*
* @func:
* FT_Library_SetLcdFilterWeights
*
* @description:
* Use this function to override the filter weights selected by
* @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
* (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
* 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
* FT_LCD_FILTER_LEGACY.
*
* @input:
* library ::
* A handle to the target library instance.
*
* weights ::
* A pointer to an array; the function copies the first five bytes and
* uses them to specify the filter weights.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* This function must be called after @FT_Library_SetLcdFilter to have
* any effect.
*
* @since:
* 2.4.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights );
/* */ /* */

View file

@ -4,7 +4,7 @@
/* */ /* */
/* Generic list support for FreeType (specification). */ /* Generic list support for FreeType (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2007 by */ /* Copyright 1996-2001, 2003, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -255,6 +255,10 @@ FT_BEGIN_HEADER
/* user :: A user-supplied field which is passed as the last */ /* user :: A user-supplied field which is passed as the last */
/* argument to the destructor. */ /* argument to the destructor. */
/* */ /* */
/* <Note> */
/* This function expects that all nodes added by @FT_List_Add or */
/* @FT_List_Insert have been dynamically allocated. */
/* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Finalize( FT_List list, FT_List_Finalize( FT_List list,
FT_List_Destructor destroy, FT_List_Destructor destroy,

View file

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType modules public interface (specification). */ /* FreeType modules public interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -263,6 +263,9 @@ FT_BEGIN_HEADER
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
/* instead of @FT_Init_FreeType to initialize the FreeType library. */ /* instead of @FT_Init_FreeType to initialize the FreeType library. */
/* */ /* */
/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
/* library instance. */
/* */
/* <Input> */ /* <Input> */
/* memory :: A handle to the original memory object. */ /* memory :: A handle to the original memory object. */
/* */ /* */
@ -394,8 +397,8 @@ FT_BEGIN_HEADER
* *
* FT_TRUETYPE_ENGINE_TYPE_PATENTED :: * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers * The library implements a bytecode interpreter that covers
* the full instruction set of the TrueType virtual machine. * the full instruction set of the TrueType virtual machine (this
* See the file `docs/PATENTS' for legal aspects. * was governed by patents until May 2010, hence the name).
* *
* @since: * @since:
* 2.2 * 2.2

View file

@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */ /* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */ /* most scalable font formats (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -85,9 +85,8 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* Walk over an outline's structure to decompose it into individual */ /* Walk over an outline's structure to decompose it into individual */
/* segments and Bézier arcs. This function is also able to emit */ /* segments and Bézier arcs. This function also emits `move to' */
/* `move to' and `close to' operations to indicate the start and end */ /* operations to indicate the start of new contours in the outline. */
/* of new contours in the outline. */
/* */ /* */
/* <Input> */ /* <Input> */
/* outline :: A pointer to the source target. */ /* outline :: A pointer to the source target. */

View file

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType renderer modules public interface (specification). */ /* FreeType renderer modules public interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2005, 2006 by */ /* Copyright 1996-2001, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -141,10 +141,6 @@ FT_BEGIN_HEADER
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to its raster's class. */ /* This is a pointer to its raster's class. */
/* */ /* */
/* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to the corresponding raster */
/* object, if any. */
/* */
typedef struct FT_Renderer_Class_ typedef struct FT_Renderer_Class_
{ {
FT_Module_Class root; FT_Module_Class root;

View file

@ -7,7 +7,7 @@
/* */ /* */
/* This is _not_ used to retrieve glyph names! */ /* This is _not_ used to retrieve glyph names! */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -160,6 +160,35 @@ FT_BEGIN_HEADER
FT_SfntName *aname ); FT_SfntName *aname );
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred family subfamily names in `name'
* table since OpenType version 1.4. For backwards compatibility with
* legacy systems which has 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred subfamily names in `name' table since
* OpenType version 1.4. For backwards compatibility with legacy
* systems which has 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* */ /* */

View file

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType low-level system interface definition (specification). */ /* FreeType low-level system interface definition (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2005 by */ /* Copyright 1996-2001, 2002, 2005, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -240,7 +240,8 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* This function might be called to perform a seek or skip operation * This function might be called to perform a seek or skip operation
* with a `count' of~0. * with a `count' of~0. A non-zero return value then indicates an
* error.
* *
*/ */
typedef unsigned long typedef unsigned long
@ -301,7 +302,7 @@ FT_BEGIN_HEADER
* The stream's input function. * The stream's input function.
* *
* close :: * close ::
* The stream;s close function. * The stream's close function.
* *
* memory :: * memory ::
* The memory manager to use to preload frames. This is set * The memory manager to use to preload frames. This is set

View file

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType memory management macros (specification). */ /* The FreeType memory management macros (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by */ /* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */ /* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -58,15 +58,27 @@ FT_BEGIN_HEADER
/* /*
* C++ refuses to handle statements like p = (void*)anything; where `p' * C++ refuses to handle statements like p = (void*)anything, with `p' a
* is a typed pointer. Since we don't have a `typeof' operator in * typed pointer. Since we don't have a `typeof' operator in standard
* standard C++, we have to use ugly casts. * C++, we have to use a template to emulate it.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#define FT_ASSIGNP( p, val ) *((void**)&(p)) = (val)
extern "C++"
template <typename T> inline T*
cplusplus_typeof( T*,
void *v )
{
return static_cast <T*> ( v );
}
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
#else #else
#define FT_ASSIGNP( p, val ) (p) = (val) #define FT_ASSIGNP( p, val ) (p) = (val)
#endif #endif

View file

@ -64,7 +64,7 @@ FT_BEGIN_HEADER
* MacOS systems (even if they contain a Microsoft charmap as well). * MacOS systems (even if they contain a Microsoft charmap as well).
* *
* TT_PLATFORM_ISO :: * TT_PLATFORM_ISO ::
* This value was used to specify Unicode charmaps. It is however * This value was used to specify ISO/IEC 10646 charmaps. It is however
* now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
* `encoding_id' values. * `encoding_id' values.
* *

View file

@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */ /* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */ /* (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -557,13 +557,13 @@ FT_BEGIN_HEADER
/* */ /* */
typedef enum FT_Sfnt_Tag_ typedef enum FT_Sfnt_Tag_
{ {
ft_sfnt_head = 0, ft_sfnt_head = 0, /* TT_Header */
ft_sfnt_maxp = 1, ft_sfnt_maxp = 1, /* TT_MaxProfile */
ft_sfnt_os2 = 2, ft_sfnt_os2 = 2, /* TT_OS2 */
ft_sfnt_hhea = 3, ft_sfnt_hhea = 3, /* TT_HoriHeader */
ft_sfnt_vhea = 4, ft_sfnt_vhea = 4, /* TT_VertHeader */
ft_sfnt_post = 5, ft_sfnt_post = 5, /* TT_Postscript */
ft_sfnt_pclt = 6, ft_sfnt_pclt = 6, /* TT_PCLT */
sfnt_max /* internal end mark */ sfnt_max /* internal end mark */
@ -590,6 +590,9 @@ FT_BEGIN_HEADER
/* error, or if the corresponding table was not found *OR* loaded */ /* error, or if the corresponding table was not found *OR* loaded */
/* from the file. */ /* from the file. */
/* */ /* */
/* Use a typecast according to `tag' to access the structure */
/* elements. */
/* */
/* <Note> */ /* <Note> */
/* The table is owned by the face object and disappears with it. */ /* The table is owned by the face object and disappears with it. */
/* */ /* */

Binary file not shown.

View file

@ -1613,6 +1613,9 @@ void CClient::Run()
Input()->MouseModeRelative(); Input()->MouseModeRelative();
// process pending commands
m_pConsole->StoreCommands(false);
while (1) while (1)
{ {
int64 FrameStartTime = time_get(); int64 FrameStartTime = time_get();
@ -1899,28 +1902,23 @@ void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData)
pSelf->m_DemoRecorder.Stop(); pSelf->m_DemoRecorder.Stop();
} }
void CClient::Con_ServerDummy(IConsole::IResult *pResult, void *pUserData)
{
dbg_msg("client", "this command is not available on the client");
}
void CClient::RegisterCommands() void CClient::RegisterCommands()
{ {
m_pConsole = Kernel()->RequestInterface<IConsole>(); m_pConsole = Kernel()->RequestInterface<IConsole>();
// register server dummy commands for tab completion // register server dummy commands for tab completion
m_pConsole->Register("kick", "i", CFGFLAG_SERVER, Con_ServerDummy, this, "Kick player with specified id"); m_pConsole->Register("kick", "i", CFGFLAG_SERVER, 0, 0, "Kick player with specified id");
m_pConsole->Register("ban", "s?i", CFGFLAG_SERVER, Con_ServerDummy, this, "Ban player with ip/id for x minutes"); m_pConsole->Register("ban", "s?i", CFGFLAG_SERVER, 0, 0, "Ban player with ip/id for x minutes");
m_pConsole->Register("unban", "s", CFGFLAG_SERVER, Con_ServerDummy, this, "Unban ip"); m_pConsole->Register("unban", "s", CFGFLAG_SERVER, 0, 0, "Unban ip");
m_pConsole->Register("bans", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Show banlist"); m_pConsole->Register("bans", "", CFGFLAG_SERVER, 0, 0, "Show banlist");
m_pConsole->Register("status", "", CFGFLAG_SERVER, Con_ServerDummy, this, "List players"); m_pConsole->Register("status", "", CFGFLAG_SERVER, 0, 0, "List players");
m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Shut down"); m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, 0, 0, "Shut down");
m_pConsole->Register("record", "s", CFGFLAG_SERVER, Con_ServerDummy, this, "Record to a file"); m_pConsole->Register("record", "s", CFGFLAG_SERVER, 0, 0, "Record to a file");
m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Stop recording"); m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording");
m_pConsole->Register("reload", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Reload the map"); m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map");
m_pConsole->Register("quit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds"); m_pConsole->Register("quit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
m_pConsole->Register("exit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds"); m_pConsole->Register("exit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
m_pConsole->Register("minimize", "", CFGFLAG_CLIENT, Con_Minimize, this, "Minimize Teeworlds"); m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds");
m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip"); m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip");
m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server"); m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server");
m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server"); m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server");
@ -1964,7 +1962,7 @@ int main(int argc, const char **argv) // ignore_convention
// create the components // create the components
IConsole *pConsole = CreateConsole(CFGFLAG_CLIENT); IConsole *pConsole = CreateConsole(CFGFLAG_CLIENT);
IStorage *pStorage = CreateStorage("Teeworlds", argv[0]); // ignore_convention IStorage *pStorage = CreateStorage("Teeworlds", argc, argv); // ignore_convention
IConfig *pConfig = CreateConfig(); IConfig *pConfig = CreateConfig();
IEngineGraphics *pEngineGraphics = CreateEngineGraphics(); IEngineGraphics *pEngineGraphics = CreateEngineGraphics();
IEngineSound *pEngineSound = CreateEngineSound(); IEngineSound *pEngineSound = CreateEngineSound();
@ -2017,6 +2015,9 @@ int main(int argc, const char **argv) // ignore_convention
// init client's interfaces // init client's interfaces
m_Client.InitInterfaces(); m_Client.InitInterfaces();
// execute config file
pConsole->ExecuteFile("settings.cfg");
// execute autoexec file // execute autoexec file
pConsole->ExecuteFile("autoexec.cfg"); pConsole->ExecuteFile("autoexec.cfg");
@ -2024,8 +2025,7 @@ int main(int argc, const char **argv) // ignore_convention
if(argc > 1) // ignore_convention if(argc > 1) // ignore_convention
pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention
// execute config file m_Client.Engine()->InitLogfile();
pConsole->ExecuteFile("settings.cfg");
// run the client // run the client
m_Client.Run(); m_Client.Run();

View file

@ -280,7 +280,6 @@ public:
static void Con_Play(IConsole::IResult *pResult, void *pUserData); static void Con_Play(IConsole::IResult *pResult, void *pUserData);
static void Con_Record(IConsole::IResult *pResult, void *pUserData); static void Con_Record(IConsole::IResult *pResult, void *pUserData);
static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData); static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData);
static void Con_ServerDummy(IConsole::IResult *pResult, void *pUserData);
void RegisterCommands(); void RegisterCommands();

View file

@ -103,7 +103,7 @@ void CGraphics_OpenGL::AddVertices(int Count)
Flush(); Flush();
} }
void CGraphics_OpenGL::Rotate4(CPoint *pCenter, CVertex *pPoints) void CGraphics_OpenGL::Rotate4(const CPoint &rCenter, CVertex *pPoints)
{ {
float c = cosf(m_Rotation); float c = cosf(m_Rotation);
float s = sinf(m_Rotation); float s = sinf(m_Rotation);
@ -112,10 +112,10 @@ void CGraphics_OpenGL::Rotate4(CPoint *pCenter, CVertex *pPoints)
for(i = 0; i < 4; i++) for(i = 0; i < 4; i++)
{ {
x = pPoints[i].m_Pos.x - pCenter->x; x = pPoints[i].m_Pos.x - rCenter.x;
y = pPoints[i].m_Pos.y - pCenter->y; y = pPoints[i].m_Pos.y - rCenter.y;
pPoints[i].m_Pos.x = x * c - y * s + pCenter->x; pPoints[i].m_Pos.x = x * c - y * s + rCenter.x;
pPoints[i].m_Pos.y = x * s + y * c + pCenter->y; pPoints[i].m_Pos.y = x * s + y * c + rCenter.y;
} }
} }
@ -558,15 +558,12 @@ void CGraphics_OpenGL::QuadsDraw(CQuadItem *pArray, int Num)
void CGraphics_OpenGL::QuadsDrawTL(const CQuadItem *pArray, int Num) void CGraphics_OpenGL::QuadsDrawTL(const CQuadItem *pArray, int Num)
{ {
CPoint Center; CPoint Center;
Center.z = 0;
dbg_assert(m_Drawing == DRAWING_QUADS, "called quads_draw without begin"); dbg_assert(m_Drawing == DRAWING_QUADS, "called quads_draw without begin");
for(int i = 0; i < Num; ++i) for(int i = 0; i < Num; ++i)
{ {
Center.x = pArray[i].m_X + pArray[i].m_Width/2;
Center.y = pArray[i].m_Y + pArray[i].m_Height/2;
Center.z = 0;
m_aVertices[m_NumVertices + 4*i].m_Pos.x = pArray[i].m_X; m_aVertices[m_NumVertices + 4*i].m_Pos.x = pArray[i].m_X;
m_aVertices[m_NumVertices + 4*i].m_Pos.y = pArray[i].m_Y; m_aVertices[m_NumVertices + 4*i].m_Pos.y = pArray[i].m_Y;
m_aVertices[m_NumVertices + 4*i].m_Tex = m_aTexture[0]; m_aVertices[m_NumVertices + 4*i].m_Tex = m_aTexture[0];
@ -588,7 +585,12 @@ void CGraphics_OpenGL::QuadsDrawTL(const CQuadItem *pArray, int Num)
m_aVertices[m_NumVertices + 4*i + 3].m_Color = m_aColor[3]; m_aVertices[m_NumVertices + 4*i + 3].m_Color = m_aColor[3];
if(m_Rotation != 0) if(m_Rotation != 0)
Rotate4(&Center, &m_aVertices[m_NumVertices + 4*i]); {
Center.x = pArray[i].m_X + pArray[i].m_Width/2;
Center.y = pArray[i].m_Y + pArray[i].m_Height/2;
Rotate4(Center, &m_aVertices[m_NumVertices + 4*i]);
}
} }
AddVertices(4*Num); AddVertices(4*Num);

View file

@ -60,7 +60,7 @@ protected:
void Flush(); void Flush();
void AddVertices(int Count); void AddVertices(int Count);
void Rotate4(CPoint *pCenter, CVertex *pPoints); void Rotate4(const CPoint &rCenter, CVertex *pPoints);
static unsigned char Sample(int w, int h, const unsigned char *pData, int u, int v, int Offset); static unsigned char Sample(int w, int h, const unsigned char *pData, int u, int v, int Offset);
public: public:

View file

@ -45,6 +45,7 @@ public:
virtual void Register(const char *pName, const char *pParams, virtual void Register(const char *pName, const char *pParams,
int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp, const int Level) = 0; int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp, const int Level) = 0;
virtual void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser) = 0; virtual void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser) = 0;
virtual void StoreCommands(bool Store, int ClientId) = 0;
virtual void ExecuteLine(const char *Sptr, const int ClientLevel, const int ClientId) = 0; virtual void ExecuteLine(const char *Sptr, const int ClientLevel, const int ClientId) = 0;
virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId) = 0; virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId) = 0;

View file

@ -1215,6 +1215,9 @@ int CServer::Run()
GameServer()->OnInit(); GameServer()->OnInit();
dbg_msg("server", "version %s", GameServer()->NetVersion()); dbg_msg("server", "version %s", GameServer()->NetVersion());
// process pending commands
m_pConsole->StoreCommands(false,-1);
// start game // start game
{ {
int64 ReportTime = time_get(); int64 ReportTime = time_get();
@ -1398,7 +1401,7 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientId1)
return; return;
} }
NETADDR Addr = ((CServer *)pUser)->m_NetServer.ClientAddr(ClientId); Addr = ((CServer *)pUser)->m_NetServer.ClientAddr(ClientId);
((CServer *)pUser)->BanAdd(Addr, Minutes*60, Bufz); ((CServer *)pUser)->BanAdd(Addr, Minutes*60, Bufz);
} }
@ -1530,15 +1533,12 @@ void CServer::RegisterCommands()
Console()->Register("kick", "i", CFGFLAG_SERVER, ConKick, this, "", 2); Console()->Register("kick", "i", CFGFLAG_SERVER, ConKick, this, "", 2);
Console()->Register("ban", "s?i?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s", CFGFLAG_SERVER, ConBan, this, "Ban player",2); //horrible long string Console()->Register("ban", "s?i?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s?s", CFGFLAG_SERVER, ConBan, this, "Ban player",2); //horrible long string
Console()->Register("unban", "s", CFGFLAG_SERVER, ConUnban, this, "", 3); Console()->Register("unban", "s", CFGFLAG_SERVER, ConUnban, this, "", 3);
Console()->Register("bans", "", CFGFLAG_SERVER, ConBans, this, "", 2); Console()->Register("bans", "", CFGFLAG_SERVER, ConBans, this, "", 2);
Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, "", 1); Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, "", 1);
Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, "", 3); Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, "", 3);
Console()->Register("record", "s", CFGFLAG_SERVER, ConRecord, this, "", 3); Console()->Register("record", "s", CFGFLAG_SERVER, ConRecord, this, "", 3);
Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, "", 3); Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, "", 3);
Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, "", 3); Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, "", 3);
Console()->Chain("sv_name", ConchainSpecialInfoupdate, this); Console()->Chain("sv_name", ConchainSpecialInfoupdate, this);
@ -1598,7 +1598,7 @@ int main(int argc, const char **argv) // ignore_convention
IGameServer *pGameServer = CreateGameServer(); IGameServer *pGameServer = CreateGameServer();
IConsole *pConsole = CreateConsole(CFGFLAG_SERVER); IConsole *pConsole = CreateConsole(CFGFLAG_SERVER);
IEngineMasterServer *pEngineMasterServer = CreateEngineMasterServer(); IEngineMasterServer *pEngineMasterServer = CreateEngineMasterServer();
IStorage *pStorage = CreateStorage("Teeworlds", argv[0]); // ignore_convention IStorage *pStorage = CreateStorage("Teeworlds", argc, argv); // ignore_convention
IConfig *pConfig = CreateConfig(); IConfig *pConfig = CreateConfig();
pServer->InitRegister(&pServer->m_NetServer, pEngineMasterServer); pServer->InitRegister(&pServer->m_NetServer, pEngineMasterServer);
@ -1644,6 +1644,7 @@ int main(int argc, const char **argv) // ignore_convention
if(argc > 1) // ignore_convention if(argc > 1) // ignore_convention
pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention
pServer->Engine()->InitLogfile();
if(g_Config.m_SvExternalRecords == 1) { if(g_Config.m_SvExternalRecords == 1) {
char pathBuf[512]; char pathBuf[512];
str_format(pathBuf, sizeof(pathBuf), "%s/records", pStorage->ApplicationSavePath()); str_format(pathBuf, sizeof(pathBuf), "%s/records", pStorage->ApplicationSavePath());

View file

@ -16,7 +16,8 @@ enum
{ {
CFGFLAG_SAVE=1, CFGFLAG_SAVE=1,
CFGFLAG_CLIENT=2, CFGFLAG_CLIENT=2,
CFGFLAG_SERVER=4 CFGFLAG_SERVER=4,
CFGFLAG_STORE=8
}; };
#endif #endif

View file

@ -64,7 +64,7 @@ MACRO_CONFIG_INT(SvRegister, sv_register, 1, 0, 1, CFGFLAG_SERVER, "Register ser
MACRO_CONFIG_STR(PlayerName, player_name, 24, "nameless tee", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Name of the player") MACRO_CONFIG_STR(PlayerName, player_name, 24, "nameless tee", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Name of the player")
MACRO_CONFIG_STR(ClanName, clan_name, 32, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "(not used)") MACRO_CONFIG_STR(ClanName, clan_name, 32, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "(not used)")
MACRO_CONFIG_STR(Password, password, 32, "", CFGFLAG_CLIENT|CFGFLAG_SERVER, "Password to the server") MACRO_CONFIG_STR(Password, password, 32, "", CFGFLAG_CLIENT|CFGFLAG_SERVER, "Password to the server")
MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filename to log all output to") MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT|CFGFLAG_SERVER, "Filename to log all output to")
MACRO_CONFIG_INT(ClCpuThrottle, cl_cpu_throttle, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(ClCpuThrottle, cl_cpu_throttle, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "")

View file

@ -1,3 +1,4 @@
#include <new>
#include <base/system.h> #include <base/system.h>
#include <engine/shared/protocol.h> #include <engine/shared/protocol.h>
#include <engine/storage.h> #include <engine/storage.h>
@ -172,11 +173,7 @@ void CConsole::Print(const char *pStr)
void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId) void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId)
{ {
CResult Result; CResult *pResult = new(&m_ExecutionQueue.m_pLast->m_Result) CResult;
char aStrokeStr[2] = {'0', 0};
if(Stroke)
aStrokeStr[0] = '1';
while(pStr && *pStr) while(pStr && *pStr)
{ {
@ -207,31 +204,31 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
pEnd++; pEnd++;
} }
if(ParseStart(&Result, pStr, (pEnd-pStr) + 1) != 0) if(ParseStart(pResult, pStr, (pEnd-pStr) + 1) != 0)
return; return;
CCommand *pCommand = FindCommand(Result.m_pCommand, m_FlagMask); CCommand *pCommand = FindCommand(pResult->m_pCommand, m_FlagMask);
if(pCommand) if(pCommand)
{ {
int IsStrokeCommand = 0; int IsStrokeCommand = 0;
if(Result.m_pCommand[0] == '+') if(pResult->m_pCommand[0] == '+')
{ {
// insert the stroke direction token // insert the stroke direction token
Result.AddArgument(aStrokeStr); pResult->AddArgument(m_paStrokeStr[Stroke]);
IsStrokeCommand = 1; IsStrokeCommand = 1;
} }
if(Stroke || IsStrokeCommand) if(Stroke || IsStrokeCommand)
{ {
if(ParseArgs(&Result, pCommand->m_pParams)) if(ParseArgs(pResult, pCommand->m_pParams))
{ {
char aBuf[256]; char aBuf[256];
str_format(aBuf, sizeof(aBuf), "Invalid arguments... Usage: %s %s", pCommand->m_pName, pCommand->m_pParams); str_format(aBuf, sizeof(aBuf), "Invalid arguments... Usage: %s %s", pCommand->m_pName, pCommand->m_pParams);
Print(aBuf); Print(aBuf);
} }
if (pCommand->m_Level <= ClientLevel) { if (pCommand->m_Level <= ClientLevel) {
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientId); pCommand->m_pfnCallback(pResult, pCommand->m_pUserData, ClientId);
} else { } else {
char aBuf[256]; char aBuf[256];
if (pCommand->m_Level == 100 && ClientLevel < 100) if (pCommand->m_Level == 100 && ClientLevel < 100)
@ -247,7 +244,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
else if(Stroke) else if(Stroke)
{ {
char aBuf[256]; char aBuf[256];
str_format(aBuf, sizeof(aBuf), "No such command: %s.", Result.m_pCommand); str_format(aBuf, sizeof(aBuf), "No such command: %s.", pResult->m_pCommand);
Print(aBuf); Print(aBuf);
} }
@ -400,6 +397,10 @@ static void StrVariableCommand(IConsole::IResult *pResult, void *pUserData, int
CConsole::CConsole(int FlagMask) CConsole::CConsole(int FlagMask)
{ {
m_FlagMask = FlagMask; m_FlagMask = FlagMask;
m_StoreCommands = true;
m_paStrokeStr[0] = "0";
m_paStrokeStr[1] = "1";
m_ExecutionQueue.Reset();
m_pFirstCommand = 0; m_pFirstCommand = 0;
m_pFirstExec = 0; m_pFirstExec = 0;
m_pPrintCallbackUserdata = 0; m_pPrintCallbackUserdata = 0;
@ -493,6 +494,17 @@ void CConsole::Chain(const char *pName, FChainCommandCallback pfnChainFunc, void
pCommand->m_pUserData = pChainInfo; pCommand->m_pUserData = pChainInfo;
} }
void CConsole::StoreCommands(bool Store, int ClientId)
{
if(!Store)
{
for(CExecutionQueue::CQueueEntry *pEntry = m_ExecutionQueue.m_pFirst; pEntry != m_ExecutionQueue.m_pLast; pEntry = pEntry->m_pNext)
pEntry->m_pfnCommandCallback(&pEntry->m_Result, pEntry->m_pCommandUserData, ClientId);
m_ExecutionQueue.Reset();
}
m_StoreCommands = Store;
}
IConsole::CCommandInfo *CConsole::GetCommandInfo(const char *pName, int FlagMask) IConsole::CCommandInfo *CConsole::GetCommandInfo(const char *pName, int FlagMask)
{ {

View file

@ -2,6 +2,7 @@
#define ENGINE_SHARED_CONSOLE_H #define ENGINE_SHARED_CONSOLE_H
#include <engine/console.h> #include <engine/console.h>
#include "memheap.h"
class CConsole : public IConsole class CConsole : public IConsole
{ {
@ -25,6 +26,8 @@ class CConsole : public IConsole
}; };
int m_FlagMask; int m_FlagMask;
bool m_StoreCommands;
const char *m_paStrokeStr[2];
CCommand *m_pFirstCommand; CCommand *m_pFirstCommand;
class CExecFile class CExecFile
@ -75,6 +78,34 @@ class CConsole : public IConsole
int ParseStart(CResult *pResult, const char *pString, int Length); int ParseStart(CResult *pResult, const char *pString, int Length);
int ParseArgs(CResult *pResult, const char *pFormat); int ParseArgs(CResult *pResult, const char *pFormat);
class CExecutionQueue
{
CHeap m_Queue;
public:
struct CQueueEntry
{
CQueueEntry *m_pNext;
FCommandCallback m_pfnCommandCallback;
void *m_pCommandUserData;
CResult m_Result;
} *m_pFirst, *m_pLast;
void AddEntry()
{
CQueueEntry *pEntry = static_cast<CQueueEntry *>(m_Queue.Allocate(sizeof(CQueueEntry)));
pEntry->m_pNext = 0;
m_pLast->m_pNext = pEntry;
m_pLast = pEntry;
}
void Reset()
{
m_Queue.Reset();
m_pFirst = m_pLast = static_cast<CQueueEntry *>(m_Queue.Allocate(sizeof(CQueueEntry)));
m_pLast->m_pNext = 0;
}
} m_ExecutionQueue;
CCommand *FindCommand(const char *pName, int FlagMask); CCommand *FindCommand(const char *pName, int FlagMask);
public: public:
@ -86,6 +117,7 @@ public:
virtual void ParseArguments(int NumArgs, const char **ppArguments); virtual void ParseArguments(int NumArgs, const char **ppArguments);
virtual void Register(const char *pName, const char *pParams, int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp, const int Level); virtual void Register(const char *pName, const char *pParams, int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp, const int Level);
virtual void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser); virtual void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser);
virtual void StoreCommands(bool Store, int ClientId);
virtual void ExecuteLine(const char *pStr, const int ClientLevel, const int ClientId); virtual void ExecuteLine(const char *pStr, const int ClientLevel, const int ClientId);
virtual void ExecuteFile(const char *pFilename); virtual void ExecuteFile(const char *pFilename);

View file

@ -61,6 +61,12 @@ void CEngine::Init(const char *pAppname)
//config_reset(); //config_reset();
} }
void CEngine::InitLogfile()
{
// open logfile if needed
if(g_Config.m_Logfile[0])
dbg_logger_file(g_Config.m_Logfile);
}
static int HostLookupThread(void *pUser) static int HostLookupThread(void *pUser)
{ {

View file

@ -17,6 +17,7 @@ class CEngine
public: public:
void Init(const char *pAppname); void Init(const char *pAppname);
void InitLogfile();
void HostLookup(CHostLookup *pLookup, const char *pHostname); void HostLookup(CHostLookup *pLookup, const char *pHostname);
}; };

View file

@ -45,6 +45,12 @@ public:
virtual bool RegisterInterfaceImpl(const char *pName, IInterface *pInterface) virtual bool RegisterInterfaceImpl(const char *pName, IInterface *pInterface)
{ {
// TODO: More error checks here // TODO: More error checks here
if(!pInterface)
{
dbg_msg("kernel", "ERROR: couldn't register interface %s. null pointer given", pName);
return false;
}
if(m_NumInterfaces == MAX_INTERFACES) if(m_NumInterfaces == MAX_INTERFACES)
{ {
dbg_msg("kernel", "ERROR: couldn't register interface '%s'. maximum of interfaces reached", pName); dbg_msg("kernel", "ERROR: couldn't register interface '%s'. maximum of interfaces reached", pName);
@ -53,7 +59,7 @@ public:
if(FindInterfaceInfo(pName) != 0) if(FindInterfaceInfo(pName) != 0)
{ {
dbg_msg("kernel", "ERROR: couldn't register interface '%s'. interface already exists"); dbg_msg("kernel", "ERROR: couldn't register interface '%s'. interface already exists", pName);
return false; return false;
} }

View file

@ -18,7 +18,7 @@ public:
m_aDatadir[0] = 0; m_aDatadir[0] = 0;
} }
int Init(const char *pApplicationName, const char *pArgv0) int Init(const char *pApplicationName, int NumArgs, const char **ppArguments)
{ {
char aPath[1024] = {0}; char aPath[1024] = {0};
fs_storage_path(pApplicationName, m_aApplicationSavePath, sizeof(m_aApplicationSavePath)); fs_storage_path(pApplicationName, m_aApplicationSavePath, sizeof(m_aApplicationSavePath));
@ -39,8 +39,7 @@ public:
str_format(aPath, sizeof(aPath), "%s/demos", m_aApplicationSavePath); str_format(aPath, sizeof(aPath), "%s/demos", m_aApplicationSavePath);
fs_makedir(aPath); fs_makedir(aPath);
} }
return FindDatadir(ppArguments[0]);
return FindDatadir(pArgv0);
} }
int FindDatadir(const char *pArgv0) int FindDatadir(const char *pArgv0)
@ -184,10 +183,10 @@ public:
return 0; return 0;
} }
static IStorage *Create(const char *pApplicationName, const char *pArgv0) static IStorage *Create(const char *pApplicationName, int NumArgs, const char **ppArguments)
{ {
CStorage *p = new CStorage(); CStorage *p = new CStorage();
if(p->Init(pApplicationName, pArgv0)) if(p && p->Init(pApplicationName, NumArgs, ppArguments))
{ {
delete p; delete p;
p = 0; p = 0;
@ -200,4 +199,4 @@ public:
} }
}; };
IStorage *CreateStorage(const char *pApplicationName, const char *pArgv0) { return CStorage::Create(pApplicationName, pArgv0); } IStorage *CreateStorage(const char *pApplicationName, int NumArgs, const char **ppArguments) { return CStorage::Create(pApplicationName, NumArgs, ppArguments); }

View file

@ -20,7 +20,7 @@ public:
virtual const char* ApplicationSavePath() = 0; virtual const char* ApplicationSavePath() = 0;
}; };
extern IStorage *CreateStorage(const char *pApplicationName, const char *pArgv0); extern IStorage *CreateStorage(const char *pApplicationName, int NumArgs, const char **ppArguments);
#endif #endif

View file

@ -63,6 +63,8 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
{-1, -1, " ", 1, 10.0f, 0, {0}, {0}}, {-1, -1, " ", 1, 10.0f, 0, {0}, {0}},
{COL_PING, IServerBrowser::SORT_PING, "Ping", 1, 40.0f, FIXED, {0}, {0}}, {COL_PING, IServerBrowser::SORT_PING, "Ping", 1, 40.0f, FIXED, {0}, {0}},
}; };
// This is just for scripts/update_localization.py to work correctly (all other strings are already Localize()'d somewhere else). Don't remove!
// Localize("Type");
int NumCols = sizeof(s_aCols)/sizeof(CColumn); int NumCols = sizeof(s_aCols)/sizeof(CColumn);

View file

@ -490,7 +490,7 @@ void CMenus::RenderDemoList(CUIRect MainView)
{ {
const char *pError = Client()->DemoPlayer_Play(m_lDemos[s_SelectedItem].m_aFilename); const char *pError = Client()->DemoPlayer_Play(m_lDemos[s_SelectedItem].m_aFilename);
if(pError) if(pError)
PopupMessage(Localize("Error"), Localize(pError), Localize("Ok")); PopupMessage(Localize("Error"), str_comp(pError, "error loading demo") ? pError : Localize("error loading demo"), Localize("Ok"));
} }
} }
} }

View file

@ -139,7 +139,10 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView)
Button.VSplitLeft(100.0f, 0, &Button); Button.VSplitLeft(100.0f, 0, &Button);
str_format(aBuf, sizeof(aBuf), "%s", g_Config.m_PlayerSkin); str_format(aBuf, sizeof(aBuf), "%s", g_Config.m_PlayerSkin);
UI()->DoLabel(&Button, aBuf, 14.0, -1); CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, Button.x, Button.y, 14.0f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
Cursor.m_LineWidth = SkinRect.w-(Button.x-SkinRect.x)-5.0f;
TextRender()->TextEx(&Cursor, aBuf, -1);
} }
RightView.HSplitTop(20.0f, &Button, &RightView); RightView.HSplitTop(20.0f, &Button, &RightView);
@ -285,7 +288,6 @@ typedef struct
static CKeyInfo gs_aKeys[] = static CKeyInfo gs_aKeys[] =
{ {
// we need to do localize so the scripts can pickup the string
{ "Move left", "+left", 0}, // Localize - these strings are localized within CLocConstString { "Move left", "+left", 0}, // Localize - these strings are localized within CLocConstString
{ "Move right", "+right", 0 }, { "Move right", "+right", 0 },
{ "Jump", "+jump", 0 }, { "Jump", "+jump", 0 },
@ -309,6 +311,12 @@ static CKeyInfo gs_aKeys[] =
{ "Screenshot", "screenshot", 0 }, { "Screenshot", "screenshot", 0 },
{ "Scoreboard", "+scoreboard", 0 }, { "Scoreboard", "+scoreboard", 0 },
}; };
/* This is for scripts/update_localization.py to work, don't remove!
Localize("Move left");Localize("Move right");Localize("Jump");Localize("Fire");Localize("Hook");Localize("Hammer");
Localize("Pistol");Localize("Shotgun");Localize("Grenade");Localize("Rifle");Localize("Next weapon");Localize("Prev. weapon");
Localize("Vote yes");Localize("Vote no");Localize("Chat");Localize("Team chat");Localize("Show chat");Localize("Emoticon");
Localize("Console");Localize("Remote console");Localize("Screenshot");Localize("Scoreboard");
*/
const int g_KeyCount = sizeof(gs_aKeys) / sizeof(CKeyInfo); const int g_KeyCount = sizeof(gs_aKeys) / sizeof(CKeyInfo);
@ -625,15 +633,16 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
} }
} }
struct LANGUAGE class CLanguage
{ {
LANGUAGE() {} public:
LANGUAGE(const char *n, const char *f) : m_Name(n), m_FileName(f) {} CLanguage() {}
CLanguage(const char *n, const char *f) : m_Name(n), m_FileName(f) {}
string m_Name; string m_Name;
string m_FileName; string m_FileName;
bool operator<(const LANGUAGE &Other) { return m_Name < Other.m_Name; } bool operator<(const CLanguage &Other) { return m_Name < Other.m_Name; }
}; };
@ -644,7 +653,7 @@ void GatherLanguages(const char *pName, int IsDir, void *pUser)
if(IsDir || pName[0] == '.') if(IsDir || pName[0] == '.')
return; return;
sorted_array<LANGUAGE> &Languages = *((sorted_array<LANGUAGE> *)pUser); sorted_array<CLanguage> &Languages = *((sorted_array<CLanguage> *)pUser);
char aFileName[128]; char aFileName[128];
str_format(aFileName, sizeof(aFileName), "data/languages/%s", pName); str_format(aFileName, sizeof(aFileName), "data/languages/%s", pName);
@ -657,19 +666,19 @@ void GatherLanguages(const char *pName, int IsDir, void *pUser)
if(*p == '.') if(*p == '.')
*p = 0; *p = 0;
Languages.add(LANGUAGE(NiceName, aFileName)); Languages.add(CLanguage(NiceName, aFileName));
} }
void CMenus::RenderSettingsGeneral(CUIRect MainView) void CMenus::RenderSettingsGeneral(CUIRect MainView)
{ {
static int s_LanguageList = 0; static int s_LanguageList = 0;
static int s_SelectedLanguage = 0; static int s_SelectedLanguage = 0;
static sorted_array<LANGUAGE> s_Languages; static sorted_array<CLanguage> s_Languages;
static float s_ScrollValue = 0; static float s_ScrollValue = 0;
if(s_Languages.size() == 0) if(s_Languages.size() == 0)
{ {
s_Languages.add(LANGUAGE("English", "")); s_Languages.add(CLanguage("English", ""));
fs_listdir("data/languages", GatherLanguages, &s_Languages); fs_listdir("data/languages", GatherLanguages, &s_Languages);
for(int i = 0; i < s_Languages.size(); i++) for(int i = 0; i < s_Languages.size(); i++)
if(str_comp(s_Languages[i].m_FileName, g_Config.m_ClLanguagefile) == 0) if(str_comp(s_Languages[i].m_FileName, g_Config.m_ClLanguagefile) == 0)
@ -684,7 +693,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
CUIRect List = MainView; CUIRect List = MainView;
UiDoListboxStart(&s_LanguageList , &List, 24.0f, Localize("Language"), "", s_Languages.size(), 1, s_SelectedLanguage, s_ScrollValue); UiDoListboxStart(&s_LanguageList , &List, 24.0f, Localize("Language"), "", s_Languages.size(), 1, s_SelectedLanguage, s_ScrollValue);
for(sorted_array<LANGUAGE>::range r = s_Languages.all(); !r.empty(); r.pop_front()) for(sorted_array<CLanguage>::range r = s_Languages.all(); !r.empty(); r.pop_front())
{ {
CListboxItem Item = UiDoListboxNextItem(&r.front()); CListboxItem Item = UiDoListboxNextItem(&r.front());

View file

@ -99,11 +99,6 @@ static int gs_LoadTotal;
} }
}*/ }*/
static void ConServerDummy(IConsole::IResult *pResult, void *pUserData)
{
dbg_msg("client", "this command is not available on the client");
}
#include <base/tl/sorted_array.h> #include <base/tl/sorted_array.h>
const char *CGameClient::Version() { return GAME_VERSION; } const char *CGameClient::Version() { return GAME_VERSION; }
@ -187,16 +182,16 @@ void CGameClient::OnConsoleInit()
Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself"); Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself");
// register server dummy commands for tab completion // register server dummy commands for tab completion
Console()->Register("tune", "si", CFGFLAG_SERVER, ConServerDummy, 0, "Tune variable to value"); Console()->Register("tune", "si", CFGFLAG_SERVER, 0, 0, "Tune variable to value");
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConServerDummy, 0, "Reset tuning"); Console()->Register("tune_reset", "", CFGFLAG_SERVER, 0, 0, "Reset tuning");
Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConServerDummy, 0, "Dump tuning"); Console()->Register("tune_dump", "", CFGFLAG_SERVER, 0, 0, "Dump tuning");
Console()->Register("change_map", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Change map"); Console()->Register("change_map", "r", CFGFLAG_SERVER, 0, 0, "Change map");
Console()->Register("restart", "?i", CFGFLAG_SERVER, ConServerDummy, 0, "Restart in x seconds"); Console()->Register("restart", "?i", CFGFLAG_SERVER, 0, 0, "Restart in x seconds");
Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Broadcast message"); Console()->Register("broadcast", "r", CFGFLAG_SERVER, 0, 0, "Broadcast message");
//MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_serverdummy, 0); Console()->Register("say", "r", CFGFLAG_SERVER, 0, 0, "Say in chat");
Console()->Register("set_team", "ii", CFGFLAG_SERVER, ConServerDummy, 0, "Set team of player to team"); Console()->Register("set_team", "ii", CFGFLAG_SERVER, 0, 0, "Set team of player to team");
Console()->Register("addvote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Add a voting option"); Console()->Register("addvote", "r", CFGFLAG_SERVER, 0, 0, "Add a voting option");
//MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0); Console()->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Force a vote to yes/no");
// propagate pointers // propagate pointers

View file

@ -292,8 +292,8 @@ void CRenderTools::MapscreenToWorld(float CenterX, float CenterY, float Parallax
Height *= Zoom; Height *= Zoom;
pPoints[0] = OffsetX+CenterX-Width/2; pPoints[0] = OffsetX+CenterX-Width/2;
pPoints[1] = OffsetY+CenterY-Height/2; pPoints[1] = OffsetY+CenterY-Height/2;
pPoints[2] = OffsetX+CenterX+Width/2; pPoints[2] = pPoints[0]+Width;
pPoints[3] = OffsetY+CenterY+Height/2; pPoints[3] = pPoints[1]+Height;
} }
void CRenderTools::RenderTilemapGenerateSkip(class CLayers *pLayers) void CRenderTools::RenderTilemapGenerateSkip(class CLayers *pLayers)

View file

@ -241,8 +241,8 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
int ty = Index/16; int ty = Index/16;
int Px0 = tx*(1024/16); int Px0 = tx*(1024/16);
int Py0 = ty*(1024/16); int Py0 = ty*(1024/16);
int Px1 = (tx+1)*(1024/16)-1; int Px1 = Px0+(1024/16)-1;
int Py1 = (ty+1)*(1024/16)-1; int Py1 = Py0+(1024/16)-1;
float u0 = Nudge + Px0/TexSize+Frac; float u0 = Nudge + Px0/TexSize+Frac;
float v0 = Nudge + Py0/TexSize+Frac; float v0 = Nudge + Py0/TexSize+Frac;

View file

@ -626,7 +626,7 @@ void CEditor::DoToolbar(CUIRect ToolBar)
// animation button // animation button
TB_Top.VSplitLeft(40.0f, &Button, &TB_Top); TB_Top.VSplitLeft(40.0f, &Button, &TB_Top);
static int s_AnimateButton = 0; static int s_AnimateButton = 0;
if(DoButton_Editor(&s_AnimateButton, Localize("Anim"), m_Animate, &Button, 0, ("[ctrl+m] Toggle animation")) || if(DoButton_Editor(&s_AnimateButton, Localize("Anim"), m_Animate, &Button, 0, Localize("[ctrl+m] Toggle animation")) ||
(Input()->KeyDown('m') && (Input()->KeyPressed(KEY_LCTRL) || Input()->KeyPressed(KEY_RCTRL)))) (Input()->KeyDown('m') && (Input()->KeyPressed(KEY_LCTRL) || Input()->KeyPressed(KEY_RCTRL))))
{ {
m_AnimateStart = time_get(); m_AnimateStart = time_get();
@ -1718,12 +1718,12 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
{ {
LayersBox.HSplitTop(12.0f, &Slot, &LayersBox); LayersBox.HSplitTop(12.0f, &Slot, &LayersBox);
Slot.VSplitLeft(12, &VisibleToggle, &Slot); Slot.VSplitLeft(12, &VisibleToggle, &Slot);
if(DoButton_Ex(&m_Map.m_lGroups[g]->m_Visible, m_Map.m_lGroups[g]->m_Visible?"V":"H", 0, &VisibleToggle, 0, "Toggle group visibility", CUI::CORNER_L)) if(DoButton_Ex(&m_Map.m_lGroups[g]->m_Visible, m_Map.m_lGroups[g]->m_Visible?"V":"H", 0, &VisibleToggle, 0, Localize("Toggle group visibility"), CUI::CORNER_L))
m_Map.m_lGroups[g]->m_Visible = !m_Map.m_lGroups[g]->m_Visible; m_Map.m_lGroups[g]->m_Visible = !m_Map.m_lGroups[g]->m_Visible;
str_format(aBuf, sizeof(aBuf),"#%d %s", g, m_Map.m_lGroups[g]->m_pName); str_format(aBuf, sizeof(aBuf),"#%d %s", g, m_Map.m_lGroups[g]->m_pName);
if(int Result = DoButton_Ex(&m_Map.m_lGroups[g], aBuf, g==m_SelectedGroup, &Slot, if(int Result = DoButton_Ex(&m_Map.m_lGroups[g], aBuf, g==m_SelectedGroup, &Slot,
BUTTON_CONTEXT, "Select group. Right click for properties.", CUI::CORNER_R)) BUTTON_CONTEXT, Localize("Select group. Right click for properties."), CUI::CORNER_R))
{ {
m_SelectedGroup = g; m_SelectedGroup = g;
m_SelectedLayer = 0; m_SelectedLayer = 0;
@ -2286,31 +2286,18 @@ void CEditor::RenderStatusbar(CUIRect View)
void CEditor::RenderEnvelopeEditor(CUIRect View) void CEditor::RenderEnvelopeEditor(CUIRect View)
{ {
if(m_SelectedEnvelope < 0) m_SelectedEnvelope = 0; if(m_SelectedEnvelope < 0) m_SelectedEnvelope = 0;
if(m_SelectedEnvelope >= m_Map.m_lEnvelopes.size()) m_SelectedEnvelope--; if(m_SelectedEnvelope >= m_Map.m_lEnvelopes.size()) m_SelectedEnvelope = m_Map.m_lEnvelopes.size()-1;
CEnvelope *pEnvelope = 0; CEnvelope *pEnvelope = 0;
if(m_SelectedEnvelope >= 0 && m_SelectedEnvelope < m_Map.m_lEnvelopes.size()) if(m_SelectedEnvelope >= 0 && m_SelectedEnvelope < m_Map.m_lEnvelopes.size())
pEnvelope = m_Map.m_lEnvelopes[m_SelectedEnvelope]; pEnvelope = m_Map.m_lEnvelopes[m_SelectedEnvelope];
bool ShowColorBar = false;
if(pEnvelope && pEnvelope->m_Channels == 4)
ShowColorBar = true;
CUIRect ToolBar, CurveBar, ColorBar; CUIRect ToolBar, CurveBar, ColorBar;
View.HSplitTop(15.0f, &ToolBar, &View); View.HSplitTop(15.0f, &ToolBar, &View);
View.HSplitTop(15.0f, &CurveBar, &View); View.HSplitTop(15.0f, &CurveBar, &View);
ToolBar.Margin(2.0f, &ToolBar); ToolBar.Margin(2.0f, &ToolBar);
CurveBar.Margin(2.0f, &CurveBar); CurveBar.Margin(2.0f, &CurveBar);
if(ShowColorBar)
{
View.HSplitTop(20.0f, &ColorBar, &View);
ColorBar.Margin(2.0f, &ColorBar);
RenderBackground(ColorBar, ms_CheckerTexture, 16.0f, 1.0f);
}
RenderBackground(View, ms_CheckerTexture, 32.0f, 0.1f);
// do the toolbar // do the toolbar
{ {
CUIRect Button; CUIRect Button;
@ -2327,6 +2314,21 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
if(DoButton_Editor(&s_New2dButton, Localize("Pos.+"), 0, &Button, 0, Localize("Creates a new pos envelope"))) if(DoButton_Editor(&s_New2dButton, Localize("Pos.+"), 0, &Button, 0, Localize("Creates a new pos envelope")))
pNewEnv = m_Map.NewEnvelope(3); pNewEnv = m_Map.NewEnvelope(3);
// Delete button
if(m_SelectedEnvelope >= 0)
{
ToolBar.VSplitRight(10.0f, &ToolBar, &Button);
ToolBar.VSplitRight(50.0f, &ToolBar, &Button);
static int s_DelButton = 0;
if(DoButton_Editor(&s_DelButton, Localize("Delete"), 0, &Button, 0, Localize("Delete this envelope")))
{
m_Map.DeleteEnvelope(m_SelectedEnvelope);
if(m_SelectedEnvelope >= m_Map.m_lEnvelopes.size())
m_SelectedEnvelope = m_Map.m_lEnvelopes.size()-1;
pEnvelope = m_SelectedEnvelope >= 0 ? m_Map.m_lEnvelopes[m_SelectedEnvelope] : 0;
}
}
if(pNewEnv) // add the default points if(pNewEnv) // add the default points
{ {
if(pNewEnv->m_Channels == 4) if(pNewEnv->m_Channels == 4)
@ -2371,6 +2373,17 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
} }
} }
bool ShowColorBar = false;
if(pEnvelope && pEnvelope->m_Channels == 4)
{
ShowColorBar = true;
View.HSplitTop(20.0f, &ColorBar, &View);
ColorBar.Margin(2.0f, &ColorBar);
RenderBackground(ColorBar, ms_CheckerTexture, 16.0f, 1.0f);
}
RenderBackground(View, ms_CheckerTexture, 32.0f, 0.1f);
if(pEnvelope) if(pEnvelope)
{ {
static array<int> Selection; static array<int> Selection;
@ -2692,7 +2705,7 @@ int CEditor::PopupMenuFile(CEditor *pEditor, CUIRect View)
if(pEditor->m_aFileName[0]) if(pEditor->m_aFileName[0])
CallbackSaveMap(pEditor->m_aFileName, pEditor); CallbackSaveMap(pEditor->m_aFileName, pEditor);
else else
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, Localize("Save Map"), Localize("Save"), "maps/", "", CallbackSaveMap, pEditor); pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, Localize("Save map"), Localize("Save"), "maps/", "", CallbackSaveMap, pEditor);
return 1; return 1;
} }
@ -2700,7 +2713,7 @@ int CEditor::PopupMenuFile(CEditor *pEditor, CUIRect View)
View.HSplitTop(12.0f, &Slot, &View); View.HSplitTop(12.0f, &Slot, &View);
if(pEditor->DoButton_MenuItem(&s_SaveAsButton, Localize("Save As"), 0, &Slot, 0, Localize("Saves the current map under a new name"))) if(pEditor->DoButton_MenuItem(&s_SaveAsButton, Localize("Save As"), 0, &Slot, 0, Localize("Saves the current map under a new name")))
{ {
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, Localize("Save Map"), Localize("Save"), "maps/", "", CallbackSaveMap, pEditor); pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, Localize("Save map"), Localize("Save"), "maps/", "", CallbackSaveMap, pEditor);
return 1; return 1;
} }
@ -2900,6 +2913,33 @@ void CEditor::Reset(bool CreateDefault)
m_MouseDeltaWy = 0; m_MouseDeltaWy = 0;
} }
void CEditorMap::DeleteEnvelope(int Index)
{
if(Index < 0 || Index >= m_lEnvelopes.size())
return;
// fix links between envelopes and quads
for(int i = 0; i < m_lGroups.size(); ++i)
for(int j = 0; j < m_lGroups[i]->m_lLayers.size(); ++j)
if(m_lGroups[i]->m_lLayers[j]->m_Type == LAYERTYPE_QUADS)
{
CLayerQuads *Layer = static_cast<CLayerQuads *>(m_lGroups[i]->m_lLayers[j]);
for(int k = 0; k < Layer->m_lQuads.size(); ++k)
{
if(Layer->m_lQuads[k].m_PosEnv == Index)
Layer->m_lQuads[k].m_PosEnv = -1;
else if(Layer->m_lQuads[k].m_PosEnv > Index)
Layer->m_lQuads[k].m_PosEnv--;
if(Layer->m_lQuads[k].m_ColorEnv == Index)
Layer->m_lQuads[k].m_ColorEnv = -1;
else if(Layer->m_lQuads[k].m_ColorEnv > Index)
Layer->m_lQuads[k].m_ColorEnv--;
}
}
m_lEnvelopes.remove_index(Index);
}
void CEditorMap::MakeGameLayer(CLayer *pLayer) void CEditorMap::MakeGameLayer(CLayer *pLayer)
{ {
m_pGameLayer = (CLayerGame *)pLayer; m_pGameLayer = (CLayerGame *)pLayer;

View file

@ -273,6 +273,8 @@ public:
return e; return e;
} }
void DeleteEnvelope(int Index);
CLayerGroup *NewGroup() CLayerGroup *NewGroup()
{ {
CLayerGroup *g = new CLayerGroup; CLayerGroup *g = new CLayerGroup;

View file

@ -1,5 +1,6 @@
#include <engine/graphics.h> #include <engine/graphics.h>
#include <engine/storage.h> #include <engine/storage.h>
#include <game/gamecore.h>
#include "ed_editor.h" #include "ed_editor.h"
template<typename T> template<typename T>
@ -323,7 +324,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
Item.m_Channels = m_lEnvelopes[e]->m_Channels; Item.m_Channels = m_lEnvelopes[e]->m_Channels;
Item.m_StartPoint = PointCount; Item.m_StartPoint = PointCount;
Item.m_NumPoints = m_lEnvelopes[e]->m_lPoints.size(); Item.m_NumPoints = m_lEnvelopes[e]->m_lPoints.size();
Item.m_Name = -1; StrToInts(Item.m_aName, sizeof(Item.m_aName)/sizeof(int), m_lEnvelopes[e]->m_aName);
df.AddItem(MAPITEMTYPE_ENVELOPE, e, sizeof(Item), &Item); df.AddItem(MAPITEMTYPE_ENVELOPE, e, sizeof(Item), &Item);
PointCount += Item.m_NumPoints; PointCount += Item.m_NumPoints;
@ -552,6 +553,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName)
CEnvelope *pEnv = new CEnvelope(pItem->m_Channels); CEnvelope *pEnv = new CEnvelope(pItem->m_Channels);
pEnv->m_lPoints.set_size(pItem->m_NumPoints); pEnv->m_lPoints.set_size(pItem->m_NumPoints);
mem_copy(pEnv->m_lPoints.base_ptr(), &pPoints[pItem->m_StartPoint], sizeof(CEnvPoint)*pItem->m_NumPoints); mem_copy(pEnv->m_lPoints.base_ptr(), &pPoints[pItem->m_StartPoint], sizeof(CEnvPoint)*pItem->m_NumPoints);
if(pItem->m_aName[0] != -1) // compatibility with old maps
IntsToStr(pItem->m_aName, sizeof(pItem->m_aName)/sizeof(int), pEnv->m_aName);
m_lEnvelopes.add(pEnv); m_lEnvelopes.add(pEnv);
} }
} }

View file

@ -292,8 +292,8 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
}; };
CProperty aProps[] = { CProperty aProps[] = {
{Localize("Width"), m_Width, PROPTYPE_INT_STEP, 1, 1000000000}, {Localize("Width"), m_Width, PROPTYPE_INT_SCROLL, 1, 1000000000},
{Localize("Height"), m_Height, PROPTYPE_INT_STEP, 1, 1000000000}, {Localize("Height"), m_Height, PROPTYPE_INT_SCROLL, 1, 1000000000},
{Localize("Image"), m_Image, PROPTYPE_IMAGE, 0, 0}, {Localize("Image"), m_Image, PROPTYPE_IMAGE, 0, 0},
{0}, {0},
}; };

View file

@ -242,7 +242,7 @@ struct CMapItemEnvelope
int m_Channels; int m_Channels;
int m_StartPoint; int m_StartPoint;
int m_NumPoints; int m_NumPoints;
int m_Name; int m_aName[8];
} ; } ;
#endif #endif

View file

@ -1006,7 +1006,7 @@ void CCharacter::Snap(int SnappingClient)
CNetObj_Character *Character = static_cast<CNetObj_Character *>(Server()->SnapNewItem(NETOBJTYPE_CHARACTER, m_pPlayer->GetCID(), sizeof(CNetObj_Character))); CNetObj_Character *Character = static_cast<CNetObj_Character *>(Server()->SnapNewItem(NETOBJTYPE_CHARACTER, m_pPlayer->GetCID(), sizeof(CNetObj_Character)));
// write down the m_Core // write down the m_Core
if(GameServer()->m_World.m_Paused) if(!m_ReckoningTick || GameServer()->m_World.m_Paused)
{ {
// no dead reckoning when paused because the client doesn't know // no dead reckoning when paused because the client doesn't know
// how far to perform the reckoning // how far to perform the reckoning

View file

@ -756,6 +756,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
int64 Now = Server()->Tick(); int64 Now = Server()->Tick();
p->m_Last_VoteTry = Now; p->m_Last_VoteTry = Now;
if(p->GetTeam() == -1)
{
SendChatTarget(ClientId, "Spectators aren't allowed to start a vote.");
return;
}
if(m_VoteCloseTime) if(m_VoteCloseTime)
{ {
SendChatTarget(ClientId, "Wait for current vote to end before calling a new one."); SendChatTarget(ClientId, "Wait for current vote to end before calling a new one.");

View file

@ -5,14 +5,14 @@
int main(int argc, const char **argv) int main(int argc, const char **argv)
{ {
IStorage *pStorage = CreateStorage("Teeworlds", argv[0]); IStorage *pStorage = CreateStorage("Teeworlds", argc, argv);
int Index, Id = 0, Type = 0, Size; int Index, Id = 0, Type = 0, Size;
void *pPtr; void *pPtr;
char aFileName[1024]; char aFileName[1024];
CDataFileReader DataFile; CDataFileReader DataFile;
CDataFileWriter df; CDataFileWriter df;
if(argc != 3) if(!pStorage || argc != 3)
return -1; return -1;
str_format(aFileName, sizeof(aFileName), "maps/%s", argv[2]); str_format(aFileName, sizeof(aFileName), "maps/%s", argv[2]);