|
From: Yura S. <yu...@us...> - 2006-06-18 13:10:12
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6689/source/util Modified Files: random.cpp pmask.h pmask.c net_tcp.cpp base.cpp aautil.c aastr.h aarot.c Log Message: Fixed linux compilation issues. Code is compiling on amd64 now. Index: aastr.h =================================================================== RCS file: /cvsroot/timewarp/source/util/aastr.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aastr.h 24 Mar 2004 23:51:45 -0000 1.7 --- aastr.h 18 Jun 2006 13:10:01 -0000 1.8 *************** *** 202,214 **** // Rotation. void aa_rotate_scaled_bitmap (BITMAP* src, BITMAP* dst, ! int x, int y, long angle, ! long scalex, long scaley); void aa_rotate_scaled_sprite (BITMAP* dst, BITMAP* src, ! int x, int y, long angle, ! long scalex, long scaley); void aa_rotate_bitmap (BITMAP* src, BITMAP* dst, ! int x, int y, long angle); void aa_rotate_sprite (BITMAP* dst, BITMAP* src, ! int x, int y, long angle); --- 202,214 ---- // Rotation. void aa_rotate_scaled_bitmap (BITMAP* src, BITMAP* dst, ! int x, int y, fixed angle, ! fixed scalex, fixed scaley); void aa_rotate_scaled_sprite (BITMAP* dst, BITMAP* src, ! int x, int y, fixed angle, ! fixed scalex, fixed scaley); void aa_rotate_bitmap (BITMAP* src, BITMAP* dst, ! int x, int y, fixed angle); void aa_rotate_sprite (BITMAP* dst, BITMAP* src, ! int x, int y, fixed angle); Index: net_tcp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/net_tcp.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** net_tcp.cpp 1 Aug 2005 10:46:35 -0000 1.14 --- net_tcp.cpp 18 Jun 2006 13:10:01 -0000 1.15 *************** *** 208,212 **** # if defined NETWORK_WEIRD_SIGNEDNESS //WTF!?! ! size_t tmp; //some linuxes (but not the version superdave uses (slackware of some //kind)) require this, even though some linux documentation contradicts --- 208,212 ---- # if defined NETWORK_WEIRD_SIGNEDNESS //WTF!?! ! socklen_t tmp; //some linuxes (but not the version superdave uses (slackware of some //kind)) require this, even though some linux documentation contradicts Index: random.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/random.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** random.cpp 15 Mar 2006 13:02:12 -0000 1.11 --- random.cpp 18 Jun 2006 13:10:01 -0000 1.12 *************** *** 298,302 **** } ! int k = int( tw_random_unsigned() % unsigned int(a) ); if (k < 0 || k >= a) --- 298,303 ---- } ! // int k = int( tw_random_unsigned() % unsigned int(a) ); ! int k = int( tw_random_unsigned() % int(a) ); if (k < 0 || k >= a) Index: pmask.c =================================================================== RCS file: /cvsroot/timewarp/source/util/pmask.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pmask.c 27 Sep 2005 22:03:56 -0000 1.10 --- pmask.c 18 Jun 2006 13:10:01 -0000 1.11 *************** *** 61,65 **** #define COMPILE_TIME_ASSERT(condition) typedef char _compile_time_assert__[(condition) ? 1 : -1]; void install_pmask() { ! COMPILE_TIME_ASSERT((1 << MASK_WORD_BITBITS) == MASK_WORD_BITS); return; } --- 61,65 ---- #define COMPILE_TIME_ASSERT(condition) typedef char _compile_time_assert__[(condition) ? 1 : -1]; void install_pmask() { ! COMPILE_TIME_ASSERT((1 << MASK_WORD_BITBITS) == MASK_WORD_BITS); return; } Index: base.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/base.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** base.cpp 11 Jul 2005 00:26:07 -0000 1.8 --- base.cpp 18 Jun 2006 13:10:01 -0000 1.9 *************** *** 9,13 **** COMPILE_TIME_ASSERT(sizeof(short)==2); COMPILE_TIME_ASSERT(sizeof(int)==4); ! COMPILE_TIME_ASSERT(sizeof(long)==4); __call_before_main::__call_before_main ( void (*func)() ) { --- 9,13 ---- COMPILE_TIME_ASSERT(sizeof(short)==2); COMPILE_TIME_ASSERT(sizeof(int)==4); ! //COMPILE_TIME_ASSERT(sizeof(long)==4); __call_before_main::__call_before_main ( void (*func)() ) { Index: aarot.c =================================================================== RCS file: /cvsroot/timewarp/source/util/aarot.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** aarot.c 24 Mar 2004 23:51:45 -0000 1.5 --- aarot.c 18 Jun 2006 13:10:01 -0000 1.6 *************** *** 30,35 **** */ void ! _aa_rotate_bitmap (BITMAP *_src, BITMAP *_dst, int _x, int _y, fixed _angle, ! fixed _scalex, fixed _scaley, int _mode) { int sw, sh, dw, dh; --- 30,35 ---- */ void ! _aa_rotate_bitmap (BITMAP *_src, BITMAP *_dst, int _x, int _y, long _angle, ! long _scalex, long _scaley, int _mode) { int sw, sh, dw, dh; Index: pmask.h =================================================================== RCS file: /cvsroot/timewarp/source/util/pmask.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pmask.h 15 Sep 2005 09:03:09 -0000 1.6 --- pmask.h 18 Jun 2006 13:10:01 -0000 1.7 *************** *** 51,55 **** --- 51,60 ---- //don't worry about setting it incorrectly //you'll get a compile error if you do, not a run-time error + + #if ULONG_MAX == 0xFFFFFFFFUL #define MASK_WORD_BITBITS 5 + #else + #define MASK_WORD_BITBITS 6 + #endif Index: aautil.c =================================================================== RCS file: /cvsroot/timewarp/source/util/aautil.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aautil.c 26 Mar 2004 17:55:49 -0000 1.7 --- aautil.c 18 Jun 2006 13:10:01 -0000 1.8 *************** *** 1,3 **** - /* $Id$ */ /* modified by orz for Star Control: TimeWarp Lots of features added, large code re-organization, etc. --- 1,2 ---- *************** *** 19,22 **** --- 18,24 ---- */ + #include <stdio.h> + #include <stdlib.h> + #include "types.h" #include "aautil.h" *************** *** 53,57 **** */ ! #define bit(a) (1 << a) #define bitn(a) (bit(a)-1) --- 55,59 ---- */ ! #define bit(a) (1 << (a)) #define bitn(a) (bit(a)-1) *************** *** 94,100 **** #define BLENDER32_WITH_A(bpp,bpp2) {int c2;c=makecol24(r,g,b);c2=bmp_read##bpp(_addr+_x*((bpp+7)/8));c=_blender_func_24(makecol24(getr##bpp2(c2),getg##bpp2(c2),getb##bpp2(c2)), c, (_aa.trans * _aa.trans) >> 8);r=getr24(c);g=getg24(c);b=getb32(c); //these macros output the color to the screen #define PUT(bpp,bpp2) bmp_write##bpp(_addr+_x*((bpp+7)/8), c); ! #define PUT_8X(bpp,bpp2) outportw(0x3C4, (0x100<<(_x&3))|2); bmp_write8(_addr + (_x>>2), c); #define PUT_N(bpp,bpp2) putpixel(_aa.destination, _x, _aa.y, c); //parameters ignored for 8X & N --- 96,103 ---- #define BLENDER32_WITH_A(bpp,bpp2) {int c2;c=makecol24(r,g,b);c2=bmp_read##bpp(_addr+_x*((bpp+7)/8));c=_blender_func_24(makecol24(getr##bpp2(c2),getg##bpp2(c2),getb##bpp2(c2)), c, (_aa.trans * _aa.trans) >> 8);r=getr24(c);g=getg24(c);b=getb32(c); + //these macros output the color to the screen #define PUT(bpp,bpp2) bmp_write##bpp(_addr+_x*((bpp+7)/8), c); ! //#define PUT_8X(bpp,bpp2) outportw(0x3C4, (0x100<<(_x&3))|2); bmp_write8(_addr + (_x>>2), c); #define PUT_N(bpp,bpp2) putpixel(_aa.destination, _x, _aa.y, c); //parameters ignored for 8X & N *************** *** 185,201 **** //no alpha-dither-notrans ! #ifdef GFX_MODEX ! //macro name bpp/2 ALPHA DITHER NOTRANS PUT ! MAKE_PUTFUNC( _aa_put_modex_8 ,8,8, NONE, NO_DITHER, NONE, PUT_8X) ! MAKE_PUTFUNC( _aa_put_modex_dither_8 ,8,8, NONE, DITHER, NONE, PUT_8X) ! MAKE_PUTFUNC( _aa_put_modex_alpha_8 ,8,8, ALPHA, NO_DITHER, NONE, PUT_8X) ! MAKE_PUTFUNC( _aa_put_modex_alpha_dither_8 ,8,8, ALPHA, DITHER, NONE, PUT_8X) ! PUT_TYPE *put_array_modex[4] = { ! _aa_put_modex_8, ! _aa_put_modex_dither_8, ! _aa_put_modex_alpha_8, ! _aa_put_modex_alpha_dither_8 ! }; ! #endif #ifdef ALLEGRO_COLOR16 --- 188,192 ---- //no alpha-dither-notrans ! #ifdef ALLEGRO_COLOR16 *************** *** 366,369 **** --- 357,361 ---- if (options & AA_MASKED_DEST) j += 4; + #if 0 # ifdef GFX_MODEX if (is_planar_bitmap(destination)) { *************** *** 372,375 **** --- 364,368 ---- } # endif + #endif if (options & AA_RAW_ALPHA) { |