You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/timewarp/gamedata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4788/gamedata Modified Files: SecretPlanet.lua TestQuest.lua Removed Files: human.bmp pkunk-standing.bmp spathi.bmp SPATHI.MOD ur-quan.bmp UR-QUAN.MOD Log Message: Added jpg support, Communication with target ship (GOB), removed old configure files Index: SecretPlanet.lua =================================================================== RCS file: /cvsroot/timewarp/gamedata/SecretPlanet.lua,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SecretPlanet.lua 29 Feb 2004 23:22:18 -0000 1.2 --- SecretPlanet.lua 1 Mar 2004 23:21:47 -0000 1.3 *************** *** 27,31 **** function FirstDialog() ! DialogStart "gamedata/human.bmp" DialogWrite "We have intercepted hyperwave radio transmissions using old Hierarchy frequencies..." DialogKeyPressed(); --- 27,32 ---- function FirstDialog() ! DialogStart "gamedata/dialogs/human.jpg" ! DialogSetMusic "gamedata/dialogs/human.mod" DialogWrite "We have intercepted hyperwave radio transmissions using old Hierarchy frequencies..." DialogKeyPressed(); *************** *** 51,56 **** if matter_investigated == 0 then -- Big Fun dialog ! DialogStart "gamedata/spathi.bmp"; ! DialogSetMusic "gamedata/spathi.mod"; function Question1() -- STARTCONVERSATION DialogWrite "What are you doing here? This planet is strictly off limits to -- I mean -- Hi, how would like to avoid killing me today?"; --- 52,57 ---- if matter_investigated == 0 then -- Big Fun dialog ! DialogStart "gamedata/dialogs/spathi.jpg"; ! DialogSetMusic "gamedata/dialogs/spathi.mod"; function Question1() -- STARTCONVERSATION DialogWrite "What are you doing here? This planet is strictly off limits to -- I mean -- Hi, how would like to avoid killing me today?"; *************** *** 207,211 **** function Question13() -- LEING2 DialogWrite "I can't take it anymore! I can't stand lieing to you, hunam!"; ! DialogSetMusic "gamedata/ur-quan.mod"; DialogKeyPressed(); DialogWrite "We've been taken captive by the Ur-Quan!"; --- 208,212 ---- function Question13() -- LEING2 DialogWrite "I can't take it anymore! I can't stand lieing to you, hunam!"; ! DialogSetMusic "gamedata/dialogs/urquan.mod"; DialogKeyPressed(); DialogWrite "We've been taken captive by the Ur-Quan!"; *************** *** 215,219 **** DialogWrite "Oh no! .... are jamming ... can't ..."; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/ur-quan.bmp" DialogWrite "This transmission cannot be allowed."; DialogKeyPressed(); --- 216,220 ---- DialogWrite "Oh no! .... are jamming ... can't ..."; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/dialogs/urquan.jpg" DialogWrite "This transmission cannot be allowed."; DialogKeyPressed(); *************** *** 255,264 **** DialogWrite "then we would not have this conflict."; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/spathi.bmp"; DialogWrite "I'm swtiching to another frequency, can you hear me hunam?"; DialogKeyPressed(); DialogWrite "Please don't let me die! Tomorrow would be much better!"; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/ur-quan.bmp"; DialogWrite "Be silent, Spathi."; DialogKeyPressed(); --- 256,265 ---- DialogWrite "then we would not have this conflict."; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/dialogs/spathi.jpg"; DialogWrite "I'm swtiching to another frequency, can you hear me hunam?"; DialogKeyPressed(); DialogWrite "Please don't let me die! Tomorrow would be much better!"; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/dialogs/urquan.jpg"; DialogWrite "Be silent, Spathi."; DialogKeyPressed(); *************** *** 279,288 **** DialogWrite "on which to train a vast army." DialogKeyPressed(); ! DialogSetAlienImage "gamedata/spathi.bmp"; DialogWrite "Nooo! Fwinda!" DialogKeyPressed(); DialogWrite "I'll probably lose my pr0n collection too!"; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/ur-quan.bmp"; DialogAnswer ("Hey creepy-looking slimey thing, um, the evil one of the two: you forgot that the Spathi are wimps!"); DialogWrite "While this is true,"; --- 280,289 ---- DialogWrite "on which to train a vast army." DialogKeyPressed(); ! DialogSetAlienImage "gamedata/dialogs/spathi.jpg"; DialogWrite "Nooo! Fwinda!" DialogKeyPressed(); DialogWrite "I'll probably lose my pr0n collection too!"; DialogKeyPressed(); ! DialogSetAlienImage "gamedata/dialogs/urquan.jpg"; DialogAnswer ("Hey creepy-looking slimey thing, um, the evil one of the two: you forgot that the Spathi are wimps!"); DialogWrite "While this is true,"; *************** *** 363,368 **** if Complited == 0 then -- Ur-quan boasting ! DialogStart "gamedata/ur-quan.bmp" ! DialogSetMusic "gamedata/ur-quan.mod"; DialogWrite ("We will destroy you our ships already on they way!!!"); DialogAnswer ("Ha"); --- 364,369 ---- if Complited == 0 then -- Ur-quan boasting ! DialogStart "gamedata/dialogs/urquan.jpg" ! DialogSetMusic "gamedata/dialogs/urquan.mod"; DialogWrite ("We will destroy you our ships already on they way!!!"); DialogAnswer ("Ha"); *************** *** 371,376 **** if Complited == 1 and Exist == 1 then -- Dialog about capturing kohr-ah factory ! DialogStart "gamedata/spathi.bmp" ! DialogSetMusic "gamedata/spathi.mod"; DialogWrite ("Savior!!! We have Ur-quan ship factory here and now we leave it to you. It can produce Kohr-Ah Marauders!!!"); DialogKeyPressed(); --- 372,377 ---- if Complited == 1 and Exist == 1 then -- Dialog about capturing kohr-ah factory ! DialogStart "gamedata/dialogs/spathi.jpg" ! DialogSetMusic "gamedata/dialogs/spathi.mod"; DialogWrite ("Savior!!! We have Ur-quan ship factory here and now we leave it to you. It can produce Kohr-Ah Marauders!!!"); DialogKeyPressed(); Index: TestQuest.lua =================================================================== RCS file: /cvsroot/timewarp/gamedata/TestQuest.lua,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestQuest.lua 28 Feb 2004 01:05:50 -0000 1.7 --- TestQuest.lua 1 Mar 2004 23:21:48 -0000 1.8 *************** *** 19,23 **** function Reward() ! DialogStart "gamedata/pkunk-standing.bmp" DialogWrite "Congratulations, those bastards are all dead now! Take 20 bucks" answer = DialogAnswer ( "Thanks!" ) --- 19,23 ---- function Reward() ! DialogStart "gamedata/dialogs/pkunk.jpg" DialogWrite "Congratulations, those bastards are all dead now! Take 20 bucks" answer = DialogAnswer ( "Thanks!" ) *************** *** 28,32 **** function HurryLazyPlayer() ! DialogStart "gamedata/pkunk-standing.bmp" DialogWrite "Hurry, they are criminals!" answer = DialogAnswer ( "I am off!!!" ) --- 28,32 ---- function HurryLazyPlayer() ! DialogStart "gamedata/dialogs/pkunk.jpg" DialogWrite "Hurry, they are criminals!" answer = DialogAnswer ( "I am off!!!" ) *************** *** 35,39 **** ! DialogStart "gamedata/pkunk-standing.bmp" function question1() DialogWrite "Hello, my spiritual child. Kill Shofixti Scout for me." --- 35,39 ---- ! DialogStart "gamedata/dialogs/pkunk.jpg" function question1() DialogWrite "Hello, my spiritual child. Kill Shofixti Scout for me." --- human.bmp DELETED --- --- pkunk-standing.bmp DELETED --- --- spathi.bmp DELETED --- --- SPATHI.MOD DELETED --- --- ur-quan.bmp DELETED --- --- UR-QUAN.MOD DELETED --- |
Update of /cvsroot/timewarp/source/jpgalleg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4788/source/jpgalleg Added Files: decode.c encode.c fix8bit.patch internal.h io.c jpgalleg.c jpgalleg.h readme.txt Log Message: Added jpg support, Communication with target ship (GOB), removed old configure files --- NEW FILE: decode.c --- /* * __ _____ ______ ______ ___ ___ * /\ \ /\ _ `\ /\ ___\ /\ _ \ /\_ \ /\_ \ * \ \ \\ \ \L\ \\ \ \__/ \ \ \L\ \\//\ \ \//\ \ __ __ * __ \ \ \\ \ __| \ \ \ __\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\ * /\ \_\/ / \ \ \/ \ \ \L\ \\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ * \ \____// \ \_\ \ \____/ \ \_\ \_\/\____\/\____\ \____\ \____ \ * \/____/ \/_/ \/___/ \/_/\/_/\/____/\/____/\/____/\/___L\ \ * /\____/ * \_/__/ * * Version 2.2, by Angelo Mottola, 2000-2003. * * Decoder core module. * * See the readme.txt file for instructions on using this package in your * own programs. */ [...1190 lines suppressed...] depth = _color_load_depth(32, FALSE); if (depth != 32) bmp = _fixup_loaded_bitmap(bmp, want_palette ? pal : NULL, depth); exit_ok: for (i = 0; i < jpeg_components; i++) { if (data_buffer[i]) free(data_buffer[i]); } for (i = 0; i < 4; i++) { free_huffman_table(&huffman_dc_table[i]); free_huffman_table(&huffman_ac_table[i]); } return bmp; exit_error: destroy_bitmap(bmp); bmp = NULL; goto exit_ok; } --- NEW FILE: encode.c --- /* * __ _____ ______ ______ ___ ___ * /\ \ /\ _ `\ /\ ___\ /\ _ \ /\_ \ /\_ \ * \ \ \\ \ \L\ \\ \ \__/ \ \ \L\ \\//\ \ \//\ \ __ __ * __ \ \ \\ \ __| \ \ \ __\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\ * /\ \_\/ / \ \ \/ \ \ \L\ \\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ * \ \____// \ \_\ \ \____/ \ \_\ \_\/\____\/\____\ \____\ \____ \ * \/____/ \/_/ \/___/ \/_/\/_/\/____/\/____/\/____/\/___L\ \ * /\____/ * \_/__/ * * Version 2.2, by Angelo Mottola, 2000-2003. * * Encoder core module. * * See the readme.txt file for instructions on using this package in your * own programs. */ #include "internal.h" /* Standard quantization tables for luminance and chrominance. Scaled version * of these are used by the encoder for a given quality. * These tables come from the IJG code, which takes them from the JPeg specs, * and are generic quantization tables that give good results on most images. */ static const unsigned char default_luminance_quant_table[64] = { 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99 }; static const unsigned char default_chrominance_quant_table[64] = { 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 }; /* Standard huffman tables for luminance AC/DC and chrominance AC/DC. * These come from the IJG code, which takes them from the JPeg standard. */ static const unsigned char num_codes_dc_luminance[17] = { 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; static const unsigned char val_dc_luminance[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; static const unsigned char num_codes_dc_chrominance[17] = { 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; static const unsigned char val_dc_chrominance[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; static const unsigned char num_codes_ac_luminance[17] = { 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; static const unsigned char val_ac_luminance[] = { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }; static const unsigned char num_codes_ac_chrominance[17] = { 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; static const unsigned char val_ac_chrominance[] = { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }; static HUFFMAN_TABLE huffman_ac_table[2]; static HUFFMAN_TABLE huffman_dc_table[2]; static int luminance_quant_table[64]; static int chrominance_quant_table[64]; static void (*rgb2ycbcr)(int address, short *y1, short *cb1, short *cr1, short *y2, short *cb2, short *cr2); /* apply_fdct: * Applies the forward discrete cosine transform to the given input block, * in the form of a vector of 64 coefficients. * This uses integer fixed point math and is based on code by the IJG. */ static void apply_fdct(short *data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1, z2, z3, z4, z5; short *dataptr = data; int i; for (i = 8; i; i--) { tmp0 = dataptr[0] + dataptr[7]; tmp7 = dataptr[0] - dataptr[7]; tmp1 = dataptr[1] + dataptr[6]; tmp6 = dataptr[1] - dataptr[6]; tmp2 = dataptr[2] + dataptr[5]; tmp5 = dataptr[2] - dataptr[5]; tmp3 = dataptr[3] + dataptr[4]; tmp4 = dataptr[3] - dataptr[4]; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; dataptr[0] = (tmp10 + tmp11) << 2; dataptr[4] = (tmp10 - tmp11) << 2; z1 = (tmp12 + tmp13) * FIX_0_541196100; dataptr[2] = (z1 + (tmp13 * FIX_0_765366865)) >> 11; dataptr[6] = (z1 + (tmp12 * -FIX_1_847759065)) >> 11; z1 = tmp4 + tmp7; z2 = tmp5 + tmp6; z3 = tmp4 + tmp6; z4 = tmp5 + tmp7; z5 = (z3 + z4) * FIX_1_175875602; tmp4 *= FIX_0_298631336; tmp5 *= FIX_2_053119869; tmp6 *= FIX_3_072711026; tmp7 *= FIX_1_501321110; z1 *= -FIX_0_899976223; z2 *= -FIX_2_562915447; z3 *= -FIX_1_961570560; z4 *= -FIX_0_390180644; z3 += z5; z4 += z5; dataptr[7] = (tmp4 + z1 + z3) >> 11; dataptr[5] = (tmp5 + z2 + z4) >> 11; dataptr[3] = (tmp6 + z2 + z3) >> 11; dataptr[1] = (tmp7 + z1 + z4) >> 11; dataptr += 8; } dataptr = data; for (i = 8; i; i--) { tmp0 = dataptr[0] + dataptr[56]; tmp7 = dataptr[0] - dataptr[56]; tmp1 = dataptr[8] + dataptr[48]; tmp6 = dataptr[8] - dataptr[48]; tmp2 = dataptr[16] + dataptr[40]; tmp5 = dataptr[16] - dataptr[40]; tmp3 = dataptr[24] + dataptr[32]; tmp4 = dataptr[24] - dataptr[32]; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; dataptr[0] = (tmp10 + tmp11) >> 2; dataptr[32] = (tmp10 - tmp11) >> 2; z1 = (tmp12 + tmp13) * FIX_0_541196100; dataptr[16] = (z1 + (tmp13 * FIX_0_765366865)) >> 15; dataptr[48] = (z1 + (tmp12 * -FIX_1_847759065)) >> 15; z1 = tmp4 + tmp7; z2 = tmp5 + tmp6; z3 = tmp4 + tmp6; z4 = tmp5 + tmp7; z5 = (z3 + z4) * FIX_1_175875602; tmp4 *= FIX_0_298631336; tmp5 *= FIX_2_053119869; tmp6 *= FIX_3_072711026; tmp7 *= FIX_1_501321110; z1 *= -FIX_0_899976223; z2 *= -FIX_2_562915447; z3 *= -FIX_1_961570560; z4 *= -FIX_0_390180644; z3 += z5; z4 += z5; dataptr[56] = (tmp4 + z1 + z3) >> 15; dataptr[40] = (tmp5 + z2 + z4) >> 15; dataptr[24] = (tmp6 + z2 + z3) >> 15; dataptr[8] = (tmp7 + z1 + z4) >> 15; dataptr++; } } /* zigzag_reorder: * Reorders a vector of coefficients by the zigzag scan. */ static void zigzag_reorder(short *input, short *output) { int i; for (i = 0; i < 64; i++) output[_jpeg_zigzag_scan[i]] = input[i]; } /* write_quantization_table: * Computes a quantization table given a quality value and writes it to the * output stream. */ static void write_quantization_table(int *quant_table, const unsigned char *data, int quality) { short temp[64], temp_table[64]; double value; int i; for (i = 0; i < 64; i++) { if (quality == 100) value = 1.0; else { value = (double)data[i]; value /= QUALITY_FACTOR(quality); } temp[i] = MID(1, (int)floor(value), 255); } zigzag_reorder(temp, temp_table); for (i = 0; i < 64; i++) { _jpeg_chunk_putc(temp_table[i]); quant_table[i] = (1 << 16) / (int)temp_table[i]; } } /* write_huffman_table: * Writes an huffman table to the output stream and computes a lookup table * for faster huffman encoding. */ static void write_huffman_table(HUFFMAN_TABLE *table, unsigned const char *num_codes, unsigned const char *value) { HUFFMAN_ENTRY *entry; int i, j, code, index; for (i = 1; i <= 16; i++) _jpeg_chunk_putc(num_codes[i]); memset(table, 0, sizeof(HUFFMAN_TABLE)); index = code = 0; entry = table->entry; for (i = 1; i <= 16; i++) { for (j = 0; j < num_codes[i]; j++) { entry->value = value[index]; entry->encoded_value = code; entry->bits_length = i; _jpeg_chunk_putc(value[index]); table->code[entry->value] = entry; entry++; code++; index++; } code <<= 1; } } /* write_header: * Writes the complete header of a baseline JPG image to the output stream. * This is made of the following chunks (in order): APP0, COM, DQT, SOF0, * DHT, SOS. */ static int write_header(int sampling, int greyscale, int quality, int width, int height) { char *comment = "Created by JPGalleg"; unsigned int i; int sampling_byte = 0x11; _jpeg_putw(CHUNK_SOI); /* APP0 chunk */ _jpeg_new_chunk(CHUNK_APP0); _jpeg_chunk_putc('J'); _jpeg_chunk_putc('F'); _jpeg_chunk_putc('I'); _jpeg_chunk_putc('F'); _jpeg_chunk_putc(0); _jpeg_chunk_putw(0x0101); /* JFIF version 1.1 */ _jpeg_chunk_putc(0); /* No units, 1:1 aspect ratio */ _jpeg_chunk_putw(1); _jpeg_chunk_putw(1); _jpeg_chunk_putw(0); /* No thumbnail */ _jpeg_write_chunk(); /* COM chunk ;) */ _jpeg_new_chunk(CHUNK_COM); for (i = 0; i < strlen(comment); i++) _jpeg_chunk_putc(comment[i]); _jpeg_write_chunk(); /* DQT chunk */ _jpeg_new_chunk(CHUNK_DQT); _jpeg_chunk_putc(0); write_quantization_table(luminance_quant_table, default_luminance_quant_table, quality); if (!greyscale) { _jpeg_chunk_putc(1); write_quantization_table(chrominance_quant_table, default_chrominance_quant_table, quality); } _jpeg_write_chunk(); /* SOF0 chunk */ switch (sampling) { case JPG_SAMPLING_411: sampling_byte = 0x22; break; case JPG_SAMPLING_422: sampling_byte = 0x21; break; case JPG_SAMPLING_444: sampling_byte = 0x11; break; } _jpeg_new_chunk(CHUNK_SOF0); _jpeg_chunk_putc(8); _jpeg_chunk_putw(height); _jpeg_chunk_putw(width); _jpeg_chunk_putc(greyscale ? 1 : 3); _jpeg_chunk_putc(1); /* Y component id */ _jpeg_chunk_putc(greyscale ? 0x11 : sampling_byte);/* Luminance sampling factor */ _jpeg_chunk_putc(0); /* Quantization table number for Y */ if (!greyscale) { _jpeg_chunk_putc(2); /* Cb component id */ _jpeg_chunk_putc(0x11); /* Chrominance always has a sampling factor of 1:1 */ _jpeg_chunk_putc(1); /* Quantization table number for CbCr */ _jpeg_chunk_putc(3); /* Cr component id */ _jpeg_chunk_putc(0x11); _jpeg_chunk_putc(1); } _jpeg_write_chunk(); /* DHT chunk */ _jpeg_new_chunk(CHUNK_DHT); _jpeg_chunk_putc(0x00); /* DC huffman table 0 (used for luminance) */ write_huffman_table(&huffman_dc_table[0], num_codes_dc_luminance, val_dc_luminance); _jpeg_chunk_putc(0x10); /* AC huffman table 0 (used for luminance) */ write_huffman_table(&huffman_ac_table[0], num_codes_ac_luminance, val_ac_luminance); if (!greyscale) { _jpeg_chunk_putc(0x01); /* DC huffman table 1 (used for chrominance) */ write_huffman_table(&huffman_dc_table[1], num_codes_dc_chrominance, val_dc_chrominance); _jpeg_chunk_putc(0x11); /* AC huffman table 1 (used for chrominance) */ write_huffman_table(&huffman_ac_table[1], num_codes_ac_chrominance, val_ac_chrominance); } _jpeg_write_chunk(); /* SOS chunk */ _jpeg_new_chunk(CHUNK_SOS); _jpeg_chunk_putc(greyscale ? 1 : 3); _jpeg_chunk_putc(1); _jpeg_chunk_putc(0x00); /* Y uses DC table 0 and AC table 0 */ if (!greyscale) { _jpeg_chunk_putc(2); _jpeg_chunk_putc(0x11); /* Cb uses DC table 1 and AC table 1 */ _jpeg_chunk_putc(3); _jpeg_chunk_putc(0x11); /* Cr uses DC table 1 and AC table 1 */ } _jpeg_chunk_putc(0); /* Cover whole spectrum (0-63) since we're saving a baseline JPG */ _jpeg_chunk_putc(63); _jpeg_chunk_putc(0); /* Successive approximation not needed for baseline JPG */ _jpeg_write_chunk(); return 0; } /* format_number: * Computes the category and bits of a given number. */ static void format_number(int num, int *category, int *bits) { int abs_num, mask, cat; mask = num >> 31; abs_num = (num ^ mask) - mask; for (cat = 0; abs_num; cat++) abs_num >>= 1; *category = cat; if (num >= 0) *bits = num; else *bits = num + ((1 << cat) - 1); } /* put_bits: * Writes some bits to the output stream. */ static int put_bits(int value, int num_bits) { int i; for (i = num_bits - 1; i >= 0; i--) { if (_jpeg_put_bit((value >> i) & 0x1)) return -1; } return 0; } /* huffman_encode: * Writes the huffman code of a given value. */ static int huffman_encode(HUFFMAN_TABLE *table, int value) { HUFFMAN_ENTRY *entry; entry = table->code[value]; if (entry) return put_bits(entry->encoded_value, entry->bits_length); jpgalleg_error = JPG_ERROR_HUFFMAN; return -1; } /* encode_block: * Encodes an 8x8 basic block of coefficients of given type (luminance or * chrominance) and writes it to the output stream. */ static int encode_block(short *block, int type, int *old_dc) { HUFFMAN_TABLE *dc_table, *ac_table; int *quant_table; short data[64]; int i, index; int value, num_zeroes; int category, bits; if (type == LUMINANCE) { dc_table = &huffman_dc_table[0]; ac_table = &huffman_ac_table[0]; quant_table = luminance_quant_table; } else { dc_table = &huffman_dc_table[1]; ac_table = &huffman_ac_table[1]; quant_table = chrominance_quant_table; } apply_fdct(block); for (i = 0; i < 64; i++) { value = block[i]; if (value < 0) { value = -value; value = (value * quant_table[i]) + (quant_table[i] >> 1); block[i] = -(value >> 19); } else block[i] = ((value * quant_table[i]) + (quant_table[i] >> 1)) >> 19; } zigzag_reorder(block, data); value = data[0] - *old_dc; *old_dc = data[0]; format_number(value, &category, &bits); if (huffman_encode(dc_table, category)) return -1; if (put_bits(bits, category)) return -1; num_zeroes = 0; for (index = 1; index < 64; index++) { if ((value = data[index]) == 0) num_zeroes++; else { while (num_zeroes > 15) { if (huffman_encode(ac_table, 0xf0)) return -1; num_zeroes -= 16; } format_number(value, &category, &bits); value = (num_zeroes << 4) | category; if (huffman_encode(ac_table, value)) return -1; if (put_bits(bits, category)) return -1; num_zeroes = 0; } } if (num_zeroes > 0) { if (huffman_encode(ac_table, 0x00)) return -1; } return 0; } /* _jpeg_c_rgb2ycbcr: * C version of the RGB -> YCbCr color conversion routine. Converts 2 pixels * at a time. */ static void _jpeg_c_rgb2ycbcr(int addr, short *y1, short *cb1, short *cr1, short *y2, short *cb2, short *cr2) { int r, g, b; unsigned int *ptr = (unsigned int *)addr; r = getr32(ptr[0]); g = getg32(ptr[0]); b = getb32(ptr[0]); *y1 = (((r * 76) + (g * 151) + (b * 29)) >> 8) - 128; *cb1 = (((r * -43) + (g * -85) + (b * 128)) >> 8); *cr1 = (((r * 128) + (g * -107) + (b * -21)) >> 8); r = getr32(ptr[1]); g = getg32(ptr[1]); b = getb32(ptr[1]); *y2 = (((r * 76) + (g * 151) + (b * 29)) >> 8) - 128; *cb2 = (((r * -43) + (g * -85) + (b * 128)) >> 8); *cr2 = (((r * 128) + (g * -107) + (b * -21)) >> 8); } /* _jpeg_encode: * Main encoding function. */ int _jpeg_encode(BITMAP *bmp, AL_CONST RGB *pal, int quality, int flags) { short y1[64], y2[64], y3[64], y4[64], cb[64], cr[64]; short *y1_ptr, *y2_ptr, *y3_ptr, *y4_ptr, *cb_ptr, *cr_ptr; short cb1_sample, cr1_sample, cb2_sample, cr2_sample, cb_total, cr_total, dummy; int dc_y, dc_cb, dc_cr; int sampling, greyscale; int block_x, block_y, x, y, i; int addr, pitch; int error = 0; BITMAP *fixed_bmp; jpgalleg_error = JPG_ERROR_NONE; #ifdef JPGALLEG_MMX if (cpu_capabilities & CPU_MMX) { if (_rgb_r_shift_32 == 0) rgb2ycbcr = _jpeg_mmx_rgb2ycbcr; else if (_rgb_r_shift_32 == 16) rgb2ycbcr = _jpeg_mmx_bgr2ycbcr; else rgb2ycbcr = _jpeg_c_rgb2ycbcr; } else #endif rgb2ycbcr = _jpeg_c_rgb2ycbcr; quality = MID(1, quality, 100); sampling = flags & 0xf; if ((sampling != JPG_SAMPLING_411) && (sampling != JPG_SAMPLING_422) && (sampling != JPG_SAMPLING_444)) return -1; greyscale = flags & JPG_GREYSCALE; fixed_bmp = create_bitmap_ex(32, (bmp->w + 15) & ~0xf, (bmp->h + 15) & ~0xf); if (!fixed_bmp) return -1; if (pal) select_palette(pal); blit(bmp, fixed_bmp, 0, 0, 0, 0, bmp->w, bmp->h); if (pal) unselect_palette(); for (i = bmp->w; i < fixed_bmp->w; i++) blit(fixed_bmp, fixed_bmp, bmp->w - 1, 0, i, 0, 1, bmp->h); for (i = bmp->h; i < fixed_bmp->h; i++) blit(fixed_bmp, fixed_bmp, 0, bmp->h - 1, 0, i, fixed_bmp->w, 1); pitch = (int)(fixed_bmp->line[1] - fixed_bmp->line[0]); if (write_header(sampling, greyscale, quality, bmp->w, bmp->h)) { destroy_bitmap(fixed_bmp); return -1; } dc_y = dc_cb = dc_cr = 0; if (!greyscale) { switch (sampling) { case JPG_SAMPLING_411: for (block_y = 0; block_y < bmp->h; block_y += 16) { for (block_x = 0; block_x < bmp->w; block_x += 16) { addr = (int)fixed_bmp->line[block_y] + (block_x * 4); y1_ptr = y1; y2_ptr = y2; y3_ptr = y3; y4_ptr = y4; cb_ptr = cb; cr_ptr = cr; for (y = 0; y < 8; y += 2) { for (x = 0; x < 8; x += 2) { rgb2ycbcr(addr, y1_ptr, &cb_total, &cr_total, y1_ptr + 1, &cb1_sample, &cr1_sample); cb_total += cb1_sample; cr_total += cr1_sample; rgb2ycbcr(addr + pitch, y1_ptr + 8, &cb1_sample, &cr1_sample, y1_ptr + 9, &cb2_sample, &cr2_sample); *cb_ptr = (cb_total + cb1_sample + cb2_sample) / 4; *cr_ptr = (cr_total + cr1_sample + cr2_sample) / 4; rgb2ycbcr(addr + 32, y2_ptr, &cb_total, &cr_total, y2_ptr + 1, &cb1_sample, &cr1_sample); cb_total += cb1_sample; cr_total += cr1_sample; rgb2ycbcr(addr + 32 + pitch, y2_ptr + 8, &cb1_sample, &cr1_sample, y2_ptr + 9, &cb2_sample, &cr2_sample); *(cb_ptr + 4) = (cb_total + cb1_sample + cb2_sample) / 4; *(cr_ptr + 4) = (cr_total + cr1_sample + cr2_sample) / 4; rgb2ycbcr(addr + (pitch * 8), y3_ptr, &cb_total, &cr_total, y3_ptr + 1, &cb1_sample, &cr1_sample); cb_total += cb1_sample; cr_total += cr1_sample; rgb2ycbcr(addr + (pitch * 9), y3_ptr + 8, &cb1_sample, &cr1_sample, y3_ptr + 9, &cb2_sample, &cr2_sample); *(cb_ptr + 32) = (cb_total + cb1_sample + cb2_sample) / 4; *(cr_ptr + 32) = (cr_total + cr1_sample + cr2_sample) / 4; rgb2ycbcr(addr + 32 + (pitch * 8), y4_ptr, &cb_total, &cr_total, y4_ptr + 1, &cb1_sample, &cr1_sample); cb_total += cb1_sample; cr_total += cr1_sample; rgb2ycbcr(addr + 32 + (pitch * 9), y4_ptr + 8, &cb1_sample, &cr1_sample, y4_ptr + 9, &cb2_sample, &cr2_sample); *(cb_ptr + 36) = (cb_total + cb1_sample + cb2_sample) / 4; *(cr_ptr + 36) = (cr_total + cr1_sample + cr2_sample) / 4; addr += 8; y1_ptr += 2; y2_ptr += 2; y3_ptr += 2; y4_ptr += 2; cb_ptr++; cr_ptr++; } addr += (pitch - 32) + pitch; y1_ptr += 8; y2_ptr += 8; y3_ptr += 8; y4_ptr += 8; cb_ptr += 4; cr_ptr += 4; } error |= encode_block(y1, LUMINANCE, &dc_y); error |= encode_block(y2, LUMINANCE, &dc_y); error |= encode_block(y3, LUMINANCE, &dc_y); error |= encode_block(y4, LUMINANCE, &dc_y); error |= encode_block(cb, CHROMINANCE, &dc_cb); error |= encode_block(cr, CHROMINANCE, &dc_cr); if (error) goto exit_error; } } break; case JPG_SAMPLING_422: for (block_y = 0; block_y < bmp->h; block_y += 8) { for (block_x = 0; block_x < bmp->w; block_x += 16) { addr = (int)fixed_bmp->line[block_y] + (block_x * 4); y1_ptr = y1; y2_ptr = y2; cb_ptr = cb; cr_ptr = cr; for (y = 0; y < 8; y++) { for (x = 0; x < 8; x += 2) { rgb2ycbcr(addr, y1_ptr, cb_ptr, cr_ptr, y1_ptr + 1, &cb1_sample, &cr1_sample); *cb_ptr = (*cb_ptr + cb1_sample) / 2; *cr_ptr = (*cr_ptr + cr1_sample) / 2; rgb2ycbcr(addr + 32, y2_ptr, cb_ptr + 4, cr_ptr + 4, y2_ptr + 1, &cb1_sample, &cr1_sample); *(cb_ptr + 4) = (*(cb_ptr + 4) + cb1_sample) / 2; *(cr_ptr + 4) = (*(cr_ptr + 4) + cr1_sample) / 2; addr += 8; y1_ptr += 2; y2_ptr += 2; cb_ptr++; cr_ptr++; } addr += (pitch - 32); cb_ptr += 4; cr_ptr += 4; } error |= encode_block(y1, LUMINANCE, &dc_y); error |= encode_block(y2, LUMINANCE, &dc_y); error |= encode_block(cb, CHROMINANCE, &dc_cb); error |= encode_block(cr, CHROMINANCE, &dc_cr); if (error) goto exit_error; } } break; case JPG_SAMPLING_444: for (block_y = 0; block_y < bmp->h; block_y += 8) { for (block_x = 0; block_x < bmp->w; block_x += 8) { addr = (int)fixed_bmp->line[block_y] + (block_x * 4); y1_ptr = y1; cb_ptr = cb; cr_ptr = cr; for (y = 0; y < 8; y++) { for (x = 0; x < 8; x += 2) { rgb2ycbcr(addr, y1_ptr, cb_ptr, cr_ptr, y1_ptr + 1, cb_ptr + 1, cr_ptr + 1); addr += 8; y1_ptr += 2; cb_ptr += 2; cr_ptr += 2; } addr += (pitch - 32); } error |= encode_block(y1, LUMINANCE, &dc_y); error |= encode_block(cb, CHROMINANCE, &dc_cb); error |= encode_block(cr, CHROMINANCE, &dc_cr); if (error) goto exit_error; } } break; } } else { for (block_y = 0; block_y < bmp->h; block_y += 8) { for (block_x = 0; block_x < bmp->w; block_x += 8) { addr = (int)fixed_bmp->line[block_y] + (block_x * 4); y1_ptr = y1; for (y = 0; y < 8; y++) { for (x = 0; x < 8; x += 2) { rgb2ycbcr(addr, y1_ptr, &dummy, &dummy, y1_ptr + 1, &dummy, &dummy); addr += 8; y1_ptr += 2; } addr += (pitch - 32); } if (encode_block(y1, LUMINANCE, &dc_y)) goto exit_error; } } } _jpeg_flush_bits(); _jpeg_putw(CHUNK_EOI); destroy_bitmap(fixed_bmp); return 0; exit_error: destroy_bitmap(fixed_bmp); return -1; } --- NEW FILE: fix8bit.patch --- diff -u -r I:/jpgalleg-2.2/decode.c ./decode.c --- I:/jpgalleg-2.2/decode.c Sat Jul 5 16:22:56 2003 +++ ./decode.c Wed Jan 7 18:01:08 2004 @@ -18,7 +18,7 @@ */ -#include <internal.h> +#include "internal.h" static HUFFMAN_TABLE huffman_ac_table[4]; @@ -179,7 +179,7 @@ /* zigzag_reorder: * Reorders a vector of 64 coefficients by the zigzag scan. */ -static INLINE void +static void zigzag_reorder(short *input, short *output) { int i; @@ -434,7 +434,7 @@ /* get_bits: * Reads a value from the input stream, given its category. */ -static INLINE int +static int get_bits(int category) { int i, bit, result = 0; @@ -455,7 +455,7 @@ * Fetches bits from the input stream until a valid huffman code is found, * then returns the value associated with that code. */ -static INLINE int +static int huffman_decode(HUFFMAN_TABLE *table) { HUFFMAN_ENTRY *entry; @@ -857,7 +857,14 @@ int data, flags = 0; int restart_count; int depth; + PALETTE tmppal; + int want_palette = 1; + if (!pal) { + want_palette = 0; + pal = tmppal; + } + jpgalleg_error = JPG_ERROR_NONE; #ifdef JPGALLEG_MMX @@ -1198,11 +1205,11 @@ blit(bmp, temp, 0, 0, 0, 0, jpeg_w, jpeg_h); destroy_bitmap(bmp); bmp = temp; - + generate_332_palette(pal); depth = _color_load_depth(32, FALSE); if (depth != 32) - bmp = _fixup_loaded_bitmap(bmp, pal, depth); + bmp = _fixup_loaded_bitmap(bmp, want_palette ? pal : NULL, depth); exit_ok: for (i = 0; i < jpeg_components; i++) { diff -u -r I:/jpgalleg-2.2/encode.c ./encode.c --- I:/jpgalleg-2.2/encode.c Sat Jul 5 16:22:56 2003 +++ ./encode.c Wed Jan 7 18:01:15 2004 @@ -18,7 +18,7 @@ */ -#include <internal.h> +#include "internal.h" /* Standard quantization tables for luminance and chrominance. Scaled version @@ -236,7 +236,7 @@ /* zigzag_reorder: * Reorders a vector of coefficients by the zigzag scan. */ -static INLINE void +static void zigzag_reorder(short *input, short *output) { int i; @@ -410,7 +410,7 @@ /* format_number: * Computes the category and bits of a given number. */ -static INLINE void +static void format_number(int num, int *category, int *bits) { int abs_num, mask, cat; @@ -431,7 +431,7 @@ /* put_bits: * Writes some bits to the output stream. */ -static INLINE int +static int put_bits(int value, int num_bits) { int i; @@ -447,7 +447,7 @@ /* huffman_encode: * Writes the huffman code of a given value. */ -static INLINE int +static int huffman_encode(HUFFMAN_TABLE *table, int value) { HUFFMAN_ENTRY *entry; diff -u -r I:/jpgalleg-2.2/internal.h ./internal.h --- I:/jpgalleg-2.2/internal.h Sat Jul 5 16:22:56 2003 +++ ./internal.h Wed Jan 7 18:01:21 2004 @@ -27,8 +27,7 @@ #include <stdlib.h> #include <string.h> #include <math.h> -#include <jpgalleg.h> -#include <mmx.h> +#include "jpgalleg.h" #define FIX_0_298631336 2446 @@ -143,12 +142,12 @@ extern void _jpeg_init_file_io(PACKFILE *); extern void _jpeg_init_memory_io(void *buffer, int size); extern int _jpeg_memory_size(); -extern INLINE int _jpeg_getc(); -extern INLINE int _jpeg_putc(int); -extern INLINE int _jpeg_putw(int); -extern INLINE int _jpeg_getw(); -extern INLINE int _jpeg_get_bit(); -extern INLINE int _jpeg_put_bit(int); +extern int _jpeg_getc(); +extern int _jpeg_putc(int); +extern int _jpeg_putw(int); +extern int _jpeg_getw(); +extern int _jpeg_get_bit(); +extern int _jpeg_put_bit(int); extern void _jpeg_flush_bits(); extern void _jpeg_open_chunk(); extern void _jpeg_close_chunk(); diff -u -r I:/jpgalleg-2.2/io.c ./io.c --- I:/jpgalleg-2.2/io.c Sat Jul 5 16:22:56 2003 +++ ./io.c Wed Jan 7 18:01:33 2004 @@ -18,7 +18,7 @@ */ -#include <internal.h> +#include "internal.h" static PACKFILE *f = NULL; @@ -138,7 +138,7 @@ /* _jpeg_getc: * Reads a byte from the input stream. */ -INLINE int +int _jpeg_getc() { bytes_read++; @@ -150,7 +150,7 @@ /* _jpeg_putc: * Writes a byte to the output stream. */ -INLINE int +int _jpeg_putc(int c) { return putc_func(c); @@ -160,7 +160,7 @@ /* _jpeg_getw: * Reads a word from the input stream. */ -INLINE int +int _jpeg_getw() { return (_jpeg_getc() << 8) | _jpeg_getc(); @@ -170,7 +170,7 @@ /* _jpeg_putw: * Writes a word to the output stream. */ -INLINE int +int _jpeg_putw(int w) { int result; @@ -184,7 +184,7 @@ /* _jpeg_get_bit: * Reads a bit from the input stream. */ -INLINE int +int _jpeg_get_bit() { current_bit--; @@ -206,7 +206,7 @@ /* _jpeg_put_bit: * Writes a bit to the output stream. */ -INLINE int +int _jpeg_put_bit(int bit) { current_byte |= (bit << current_bit); diff -u -r I:/jpgalleg-2.2/jpgalleg.c ./jpgalleg.c --- I:/jpgalleg-2.2/jpgalleg.c Sat Jul 5 16:22:56 2003 +++ ./jpgalleg.c Wed Jan 7 17:08:39 2004 @@ -19,7 +19,7 @@ */ -#include <internal.h> +#include "internal.h" const unsigned char _jpeg_zigzag_scan[64] = { @@ -91,10 +91,6 @@ { PACKFILE *f; BITMAP *bmp; - PALETTE pal; - - if (!palette) - palette = pal; f = pack_fopen(filename, F_READ); if (!f) @@ -115,10 +111,6 @@ load_memory_jpg(void *buffer, int size, RGB *palette) { BITMAP *bmp; - PALETTE pal; - - if (!palette) - palette = pal; _jpeg_init_memory_io(buffer, size); --- NEW FILE: internal.h --- /* * __ _____ ______ ______ ___ ___ * /\ \ /\ _ `\ /\ ___\ /\ _ \ /\_ \ /\_ \ * \ \ \\ \ \L\ \\ \ \__/ \ \ \L\ \\//\ \ \//\ \ __ __ * __ \ \ \\ \ __| \ \ \ __\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\ * /\ \_\/ / \ \ \/ \ \ \L\ \\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ * \ \____// \ \_\ \ \____/ \ \_\ \_\/\____\/\____\ \____\ \____ \ * \/____/ \/_/ \/___/ \/_/\/_/\/____/\/____/\/____/\/___L\ \ * /\____/ * \_/__/ * * Version 2.2, by Angelo Mottola, 2000-2003. * * Internal library definitions. * * See the readme.txt file for instructions on using this package in your * own programs. */ #ifndef _JPGALLEG_INTERNAL_H_ #define _JPGALLEG_INTERNAL_H_ #include <allegro.h> #include <allegro/internal/aintern.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include "jpgalleg.h" #define FIX_0_298631336 2446 #define FIX_0_390180644 3196 #define FIX_0_541196100 4433 #define FIX_0_765366865 6270 #define FIX_0_899976223 7373 #define FIX_1_175875602 9633 #define FIX_1_501321110 12299 #define FIX_1_847759065 15137 #define FIX_1_961570560 16069 #define FIX_2_053119869 16819 #define FIX_2_562915447 20995 #define FIX_3_072711026 25172 #define CHUNK_SOI 0xffd8 #define CHUNK_EOI 0xffd9 #define CHUNK_JPG0 0xf0 #define CHUNK_JPG13 0xfd #define CHUNK_DHP 0xde #define CHUNK_EXP 0xdf #define CHUNK_DNL 0xdc #define CHUNK_DAC 0xcc #define CHUNK_SOF3 0xc3 #define CHUNK_SOF5 0xc5 #define CHUNK_SOF6 0xc6 #define CHUNK_SOF7 0xc7 #define CHUNK_SOF9 0xc9 #define CHUNK_SOF10 0xca #define CHUNK_SOF11 0xcb #define CHUNK_SOF13 0xcd #define CHUNK_SOF14 0xce #define CHUNK_SOF15 0xcf #define CHUNK_APP14 0xee #define CHUNK_APP15 0xef #define CHUNK_TEM 0x01 #define CHUNK_RST0 0xffd0 #define CHUNK_RST1 0xffd1 #define CHUNK_RST2 0xffd2 #define CHUNK_RST3 0xffd3 #define CHUNK_RST4 0xffd4 #define CHUNK_RST5 0xffd5 #define CHUNK_RST6 0xffd6 #define CHUNK_RST7 0xffd7 #define CHUNK_JPG 0xc8 #define CHUNK_SOF0 0xc0 #define CHUNK_SOF1 0xc1 #define CHUNK_SOF2 0xc2 #define CHUNK_DHT 0xc4 #define CHUNK_SOS 0xda #define CHUNK_DQT 0xdb #define CHUNK_DRI 0xdd #define CHUNK_APP0 0xe0 #define CHUNK_COM 0xfe #define SOF0_DEFINED 0x01 #define DHT_DEFINED 0x02 #define SOS_DEFINED 0x04 #define DQT_DEFINED 0x08 #define APP0_DEFINED 0x10 #define DRI_DEFINED 0x20 #define IS_PROGRESSIVE 0x40 #define JFIF_OK 0x1F #define LUMINANCE 0 #define CHROMINANCE 1 /* This expression is made to return: * Quality = 100 -> Factor = 55 * Quality = 50 -> Factor = 10 * Quality = 1 -> Factor = 0.05 * Other values follow a logarithmic curve */ #define QUALITY_FACTOR(q) ((q) < 50 ? (pow(10.0, ((q) - 28.705189) / 21.294811)) : (pow(10.0, ((q) +17.534468) / 67.534468))) /* Default quality/flags values for save_jpg() and save_memory_jpg() */ #define DEFAULT_QUALITY 75 #define DEFAULT_FLAGS JPG_SAMPLING_444 typedef struct HUFFMAN_ENTRY { int value; int encoded_value; int bits_length; } HUFFMAN_ENTRY; typedef struct HUFFMAN_TABLE { HUFFMAN_ENTRY entry[256]; HUFFMAN_ENTRY *entry_of_length[16]; HUFFMAN_ENTRY *code[256]; } HUFFMAN_TABLE; typedef struct DATA_BUFFER { short data[64]; } DATA_BUFFER; extern void _jpeg_init_file_io(PACKFILE *); extern void _jpeg_init_memory_io(void *buffer, int size); extern int _jpeg_memory_size(); extern int _jpeg_getc(); extern int _jpeg_putc(int); extern int _jpeg_putw(int); extern int _jpeg_getw(); extern int _jpeg_get_bit(); extern int _jpeg_put_bit(int); extern void _jpeg_flush_bits(); extern void _jpeg_open_chunk(); extern void _jpeg_close_chunk(); extern int _jpeg_eoc(); extern void _jpeg_new_chunk(int); extern void _jpeg_write_chunk(); extern void _jpeg_chunk_putc(int); extern void _jpeg_chunk_putw(int); extern BITMAP *_jpeg_decode(RGB *); extern void _jpeg_mmx_idct(int *, int *, int *, int *); extern void _jpeg_mmx_ycbcr2rgb(int, int, int, int, int, int, int); extern void _jpeg_mmx_ycbcr2bgr(int, int, int, int, int, int, int); extern int _jpeg_encode(BITMAP *, AL_CONST RGB *, int, int); extern void _jpeg_mmx_rgb2ycbcr(int, short *, short *, short *, short *, short *, short *); extern void _jpeg_mmx_bgr2ycbcr(int, short *, short *, short *, short *, short *, short *); extern const unsigned char _jpeg_zigzag_scan[]; #endif --- NEW FILE: io.c --- /* * __ _____ ______ ______ ___ ___ * /\ \ /\ _ `\ /\ ___\ /\ _ \ /\_ \ /\_ \ * \ \ \\ \ \L\ \\ \ \__/ \ \ \L\ \\//\ \ \//\ \ __ __ * __ \ \ \\ \ __| \ \ \ __\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\ * /\ \_\/ / \ \ \/ \ \ \L\ \\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ * \ \____// \ \_\ \ \____/ \ \_\ \_\/\____\/\____\ \____\ \____ \ * \/____/ \/_/ \/___/ \/_/\/_/\/____/\/____/\/____/\/___L\ \ * /\____/ * \_/__/ * * Version 2.2, by Angelo Mottola, 2000-2003. * * Input/output helper routines module. * * See the readme.txt file for instructions on using this package in your * own programs. */ #include "internal.h" static PACKFILE *f = NULL; static int (*getc_func)() = NULL; static int (*putc_func)(int c) = NULL; static int current_bit = 0; static int current_byte = 0; static int bytes_read = 0; static int chunk_len = 0; static void *chunk = NULL; static unsigned char *buffer = NULL; static int buffer_pos = 0; static int buffer_size = 0; /* file_io_getc: * Byte input routine for file access mode. */ static int file_io_getc() { int result = pack_getc(f); if (result < 0) jpgalleg_error = JPG_ERROR_READING_FILE; return result; } /* file_io_putc: * Byte output routine for file access mode. */ static int file_io_putc(int c) { if (pack_putc(c, f) != c) { jpgalleg_error = JPG_ERROR_WRITING_FILE; return -1; } return 0; } /* _jpeg_init_file_io: * Initializes the I/O system for file access. */ void _jpeg_init_file_io(PACKFILE *jpeg_file) { f = jpeg_file; getc_func = file_io_getc; putc_func = file_io_putc; current_bit = 0; } /* memory_io_getc: * Byte input routine for memory access mode. */ static int memory_io_getc() { int result; if (buffer_pos >= buffer_size) { jpgalleg_error = JPG_ERROR_INPUT_BUFFER_TOO_SMALL; return -1; } result = buffer[buffer_pos]; buffer_pos++; return result; } /* memory_io_putc: * Byte output routine for memory access mode. */ static int memory_io_putc(int c) { if (buffer_pos >= buffer_size) { jpgalleg_error = JPG_ERROR_OUTPUT_BUFFER_TOO_SMALL; return -1; } buffer[buffer_pos] = c; buffer_pos++; return 0; } /* _jpeg_init_memory_io: * Initializes the I/O system for memory access. */ void _jpeg_init_memory_io(void *data, int size) { buffer = (unsigned char *)data; buffer_size = size; buffer_pos = 0; getc_func = memory_io_getc; putc_func = memory_io_putc; current_bit = 0; } /* _jpeg_memory size: * Returns the number of bytes read/written in memory. */ int _jpeg_memory_size() { return buffer_pos; } /* _jpeg_getc: * Reads a byte from the input stream. */ int _jpeg_getc() { bytes_read++; current_bit = 0; return getc_func(); } /* _jpeg_putc: * Writes a byte to the output stream. */ int _jpeg_putc(int c) { return putc_func(c); } /* _jpeg_getw: * Reads a word from the input stream. */ int _jpeg_getw() { return (_jpeg_getc() << 8) | _jpeg_getc(); } /* _jpeg_putw: * Writes a word to the output stream. */ int _jpeg_putw(int w) { int result; result = _jpeg_putc((w >> 8) & 0xff); result |= _jpeg_putc(w & 0xff); return result; } /* _jpeg_get_bit: * Reads a bit from the input stream. */ int _jpeg_get_bit() { current_bit--; if (current_bit < 0) { current_byte = getc_func(); current_bit = 7; if (current_byte == 0xff) /* Special encoding for 0xff, which in JPGs is encoded like 2 bytes: * 0xff00. Here we skip the next byte (0x00) */ getc_func(); else if (current_byte == -1) return -1; } return (current_byte >> current_bit) & 0x1; } /* _jpeg_put_bit: * Writes a bit to the output stream. */ int _jpeg_put_bit(int bit) { current_byte |= (bit << current_bit); current_bit--; if (current_bit < 0) { if (putc_func(current_byte)) return -1; if (current_byte == 0xff) putc_func(0); current_bit = 7; current_byte = 0; } return 0; } /* _jpeg_flush_bits: * Flushes the current byte by filling unset bits with 1. */ void _jpeg_flush_bits() { while (current_bit < 7) _jpeg_put_bit(1); } /* _jpeg_open_chunk: * Opens a chunk for reading. */ void _jpeg_open_chunk() { bytes_read = 0; chunk_len = _jpeg_getw(); current_bit = 0; } /* _jpeg_close_chunk: * Closes the chunk being read, eventually skipping unused bytes. */ void _jpeg_close_chunk() { while (bytes_read < chunk_len) _jpeg_getc(); current_bit = 0; } /* _jpeg_eoc: * Returns true if the end of chunk being read is reached, otherwise false. */ int _jpeg_eoc() { return (bytes_read < chunk_len) ? FALSE : TRUE; } /* _jpeg_new_chunk: * Creates a new chunk for writing. */ void _jpeg_new_chunk(int type) { char *c = (char *)malloc(65536); c[0] = 0xff; c[1] = type; chunk_len = 2; chunk = c; } /* _jpeg_write_chunk: * Writes the current chunk to the output stream. */ void _jpeg_write_chunk() { char *c; if (!chunk) return; c = (char *)chunk; c[2] = (chunk_len >> 8) & 0xff; c[3] = chunk_len & 0xff; chunk_len += 2; while (chunk_len > 0) { _jpeg_putc(*c); chunk_len--; c++; } free(chunk); chunk = NULL; current_bit = 7; current_byte = 0; } /* _jpeg_chunk_putc: * Writes a byte to the current chunk. */ void _jpeg_chunk_putc(int c) { char *p = (char *)chunk + chunk_len + 2; *p = c; chunk_len++; } /* _jpeg_chunk_putw: * Writes a word to the current chunk. */ void _jpeg_chunk_putw(int w) { _jpeg_chunk_putc((w >> 8) & 0xff); _jpeg_chunk_putc(w & 0xff); } --- NEW FILE: jpgalleg.c --- /* * __ _____ ______ ______ ___ ___ * /\ \ /\ _ `\ /\ ___\ /\ _ \ /\_ \ /\_ \ * \ \ \\ \ \L\ \\ \ \__/ \ \ \L\ \\//\ \ \//\ \ __ __ * __ \ \ \\ \ __| \ \ \ __\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\ * /\ \_\/ / \ \ \/ \ \ \L\ \\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ * \ \____// \ \_\ \ \____/ \ \_\ \_\/\____\/\____\ \____\ \____ \ * \/____/ \/_/ \/___/ \/_/\/_/\/____/\/____/\/____/\/___L\ \ * /\____/ * \_/__/ * * Version 2.2, by Angelo Mottola, 2000-2003. * * Public library functions. * * See the readme.txt file for instructions on using this package in your * own programs. * */ #include "internal.h" const unsigned char _jpeg_zigzag_scan[64] = { 0, 1, 5, 6,14,15,27,28, 2, 4, 7,13,16,26,29,42, 3, 8,12,17,25,30,41,43, 9,11,18,24,31,40,44,53, 10,19,23,32,39,45,52,54, 20,22,33,38,46,51,55,60, 21,34,37,47,50,56,59,61, 35,36,48,49,57,58,62,63 }; int jpgalleg_error = JPG_ERROR_NONE; /* load_datafile_jpg: * Hook function for loading a JPEG object from a datafile. Returns the * decoded JPG into a BITMAP or NULL on error. */ static void * load_datafile_jpg(PACKFILE *f, long size) { BITMAP *bmp; char *buffer; buffer = (char *)malloc(size); if (!buffer) return NULL; pack_fread(buffer, size, f); bmp = load_memory_jpg(buffer, size, NULL); free(buffer); return (void *)bmp; } /* destroy_datafile_jpg: * Hook function for freeing memory of JPEG objects in a loaded datafile. */ static void destroy_datafile_jpg(void *data) { if (data) destroy_bitmap((BITMAP *)data); } /* jpgalleg_init: * Initializes JPGalleg by registering the file format with the Allegro image * handling and datafile subsystems. */ int jpgalleg_init(void) { register_datafile_object(DAT_JPEG, load_datafile_jpg, destroy_datafile_jpg); register_bitmap_file_type("jpg", load_jpg, save_jpg); jpgalleg_error = JPG_ERROR_NONE; return 0; } /* load_jpg: * Loads a JPG image from a file into a BITMAP. */ BITMAP * load_jpg(AL_CONST char *filename, RGB *palette) { PACKFILE *f; BITMAP *bmp; f = pack_fopen(filename, F_READ); if (!f) return NULL; _jpeg_init_file_io(f); bmp = _jpeg_decode(palette); pack_fclose(f); return bmp; } /* load_memory_jpg: * Loads a JPG image from a memory buffer into a BITMAP. */ BITMAP * load_memory_jpg(void *buffer, int size, RGB *palette) { BITMAP *bmp; _jpeg_init_memory_io(buffer, size); bmp = _jpeg_decode(palette); return bmp; } /* save_jpg: * Saves specified BITMAP into a JPG file with quality 75 and no subsampling. */ int save_jpg(AL_CONST char *filename, BITMAP *bmp, AL_CONST RGB *palette) { return save_jpg_ex(filename, bmp, palette, DEFAULT_QUALITY, DEFAULT_FLAGS); } /* save_jpg_ex: * Saves a BITMAP into a JPG file using given quality and subsampling mode. */ int save_jpg_ex(AL_CONST char *filename, BITMAP *bmp, AL_CONST RGB *palette, int quality, int flags) { PACKFILE *f; PALETTE pal; int result; if (!palette) palette = pal; f = pack_fopen(filename, F_WRITE); if (!f) return -1; _jpeg_init_file_io(f); result = _jpeg_encode(bmp, palette, quality, flags); pack_fclose(f); return result; } /* save_memory_jpg: * Saves a BITMAP in JPG format and stores it into a memory buffer. The JPG * is saved with quality 75 and no subsampling. */ int save_memory_jpg(void *buffer, int *size, BITMAP *bmp, AL_CONST RGB *palette) { return save_memory_jpg_ex(buffer, size, bmp, palette, DEFAULT_QUALITY, DEFAULT_FLAGS); } /* save_memory_jpg_ex: * Saves a BITMAP in JPG format using given quality and subsampling settings * and stores it into a memory buffer. */ int save_memory_jpg_ex(void *buffer, int *size, BITMAP *bmp, AL_CONST RGB *palette, int quality, int flags) { int result; if (!buffer) return -1; _jpeg_init_memory_io(buffer, *size); *size = 0; result = _jpeg_encode(bmp, palette, quality, flags); if (result == 0) *size = _jpeg_memory_size(); return result; } --- NEW FILE: jpgalleg.h --- /* * __ _____ ______ ______ ___ ___ * /\ \ /\ _ `\ /\ ___\ /\ _ \ /\_ \ /\_ \ * \ \ \\ \ \L\ \\ \ \__/ \ \ \L\ \\//\ \ \//\ \ __ __ * __ \ \ \\ \ __| \ \ \ __\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\ * /\ \_\/ / \ \ \/ \ \ \L\ \\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ * \ \____// \ \_\ \ \____/ \ \_\ \_\/\____\/\____\ \____\ \____ \ * \/____/ \/_/ \/___/ \/_/\/_/\/____/\/____/\/____/\/___L\ \ * /\____/ * \_/__/ * * Version 2.2, by Angelo Mottola, 2000-2003. * * Public header file. * * See the readme.txt file for instructions on using this package in your * own programs. */ #ifndef _JPGALLEG_H_ #define _JPGALLEG_H_ #include <allegro.h> /* Subsampling mode */ #define JPG_SAMPLING_444 0 #define JPG_SAMPLING_422 1 #define JPG_SAMPLING_411 2 /* Force greyscale when saving */ #define JPG_GREYSCALE 0x10 /* Error codes */ #define JPG_ERROR_NONE 0 #define JPG_ERROR_READING_FILE -1 #define JPG_ERROR_WRITING_FILE -2 #define JPG_ERROR_INPUT_BUFFER_TOO_SMALL -3 #define JPG_ERROR_OUTPUT_BUFFER_TOO_SMALL -4 #define JPG_ERROR_HUFFMAN -5 #define JPG_ERROR_NOT_JFIF -6 #define JPG_ERROR_UNSUPPORTED_ENCODING -7 #define JPG_ERROR_UNSUPPORTED_COLOR_SPACE -8 #define JPG_ERROR_UNSUPPORTED_DATA_PRECISION -9 #define JPG_ERROR_BAD_IMAGE -10 #define JPG_ERROR_OUT_OF_MEMORY -11 /* Datafile object type for JPG images */ #define DAT_JPEG DAT_ID('J','P','E','G') #ifdef __cplusplus extern "C" { #endif extern int jpgalleg_init(void); extern BITMAP *load_jpg(AL_CONST char *filename, RGB *palette); extern BITMAP *load_memory_jpg(void *buffer, int size, RGB *palette); extern int save_jpg(AL_CONST char *filename, BITMAP *image, AL_CONST RGB *palette); extern int save_jpg_ex(AL_CONST char *filename, BITMAP *image, AL_CONST RGB *palette, int quality, int flags); extern int save_memory_jpg(void *buffer, int *size, BITMAP *image, AL_CONST RGB *palette); extern int save_memory_jpg_ex(void *buffer, int *size, BITMAP *image, AL_CONST RGB *palette, int quality, int flags); extern int jpgalleg_error; #ifdef __cplusplus } #endif #endif --- NEW FILE: readme.txt --- This directory contains source files taken from JPGAlleg 2.2 library and patched to properly support loading jpg files in video modes with 8 bit color depth. Another reason to include these source files directly into UFO2000 source tree is that I was unable to locate JPGAlleg home page. I have downloaded JPGAlleg 2.2 sources using a link found somewhere on http://allegro.cc forums. I have put original sources of JPGAlleg 2.2 for those who are interested here: http://ufo2000.lxnt.info/files/jpgalleg-2.2.zip The file 'fix8bit.patch' contains a patch with all the changes made to original JPGAlleg 2.2 sources. |
Update of /cvsroot/timewarp/gamedata/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4788/gamedata/dialogs Added Files: arilou.jpg arilou.mod chmmr.jpg chmmr.mod druuge.jpg druuge.mod dynarri.jpg dynarri.mod human.jpg human.mod ilwrath.jpg ilwrath.mod korah.jpg korah.mod melnorme.jpg melnorme.mod mycon.jpg mycon.mod orz.jpg orz.mod pkunk.jpg pkunk.mod shofixty.jpg shofixty.mod spathi-council.jpg spathi.jpg spathi.mod supox.jpg supox.mod sylandro.jpg sylandro.mod syreen.jpg syreen.mod thraddash.jpg thraddash.mod umgah.jpg umgah.mod urquan.jpg urquan.mod utwig.jpg utwig.mod vux.jpg vux.mod yehat.jpg yehat.mod zoqfot.jpg zoqfot.mod Log Message: Added jpg support, Communication with target ship (GOB), removed old configure files --- NEW FILE: arilou.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: arilou.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: chmmr.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: chmmr.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: druuge.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: druuge.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dynarri.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dynarri.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: human.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: human.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ilwrath.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ilwrath.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: korah.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: korah.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: melnorme.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: melnorme.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mycon.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mycon.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: orz.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: orz.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pkunk.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pkunk.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shofixty.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shofixty.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spathi-council.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spathi.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spathi.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: supox.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: supox.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: sylandro.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: sylandro.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: syreen.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: syreen.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: thraddash.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: thraddash.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: umgah.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: umgah.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: urquan.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: urquan.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: utwig.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: utwig.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vux.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vux.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: yehat.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: yehat.mod --- (This appears to be a binary file; contents omitted.) --- NEW FILE: zoqfot.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: zoqfot.mod --- (This appears to be a binary file; contents omitted.) |
From: <yu...@us...> - 2004-03-01 23:10:04
|
Update of /cvsroot/timewarp/source/jpgalleg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2190/jpgalleg Log Message: Directory /cvsroot/timewarp/source/jpgalleg added to the repository |
From: <yu...@us...> - 2004-03-01 23:07:45
|
Update of /cvsroot/timewarp/gamedata/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1510/dialogs Log Message: Directory /cvsroot/timewarp/gamedata/dialogs added to the repository |
From: <geo...@us...> - 2004-03-01 22:57:34
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31400/source/newships Modified Files: shpcrore.cpp Log Message: no message Index: shpcrore.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpcrore.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpcrore.cpp 1 Mar 2004 22:21:09 -0000 1.1 --- shpcrore.cpp 1 Mar 2004 22:46:13 -0000 1.2 *************** *** 136,140 **** if (special_recharge > 0) { Query q; ! double r, p, t, xp, xt, ps, ts, ov, nv, ta; Vector2 nvel, ovel; --- 136,140 ---- if (special_recharge > 0) { Query q; ! double r, p, t, xp, xt, ov, nv, ta; Vector2 nvel, ovel; |
From: <geo...@us...> - 2004-03-01 22:56:45
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31130 Modified Files: twwin.dsp Log Message: updated to accomodate the crome revenant ship |
From: <geo...@us...> - 2004-03-01 22:32:29
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25083/source/newships Added Files: shpcrore.cpp Log Message: adding a timewarp-team ship, with permission of Baltar (so JP told me) --- NEW FILE: shpcrore.cpp --- #include "../ship.h" REGISTER_FILE #define max_recoil 250 #define recoil_velocity scale_velocity(30) class Crome : public Ship { double weaponRange, weaponBlastRange, weaponVelocity, weaponMaxCharge, weapon_charge; int weaponDamage, weaponBlastDamage, weaponBlastDamageShots, weaponArmour; bool weaponAutoExplode; bool holding_fire; int recoil_frame; int recharge_extra; // double rtx, rty; Vector2 rtpos; double specialRange, specialRepulse, specialTranslate; public: Crome (Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code); virtual int activate_weapon(); virtual int activate_special(); virtual void calculate(); virtual void animate(Frame *space); }; class CromeShot : public Shot { bool exploded_already, auto_explode; int blast_damage, blast_damage_shots; double blast_range; SpaceObject *direct_hit; public: CromeShot (SpaceLocation *creator, Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, SpaceSprite *osprite, double relativity, int oblast_damage, int oblast_damage_shots, double oblast_range, bool oauto_explode); virtual void calculate(); virtual void animateExplosion(); virtual void inflict_damage(SpaceObject *other); }; Crome::Crome (Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code) : Ship(opos, shipAngle, shipData, code) { // hotspot_position = 0.22; weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); weaponDamage = get_config_int("Weapon", "Damage", 0); weaponArmour = get_config_int("Weapon", "Armour", 0); weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); weaponBlastDamage = get_config_int("Weapon", "BlastDamage", 0); weaponBlastDamageShots = get_config_int("Weapon", "BlastDamageShots", 0); weaponBlastRange = scale_range(get_config_float("Weapon", "BlastRange", 0)); weaponAutoExplode = (get_config_int("Weapon", "AutoExplode", 0) != 0); weaponMaxCharge = get_config_int("Weapon", "MaxChargeTime", 0); specialRange = scale_range(get_config_float("Special", "Range", 0)); specialRepulse = scale_velocity(get_config_float("Special", "RepulseAway", 0))/1000.0; specialTranslate = scale_range(get_config_float("Special", "TranslateAway", 0))/1000.0; holding_fire = false; recoil_frame = 0; recharge_extra = recharge_amount; } int Crome::activate_weapon() { if ((holding_fire) || (recoil_frame > 0)) return false; holding_fire = true; weapon_charge = 0; recharge_amount = 0; return true; } int Crome::activate_special() { return true; } void Crome::calculate() { if ((holding_fire) && (weapon_charge < weaponMaxCharge)) { if ( ((weapon_charge += frame_time) >= weaponMaxCharge) || (!fire_weapon)) { game->add(new CromeShot (this, Vector2(0, 10), angle, weaponVelocity, weaponDamage, (weaponRange*weapon_charge)/weaponMaxCharge, weaponArmour, data->spriteWeapon, 1, weaponBlastDamage, weaponBlastDamageShots, weaponBlastRange, weaponAutoExplode)); play_sound2(data->sampleWeapon[0],0); play_sound2(data->sampleWeapon[1]); recoil_frame = max_recoil; // rtx = cos(angle*ANGLE_RATIO); // rty = sin(angle*ANGLE_RATIO); rtpos = unit_vector(angle); recharge_amount = recharge_extra; weapon_charge = weaponMaxCharge; } } if (!fire_weapon) { holding_fire = false; recharge_amount = recharge_extra; } Ship::calculate(); if (recoil_frame > 0) { double xxx = frame_time * recoil_frame * recoil_velocity / max_recoil; // x -= rtx * xxx; // y -= rty * xxx; pos -= rtpos * xxx; recoil_frame -= frame_time; } if (special_recharge > 0) { Query q; double r, p, t, xp, xt, ps, ts, ov, nv, ta; Vector2 nvel, ovel; for (q.begin(this, OBJECT_LAYERS, specialRange); q.currento; q.next()) { if (((q.currento->mass <= 0) && !q.currento->isShot()) ) continue; xt = 0; xp = 0; r = distance(q.currento)/specialRange; // r *= r; r = sqrt(sqrt(r)); p = specialRepulse * (1 - r) * frame_time; t = specialTranslate * (1 - r) * frame_time; if (q.currento->isPlanet()) { xp = p / sqrt(mass); xt = t / sqrt(mass); } else { if (q.currento->mass > 1) { xp = (p / sqrt(mass)) * (1-1/sqrt(q.currento->mass)); xt = (t / sqrt(mass)) * (1-1/sqrt(q.currento->mass)); p /= sqrt(q.currento->mass); t /= sqrt(q.currento->mass); } } // ovx = q.currento->get_vx(); // ovy = q.currento->get_vy(); ovel = q.currento->get_vel(); ov = ovel.magnitude(); //sqrt(ovx*ovx + ovy*ovy); ta = trajectory_angle(q.currento); accelerate(this, ta+PI, xp, MAX_SPEED); if (!q.currento->isPlanet()) q.currento->accelerate(this, ta, p, MAX_SPEED); ta *=-1;// -ANGLE_RATIO; translate(xt * -unit_vector(-ta));//(-cos(ta)*xt, sin(ta)*xt); if (q.currento->isPlanet()) continue; q.currento->translate(unit_vector(-ta));//(cos(ta)*t, -sin(ta)*t); if (q.currento->isShot()) { // ovx = q.currento->get_vx(); // ovy = q.currento->get_vy(); ovel = q.currento->get_vel(); ((Shot*)q.currento)->changeDirection(ovel.atan()); //atan3(ovy, ovx)*180/PI // nvx = q.currento->get_vx(); // nvy = q.currento->get_vy(); nvel = q.currento->get_vel(); nv = nvel.magnitude();//sqrt(nvx*nvx + nvy*nvy); if (fabs(nv-ov) > 0.2*(ov+nv)/2) { // q.currento->vx = ovx; // q.currento->vy = ovy; q.currento->vel = ovel; } } } } } void Crome::animate(Frame* space) { if (special_recharge > 0) data->spriteSpecial->animate(pos, sprite_index, space); else sprite->animate(pos, sprite_index, space); } CromeShot::CromeShot (SpaceLocation *creator, Vector2 opos, double oangle, double ov, int odamage, double orange, int oarmour, SpaceSprite *osprite, double relativity, int oblast_damage, int oblast_damage_shots, double oblast_range, bool oauto_explode) : Shot(creator, opos, oangle, ov, odamage, orange, oarmour, creator, osprite, relativity) { exploded_already = false; blast_range = oblast_range; blast_damage = oblast_damage; auto_explode = oauto_explode; direct_hit = 0; blast_damage_shots = oblast_damage_shots; explosionSample = data->sampleWeapon[2]; } void CromeShot::calculate() { Shot::calculate(); if ((state == 0) && (!exploded_already) && auto_explode) { soundExplosion(); animateExplosion(); return; } sprite_index = int(24*d/range); } void CromeShot::animateExplosion() { if (exploded_already) return; exploded_already = true; game->add(new Animation(this, pos, data->spriteWeaponExplosion, 0, 8, 50, LAYER_EXPLOSIONS)); game->add(new Animation(this, pos, data->spriteExtraExplosion, 0, 12, 50, LAYER_HOTSPOTS)); Query q; double r; for (q.begin(this, OBJECT_LAYERS, blast_range); q.currento; q.next()) { if (q.currento != direct_hit) { if (q.currento->sameShip(this)) r *= 2; if (r > blast_range) continue; r = distance(q.currento) / blast_range; if (q.currento->isShot()) damage(q.currento, (int)ceil(blast_damage_shots * (1 - r*r*r*r))); else damage(q.currento, (int)ceil(blast_damage * (1 - r*r*r*r))); } } } void CromeShot::inflict_damage(SpaceObject *other) { direct_hit = other; Shot::inflict_damage(other); } REGISTER_SHIP(Crome) |
From: <geo...@us...> - 2004-03-01 22:32:29
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25083/ships Added Files: shpcrore.dat shpcrore.ini shpcrore.txt Log Message: adding a timewarp-team ship, with permission of Baltar (so JP told me) --- NEW FILE: shpcrore.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpcrore.ini --- [Info] TWCost = 23 Name1 = Crome Name2 = Revenant Origin = TW Coders = Tau Code = Crome [Ship] Crew = 16 CrewMax = 16 Batt = 32 BattMax = 32 SpeedMax = 33 AccelRate = 8 TurnRate = 1.3 RechargeAmount = 1 RechargeRate = 3 WeaponDrain = 10 WeaponRate = 10 SpecialDrain = 10 SpecialRate = 10 HotspotRate = 3 Mass = 16 [Weapon] Range = 40 Velocity = 110 Damage = 6 Armour = 3 BlastDamage = 4 BlastDamageShots = 12 BlastRange = 10 AutoExplode = 1 MaxChargeTime = 2000 [Special] Range = 9 RepulseAway = 3800 TranslateAway = 45 --- NEW FILE: shpcrore.txt --- 1. Weapon - press and hold. The longer you hold, the further the shot will go before exploding (same damage). There's a maximum range (and maximums "charge" time, after whihc the shot is fire d automatically). The areas effect DOES affect the ship itself (though as if it was at double the distance), so be careful. 2. Special - repulsion filed. No comment. *TAU* |
From: <geo...@us...> - 2004-03-01 17:57:44
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26151/melee Modified Files: mmain.cpp Log Message: and yeah, got rid of the final error, melee end should work fine now even with bots in network play Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** mmain.cpp 1 Mar 2004 15:47:25 -0000 1.28 --- mmain.cpp 1 Mar 2004 17:46:30 -0000 1.29 *************** *** 591,595 **** ! } log_test(); --- 591,596 ---- ! ! } log_test(); *************** *** 719,739 **** int choices[32]; int k; for ( k = 0; k < num_players; ++k ) { ! int ichoice = 9; - // channel_server is always the local channel ? if (is_local(player_control[k]->channel)) { ! char *endmessage; ! if (player_isalive(k)) ! endmessage = "Victory"; ! else ! endmessage = "Game Over"; ! ! char tmp[512]; ! sprintf(tmp, "%s num = %i channel = %i framenum = %i", endmessage, k, player_control[k]->channel, frame_number); ! ! ichoice = tw_alert(tmp, "&QUIT", "&RESTART"); } --- 720,753 ---- int choices[32]; int k; + int local_choice = 0; // only 1 local player needs to make a choice; the rest can be copied for local players for ( k = 0; k < num_players; ++k ) { ! // zero indicates an invalid choice (note that valid choices as 1 and 2 --> see the tw_alert menu below ! int ichoice = 0; if (is_local(player_control[k]->channel)) { ! // note, that a "local" player can also be an AI ship, but that doesn't matter, ! // what matters is that all players on one computer (AI or human) submit the ! // same choice. ! if (!local_choice) ! { ! char *endmessage; ! if (player_isalive(k)) ! endmessage = "Victory"; ! else ! endmessage = "Game Over"; ! ! char tmp[512]; ! sprintf(tmp, "%s num = %i channel = %i framenum = %i", endmessage, k, player_control[k]->channel, frame_number); ! ! ichoice = tw_alert(tmp, "&QUIT", "&RESTART"); ! ! local_choice = ichoice; ! ! } else { ! // copy the local choice ! ichoice = local_choice; ! } } *************** *** 753,756 **** --- 767,777 ---- log_test(); + // extra test, check if all choices are "valid" (ie non-zero) + for ( i = 0; i < num_players; ++i ) + { + if (!choices[i]) + tw_error("an invalid choice was encountered at end of the game"); + } + // check if all the players want to restart, or quit, if not, give a warning and quit *************** *** 813,827 **** m = k; ! log_int(player_control[0]->channel, k); ! if ( k != m ) ! tw_error("weird, log stack is probably mixed up"); ! ! log_int(player_control[1]->channel, k); ! if ( k != m ) ! tw_error("weird, log stack is probably mixed up"); // check if the "log stack" of data is empty if (log_totalsize() > 0) ! tw_error("Log isn't empty (A) %i %i", log_size_pl(0), log_size_pl(1)); #endif // otherwise, it's just an empty routine. --- 834,848 ---- m = k; ! int i; ! for ( i = 0; i < num_players; ++i ) ! { ! log_int(player_control[i]->channel, k); ! if ( k != m ) ! tw_error("weird, log stack is probably mixed up"); ! } // check if the "log stack" of data is empty if (log_totalsize() > 0) ! tw_error("Log isn't empty %i %i", log_size_pl(0), log_size_pl(1)); #endif // otherwise, it's just an empty routine. |
From: <geo...@us...> - 2004-03-01 15:58:47
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29924/melee Modified Files: mmain.cpp mmain.h Log Message: fixed the 2-player networked game-ending Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** mmain.cpp 1 Mar 2004 00:19:22 -0000 1.27 --- mmain.cpp 1 Mar 2004 15:47:25 -0000 1.28 *************** *** 496,501 **** //choose ships and send them across network ! if (log_totalsize() > 0) ! tw_error("Log isn't empty (a)"); for (i = 0; i < num_players; i += 1) { --- 496,500 ---- //choose ships and send them across network ! log_test(); for (i = 0; i < num_players; i += 1) { *************** *** 543,548 **** share_update(); ! if (log_totalsize() > 0) ! tw_error("Log isn't empty (b)"); //create the ships that were chosen --- 542,546 ---- share_update(); ! log_test(); //create the ships that were chosen *************** *** 594,597 **** --- 592,598 ---- } + + log_test(); + delete[] slot; message.out("Finished selecting ships...", 1500); *************** *** 653,656 **** --- 654,659 ---- + + bool NormalGame::player_isalive(int i) { *************** *** 685,688 **** --- 688,697 ---- } + int NormalGame::log_size_pl(int iplayer) + { + int k = player_control[iplayer]->channel; + return game->log->log_len[k] - game->log->log_pos[k]; + } + int NormalGame::log_totalsize() { *************** *** 690,697 **** int i; for ( i = 0; i < num_players; ++i ) ! { ! int k = player_control[i]->channel; ! test += game->log->log_len[k] - game->log->log_pos[k]; ! } return test; --- 699,703 ---- int i; for ( i = 0; i < num_players; ++i ) ! test += log_size_pl(i); return test; *************** *** 707,714 **** // I guess, you've to make sure, the log-buffer is empty, before writing/reading // values to/from it .. - ! if (log_totalsize() > 0) ! tw_error("Log isn't empty (a)"); // I suppose, each player is making/ has made such a choice ... --- 713,718 ---- // I guess, you've to make sure, the log-buffer is empty, before writing/reading // values to/from it .. ! log_test(); // I suppose, each player is making/ has made such a choice ... *************** *** 747,753 **** ! if (log_totalsize() > 0) ! tw_error("Log isn't empty (b)"); ! // check if all the players want to restart, or quit, if not, give a warning and quit --- 751,756 ---- ! log_test(); ! // check if all the players want to restart, or quit, if not, give a warning and quit *************** *** 789,796 **** --- 792,830 ---- } + // perhaps something goes wrong here, when re-loading the ships ?? + log_test(); + + unpause(); } + /** \brief Checks where the stacked data in the log buffer is cleared in-between + different network actions. This only applies to the "unbuffered channels", which + have routines that synchronize the two games explicitly in the code (ie synchronized + halts). This buffer should be empty most of the time, except in special situations. + */ + void NormalGame::log_test() + { + #ifdef _DEBUG + // synch the 2 games, which should assure that all data are read/written in the meantime + int k, m; + k = random(); + m = k; + + log_int(player_control[0]->channel, k); + if ( k != m ) + tw_error("weird, log stack is probably mixed up"); + + log_int(player_control[1]->channel, k); + if ( k != m ) + tw_error("weird, log stack is probably mixed up"); + + // check if the "log stack" of data is empty + if (log_totalsize() > 0) + tw_error("Log isn't empty (A) %i %i", log_size_pl(0), log_size_pl(1)); + #endif + // otherwise, it's just an empty routine. + } Index: mmain.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mmain.h 29 Feb 2004 15:09:04 -0000 1.10 --- mmain.h 1 Mar 2004 15:47:25 -0000 1.11 *************** *** 59,63 **** --- 59,65 ---- bool player_isalive(int i); int local_player(); + int log_size_pl(int iplayer); int log_totalsize(); + void log_test(); }; |
From: <geo...@us...> - 2004-03-01 15:58:32
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29924/util Modified Files: get_time.h net_tcp.cpp Log Message: fixed the 2-player networked game-ending Index: get_time.h =================================================================== RCS file: /cvsroot/timewarp/source/util/get_time.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** get_time.h 14 Feb 2004 13:18:38 -0000 1.5 --- get_time.h 1 Mar 2004 15:47:24 -0000 1.6 *************** *** 6,9 **** --- 6,11 ---- #endif + #include "types.h" + void init_time(); //to initialize time stuff void deinit_time(); //to de-initialize time stuff Index: net_tcp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/net_tcp.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** net_tcp.cpp 1 Mar 2004 00:19:23 -0000 1.6 --- net_tcp.cpp 1 Mar 2004 15:47:24 -0000 1.7 *************** *** 2,5 **** --- 2,7 ---- //uncoment previous line to disable networking + #include "get_time.h" + // not nice, that this module depends on timewarp this way, but well... I want to use "idle" *************** *** 286,289 **** --- 288,294 ---- if (tmp > 0) sofar += tmp; if (tmp == SOCKET_ERROR) throw "NetTCP::send - error"; + if (sofar == size) break; + if (sofar > size) throw "NetTCP::send - trying to send more data than requested"; + idle(1); } return sofar; *************** *** 310,314 **** throw "NetTCP::recv: Remote Disconnect"; }*/ ! if (tmp == SOCKET_ERROR) throw "NetTCP::recv - error"; } } --- 315,321 ---- throw "NetTCP::recv: Remote Disconnect"; }*/ ! if (tmp == SOCKET_ERROR) throw "NetTCP::recv - socket error"; ! if (tmp == 0) throw "NetTCP::recv other side disconnected"; ! idle(1); } } |
... sent by yb as the orginal email was too long Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source/newships Modified Files: shpalabc.cpp shpastba.cpp shpbahbu.cpp shpbatde.cpp shpbubbo.cpp shpclofl.cpp shpconca.cpp shpdajem.cpp shpdeees.cpp shpfiear.cpp shpgahmo.cpp shpgarty.cpp shpgerhe.cpp shpgeror.cpp shpgerra.cpp shpglacr.cpp shpglads.cpp shphydcr.cpp shpiceco.cpp shpimpka.cpp shpjnkla.cpp shpjygst.cpp shpkabwe.cpp shpklidr.cpp shpkoapa.cpp shpkolfl.cpp shpktesa.cpp shplyrwa.cpp shpmoisp.cpp shpnarlu.cpp shpneccr.cpp shpneodr.cpp shpoliha.cpp shpphepa.cpp shpqlore.cpp shpquawr.cpp shpraame.cpp shprekas.cpp shprogsq.cpp shpsamat.cpp shpsclfr.cpp shpsefn2.cpp shpsefna.cpp shptauar.cpp shptaubo.cpp shptauem.cpp shptaugl.cpp shptaule.cpp shptaumc.cpp shptaume.cpp shptausl.cpp shptaust.cpp shptautu.cpp shptelno.cpp shpterbi.cpp shptrige.cpp shptulra.cpp shpulzin.cpp shpuosli.cpp shpvelcr.cpp shpvezba.cpp shpvuvji.cpp shpwassu.cpp shpxilcr.cpp shpxxxas.cpp shpyusra.cpp Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) |
From: <geo...@us...> - 2004-03-01 00:29:59
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31745/melee Modified Files: mmain.cpp Log Message: removed stupid bug in the handle_end, but still isn't fixed completely Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mmain.cpp 29 Feb 2004 18:46:40 -0000 1.26 --- mmain.cpp 1 Mar 2004 00:19:22 -0000 1.27 *************** *** 713,717 **** // I suppose, each player is making/ has made such a choice ... ! int choices[16]; int k; for ( k = 0; k < num_players; ++k ) --- 713,717 ---- // I suppose, each player is making/ has made such a choice ... ! int choices[32]; int k; for ( k = 0; k < num_players; ++k ) *************** *** 729,733 **** char tmp[512]; ! sprintf(tmp, "%s num = %i channel = %i", endmessage, k, player_control[k]->channel); ichoice = tw_alert(tmp, "&QUIT", "&RESTART"); --- 729,733 ---- char tmp[512]; ! sprintf(tmp, "%s num = %i channel = %i framenum = %i", endmessage, k, player_control[k]->channel, frame_number); ichoice = tw_alert(tmp, "&QUIT", "&RESTART"); *************** *** 754,758 **** k = 0; for ( i = 0; i < num_players; ++i ) ! if (k += choices[i]) // disagreement --- 754,758 ---- k = 0; for ( i = 0; i < num_players; ++i ) ! k += choices[i]; // disagreement *************** *** 763,772 **** tw_alert("Someone aborted", "&Continue"); ! quit("none"); } // agreement on quitting else if ( k == 1*num_players ) { ! quit("none"); } // agreement on restarting --- 763,772 ---- tw_alert("Someone aborted", "&Continue"); ! quit("none"); // THIS IS DESYNCHED ?! } // agreement on quitting else if ( k == 1*num_players ) { ! quit("none"); // THIS IS DESYNCHED ?! } // agreement on restarting |
From: <geo...@us...> - 2004-03-01 00:29:59
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31745/util Modified Files: net_tcp.cpp Log Message: removed stupid bug in the handle_end, but still isn't fixed completely Index: net_tcp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/net_tcp.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** net_tcp.cpp 20 Oct 2003 14:46:14 -0000 1.5 --- net_tcp.cpp 1 Mar 2004 00:19:23 -0000 1.6 *************** *** 266,269 **** --- 266,270 ---- FD_SET ( s, &write_set); r = select (s+1, &read_set, &write_set, &except_set, &tmv); + if (r == SOCKET_ERROR) throw "NetTCP::select - error"; FD_CLR ( s, &write_set); return r; *************** *** 276,279 **** --- 277,281 ---- r = select (s+1, &read_set, &write_set, &except_set, &tmv); FD_CLR ( s, &read_set); + if (r == SOCKET_ERROR) throw "NetTCP::select - error"; return r; } *************** *** 283,286 **** --- 285,289 ---- int tmp = ::send(s, ((char*) data) + sofar, size - sofar, 0); if (tmp > 0) sofar += tmp; + if (tmp == SOCKET_ERROR) throw "NetTCP::send - error"; } return sofar; *************** *** 307,310 **** --- 310,314 ---- throw "NetTCP::recv: Remote Disconnect"; }*/ + if (tmp == SOCKET_ERROR) throw "NetTCP::recv - error"; } } |
From: <yu...@us...> - 2004-02-29 23:36:36
|
Update of /cvsroot/timewarp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20990 Removed Files: twgui.h Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) --- twgui.h DELETED --- |
From: <yu...@us...> - 2004-02-29 23:35:34
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20767 Added Files: twgui.h Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) |
From: <yu...@us...> - 2004-02-29 23:33:40
|
Update of /cvsroot/timewarp/gamedata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/gamedata Modified Files: SecretPlanet.lua Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: SecretPlanet.lua =================================================================== RCS file: /cvsroot/timewarp/gamedata/SecretPlanet.lua,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecretPlanet.lua 28 Feb 2004 01:05:49 -0000 1.1 --- SecretPlanet.lua 29 Feb 2004 23:22:18 -0000 1.2 *************** *** 47,51 **** station_x = x; station_y = y; - if location == "Kohr-Ah" then --- 47,50 ---- |
From: <yu...@us...> - 2004-02-29 23:33:25
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source Modified Files: scp.cpp Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** scp.cpp 28 Feb 2004 15:17:20 -0000 1.54 --- scp.cpp 29 Feb 2004 23:22:18 -0000 1.55 *************** *** 402,405 **** --- 402,406 ---- } + /* static DIALOG clientWaiting[] = { *************** *** 411,415 **** { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL } }; ! void play_net1client ( const char *_address, int _port ) {STACKTRACE --- 412,416 ---- { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL } }; ! */ void play_net1client ( const char *_address, int _port ) {STACKTRACE *************** *** 1594,1598 **** static int next_anim_time = get_time(); int old_d1 = d->d1; - int old_d2 = d->d2; int ret = 0; --- 1595,1598 ---- *************** *** 1658,1665 **** if (type && type->data) { if (type->data->spriteShip) { - float r = rotationFrame; - float s = type->data->spriteShip->frames(); - //float t = r / s; - fractionRotated = (float)((float)rotationFrame / (float)(type->data->spriteShip->frames())); } --- 1658,1661 ---- *************** *** 1729,1733 **** //unload_datafile_object(data); ! /*char obj[32]; sprintf(obj, "SHIP_P0%d_PCX", 1 + rand() % 4); data = load_datafile_object(type->data->file, obj); --- 1725,1729 ---- //unload_datafile_object(data); ! char obj[32]; sprintf(obj, "SHIP_P0%d_PCX", 1 + rand() % 4); data = load_datafile_object(type->data->file, obj); |
From: <yu...@us...> - 2004-02-29 23:33:23
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source/util Modified Files: get_time.c profile.cpp Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: get_time.c =================================================================== RCS file: /cvsroot/timewarp/source/util/get_time.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** get_time.c 19 Feb 2004 01:12:19 -0000 1.7 --- get_time.c 29 Feb 2004 23:22:17 -0000 1.8 *************** *** 124,131 **** //# define RDTSC_TIMER //need to double-check the inline asm here ! static double rdtsc_period_f = 0; ! static int rdtsc_period_i = 0; static Uint64 rdtsc_base; ! static __volatile__ Uint64 rdtsc_get_time() { unsigned int a, b; asm ("RDTSC" : "=a" (a), "=d" (b) : ); --- 124,131 ---- //# define RDTSC_TIMER //need to double-check the inline asm here ! //static double rdtsc_period_f = 0; ! //static int rdtsc_period_i = 0; static Uint64 rdtsc_base; ! __volatile__ Uint64 rdtsc_get_time() { unsigned int a, b; asm ("RDTSC" : "=a" (a), "=d" (b) : ); Index: profile.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/profile.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** profile.cpp 20 Feb 2004 08:42:44 -0000 1.2 --- profile.cpp 29 Feb 2004 23:22:17 -0000 1.3 *************** *** 26,30 **** static Uint32 _safe_profile_time; static double _time_ratio = -1; ! static int _last_ratio_update = -1; void init_profiling() { if (!is_time_initialized()) tw_error("init_profiling - you must call init_time() first"); --- 26,31 ---- static Uint32 _safe_profile_time; static double _time_ratio = -1; ! static Uint32 _last_ratio_update = 0; ! void init_profiling() { if (!is_time_initialized()) tw_error("init_profiling - you must call init_time() first"); *************** *** 87,91 **** }; ! Profile::Profile() : total_time(0), active(0), sorted(SORTED_ALPHA) { } Profile::~Profile() { --- 88,92 ---- }; ! Profile::Profile() : active(0), sorted(SORTED_ALPHA), total_time(0) { } Profile::~Profile() { *************** *** 105,114 **** */ Profile &Profile::operator+= ( const Profile &p ) { ! int i; ! int mj = 0; bool oo = false; total_time += p.total_time; for (i = 0; i < p.data.size(); i++) { ! int j; for (j = mj; j < data.size(); j++) { if (p.data[i].srcline == data[j].srcline) { --- 106,115 ---- */ Profile &Profile::operator+= ( const Profile &p ) { ! unsigned int i; ! unsigned int mj = 0; bool oo = false; total_time += p.total_time; for (i = 0; i < p.data.size(); i++) { ! unsigned int j; for (j = mj; j < data.size(); j++) { if (p.data[i].srcline == data[j].srcline) { *************** *** 132,141 **** } Profile &Profile::operator-= ( const Profile &p ) { ! int i; ! int mj = 0; bool oo = false; total_time -= p.total_time; for (i = 0; i < p.data.size(); i++) { ! int j; for (j = mj; j < data.size(); j++) { if (p.data[i].srcline == data[j].srcline) { --- 133,142 ---- } Profile &Profile::operator-= ( const Profile &p ) { ! unsigned int i; ! unsigned int mj = 0; bool oo = false; total_time -= p.total_time; for (i = 0; i < p.data.size(); i++) { ! unsigned int j; for (j = mj; j < data.size(); j++) { if (p.data[i].srcline == data[j].srcline) { *************** *** 173,177 **** void Profile::clear ( ) { ! int i; for (i = 0; i < data.size(); i++) { data[i].time = 0; --- 174,178 ---- void Profile::clear ( ) { ! unsigned int i; for (i = 0; i < data.size(); i++) { data[i].time = 0; *************** *** 235,239 **** int Profile::print ( int i, char *dest, int max ) { if (_time_ratio == -1) {tw_error("Profile::print - forgot to call init_profiling");} ! if ((i < 0) || (i >= data.size())) { dest[0] = 0; return -1; --- 236,240 ---- int Profile::print ( int i, char *dest, int max ) { if (_time_ratio == -1) {tw_error("Profile::print - forgot to call init_profiling");} ! if ((i < 0) || ((unsigned)i >= data.size())) { dest[0] = 0; return -1; |
From: <yu...@us...> - 2004-02-29 23:33:22
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source/melee Modified Files: mfleet.cpp mfleet.h mshppan.cpp Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: mfleet.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mfleet.cpp 4 Feb 2004 21:12:00 -0000 1.22 --- mfleet.cpp 29 Feb 2004 23:22:17 -0000 1.23 *************** *** 481,485 **** } ! int Fleet::getNextFleetEntryByCharacter(int currentShip, char c) { ASSERT(ships.at(currentShip) != NULL); --- 481,485 ---- } ! int Fleet::getNextFleetEntryByCharacter(unsigned int currentShip, char c) { ASSERT(ships.at(currentShip) != NULL); *************** *** 488,492 **** c = toupper(c); ! int i; for (i=currentShip+1; i<ships.size(); i++) { MyFleetShipType temp = ships.at(i); --- 488,492 ---- c = toupper(c); ! unsigned int i; for (i=currentShip+1; i<ships.size(); i++) { MyFleetShipType temp = ships.at(i); Index: mfleet.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mfleet.h 3 Feb 2004 06:45:48 -0000 1.16 --- mfleet.h 29 Feb 2004 23:22:17 -0000 1.17 *************** *** 245,249 **** relative to currentShip. */ ! int getNextFleetEntryByCharacter(int currentShip, char c); --- 245,249 ---- relative to currentShip. */ ! int getNextFleetEntryByCharacter(unsigned int currentShip, char c); Index: mshppan.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshppan.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mshppan.cpp 29 Jan 2004 21:20:29 -0000 1.17 --- mshppan.cpp 29 Feb 2004 23:22:17 -0000 1.18 *************** *** 324,328 **** int dy; dy = (ymax - ymin); ! ymin += dy * (max - value) / double(max); for ( i = ymin; i < ymax; ++i ) --- 324,328 ---- int dy; dy = (ymax - ymin); ! ymin += iround(dy * (max - value) / double(max)); for ( i = ymin; i < ymax; ++i ) *************** *** 330,334 **** int _x, _y; int k; ! k = value * double(ymax - i) / double(ymax - ymin); _x = xl + 1; --- 330,334 ---- int _x, _y; int k; ! k = iround(value * double(ymax - i) / double(ymax - ymin)); _x = xl + 1; |
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source/games Modified Files: gflmelee.cpp gluagame.cpp gmissions.cpp gmissions_objects.cpp gtrug.cpp vgGenSys.cpp Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: gflmelee.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gflmelee.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** gflmelee.cpp 28 Feb 2004 15:18:24 -0000 1.20 --- gflmelee.cpp 29 Feb 2004 23:22:17 -0000 1.21 *************** *** 47,51 **** #include "../melee/mlog.h" ! #include "twgui.h" --- 47,51 ---- #include "../melee/mlog.h" ! #include "twgui/twgui.h" Index: gluagame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gluagame.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gluagame.cpp 22 Feb 2004 10:49:38 -0000 1.9 --- gluagame.cpp 29 Feb 2004 23:22:17 -0000 1.10 *************** *** 69,73 **** Vector2 v(x, y); ! Planet * planet = create_planet(v); } lua_ret // end the function, in a way that lua likes --- 69,74 ---- Vector2 v(x, y); ! //Planet * planet = create_planet(v); ! create_planet(v); } lua_ret // end the function, in a way that lua likes Index: gmissions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gmissions.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gmissions.cpp 28 Feb 2004 15:18:24 -0000 1.24 --- gmissions.cpp 29 Feb 2004 23:22:17 -0000 1.25 *************** *** 21,25 **** #include "gamehierarchy.h" ! #include "twgui.h" #include "gflmelee.h" --- 21,25 ---- #include "gamehierarchy.h" ! #include "twgui/twgui.h" #include "gflmelee.h" *************** *** 1141,1146 **** s->batt *= pbatt / 100.0; s->batt_max *= pbatt / 100.0; ! s->recharge_amount *= prechargeamount / 100.0; ! s->recharge_rate /= prechargerate / 100.0; } --- 1141,1146 ---- s->batt *= pbatt / 100.0; s->batt_max *= pbatt / 100.0; ! s->recharge_amount = iround(s->recharge_amount * prechargeamount / 100); ! s->recharge_rate = iround(s->recharge_rate * 100/ prechargerate); } *************** *** 1192,1196 **** L = text_length(usefont, text)+6*text_length(usefont, " "); h0 = text_height(usefont); ! H = 1.5 * h0; b = create_bitmap_ex(32, L, H); --- 1192,1196 ---- L = text_length(usefont, text)+6*text_length(usefont, " "); h0 = text_height(usefont); ! H = iround(1.5 * h0); b = create_bitmap_ex(32, L, H); *************** *** 1201,1205 **** int ix, iy; ix = (screen->w - L) / 2; ! iy = 0.01 * screen->h; add( new MissionMessageBox(b, ix, iy, timesec ) ); --- 1201,1205 ---- int ix, iy; ix = (screen->w - L) / 2; ! iy = iround(0.01 * screen->h); add( new MissionMessageBox(b, ix, iy, timesec ) ); Index: gmissions_objects.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gmissions_objects.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gmissions_objects.cpp 28 Feb 2004 15:18:24 -0000 1.9 --- gmissions_objects.cpp 29 Feb 2004 23:22:17 -0000 1.10 *************** *** 19,23 **** ! #include "twgui.h" #include "gmissions_objects.h" --- 19,23 ---- ! #include "twgui/twgui.h" #include "gmissions_objects.h" Index: gtrug.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gtrug.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gtrug.cpp 21 Feb 2004 00:29:17 -0000 1.9 --- gtrug.cpp 29 Feb 2004 23:22:17 -0000 1.10 *************** *** 164,168 **** TrugGame::~TrugGame() { ! int i; for (i = 0; i < players.size(); i += 1) delete players[i]; if (gui) delete gui; --- 164,168 ---- TrugGame::~TrugGame() { ! unsigned int i; for (i = 0; i < players.size(); i += 1) delete players[i]; if (gui) delete gui; Index: vgGenSys.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/vgGenSys.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** vgGenSys.cpp 28 Feb 2004 15:18:24 -0000 1.10 --- vgGenSys.cpp 29 Feb 2004 23:22:17 -0000 1.11 *************** *** 10,14 **** #include "../melee/mview.h" ! #include "twgui.h" #include "../melee/mlog.h" --- 10,14 ---- #include "../melee/mview.h" ! #include "twgui/twgui.h" #include "../melee/mlog.h" |
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source/gamex Modified Files: gamedialogue.h gamegeneral.cpp gamehyper.cpp gameplanetscan.cpp gameplanetview.cpp gamesolarview.cpp gamestarmap.cpp Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: gamedialogue.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedialogue.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gamedialogue.h 28 Feb 2004 15:18:24 -0000 1.12 --- gamedialogue.h 29 Feb 2004 23:22:17 -0000 1.13 *************** *** 9,13 **** #include "edit/disk_stuff.h" ! #include "twgui.h" #include "../other/luaport.h" --- 9,13 ---- #include "edit/disk_stuff.h" ! #include "twgui/twgui.h" #include "../other/luaport.h" Index: gamegeneral.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gamegeneral.cpp 15 Feb 2004 13:08:56 -0000 1.13 --- gamegeneral.cpp 29 Feb 2004 23:22:17 -0000 1.14 *************** *** 200,206 **** { if (vidmem) ! tmpbmp = create_video_bitmap(bmplist[i]->w * scale, bmplist[i]->h * scale); else ! tmpbmp = create_bitmap_ex(bpp, bmplist[i]->w * scale, bmplist[i]->h * scale); stretch_blit(bmplist[i], tmpbmp, 0, 0, bmplist[i]->w, bmplist[i]->h, --- 200,206 ---- { if (vidmem) ! tmpbmp = create_video_bitmap(iround(bmplist[i]->w * scale), iround(bmplist[i]->h * scale)); else ! tmpbmp = create_bitmap_ex(bpp, iround(bmplist[i]->w * scale), iround(bmplist[i]->h * scale)); stretch_blit(bmplist[i], tmpbmp, 0, 0, bmplist[i]->w, bmplist[i]->h, Index: gamehyper.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamehyper.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gamehyper.cpp 15 Feb 2004 13:08:56 -0000 1.11 --- gamehyper.cpp 29 Feb 2004 23:22:17 -0000 1.12 *************** *** 335,339 **** bpp = bitmap_color_depth(bmp); //bmpcache[sprite_index] = create_bitmap_ex(bpp, s.x, s.y); ! bmpcache[sprite_index] = create_video_bitmap(s.x, s.y); // for faster drawing. stretch_blit(bmp, bmpcache[sprite_index], --- 335,339 ---- bpp = bitmap_color_depth(bmp); //bmpcache[sprite_index] = create_bitmap_ex(bpp, s.x, s.y); ! bmpcache[sprite_index] = create_video_bitmap(iround(s.x), iround(s.y)); // for faster drawing. stretch_blit(bmp, bmpcache[sprite_index], *************** *** 347,351 **** masked_blit(bmpcache[sprite_index], f->surface, ! 0, 0, p.x, p.y, bmpcache[sprite_index]->w, bmpcache[sprite_index]->h); } --- 347,351 ---- masked_blit(bmpcache[sprite_index], f->surface, ! 0, 0, iround(p.x), iround(p.y), bmpcache[sprite_index]->w, bmpcache[sprite_index]->h); } *************** *** 561,565 **** double sprscale; ! int abpp = bitmap_color_depth(view->frame->window->surface); hyperexpl = new HyperspaceExplosions(&wininfo); --- 561,565 ---- double sprscale; ! //int abpp = bitmap_color_depth(view->frame->window->surface); hyperexpl = new HyperspaceExplosions(&wininfo); *************** *** 852,860 **** int xp; ! xp = i*W - P.x; ! xp *= submap->w / (2*L); ! xp += 0.5 * submap->w; line ( submap, xp, 0, xp, submap->h-1, makecol(0,128,0)); --- 852,860 ---- int xp; ! xp = iround(i*W - P.x); ! xp = xp * iround(submap->w / (2*L)); ! xp += iround(0.5 * submap->w); line ( submap, xp, 0, xp, submap->h-1, makecol(0,128,0)); *************** *** 865,873 **** int yp; ! yp = i*W - P.y; ! yp *= submap->w / (2*L); ! yp += 0.5 * submap->w; line ( submap, 0, yp, submap->w-1, yp, makecol(0,128,0)); --- 865,873 ---- int yp; ! yp = iround(i*W - P.y); ! yp = yp* iround(submap->w / (2*L)); ! yp += iround(0.5 * submap->w); line ( submap, 0, yp, submap->w-1, yp, makecol(0,128,0)); *************** *** 899,903 **** bmp = star_radarspr[k]->get_bitmap(0); ! masked_blit(bmp, submap, 0, 0, D.x, D.y, bmp->w, bmp->h); } } --- 899,903 ---- bmp = star_radarspr[k]->get_bitmap(0); ! masked_blit(bmp, submap, 0, 0, iround(D.x), iround(D.y), bmp->w, bmp->h); } } *************** *** 926,930 **** bmp = radarenemyspr->get_bitmap(0); ! masked_blit(bmp, submap, 0, 0, D.x, D.y, bmp->w, bmp->h); } } --- 926,930 ---- bmp = radarenemyspr->get_bitmap(0); ! masked_blit(bmp, submap, 0, 0, iround(D.x), iround(D.y), bmp->w, bmp->h); } } *************** *** 936,940 **** P = 0.5 * bitmap_size(submap) - 0.5 * bitmap_size(bmp); ! masked_blit(bmp, submap, 0, 0, P.x, P.y, bmp->w, bmp->h); // plot the radar submap onto the (temp) screen surface. --- 936,940 ---- P = 0.5 * bitmap_size(submap) - 0.5 * bitmap_size(bmp); ! masked_blit(bmp, submap, 0, 0, iround(P.x), iround(P.y), bmp->w, bmp->h); // plot the radar submap onto the (temp) screen surface. *************** *** 1012,1017 **** // the number of cells on the map ! mapNx[i] = map_size.x / W[i]; ! mapNy[i] = map_size.y / W[i]; // the number of those cells that you can actually see. --- 1012,1017 ---- // the number of cells on the map ! mapNx[i] = iround(map_size.x / W[i]); ! mapNy[i] = iround(map_size.y / W[i]); // the number of those cells that you can actually see. *************** *** 1019,1024 **** sc = 0.35; // for testing, to see if the correct square is made sc = 0.5; ! winNx[i] = sc * wininfo->maparea.x / (W[i] * level[i]); ! winNy[i] = sc * wininfo->maparea.y / (W[i] * level[i]); ixpos[i] = int(wininfo->mapcenter.x / W[i]); --- 1019,1024 ---- sc = 0.35; // for testing, to see if the correct square is made sc = 0.5; ! winNx[i] = iround(sc * wininfo->maparea.x / (W[i] * level[i])); ! winNy[i] = iround(sc * wininfo->maparea.y / (W[i] * level[i])); ixpos[i] = int(wininfo->mapcenter.x / W[i]); Index: gameplanetscan.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetscan.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gameplanetscan.cpp 28 Feb 2004 15:18:24 -0000 1.11 --- gameplanetscan.cpp 29 Feb 2004 23:22:17 -0000 1.12 *************** *** 47,51 **** AnimatedObject(SpaceLocation *creator, Vector2 opos, ! SpaceSprite *osprite, double frame_length); virtual void animate(Frame *f); --- 47,51 ---- AnimatedObject(SpaceLocation *creator, Vector2 opos, ! SpaceSprite *osprite, int frame_length); virtual void animate(Frame *f); *************** *** 72,76 **** AnimatedObject::AnimatedObject(SpaceLocation *creator, Vector2 opos, ! SpaceSprite *osprite, double frame_length) : Animation(creator, opos, --- 72,76 ---- AnimatedObject::AnimatedObject(SpaceLocation *creator, Vector2 opos, ! SpaceSprite *osprite, int frame_length) : Animation(creator, opos, *************** *** 101,105 **** 0, 0, //pos.x - 0.5*bmp->w - space_center.x, pos.y - 0.5*bmp->h - space_center.y, ! P.x, P.y, bmp->w, bmp->h); } --- 101,105 ---- 0, 0, //pos.x - 0.5*bmp->w - space_center.x, pos.y - 0.5*bmp->h - space_center.y, ! iround(P.x), iround(P.y), bmp->w, bmp->h); } *************** *** 127,131 **** void Spawner::spawnit() { ! physics->add(new AnimatedObject(this, pos, spawnsprite, framelen)); } --- 127,131 ---- void Spawner::spawnit() { ! physics->add(new AnimatedObject(this, pos, spawnsprite, iround(framelen))); } *************** *** 783,788 **** //MapObj::animate(frame2); double s = bmpframe2->w / 400.0; ! int x = pos.x * s / scalesurface - 0.5*sprite->get_bitmap(0)->w; ! int y = pos.y * s / scalesurface - 0.5*sprite->get_bitmap(0)->h; sprite->draw(x, y, sprite_index, bmpframe2); } --- 783,788 ---- //MapObj::animate(frame2); double s = bmpframe2->w / 400.0; ! int x = iround(pos.x * s / scalesurface - 0.5*sprite->get_bitmap(0)->w); ! int y = iround(pos.y * s / scalesurface - 0.5*sprite->get_bitmap(0)->h); sprite->draw(x, y, sprite_index, bmpframe2); } *************** *** 1163,1168 **** h = iround((map_bmp->h * scalesurface) * space_zoom); ! x = -space_center.x * space_zoom + 0.5 * space_view_size.x; ! y = -space_center.y * space_zoom + 0.5 * space_view_size.y; stretch_blit(map_bmp, maparea->backgr, --- 1163,1168 ---- h = iround((map_bmp->h * scalesurface) * space_zoom); ! x = iround(-space_center.x * space_zoom + 0.5 * space_view_size.x); ! y = iround(-space_center.y * space_zoom + 0.5 * space_view_size.y); stretch_blit(map_bmp, maparea->backgr, *************** *** 1290,1294 **** char txt[512]; ! N = random(iround(nmin), iround(nmax)); for ( i = 0; i < N; ++i ) --- 1290,1294 ---- char txt[512]; ! N = iround(random(nmin, nmax)); for ( i = 0; i < N; ++i ) *************** *** 1371,1376 **** double a = random(0.1 * PI2, 0.2 * PI2); ! double da = 1.0; ! double ra = 1000.0; double v = 0.2; --- 1371,1376 ---- double a = random(0.1 * PI2, 0.2 * PI2); ! //double da = 1.0; ! //double ra = 1000.0; double v = 0.2; *************** *** 1387,1392 **** double a = random(PI2); ! double da = 1.0; ! double ra = 1000.0; double v = 0.1; --- 1387,1392 ---- double a = random(PI2); ! //double da = 1.0; ! //double ra = 1000.0; double v = 0.1; *************** *** 1403,1408 **** double a = random(PI2); ! double da = 1.0; ! double ra = 1000.0; double v = 0; --- 1403,1408 ---- double a = random(PI2); ! //double da = 1.0; ! //double ra = 1000.0; double v = 0; *************** *** 1418,1423 **** double a = random(PI2); ! double da = 1.0; ! double ra = 1000.0; double v = 0.2; --- 1418,1423 ---- double a = random(PI2); ! //double da = 1.0; ! //double ra = 1000.0; double v = 0.2; *************** *** 1433,1438 **** double a = random(PI2); ! double da = 1.0; ! double ra = 1000.0; double v = 0.0; --- 1433,1438 ---- double a = random(PI2); ! //double da = 1.0; ! //double ra = 1000.0; double v = 0.0; Index: gameplanetview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetview.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gameplanetview.cpp 28 Feb 2004 15:18:24 -0000 1.16 --- gameplanetview.cpp 29 Feb 2004 23:22:17 -0000 1.17 *************** *** 27,31 **** #include "stuff/backgr_stars.h" ! #include "twgui.h" #include "general/sprites.h" --- 27,31 ---- #include "stuff/backgr_stars.h" ! #include "twgui/twgui.h" #include "general/sprites.h" Index: gamesolarview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamesolarview.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gamesolarview.cpp 28 Feb 2004 15:18:24 -0000 1.14 --- gamesolarview.cpp 29 Feb 2004 23:22:17 -0000 1.15 *************** *** 19,23 **** #include "stuff/backgr_stars.h" ! #include "twgui.h" #include "general/sprites.h" --- 19,23 ---- #include "stuff/backgr_stars.h" ! #include "twgui/twgui.h" #include "general/sprites.h" Index: gamestarmap.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamestarmap.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gamestarmap.cpp 29 Jan 2004 21:20:28 -0000 1.11 --- gamestarmap.cpp 29 Feb 2004 23:22:17 -0000 1.12 *************** *** 256,260 **** GameBare::calculate(); ! ptr->newpos(mouse_x - maparea->pos.x, mouse_y - maparea->pos.y); if ( mouseper->update() && (mouse_b & 2) ) --- 256,260 ---- GameBare::calculate(); ! ptr->newpos(mouse_x - iround(maparea->pos.x), mouse_y - iround(maparea->pos.y)); if ( mouseper->update() && (mouse_b & 2) ) *************** *** 316,320 **** P2 = corner2( Vector2(100000, iy*10000), 0); ! hline(frame->surface, P1.x, P1.y, P2.x, c); } --- 316,320 ---- P2 = corner2( Vector2(100000, iy*10000), 0); ! hline(frame->surface, iround(P1.x), iround(P1.y), iround(P2.x), c); } *************** *** 324,328 **** P2 = corner2( Vector2(ix*10000, 100000), 0); ! vline(frame->surface, P1.x, P1.y, P2.y, c); } --- 324,328 ---- P2 = corner2( Vector2(ix*10000, 100000), 0); ! vline(frame->surface, iround(P1.x), iround(P1.y), iround(P2.y), c); } |
From: <yu...@us...> - 2004-02-29 23:33:21
|
Update of /cvsroot/timewarp/source/gamex/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676/source/gamex/edit Modified Files: disk_stuff.h edit_dialogue.h Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: disk_stuff.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/disk_stuff.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** disk_stuff.h 28 Feb 2004 15:18:24 -0000 1.6 --- disk_stuff.h 29 Feb 2004 23:22:16 -0000 1.7 *************** *** 3,7 **** #define __GAMEX_DISK_STUFF__ ! #include "twgui.h" // part of this, should go into the gamedata section ?! --- 3,7 ---- #define __GAMEX_DISK_STUFF__ ! #include "twgui/twgui.h" // part of this, should go into the gamedata section ?! Index: edit_dialogue.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/edit_dialogue.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** edit_dialogue.h 28 Feb 2004 15:18:24 -0000 1.11 --- edit_dialogue.h 29 Feb 2004 23:22:16 -0000 1.12 *************** *** 8,12 **** #include "disk_stuff.h" ! #include "twgui.h" const int Ntext = 2048; --- 8,12 ---- #include "disk_stuff.h" ! #include "twgui/twgui.h" const int Ntext = 2048; |
From: <yu...@us...> - 2004-02-29 23:33:21
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19676 Modified Files: fleets.ini makefile Log Message: Fixing Linux compile problems Removing nasty warnings (almoust all now) Index: makefile =================================================================== RCS file: /cvsroot/timewarp/makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** makefile 19 Feb 2004 01:12:19 -0000 1.10 --- makefile 29 Feb 2004 23:22:17 -0000 1.11 *************** *** 40,44 **** ifdef debug ! CFLAGS += -g -DDEBUGMODE OBJDIR := ${addsuffix -debug,$(OBJDIR)} NAME := ${addsuffix -debug,$(NAME)} --- 40,44 ---- ifdef debug ! CFLAGS += -pg -g -DDEBUGMODE OBJDIR := ${addsuffix -debug,$(OBJDIR)} NAME := ${addsuffix -debug,$(NAME)} *************** *** 62,69 **** INCLUDES = ${shell allegro-config --cflags} CFLAGS += $(INCLUDES) ! LIBS += ${shell allegro-config --libs} -L/usr/X11R6/lib -lfreetype endif ! CFLAGS += -I./source -I./source/gamex -I/usr/X11R6/include/freetype2 #CFLAGS += ${addprefix -I./, $(VPATH)} --- 62,69 ---- INCLUDES = ${shell allegro-config --cflags} CFLAGS += $(INCLUDES) ! LIBS += ${shell allegro-config --libs} ${shell freetype-config --libs} endif ! CFLAGS += -I./source ${shell freetype-config --cflags} #CFLAGS += ${addprefix -I./, $(VPATH)} |