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
|
From: <yu...@us...> - 2003-11-13 11:22:09
|
Update of /cvsroot/timewarp/docs In directory sc8-pr-cvs1:/tmp/cvs-serv23176/docs Modified Files: installing.html Log Message: Added windows-mingw install, updated install doc for Linux Index: installing.html =================================================================== RCS file: /cvsroot/timewarp/docs/installing.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** installing.html 16 Aug 2003 21:43:27 -0000 1.1 --- installing.html 13 Nov 2003 11:22:04 -0000 1.2 *************** *** 51,55 **** <ul> <li><a href="#windows-msvc">Windows - MSVC</a> ! <li><a href="windows-djgpp">Windows/DOS - djgpp</a> <li><a href="#linux">Linux</a> <li><a href="#beos">BeOS</a> --- 51,56 ---- <ul> <li><a href="#windows-msvc">Windows - MSVC</a> ! <li><a href="#windows-mingw">Windows - mingw32</a> ! <li><a href="#dos-djgpp">DOS - djgpp</a> <li><a href="#linux">Linux</a> <li><a href="#beos">BeOS</a> *************** *** 63,68 **** </pre> ! <a name="windows-djgpp"><h3>Windows - DJGPP</h3></a> <pre> Step-By-Step instructions for building Star Control: TimeWarp with DJGPP --- 64,96 ---- </pre> + <a name="windows-mingw"><h3>Windows - MinGW</h3></a> + <pre> + TimeWarp can be built with Minimalist GNU for Win32. ! Download MingWG: ! http://www.mingw.org/ ! Install it. ! ! Download ALLEGRO: ! http://http://www.talula.demon.co.uk/allegro/ ! Install it. ! ! Download this ALLEGRO extension: ! http://www.geocities.com/jeffery_guan/jgmod/jgmod.zip ! (optional, but necessary for some features) ! (homepage is http://www.geocities.com/jeffery_guan/ ) ! Install it. ! ! If you have installed jgmod then just type: ! $ make win32=1 ! ! If you don't have jgmod type: ! $ make win32=1 NO_JGMOD=1 ! ! That's it! Run timewarp and have fun! ! ! </pre> ! ! <a name="dos-djgpp"><h3>DOS - DJGPP</h3></a> <pre> Step-By-Step instructions for building Star Control: TimeWarp with DJGPP *************** *** 289,299 **** 3. Installing TW ! It looks like you already got and extracted the TW zip. So let's set the ! right permissions for the executable files (they got lost because zips ! don't support file permissions): ! $ chmod a+x config.status configure install-sh mkinstalldirs update.sh ! Now let's compile TW: ! $ ./configure && make That's it! Run ./timewarp and have fun! --- 317,327 ---- 3. Installing TW ! It looks like you already got and extracted the TW zip. ! If you have installed jgmod then just type: ! $ make ! ! If you don't have jgmod type: ! $ make NO_JGMOD=1 That's it! Run ./timewarp and have fun! |
From: <you...@us...> - 2003-11-13 01:03:10
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv20493/source Modified Files: scp.cpp Log Message: in fleet editor, made changing the checkboxes causes the available ships to sort Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** scp.cpp 13 Nov 2003 00:41:05 -0000 1.22 --- scp.cpp 13 Nov 2003 01:03:07 -0000 1.23 *************** *** 1250,1254 **** char maxFleetCostString[80] = ""; bool availableFleetDirty = true; - static Fleet::SortingMethod sortMethod1 = (Fleet::SortingMethod) Fleet::SORTING_METHOD_DEFAULT, --- 1250,1253 ---- *************** *** 1276,1285 **** Fleet *old_reference_fleet = reference_fleet; - //Fleet new_ref_fleet(*reference_fleet); // make a copy - //reference_fleet = &new_ref_fleet; // overload it. Now you can mess with it as you like - - - //fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags |= D_SELECTED; // don't override the D_EXIT - do { sprintf(title_str, fleet->getTitle()); --- 1275,1278 ---- *************** *** 1344,1349 **** } } fleetDialog[FLEET_DIALOG_AVAILABLE_SHIPS_LIST].flags |= D_DIRTY; - }/**/ --- 1337,1342 ---- } } + reference_fleet->Sort( sortMethod1, sortAscending1 ); fleetDialog[FLEET_DIALOG_AVAILABLE_SHIPS_LIST].flags |= D_DIRTY; }/**/ *************** *** 1360,1395 **** case FLEET_DIALOG_TW_EXP_TOGGLE: availableFleetDirty = true; - /*{ - - int i; - if (fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags & D_SELECTED) - { - // add the ships to the list - i = 0; - while (i < old_reference_fleet->getSize()) - { - ShipType *st = old_reference_fleet->getShipType(i); - if (st->origin == SHIP_ORIGIN_SC1) - reference_fleet->addShipType(st); - - ++i; - } - - } else { - - // remove the ships from the list: - i = 0; - while (i < reference_fleet->getSize()) - { - ShipType *st = reference_fleet->getShipType(i); - if (st->origin == SHIP_ORIGIN_SC1) - reference_fleet->clear_slot(i); - else - ++i; - } - } - - }*/ break; case FLEET_DIALOG_SORTBY_TEXT1: break; case FLEET_DIALOG_SORTBY_BUTTON1: --- 1353,1358 ---- case FLEET_DIALOG_TW_EXP_TOGGLE: availableFleetDirty = true; break; + case FLEET_DIALOG_SORTBY_TEXT1: break; case FLEET_DIALOG_SORTBY_BUTTON1: |
From: <you...@us...> - 2003-11-13 00:41:09
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv17197/source Modified Files: scp.cpp Log Message: in fleet editor, made the remainder of checkboxes update the available ships Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** scp.cpp 12 Nov 2003 22:55:08 -0000 1.21 --- scp.cpp 13 Nov 2003 00:41:05 -0000 1.22 *************** *** 1194,1210 **** { d_textbox_proc, 10, 10, 240, 20, 255, 0, 0, 0, 0, 0, (void *)"Available Ships", NULL, NULL },//FLEET_DIALOG_AVAILABLE_SHIPS_TEXT TODO specify font here in d2 I think { d_textbox_proc, 10, 35, 128, 17, 255, 0, 0, 0, 0, 0, (void *)"Ship Catagories:", NULL, NULL },//FLEET_DIALOG_SHIP_CATAGORIES_TEXT { d_check_proc_fleeteditor, ! 30, 52, 128, 14, 255, 0, 0,D_EXIT, 0, 0, (void *)"SC1", NULL, NULL },//FLEET_DIALOG_SC1_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 66, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC2", NULL, NULL },//FLEET_DIALOG_SC2_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 79, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC3", NULL, NULL },//FLEET_DIALOG_SC3_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 93, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"TW (Official)", NULL, NULL },//FLEET_DIALOG_TW_OFFICIAL_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 107, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"TW (Experimental)", NULL, NULL },//FLEET_DIALOG_TW_EXP_TOGGLE { d_textbox_proc, 10, 121, 64, 17, 255, 0, 0, 0, 0, 0, (void *)"Sort By:", NULL, NULL },//FLEET_DIALOG_SORTBY_TEXT1 ! { d_button_proc, 69, 121, 128, 17, 255, 0, 0,D_EXIT, 0, 0, (void *)"Cost TODO fix me", NULL, NULL },//FLEET_DIALOG_SORTBY_BUTTON1 { d_button_proc, 197, 121, 16, 17, 255, 0, 0,D_EXIT, 0, 0, (void *)"^", NULL, NULL },//FLEET_DIALOG_SORTBY_ASCENDING1 --- 1194,1211 ---- { d_textbox_proc, 10, 10, 240, 20, 255, 0, 0, 0, 0, 0, (void *)"Available Ships", NULL, NULL },//FLEET_DIALOG_AVAILABLE_SHIPS_TEXT TODO specify font here in d2 I think { d_textbox_proc, 10, 35, 128, 17, 255, 0, 0, 0, 0, 0, (void *)"Ship Catagories:", NULL, NULL },//FLEET_DIALOG_SHIP_CATAGORIES_TEXT + { d_check_proc_fleeteditor, ! 30, 52, 128, 14, 255, 0, 0,D_EXIT | D_SELECTED, 0, 0, (void *)"SC1", NULL, NULL },//FLEET_DIALOG_SC1_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 66, 128, 14, 255, 0, 0,D_EXIT | D_SELECTED, 0, 0, (void *)"SC2", NULL, NULL },//FLEET_DIALOG_SC2_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 79, 128, 14, 255, 0, 0,D_EXIT | D_SELECTED, 0, 0, (void *)"SC3", NULL, NULL },//FLEET_DIALOG_SC3_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 93, 128, 14, 255, 0, 0,D_EXIT | D_SELECTED, 0, 0, (void *)"TW (Official)", NULL, NULL },//FLEET_DIALOG_TW_OFFICIAL_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 107, 128, 14, 255, 0, 0,D_EXIT, 0, 0, (void *)"TW (Experimental)", NULL, NULL },//FLEET_DIALOG_TW_EXP_TOGGLE { d_textbox_proc, 10, 121, 64, 17, 255, 0, 0, 0, 0, 0, (void *)"Sort By:", NULL, NULL },//FLEET_DIALOG_SORTBY_TEXT1 ! { d_button_proc, 69, 121, 128, 17, 255, 0, 0,D_EXIT, 0, 0, (void *)"Cost", NULL, NULL },//FLEET_DIALOG_SORTBY_BUTTON1 { d_button_proc, 197, 121, 16, 17, 255, 0, 0,D_EXIT, 0, 0, (void *)"^", NULL, NULL },//FLEET_DIALOG_SORTBY_ASCENDING1 *************** *** 1241,1244 **** --- 1242,1246 ---- }; + // FLEET - dialog function void edit_fleet(int player) {STACKTRACE *************** *** 1247,1250 **** --- 1249,1253 ---- char fleetCostString[80] = ""; char maxFleetCostString[80] = ""; + bool availableFleetDirty = true; *************** *** 1271,1280 **** // the reference_fleet is used in the list in a hardcoded way, so over"load" it ! Fleet *old_reference_fleet = reference_fleet; ! Fleet new_ref_fleet(*reference_fleet); // make a copy ! reference_fleet = &new_ref_fleet; // overload it. Now you can mess with it as you like ! fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags |= D_SELECTED; // don't override the D_EXIT do { --- 1274,1284 ---- // the reference_fleet is used in the list in a hardcoded way, so over"load" it ! Fleet *old_reference_fleet = reference_fleet; ! //Fleet new_ref_fleet(*reference_fleet); // make a copy ! //reference_fleet = &new_ref_fleet; // overload it. Now you can mess with it as you like ! ! //fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags |= D_SELECTED; // don't override the D_EXIT do { *************** *** 1302,1306 **** fleetDialog[FLEET_DIALOG_SORTBY_ASCENDING2].dp = (void *)"^"; else ! fleetDialog[FLEET_DIALOG_SORTBY_ASCENDING2].dp = (void *)"v"; fleetRet = tw_do_dialog(NULL, fleetDialog, -1); --- 1306,1350 ---- fleetDialog[FLEET_DIALOG_SORTBY_ASCENDING2].dp = (void *)"^"; else ! fleetDialog[FLEET_DIALOG_SORTBY_ASCENDING2].dp = (void *)"v"; ! ! //if the user has selected a different choice of available ships, regenerate the ! //list of available ships ! if (availableFleetDirty) { ! availableFleetDirty = false; ! ! //clear out the fleet ! reference_fleet->reset(); ! ! for (int c=0; c<num_shiptypes; c++) { ! switch (shiptypes[c].origin) { ! case SHIP_ORIGIN_SC1: ! if (fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags & D_SELECTED) ! reference_fleet->addShipType(&shiptypes[c]); ! break; ! ! case SHIP_ORIGIN_SC2: ! if (fleetDialog[FLEET_DIALOG_SC2_TOGGLE].flags & D_SELECTED) ! reference_fleet->addShipType(&shiptypes[c]); ! break; ! ! case SHIP_ORIGIN_SC3: ! if (fleetDialog[FLEET_DIALOG_SC3_TOGGLE].flags & D_SELECTED) ! reference_fleet->addShipType(&shiptypes[c]); ! break; ! ! case SHIP_ORIGIN_TW_ALPHA: ! if (fleetDialog[FLEET_DIALOG_TW_OFFICIAL_TOGGLE].flags & D_SELECTED) ! reference_fleet->addShipType(&shiptypes[c]); ! break; ! ! case SHIP_ORIGIN_TW_BETA: ! if (fleetDialog[FLEET_DIALOG_TW_EXP_TOGGLE].flags & D_SELECTED) ! reference_fleet->addShipType(&shiptypes[c]); ! break; ! } ! } ! fleetDialog[FLEET_DIALOG_AVAILABLE_SHIPS_LIST].flags |= D_DIRTY; ! ! }/**/ fleetRet = tw_do_dialog(NULL, fleetDialog, -1); *************** *** 1309,1314 **** case FLEET_DIALOG_AVAILABLE_SHIPS_TEXT: break; case FLEET_DIALOG_SHIP_CATAGORIES_TEXT: break; case FLEET_DIALOG_SC1_TOGGLE: ! { int i; --- 1353,1364 ---- case FLEET_DIALOG_AVAILABLE_SHIPS_TEXT: break; case FLEET_DIALOG_SHIP_CATAGORIES_TEXT: break; + case FLEET_DIALOG_SC1_TOGGLE: ! case FLEET_DIALOG_SC2_TOGGLE: ! case FLEET_DIALOG_SC3_TOGGLE: ! case FLEET_DIALOG_TW_OFFICIAL_TOGGLE: ! case FLEET_DIALOG_TW_EXP_TOGGLE: ! availableFleetDirty = true; ! /*{ int i; *************** *** 1340,1349 **** } ! } break; - case FLEET_DIALOG_SC2_TOGGLE: break; - case FLEET_DIALOG_SC3_TOGGLE: break; - case FLEET_DIALOG_TW_OFFICIAL_TOGGLE: break; - case FLEET_DIALOG_TW_EXP_TOGGLE: break; case FLEET_DIALOG_SORTBY_TEXT1: break; case FLEET_DIALOG_SORTBY_BUTTON1: --- 1390,1395 ---- } ! }*/ break; case FLEET_DIALOG_SORTBY_TEXT1: break; case FLEET_DIALOG_SORTBY_BUTTON1: |
From: <you...@us...> - 2003-11-13 00:41:09
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv17197/source/melee Modified Files: mship.cpp Log Message: in fleet editor, made the remainder of checkboxes update the available ships Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mship.cpp 12 Nov 2003 22:55:08 -0000 1.15 --- mship.cpp 13 Nov 2003 00:41:05 -0000 1.16 *************** *** 138,142 **** if (strcmp(origname, "SC3") == 0) ori = SHIP_ORIGIN_SC3; ! if (strcmp(origname, "TWa") == 0) // alpha ships ori = SHIP_ORIGIN_TW_ALPHA; if (strcmp(origname, "TWb") == 0) // beta ships --- 138,143 ---- if (strcmp(origname, "SC3") == 0) ori = SHIP_ORIGIN_SC3; ! if ( (strcmp(origname, "TWa") == 0) || // alpha ships ! (strcmp(origname, "TW") == 0) ) ori = SHIP_ORIGIN_TW_ALPHA; if (strcmp(origname, "TWb") == 0) // beta ships |
From: <you...@us...> - 2003-11-12 22:55:12
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv30235/source Modified Files: scp.cpp Log Message: made ship origin value symbollic constants, rather than hardcoded numbers Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** scp.cpp 12 Nov 2003 20:33:33 -0000 1.20 --- scp.cpp 12 Nov 2003 22:55:08 -0000 1.21 *************** *** 1320,1324 **** { ShipType *st = old_reference_fleet->getShipType(i); ! if (st->origin == 1) reference_fleet->addShipType(st); --- 1320,1324 ---- { ShipType *st = old_reference_fleet->getShipType(i); ! if (st->origin == SHIP_ORIGIN_SC1) reference_fleet->addShipType(st); *************** *** 1333,1337 **** { ShipType *st = reference_fleet->getShipType(i); ! if (st->origin == 1) reference_fleet->clear_slot(i); else --- 1333,1337 ---- { ShipType *st = reference_fleet->getShipType(i); ! if (st->origin == SHIP_ORIGIN_SC1) reference_fleet->clear_slot(i); else |
From: <you...@us...> - 2003-11-12 22:55:12
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv30235/source/melee Modified Files: mship.cpp mship.h Log Message: made ship origin value symbollic constants, rather than hardcoded numbers Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mship.cpp 12 Nov 2003 20:33:33 -0000 1.14 --- mship.cpp 12 Nov 2003 22:55:08 -0000 1.15 *************** *** 130,145 **** int &ori = shiptypes[i].origin; ! ori = 0; const char *origname = get_config_string("Info", "Origin", NULL); if (strcmp(origname, "SC1") == 0) ! ori = 1; if (strcmp(origname, "SC2") == 0) ! ori = 2; if (strcmp(origname, "SC3") == 0) ! ori = 3; if (strcmp(origname, "TWa") == 0) // alpha ships ! ori = 4; if (strcmp(origname, "TWb") == 0) // beta ships ! ori = 5; --- 130,145 ---- int &ori = shiptypes[i].origin; ! ori = SHIP_ORIGIN_NONE; const char *origname = get_config_string("Info", "Origin", NULL); if (strcmp(origname, "SC1") == 0) ! ori = SHIP_ORIGIN_SC1; if (strcmp(origname, "SC2") == 0) ! ori = SHIP_ORIGIN_SC2; if (strcmp(origname, "SC3") == 0) ! ori = SHIP_ORIGIN_SC3; if (strcmp(origname, "TWa") == 0) // alpha ships ! ori = SHIP_ORIGIN_TW_ALPHA; if (strcmp(origname, "TWb") == 0) // beta ships ! ori = SHIP_ORIGIN_TW_BETA; Index: mship.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mship.h 16 Oct 2003 11:17:52 -0000 1.8 --- mship.h 12 Nov 2003 22:55:08 -0000 1.9 *************** *** 58,61 **** --- 58,72 ---- }; + /** the classification of where a given ship comes from */ + enum ShipOrigin { + SHIP_ORIGIN_NONE = 0, /**< None, no classification given*/ + SHIP_ORIGIN_SC1,/**< from Star Control 1*/ + SHIP_ORIGIN_SC2,/**< from Star Control 2*/ + SHIP_ORIGIN_SC3,/**< from Star Control 3*/ + SHIP_ORIGIN_TW_ALPHA,/**< Timewarp "Alpha"*/ + SHIP_ORIGIN_TW_BETA/**< Timewarp "Beta"*/ + }; + + class Ship : public SpaceObject { protected: |
From: <geo...@us...> - 2003-11-12 20:33:36
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv31619/melee Modified Files: mgame.cpp mship.cpp Log Message: added selection method for SC1 ships in fleet editor Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mgame.cpp 12 Nov 2003 03:21:10 -0000 1.21 --- mgame.cpp 12 Nov 2003 20:33:33 -0000 1.22 *************** *** 460,464 **** fprintf(f, "timewarp version = %s\n", tw_version()); ! fprintf(f, "lag_frames = %i", game->lag_frames); time_t t; --- 460,467 ---- fprintf(f, "timewarp version = %s\n", tw_version()); ! if (game) ! fprintf(f, "lag_frames = %i", game->lag_frames); ! else ! fprintf(f, "no game defined"); time_t t; Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mship.cpp 8 Nov 2003 11:19:29 -0000 1.13 --- mship.cpp 12 Nov 2003 20:33:33 -0000 1.14 *************** *** 129,132 **** --- 129,147 ---- shiptypes[i].id = strdup(tmp - 5); + int &ori = shiptypes[i].origin; + ori = 0; + const char *origname = get_config_string("Info", "Origin", NULL); + if (strcmp(origname, "SC1") == 0) + ori = 1; + if (strcmp(origname, "SC2") == 0) + ori = 2; + if (strcmp(origname, "SC3") == 0) + ori = 3; + if (strcmp(origname, "TWa") == 0) // alpha ships + ori = 4; + if (strcmp(origname, "TWb") == 0) // beta ships + ori = 5; + + const char *name = get_config_string("Info", "Name", NULL); if (!name) { |
From: <geo...@us...> - 2003-11-12 20:33:36
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv31619 Modified Files: melee.h scp.cpp Log Message: added selection method for SC1 ships in fleet editor Index: melee.h =================================================================== RCS file: /cvsroot/timewarp/source/melee.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** melee.h 25 Oct 2003 14:30:19 -0000 1.8 --- melee.h 12 Nov 2003 20:33:33 -0000 1.9 *************** *** 554,557 **** --- 554,558 ---- ShipClass *code; Ship *get_ship(Vector2 pos, double angle, unsigned int team); + int origin; }; extern ShipType *shiptypes; Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** scp.cpp 12 Nov 2003 17:35:30 -0000 1.19 --- scp.cpp 12 Nov 2003 20:33:33 -0000 1.20 *************** *** 1153,1156 **** --- 1153,1190 ---- + + int d_check_proc_fleeteditor(int msg, DIALOG *d, int c) + { + if (msg == MSG_CLICK) + { + + /* track the mouse until it is released */ + while (gui_mouse_b()) { + // state2 = ((gui_mouse_x() >= d->x) && (gui_mouse_y() >= d->y) && + // (gui_mouse_x() < d->x + d->w) && (gui_mouse_y() < d->y + d->h)); + + /* let other objects continue to animate */ + broadcast_dialog_message(MSG_IDLE, 0); + } + + /* should we close the dialog? */ + // imo the following mucho better/ simplere than that messy stuff in the allegro routine + // ... check d_button_proc in guiproc.c in the allegro sources... + + if (d->flags & D_SELECTED) + d->flags &= ~D_SELECTED; + else + d->flags |= D_SELECTED; + + if ( d->flags & D_EXIT) + return D_CLOSE; + + return D_O_K; + } + + return d_check_proc(msg, d, 0); + } + + // FLEET - dialog structure DIALOG fleetDialog[] = { *************** *** 1160,1168 **** { d_textbox_proc, 10, 10, 240, 20, 255, 0, 0, 0, 0, 0, (void *)"Available Ships", NULL, NULL },//FLEET_DIALOG_AVAILABLE_SHIPS_TEXT TODO specify font here in d2 I think { d_textbox_proc, 10, 35, 128, 17, 255, 0, 0, 0, 0, 0, (void *)"Ship Catagories:", NULL, NULL },//FLEET_DIALOG_SHIP_CATAGORIES_TEXT ! { d_check_proc, 30, 52, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC1", NULL, NULL },//FLEET_DIALOG_SC1_TOGGLE ! { d_check_proc, 30, 66, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC2", NULL, NULL },//FLEET_DIALOG_SC2_TOGGLE ! { d_check_proc, 30, 79, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC3", NULL, NULL },//FLEET_DIALOG_SC3_TOGGLE ! { d_check_proc, 30, 93, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"TW (Official)", NULL, NULL },//FLEET_DIALOG_TW_OFFICIAL_TOGGLE ! { d_check_proc, 30, 107, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"TW (Experimental)", NULL, NULL },//FLEET_DIALOG_TW_EXP_TOGGLE { d_textbox_proc, 10, 121, 64, 17, 255, 0, 0, 0, 0, 0, (void *)"Sort By:", NULL, NULL },//FLEET_DIALOG_SORTBY_TEXT1 --- 1194,1207 ---- { d_textbox_proc, 10, 10, 240, 20, 255, 0, 0, 0, 0, 0, (void *)"Available Ships", NULL, NULL },//FLEET_DIALOG_AVAILABLE_SHIPS_TEXT TODO specify font here in d2 I think { d_textbox_proc, 10, 35, 128, 17, 255, 0, 0, 0, 0, 0, (void *)"Ship Catagories:", NULL, NULL },//FLEET_DIALOG_SHIP_CATAGORIES_TEXT ! { d_check_proc_fleeteditor, ! 30, 52, 128, 14, 255, 0, 0,D_EXIT, 0, 0, (void *)"SC1", NULL, NULL },//FLEET_DIALOG_SC1_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 66, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC2", NULL, NULL },//FLEET_DIALOG_SC2_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 79, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"SC3", NULL, NULL },//FLEET_DIALOG_SC3_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 93, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"TW (Official)", NULL, NULL },//FLEET_DIALOG_TW_OFFICIAL_TOGGLE ! { d_check_proc_fleeteditor, ! 30, 107, 128, 14, 255, 0, 0, 0, 0, 0, (void *)"TW (Experimental)", NULL, NULL },//FLEET_DIALOG_TW_EXP_TOGGLE { d_textbox_proc, 10, 121, 64, 17, 255, 0, 0, 0, 0, 0, (void *)"Sort By:", NULL, NULL },//FLEET_DIALOG_SORTBY_TEXT1 *************** *** 1231,1234 **** --- 1270,1280 ---- fleetDialog[FLEET_DIALOG_POINT_LIMIT_BUTTON].dp = maxFleetCostString; + // the reference_fleet is used in the list in a hardcoded way, so over"load" it + Fleet *old_reference_fleet = reference_fleet; + + Fleet new_ref_fleet(*reference_fleet); // make a copy + reference_fleet = &new_ref_fleet; // overload it. Now you can mess with it as you like + + fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags |= D_SELECTED; // don't override the D_EXIT do { *************** *** 1263,1267 **** case FLEET_DIALOG_AVAILABLE_SHIPS_TEXT: break; case FLEET_DIALOG_SHIP_CATAGORIES_TEXT: break; ! case FLEET_DIALOG_SC1_TOGGLE: break; case FLEET_DIALOG_SC2_TOGGLE: break; case FLEET_DIALOG_SC3_TOGGLE: break; --- 1309,1345 ---- case FLEET_DIALOG_AVAILABLE_SHIPS_TEXT: break; case FLEET_DIALOG_SHIP_CATAGORIES_TEXT: break; ! case FLEET_DIALOG_SC1_TOGGLE: ! { ! ! int i; ! if (fleetDialog[FLEET_DIALOG_SC1_TOGGLE].flags & D_SELECTED) ! { ! // add the ships to the list ! i = 0; ! while (i < old_reference_fleet->getSize()) ! { ! ShipType *st = old_reference_fleet->getShipType(i); ! if (st->origin == 1) ! reference_fleet->addShipType(st); ! ! ++i; ! } ! ! } else { ! ! // remove the ships from the list: ! i = 0; ! while (i < reference_fleet->getSize()) ! { ! ShipType *st = reference_fleet->getShipType(i); ! if (st->origin == 1) ! reference_fleet->clear_slot(i); ! else ! ++i; ! } ! } ! ! } ! break; case FLEET_DIALOG_SC2_TOGGLE: break; case FLEET_DIALOG_SC3_TOGGLE: break; *************** *** 1397,1400 **** --- 1475,1480 ---- } while((fleetRet != FLEET_DIALOG_BACK_BUTTON) && (fleetRet != -1)); + + reference_fleet = old_reference_fleet; fleet->save("fleets.ini", tmp); |
From: <geo...@us...> - 2003-11-12 17:35:35
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv23410/melee Modified Files: mfleet.cpp mfleet.h mmain.cpp moptions.cpp Log Message: carriage return fix ? Index: mfleet.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mfleet.cpp 11 Nov 2003 07:31:51 -0000 1.12 --- mfleet.cpp 12 Nov 2003 17:35:30 -0000 1.13 *************** *** 44,55 **** "Coders", "Origin" ! }; ! char * Fleet::fleetCostName[] = { ! "Small",//FLEET_SIZE_SMALL = 100, ! "Medium",//FLEET_SIZE_MEDIUM = 250, ! "Large",//FLEET_SIZE_LARGE = 500, ! "Huge",//FLEET_SIZE_HUGE = 1000, ! "Massive"//FLEET_SIZE_MASSIVE = 10000 }; --- 44,55 ---- "Coders", "Origin" ! }; ! char * Fleet::fleetCostName[] = { ! "Small",//FLEET_SIZE_SMALL = 100, ! "Medium",//FLEET_SIZE_MEDIUM = 250, ! "Large",//FLEET_SIZE_LARGE = 500, ! "Huge",//FLEET_SIZE_HUGE = 1000, ! "Massive"//FLEET_SIZE_MASSIVE = 10000 }; *************** *** 74,78 **** Fleet::Fleet() {STACKTRACE ! cost = 0; maxFleetCost = (FleetCost)FLEET_COST_DEFAULT; memset(title, '\0', MAX_TITLE_LENGTH); --- 74,78 ---- Fleet::Fleet() {STACKTRACE ! cost = 0; maxFleetCost = (FleetCost)FLEET_COST_DEFAULT; memset(title, '\0', MAX_TITLE_LENGTH); *************** *** 189,193 **** char slot_str[8]; ! sort(ships.begin(), ships.end()); --- 189,193 ---- char slot_str[8]; ! sort(ships.begin(), ships.end()); *************** *** 202,206 **** set_config_int(section, "Size", count); ! set_config_string(section, "Title", title); set_config_int(section, "MaxFleetCost", getMaxCost()); } --- 202,206 ---- set_config_int(section, "Size", count); ! set_config_string(section, "Title", title); set_config_int(section, "MaxFleetCost", getMaxCost()); } *************** *** 216,221 **** if (filename) set_config_file(filename); int _fleet_size = get_config_int(section, "Size", 0); ! _fleet_title = get_config_string(section, "Title", ""); ! sprintf(title, _fleet_title); maxFleetCost = (FleetCost) get_config_int(section, "MaxFleetCost", FLEET_COST_DEFAULT); --- 216,221 ---- if (filename) set_config_file(filename); int _fleet_size = get_config_int(section, "Size", 0); ! _fleet_title = get_config_string(section, "Title", ""); ! sprintf(title, _fleet_title); maxFleetCost = (FleetCost) get_config_int(section, "MaxFleetCost", FLEET_COST_DEFAULT); Index: mfleet.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mfleet.h 11 Nov 2003 07:31:51 -0000 1.8 --- mfleet.h 12 Nov 2003 17:35:30 -0000 1.9 *************** *** 11,15 **** using namespace std; ! //TODO get rid of global variables used by this function; remove this function --- 11,15 ---- using namespace std; ! //TODO get rid of global variables used by this function; remove this function *************** *** 25,31 **** typedef vector<MyFleetShipType> MyFleetListType; ! static char * sortingMethodName[]; static char * fleetCostName[]; ! public: --- 25,31 ---- typedef vector<MyFleetShipType> MyFleetListType; ! static char * sortingMethodName[]; static char * fleetCostName[]; ! public: *************** *** 58,134 **** /** */ ! static char * getSortingMethodName(SortingMethod method) { ! ASSERT( ! ( (method > MAX_SORTING_METHODS) || (method < 0)) ); ! ! if ( (method > MAX_SORTING_METHODS) || (method < 0)) return ""; return sortingMethodName[method]; ! } ! ! enum FleetCost { ! FLEET_COST_SMALL = 100, ! FLEET_COST_MEDIUM = 250, ! FLEET_COST_LARGE = 500, ! FLEET_COST_HUGE = 1000, ! FLEET_COST_MASSIVE = 10000 ! }; ! ! enum { FLEET_COST_DEFAULT = FLEET_COST_LARGE }; ! enum { FIRST_FLEET_COST = FLEET_COST_SMALL }; ! enum { MAX_FLEET_COSTS = FLEET_COST_MASSIVE }; ! ! /** \brief cycles through each of the available preset maximum fleet sizes. ! \return the new fleet size */ ! FleetCost cycleMaxFleetCost() { ! ASSERT (!( (size != FLEET_COST_SMALL) && ! (size != FLEET_COST_MEDIUM) && ! (size != FLEET_COST_LARGE) && ! (size != FLEET_COST_HUGE) && ! (size != FLEET_COST_MASSIVE) )); ! ! switch (maxFleetCost) { ! case FLEET_COST_SMALL: ! maxFleetCost = FLEET_COST_MEDIUM; break; ! case FLEET_COST_MEDIUM: ! maxFleetCost = FLEET_COST_LARGE; break; ! case FLEET_COST_LARGE: ! maxFleetCost = FLEET_COST_HUGE; break; ! case FLEET_COST_HUGE: ! maxFleetCost = FLEET_COST_MASSIVE; break; ! case FLEET_COST_MASSIVE: ! maxFleetCost = FLEET_COST_SMALL; break; ! default: ! ASSERT(0); ! } ! return maxFleetCost; ! } ! ! protected: ! /** \brief the maximum cost this fleet will allow */ ! FleetCost maxFleetCost; ! ! public: ! ! static char * getFleetCostName(FleetCost size) { ! ! ASSERT (!( (size != FLEET_COST_SMALL) && ! (size != FLEET_COST_MEDIUM) && ! (size != FLEET_COST_LARGE) && ! (size != FLEET_COST_HUGE) && ! (size != FLEET_COST_MASSIVE) )); ! ! // this has got to be the worst solution ever :) ! int index = 0; ! switch (size) { ! case FLEET_COST_SMALL: index = 0; break; ! case FLEET_COST_MEDIUM: index = 1; break; ! case FLEET_COST_LARGE: index = 2; break; ! case FLEET_COST_HUGE: index = 3; break; ! case FLEET_COST_MASSIVE: index = 4; break; ! default: ! ASSERT(0); ! } ! return fleetCostName[index]; ! } --- 58,134 ---- /** */ ! static char * getSortingMethodName(SortingMethod method) { ! ASSERT( ! ( (method > MAX_SORTING_METHODS) || (method < 0)) ); ! ! if ( (method > MAX_SORTING_METHODS) || (method < 0)) return ""; return sortingMethodName[method]; ! } ! ! enum FleetCost { ! FLEET_COST_SMALL = 100, ! FLEET_COST_MEDIUM = 250, ! FLEET_COST_LARGE = 500, ! FLEET_COST_HUGE = 1000, ! FLEET_COST_MASSIVE = 10000 ! }; ! ! enum { FLEET_COST_DEFAULT = FLEET_COST_LARGE }; ! enum { FIRST_FLEET_COST = FLEET_COST_SMALL }; ! enum { MAX_FLEET_COSTS = FLEET_COST_MASSIVE }; ! ! /** \brief cycles through each of the available preset maximum fleet sizes. ! \return the new fleet size */ ! FleetCost cycleMaxFleetCost() { ! ASSERT (!( (size != FLEET_COST_SMALL) && ! (size != FLEET_COST_MEDIUM) && ! (size != FLEET_COST_LARGE) && ! (size != FLEET_COST_HUGE) && ! (size != FLEET_COST_MASSIVE) )); ! ! switch (maxFleetCost) { ! case FLEET_COST_SMALL: ! maxFleetCost = FLEET_COST_MEDIUM; break; ! case FLEET_COST_MEDIUM: ! maxFleetCost = FLEET_COST_LARGE; break; ! case FLEET_COST_LARGE: ! maxFleetCost = FLEET_COST_HUGE; break; ! case FLEET_COST_HUGE: ! maxFleetCost = FLEET_COST_MASSIVE; break; ! case FLEET_COST_MASSIVE: ! maxFleetCost = FLEET_COST_SMALL; break; ! default: ! ASSERT(0); ! } ! return maxFleetCost; ! } ! ! protected: ! /** \brief the maximum cost this fleet will allow */ ! FleetCost maxFleetCost; ! ! public: ! ! static char * getFleetCostName(FleetCost size) { ! ! ASSERT (!( (size != FLEET_COST_SMALL) && ! (size != FLEET_COST_MEDIUM) && ! (size != FLEET_COST_LARGE) && ! (size != FLEET_COST_HUGE) && ! (size != FLEET_COST_MASSIVE) )); ! ! // this has got to be the worst solution ever :) ! int index = 0; ! switch (size) { ! case FLEET_COST_SMALL: index = 0; break; ! case FLEET_COST_MEDIUM: index = 1; break; ! case FLEET_COST_LARGE: index = 2; break; ! case FLEET_COST_HUGE: index = 3; break; ! case FLEET_COST_MASSIVE: index = 4; break; ! default: ! ASSERT(0); ! } ! return fleetCostName[index]; ! } *************** *** 229,242 **** ShipType * operator[](int offset) { return getShipType( offset ); ! } ! ! /** @brief returns the maximum number of ships that this fleet can hold */ ! int getMaxNumberOfShips() { return MAX_FLEET_SIZE; } ! ! /** @brief returns the maximum sum of costs of each ship in the fleet */ ! FleetCost getMaxCost() { return maxFleetCost; } ! ! ! --- 229,242 ---- ShipType * operator[](int offset) { return getShipType( offset ); ! } ! ! /** @brief returns the maximum number of ships that this fleet can hold */ ! int getMaxNumberOfShips() { return MAX_FLEET_SIZE; } ! ! /** @brief returns the maximum sum of costs of each ship in the fleet */ ! FleetCost getMaxCost() { return maxFleetCost; } ! ! ! *************** *** 252,257 **** /** \brief the list of ships*/ ! MyFleetListType ships; ! --- 252,257 ---- /** \brief the list of ships*/ ! MyFleetListType ships; ! Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mmain.cpp 11 Nov 2003 19:52:53 -0000 1.15 --- mmain.cpp 12 Nov 2003 17:35:30 -0000 1.16 *************** *** 494,503 **** Fleet *fleet = player_fleet[i]; if (fleet->getSize() == 0) continue; ! char buffy[512]; ! if (strlen(fleet->getTitle()) != 0) ! sprintf(buffy, "%s\n%s\n", player_name[i], fleet->getTitle()); ! else ! sprintf(buffy, "%s\n", player_name[i]); slot[i] = player_control[i]->choose_ship(window, buffy, fleet); --- 494,503 ---- Fleet *fleet = player_fleet[i]; if (fleet->getSize() == 0) continue; ! char buffy[512]; ! if (strlen(fleet->getTitle()) != 0) ! sprintf(buffy, "%s\n%s\n", player_name[i], fleet->getTitle()); ! else ! sprintf(buffy, "%s\n", player_name[i]); slot[i] = player_control[i]->choose_ship(window, buffy, fleet); Index: moptions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/moptions.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** moptions.cpp 5 Nov 2003 09:43:37 -0000 1.6 --- moptions.cpp 12 Nov 2003 17:35:30 -0000 1.7 *************** *** 109,144 **** return; } ! ! ! bool confirmVideoChanges() { ! enum { ! DIALOG_CONFIRM_VIDEO_BOX = 0, ! DIALOG_CONFIRM_VIDEO_TEXT, ! DIALOG_CONFIRM_VIDEO_YES, ! DIALOG_CONFIRM_VIDEO_NO ! }; ! ! DIALOG confirmVideoDialog[] = { ! // (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) ! { d_box_proc, 120, 140, 368, 90, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL }, ! { d_text_proc, 130, 150, 348, 30, 255, 0, 0, 0, 0, 0, (void *)"Do you want to keep these settings?", NULL, NULL }, ! { d_button_proc, 130, 190, 174, 30, 255, 0, 0,D_EXIT, 0, 0, (void *)"Yes", NULL, NULL }, ! { d_button_proc, 294, 190, 174, 30, 255, 0, 0,D_EXIT, 0, 0, (void *)"No", NULL, NULL }, ! { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 3, 0, NULL, NULL, NULL } ! }; ! ! int choice = -1; ! while (-1 != (choice = tw_popup_dialog(NULL, confirmVideoDialog, 0))) { ! switch (choice) { ! case DIALOG_CONFIRM_VIDEO_YES: ! return true; ! case DIALOG_CONFIRM_VIDEO_NO: ! return false; ! } ! } ! return false; } ! ! int handleGammaSliderChange(void *dp3, int d2); char *resolution[] = { --- 109,144 ---- return; } ! ! ! bool confirmVideoChanges() { ! enum { ! DIALOG_CONFIRM_VIDEO_BOX = 0, ! DIALOG_CONFIRM_VIDEO_TEXT, ! DIALOG_CONFIRM_VIDEO_YES, ! DIALOG_CONFIRM_VIDEO_NO ! }; ! ! DIALOG confirmVideoDialog[] = { ! // (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) ! { d_box_proc, 120, 140, 368, 90, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL }, ! { d_text_proc, 130, 150, 348, 30, 255, 0, 0, 0, 0, 0, (void *)"Do you want to keep these settings?", NULL, NULL }, ! { d_button_proc, 130, 190, 174, 30, 255, 0, 0,D_EXIT, 0, 0, (void *)"Yes", NULL, NULL }, ! { d_button_proc, 294, 190, 174, 30, 255, 0, 0,D_EXIT, 0, 0, (void *)"No", NULL, NULL }, ! { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 3, 0, NULL, NULL, NULL } ! }; ! ! int choice = -1; ! while (-1 != (choice = tw_popup_dialog(NULL, confirmVideoDialog, 0))) { ! switch (choice) { ! case DIALOG_CONFIRM_VIDEO_YES: ! return true; ! case DIALOG_CONFIRM_VIDEO_NO: ! return false; ! } ! } ! return false; } ! ! int handleGammaSliderChange(void *dp3, int d2); char *resolution[] = { *************** *** 188,233 **** { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 3, 0, NULL, NULL, NULL } }; ! ! int handleGammaSliderChange(void *dp3, int d2) { ! set_gamma(d2); ! return d2; ! } void video_menu (Game *game) {STACKTRACE ! int choice = -1; ! bool done = false; ! while ( (choice != DIALOG_VIDEO_EXIT) && (!done) ) { ! sprintf(dialog_string[3], "%dx%d", videosystem.width, videosystem.height); ! //set index for resolution ! int x, y, x2, y2, i, bpp, bpp2, fs; ! x2 = videosystem.width; ! y2 = videosystem.height; ! for (i = 0; resolution[i+1]; i += 1) { ! x = strtol(resolution[i], NULL, 10); ! y = strtol(strchr(resolution[i], 'x') + 1, NULL, 10); ! if ((x == x2) && (y == y2)) break; ! } ! video_dialog[DIALOG_VIDEO_RESLIST].d1 = i; ! ! //set index for bpp ! bpp = videosystem.bpp; ! for (i = 0; true; i += 1) { ! if (!color_depth[i]) tw_error("video_menu - current bpp invalid?"); ! if (strtol(color_depth[i], NULL, 10) == bpp) break; ! } ! video_dialog[DIALOG_VIDEO_BPPLIST].d1 = i; ! ! //set button for fullscreen ! video_dialog[DIALOG_VIDEO_FULLSCREEN].flags = videosystem.fullscreen ? D_SELECTED : 0; ! ! int startfs = video_dialog[DIALOG_VIDEO_FULLSCREEN].flags; ! ! ! //set gamma correction ! video_dialog[DIALOG_VIDEO_GAMMA_SLIDER].d2 = get_gamma(); //do the dialog --- 188,233 ---- { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 3, 0, NULL, NULL, NULL } }; ! ! int handleGammaSliderChange(void *dp3, int d2) { ! set_gamma(d2); ! return d2; ! } void video_menu (Game *game) {STACKTRACE ! int choice = -1; ! bool done = false; ! while ( (choice != DIALOG_VIDEO_EXIT) && (!done) ) { ! sprintf(dialog_string[3], "%dx%d", videosystem.width, videosystem.height); ! //set index for resolution ! int x, y, x2, y2, i, bpp, bpp2, fs; ! x2 = videosystem.width; ! y2 = videosystem.height; ! for (i = 0; resolution[i+1]; i += 1) { ! x = strtol(resolution[i], NULL, 10); ! y = strtol(strchr(resolution[i], 'x') + 1, NULL, 10); ! if ((x == x2) && (y == y2)) break; ! } ! video_dialog[DIALOG_VIDEO_RESLIST].d1 = i; ! ! //set index for bpp ! bpp = videosystem.bpp; ! for (i = 0; true; i += 1) { ! if (!color_depth[i]) tw_error("video_menu - current bpp invalid?"); ! if (strtol(color_depth[i], NULL, 10) == bpp) break; ! } ! video_dialog[DIALOG_VIDEO_BPPLIST].d1 = i; ! ! //set button for fullscreen ! video_dialog[DIALOG_VIDEO_FULLSCREEN].flags = videosystem.fullscreen ? D_SELECTED : 0; ! ! int startfs = video_dialog[DIALOG_VIDEO_FULLSCREEN].flags; ! ! ! //set gamma correction ! video_dialog[DIALOG_VIDEO_GAMMA_SLIDER].d2 = get_gamma(); //do the dialog *************** *** 249,253 **** fs = video_dialog[DIALOG_VIDEO_FULLSCREEN].flags & D_SELECTED; ! switch (choice) { case DIALOG_VIDEO_GET_DEFAULT: set_config_file("client.ini"); --- 249,253 ---- fs = video_dialog[DIALOG_VIDEO_FULLSCREEN].flags & D_SELECTED; ! switch (choice) { case DIALOG_VIDEO_GET_DEFAULT: set_config_file("client.ini"); *************** *** 256,323 **** y2 = get_config_int("Video", "ScreenHeight", 480); fs = get_config_int("Video", "FullScreen", false); ! set_gamma(get_config_int("Video", "Gamma", 128)); ! ! videosystem.set_resolution(x2, y2, bpp2, fs); break; ! case DIALOG_VIDEO_SET_DEFAULT: if ((bpp2 != bpp) && game) { tw_alert ("Color depths cannot be changed in\nthe middle of a game\nin this version", "Okay"); - } - else { - done = true; } ! break; ! ! case DIALOG_VIDEO_BPPLIST: ! case DIALOG_VIDEO_RESLIST: ! break; ! ! case DIALOG_VIDEO_GAMMA_SLIDER: ! set_gamma(video_dialog[DIALOG_VIDEO_GAMMA_SLIDER].d2); ! break; ! ! case DIALOG_VIDEO_EXIT: ! case -1: ! return; ! break; ! } ! ! if ( (x2 != x) || ! (y2 != y) || ! (bpp != bpp2) || ! (startfs != fs) ) ! { ! set_gamma(video_dialog[DIALOG_VIDEO_GAMMA_SLIDER].d2); ! videosystem.set_resolution(x2, y2, bpp2, fs); ! ! if (confirmVideoChanges()) { ! set_config_file("client.ini"); ! set_config_int("Video", "BitsPerPixel", bpp2); ! set_config_int("Video", "ScreenWidth", x2); ! set_config_int("Video", "ScreenHeight", y2); ! set_config_int("Video", "FullScreen", fs); ! set_config_int("Video", "Gamma", get_gamma()); ! return; ! } ! else { ! set_config_file("client.ini"); ! bpp2 = get_config_int("Video", "BitsPerPixel", 16); ! x2 = get_config_int("Video", "ScreenWidth", 640); ! y2 = get_config_int("Video", "ScreenHeight", 480); ! fs = get_config_int("Video", "FullScreen", false); ! set_gamma(get_config_int("Video", "Gamma", 128)); ! ! i = videosystem.set_resolution(x2, y2, bpp2, fs); ! done = false; ! } ! } ! } return; ! } ! ! int handleSoundSliderChange(void *dp3, int d2); int handleMusicSliderChange(void *dp3, int d2); --- 256,323 ---- y2 = get_config_int("Video", "ScreenHeight", 480); fs = get_config_int("Video", "FullScreen", false); ! set_gamma(get_config_int("Video", "Gamma", 128)); ! ! videosystem.set_resolution(x2, y2, bpp2, fs); break; ! case DIALOG_VIDEO_SET_DEFAULT: if ((bpp2 != bpp) && game) { tw_alert ("Color depths cannot be changed in\nthe middle of a game\nin this version", "Okay"); } ! else { ! done = true; ! } ! break; ! ! case DIALOG_VIDEO_BPPLIST: ! case DIALOG_VIDEO_RESLIST: ! break; ! ! case DIALOG_VIDEO_GAMMA_SLIDER: ! set_gamma(video_dialog[DIALOG_VIDEO_GAMMA_SLIDER].d2); ! break; ! ! case DIALOG_VIDEO_EXIT: ! case -1: ! return; ! break; ! } ! ! if ( (x2 != x) || ! (y2 != y) || ! (bpp != bpp2) || ! (startfs != fs) ) ! { ! set_gamma(video_dialog[DIALOG_VIDEO_GAMMA_SLIDER].d2); ! videosystem.set_resolution(x2, y2, bpp2, fs); ! ! if (confirmVideoChanges()) { ! set_config_file("client.ini"); ! set_config_int("Video", "BitsPerPixel", bpp2); ! set_config_int("Video", "ScreenWidth", x2); ! set_config_int("Video", "ScreenHeight", y2); ! set_config_int("Video", "FullScreen", fs); ! set_config_int("Video", "Gamma", get_gamma()); ! return; ! } ! else { ! set_config_file("client.ini"); ! bpp2 = get_config_int("Video", "BitsPerPixel", 16); ! x2 = get_config_int("Video", "ScreenWidth", 640); ! y2 = get_config_int("Video", "ScreenHeight", 480); ! fs = get_config_int("Video", "FullScreen", false); ! set_gamma(get_config_int("Video", "Gamma", 128)); ! ! i = videosystem.set_resolution(x2, y2, bpp2, fs); ! done = false; ! } ! } ! } return; ! } ! ! int handleSoundSliderChange(void *dp3, int d2); int handleMusicSliderChange(void *dp3, int d2); *************** *** 342,346 **** { d_tw_yield_proc, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL }, { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL } ! }; void audio_menu (Game *game) {STACKTRACE --- 342,346 ---- { d_tw_yield_proc, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL }, { NULL, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL } ! }; void audio_menu (Game *game) {STACKTRACE *************** *** 368,390 **** }; ! int handleSoundSliderChange(void *dp3, int d2) { ! sound.set_volumes( ! audio_dialog[DIALOG_AUDIO_SOUND_VOL].d2, ! audio_dialog[DIALOG_AUDIO_MUSIC_VOL].d2, ! audio_dialog[DIALOG_AUDIO_SOUND_ON].flags & D_SELECTED, ! audio_dialog[DIALOG_AUDIO_MUSIC_ON].flags & D_SELECTED ! ); ! return 0; ! } ! ! int handleMusicSliderChange(void *dp3, int d2) { ! sound.set_volumes( ! audio_dialog[DIALOG_AUDIO_SOUND_VOL].d2, ! audio_dialog[DIALOG_AUDIO_MUSIC_VOL].d2, ! audio_dialog[DIALOG_AUDIO_SOUND_ON].flags & D_SELECTED, ! audio_dialog[DIALOG_AUDIO_MUSIC_ON].flags & D_SELECTED ! ); ! return 0; ! } --- 368,390 ---- }; ! int handleSoundSliderChange(void *dp3, int d2) { ! sound.set_volumes( ! audio_dialog[DIALOG_AUDIO_SOUND_VOL].d2, ! audio_dialog[DIALOG_AUDIO_MUSIC_VOL].d2, ! audio_dialog[DIALOG_AUDIO_SOUND_ON].flags & D_SELECTED, ! audio_dialog[DIALOG_AUDIO_MUSIC_ON].flags & D_SELECTED ! ); ! return 0; ! } ! ! int handleMusicSliderChange(void *dp3, int d2) { ! sound.set_volumes( ! audio_dialog[DIALOG_AUDIO_SOUND_VOL].d2, ! audio_dialog[DIALOG_AUDIO_MUSIC_VOL].d2, ! audio_dialog[DIALOG_AUDIO_SOUND_ON].flags & D_SELECTED, ! audio_dialog[DIALOG_AUDIO_MUSIC_ON].flags & D_SELECTED ! ); ! return 0; ! } |
From: <geo...@us...> - 2003-11-12 17:35:33
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv23410 Modified Files: scp.cpp Log Message: carriage return fix ? Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** scp.cpp 11 Nov 2003 07:31:51 -0000 1.18 --- scp.cpp 12 Nov 2003 17:35:30 -0000 1.19 *************** *** 1,1868 **** ! /* ! * Star Control - TimeWarp ! * ! * scp.cpp - Main project module ! * ! * 25-Jun-2002 ! * ! * - key jamming tester revised to accomodate joystick. ! * - re-added d_tw_yeildslice stuff ! * - improved "debug" button [...3707 lines suppressed...] ! tmp += sprintf(tmp, " %d %d %s", player_team[index], player_config[index], player_type[index]); ! if ((strlen(buf) >= 80)) tw_error("playerListboxGetter string too long"); ! return buf; ! } ! } ! ! char *controlListboxGetter(int index, int *list_size) { ! static char tmp[40]; ! ! tmp[0] = 0; ! if(index < 0) { ! *list_size = num_controls; ! return NULL; ! } else { ! return(control_name[index]); ! } ! } ! ! ! |
From: <geo...@us...> - 2003-11-12 17:19:45
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1:/tmp/cvs-serv18745 Modified Files: shpphepa.cpp Log Message: avoid having 0 crew in the ship and not dying. Index: shpphepa.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpphepa.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpphepa.cpp 26 Oct 2003 10:43:17 -0000 1.11 --- shpphepa.cpp 12 Nov 2003 17:19:41 -0000 1.12 *************** *** 167,171 **** { double evac = 0; ! while ( evac < totdam && crew > 0 ) // yeah, the last one may also leave !! { --- 167,171 ---- { double evac = 0; ! while ( evac < totdam && crew >= 1 ) // yeah, the last one may also leave !! { *************** *** 193,197 **** } ! if ( crew == 0 ) Ship::handle_damage(src, 0, 0); // use the "default" die procedure --- 193,198 ---- } ! // don't use == 0, but use < 1, cause of possible partial damage ? I assume, 0.8 crew is also dead crew... ! if ( crew < 1 ) Ship::handle_damage(src, 0, 0); // use the "default" die procedure |
From: <geo...@us...> - 2003-11-11 23:12:00
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1:/tmp/cvs-serv27659/newships Modified Files: shpjnkla.cpp Log Message: added crash-tests to the jnkwndo, I suspect it can crash under rare circumstances / also added lag_frames to error.log Index: shpjnkla.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpjnkla.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpjnkla.cpp 25 Oct 2003 14:30:20 -0000 1.9 --- shpjnkla.cpp 11 Nov 2003 23:11:55 -0000 1.10 *************** *** 35,38 **** --- 35,40 ---- virtual int handle_damage(SpaceLocation *source, double normal, double direct); virtual void materialize(); + + virtual void calculate(); }; *************** *** 75,99 **** }; ! JnkdwoLazel::JnkdwoLazel(Vector2 opos, double angle, ShipData *data, unsigned int code) : ! Ship(opos, angle, data, code) { ! weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); ! weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); ! weaponDamage = get_config_int("Weapon", "Damage", 0); ! weaponArmour = get_config_int("Weapon", "Armour", 0); ! ! specialDamage = get_config_int("Special", "Damage", 0); ! specialRange = scale_range(get_config_float("Special", "Range", 0)); ! specialAngle = get_config_float("Special", "Angle", 90) * ANGLE_RATIO; ! specialFrames = get_config_int("Special", "Frames", 100); ! specialAim = get_config_float("Special", "Aim", 0) * ANGLE_RATIO / 1000.0; ! specialSpread = get_config_float("Special", "Spread", 0) * ANGLE_RATIO; ! ! extraVisibility = get_config_float("Extra", "VisibilityPoints", 0); ! extraInvisibility = get_config_float("Extra", "InvisibilityFactor", 0); ! extraRangeFactor = get_config_float("Extra", "RangeFactor", 0); ! extraShipsOnly = !(get_config_int("Extra", "ShipsOnly", 0) == 0); ! ! special_low = false; } --- 77,102 ---- }; ! JnkdwoLazel::JnkdwoLazel(Vector2 opos, double angle, ShipData *data, unsigned int code) ! : ! Ship(opos, angle, data, code) { ! weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); ! weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); ! weaponDamage = get_config_int("Weapon", "Damage", 0); ! weaponArmour = get_config_int("Weapon", "Armour", 0); ! ! specialDamage = get_config_int("Special", "Damage", 0); ! specialRange = scale_range(get_config_float("Special", "Range", 0)); ! specialAngle = get_config_float("Special", "Angle", 90) * ANGLE_RATIO; ! specialFrames = get_config_int("Special", "Frames", 100); ! specialAim = get_config_float("Special", "Aim", 0) * ANGLE_RATIO / 1000.0; ! specialSpread = get_config_float("Special", "Spread", 0) * ANGLE_RATIO; ! ! extraVisibility = get_config_float("Extra", "VisibilityPoints", 0); ! extraInvisibility = get_config_float("Extra", "InvisibilityFactor", 0); ! extraRangeFactor = get_config_float("Extra", "RangeFactor", 0); ! extraShipsOnly = !(get_config_int("Extra", "ShipsOnly", 0) == 0); ! ! special_low = false; } *************** *** 101,129 **** int JnkdwoLazel::activate_weapon() { ! STACKTRACE ! add(new JnkdwoLazelMissile(this, -6.0, 45.0, angle , weaponVelocity, ! weaponDamage, weaponRange, weaponArmour, data->spriteWeapon)); ! add(new JnkdwoLazelMissile(this, +6.0, 45.0, angle , weaponVelocity, ! weaponDamage, weaponRange, weaponArmour, data->spriteWeapon)); ! return(TRUE); } void JnkdwoLazel::calculate_fire_special() { ! STACKTRACE ! if ((!fire_special) || (batt >= special_drain)) special_low = false; } void JnkdwoLazel::materialize() { ! STACKTRACE ! Ship::materialize(); ! for (int i = 0; i <4; i++) { ! crystal[i]=new JnkdwoLazelCrystal(this,-16.0, 1+(i-1.5)*12, -PI/2); ! add(crystal[i]); ! crystal[i+4]=new JnkdwoLazelCrystal(this,+16.0, 1+(i-1.5)*12, +PI/2); ! add(crystal[i+4]); ! // game->addItem(new JnkdwoLazelCrystal(this,-16.0, 1+(i-1.5)*12, -PI/2)); ! // game->addItem(new JnkdwoLazelCrystal(this,+16.0, 1+(i-1.5)*12, +PI/2)); ! } } --- 104,134 ---- int JnkdwoLazel::activate_weapon() { ! STACKTRACE; ! ! add(new JnkdwoLazelMissile(this, -6.0, 45.0, angle , weaponVelocity, ! weaponDamage, weaponRange, weaponArmour, data->spriteWeapon)); ! add(new JnkdwoLazelMissile(this, +6.0, 45.0, angle , weaponVelocity, ! weaponDamage, weaponRange, weaponArmour, data->spriteWeapon)); ! return(TRUE); } void JnkdwoLazel::calculate_fire_special() { ! STACKTRACE; ! ! if ((!fire_special) || (batt >= special_drain)) special_low = false; } void JnkdwoLazel::materialize() { ! STACKTRACE; ! Ship::materialize(); ! for (int i = 0; i <4; i++) { ! crystal[i]=new JnkdwoLazelCrystal(this,-16.0, 1+(i-1.5)*12, -PI/2); ! add(crystal[i]); ! crystal[i+4]=new JnkdwoLazelCrystal(this,+16.0, 1+(i-1.5)*12, +PI/2); ! add(crystal[i+4]); ! // game->addItem(new JnkdwoLazelCrystal(this,-16.0, 1+(i-1.5)*12, -PI/2)); ! // game->addItem(new JnkdwoLazelCrystal(this,+16.0, 1+(i-1.5)*12, +PI/2)); ! } } *************** *** 138,216 **** } ! void JnkdwoLazelCrystal::calculate() { ! STACKTRACE ! ! if (state == 0) return; ! if (!(ship && ship->exists())) { ! state = 0; ! return; ! } ! angle = normalize(ship->angle + ra, PI2); ! double alpha = ship->angle ; ! double tx = cos(alpha); ! double ty = sin(alpha); ! pos.x = normalize(ship->pos.x + ry * tx - rx * ty, map_size.x); ! pos.y = normalize(ship->pos.y + ry * ty + rx * tx, map_size.y); ! if (recharge > 0) recharge -= frame_time; ! else if (ship->fire_special) { - if (ship->batt < ship->special_drain) { - ship->special_low = true; - return; }; ! Query q; ! SpaceObject *t = NULL; ! double r1, r = 0; ! double marks; ! for (q.begin(this, OBJECT_LAYERS, ship->specialRange); q.currento; q.next()) ! if ((!q.currento->sameTeam(this)) && (q.currento->collide_flag_anyone & bit(LAYER_LINES)) && (!q.currento->isPlanet())) { ! if (ship->extraShipsOnly && q.currento->isShip()) continue; ! alpha = trajectory_angle(q.currento); ! double d_a = normalize(alpha - angle, PI2); ! if (d_a > PI) d_a -= PI2; ! if (fabs(d_a) > ship->specialAngle) continue; ! marks = 0; ! Query qm; ! for (qm.begin(q.currento, bit(LAYER_SPECIAL), 10); qm.current; qm.next()) ! if (qm.current->getID() == jnk_marker_id) ! if (((JnkdwoLazelMarker*)qm.current)->o == q.currento) ! marks += 1; ! if (!q.currento->isInvisible()) ! marks += ship->extraVisibility; ! else marks *= ship->extraInvisibility; ! r1 = distance(q.currento); ! if (r1 >= 10.0) ! marks *= (1 + ship->extraRangeFactor * 10.0 / r1); ! ! if (marks > r) { ! r = marks; t = q.currento; } } ! ! if (t) { ! int c = random()%80; ! c = makecol(160+c, 120+c, 175+c); ! // game->addItem(new PointLaser(c, ship->specialDamage, ship->specialRange, ship->specialFrames, this, t, 0, 0)); ! add(new JnkdwoLazelLaser (this, trajectory_angle(t), ship->specialAngle, c, ship->specialRange, ship->specialDamage, ! ship->specialFrames, this, t, ship->specialAim * r, ship->specialSpread)); ! //play_sound(ship->data->sampleSpecial[0]); ! play_sound(data->sampleSpecial[0]); ! recharge += ship->special_rate; ! ship->batt -= ship->special_drain; } ! } } - int JnkdwoLazel::handle_damage (SpaceLocation *source, double normal, double direct) { - STACKTRACE - int d = Ship::handle_damage(source, normal, direct); - if (state == 0) - for (int i =0; i < 8; i++) - crystal[i]->state = 0; - return d; - } --- 143,246 ---- } ! void JnkdwoLazelCrystal::calculate() ! { ! STACKTRACE; ! ! if (state == 0) return; ! if (!(ship && ship->exists())) { ! ship = 0; ! state = 0; ! return; ! } ! ! angle = normalize(ship->angle + ra, PI2); ! ! double alpha = ship->angle ; ! double tx = cos(alpha); ! double ty = sin(alpha); ! ! pos.x = normalize(ship->pos.x + ry * tx - rx * ty, map_size.x); ! pos.y = normalize(ship->pos.y + ry * ty + rx * tx, map_size.y); ! ! if (recharge > 0) recharge -= frame_time; ! else if (ship->fire_special) { ! ! if (ship->batt < ship->special_drain) { ! ship->special_low = true; ! return; }; ! ! Query q; ! SpaceObject *t = NULL; ! double r1, r = 0; ! double marks; ! for (q.begin(this, OBJECT_LAYERS, ship->specialRange); q.currento; q.next()) ! if ((!q.currento->sameTeam(this)) && (q.currento->collide_flag_anyone & bit(LAYER_LINES)) && (!q.currento->isPlanet())) { ! if (ship->extraShipsOnly && q.currento->isShip()) continue; ! alpha = trajectory_angle(q.currento); ! double d_a = normalize(alpha - angle, PI2); ! if (d_a > PI) d_a -= PI2; ! if (fabs(d_a) > ship->specialAngle) continue; ! marks = 0; ! Query qm; ! for (qm.begin(q.currento, bit(LAYER_SPECIAL), 10); qm.current; qm.next()) ! if (qm.current->getID() == jnk_marker_id) ! if (((JnkdwoLazelMarker*)qm.current)->o == q.currento) ! marks += 1; ! if (!q.currento->isInvisible()) ! marks += ship->extraVisibility; ! else marks *= ship->extraInvisibility; ! ! r1 = distance(q.currento); ! ! if (r1 >= 10.0) ! marks *= (1 + ship->extraRangeFactor * 10.0 / r1); ! ! if (marks > r) { ! r = marks; t = q.currento; } } ! ! if (t) { ! int c = random()%80; ! c = makecol(160+c, 120+c, 175+c); ! // game->addItem(new PointLaser(c, ship->specialDamage, ship->specialRange, ship->specialFrames, this, t, 0, 0)); ! add(new JnkdwoLazelLaser (this, trajectory_angle(t), ship->specialAngle, c, ship->specialRange, ship->specialDamage, ! ship->specialFrames, this, t, ship->specialAim * r, ship->specialSpread)); ! //play_sound(ship->data->sampleSpecial[0]); ! play_sound(data->sampleSpecial[0]); ! recharge += ship->special_rate; ! ship->batt -= ship->special_drain; } ! } ! } ! int JnkdwoLazel::handle_damage (SpaceLocation *source, double normal, double direct) { ! STACKTRACE; ! int d = Ship::handle_damage(source, normal, direct); ! if (state == 0) ! for (int i =0; i < 8; i++) ! crystal[i]->state = 0; ! ! return d; ! } ! void JnkdwoLazel::calculate() ! { ! STACKTRACE; ! Ship::calculate(); ! // just to be sure I guess .. check if the crystal aren't dead. ! // dunno if this can ever happen (geo)? ! for (int i =0; i < 8; i++) ! { ! if (!crystal[i]->exists()) ! { ! tw_error("A crystal died - should not happen !!"); ! } ! } } *************** *** 225,232 **** void JnkdwoLazelMissile::inflict_damage(SpaceObject *other) { ! STACKTRACE ! Missile::inflict_damage(other); ! if (other->exists()) ! add(new JnkdwoLazelMarker(this, other)); } --- 255,264 ---- void JnkdwoLazelMissile::inflict_damage(SpaceObject *other) { ! STACKTRACE; ! ! Missile::inflict_damage(other); ! ! if (other && other->exists()) ! add(new JnkdwoLazelMarker(this, other)); } *************** *** 242,290 **** void JnkdwoLazelMarker::calculate() { ! STACKTRACE ! if (state == 0) return; ! if (!(o && o->exists())) ! { ! o = 0; ! state = 0; ! return; ! } ! pos = o->normal_pos(); } JnkdwoLazelLaser::JnkdwoLazelLaser (SpaceLocation *creator, double langle, double mangle, int lcolor, double lrange, int ldamage, int lfcount, ! SpaceLocation *opos, SpaceObject *otgt, double oaim, double spread) : ! Laser(creator, langle, lcolor, lrange, 1, lfcount/ldamage, opos, 0, 0) { // collide_flag_sameteam = 0; // collide_flag_sameship = 0; ! target = NULL; ship = NULL; ! power_left = ldamage-1; ! tgt = otgt; aim = oaim; ! max_angle = mangle; lng = length; ! base_length = length; ! angle = normalize(angle + spread * (1000 - (random()%2001))/1000.0, PI2); } void JnkdwoLazelLaser::calculate() { ! STACKTRACE ! if (!(lpos && lpos->exists())) ! { ! lpos = 0; state = 0; } ! if (state == 0) return; ! if (frame < frame_count) frame += frame_time; ! else { ! if (!(tgt && tgt->exists())) { ! tgt = 0; ! state = 0; ! return; ! } ! frame = 0; ! if (power_left > 0) { ! damage_factor = 1; power_left--; } ! else tgt = NULL; } double alpha; --- 274,330 ---- void JnkdwoLazelMarker::calculate() { ! STACKTRACE; ! if (state == 0) return; ! ! if (!(o && o->exists())) ! { ! o = 0; ! state = 0; ! return; ! } ! ! pos = o->normal_pos(); ! ! // dunno if the absence of this could cause something strange ... perhaps it does? ! // maybe "some" routine needs to access its "ship" pointer sometime ? ! SpaceLocation::calculate(); } JnkdwoLazelLaser::JnkdwoLazelLaser (SpaceLocation *creator, double langle, double mangle, int lcolor, double lrange, int ldamage, int lfcount, ! SpaceLocation *opos, SpaceObject *otgt, double oaim, double spread) ! : ! Laser(creator, langle, lcolor, lrange, 1, lfcount/ldamage, opos, 0, 0) { // collide_flag_sameteam = 0; // collide_flag_sameship = 0; ! target = NULL; ship = NULL; ! power_left = ldamage-1; ! tgt = otgt; aim = oaim; ! max_angle = mangle; lng = length; ! base_length = length; ! angle = normalize(angle + spread * (1000 - (random()%2001))/1000.0, PI2); } void JnkdwoLazelLaser::calculate() { ! STACKTRACE; ! ! if (!(lpos && lpos->exists())) ! { ! lpos = 0; ! state = 0; ! } ! if (state == 0) return; ! if (frame < frame_count) frame += frame_time; ! else { ! if (!(tgt && tgt->exists())) { ! tgt = 0; state = 0; + return; } ! frame = 0; ! if (power_left > 0) { ! damage_factor = 1; power_left--; } ! else tgt = NULL; } double alpha; *************** *** 295,330 **** if (sinc_angle) angle = normalize(lpos->get_angle() + relative_angle, PI2); ! ! if (tgt) { if (!tgt->exists()) tgt = NULL;} ! else tgt = NULL; ! ! double d_a; ! if (tgt) ! d_a = normalize(trajectory_angle(tgt) - angle, PI2); ! else { //d_a = pos->get_angle(); ! base_length = lng * (frame_count - frame) / frame_count; } ! length = base_length; ! // state = 0; return; SpaceLine::calculate(); ! ! if (d_a > PI) d_a -= PI2; ! alpha = aim * frame_time; ! if (fabs(d_a) < alpha) alpha = fabs(d_a); ! if (d_a > 0) angle += alpha; ! else angle -= alpha; ! ! d_a = normalize(lpos->get_angle() - angle, PI2); ! if (d_a > PI) d_a -= PI2; ! if (fabs(d_a) > max_angle) ! tgt = NULL; // angle = pos->get_angle() - max_angle * d_a / fabs(d_a); } void JnkdwoLazelLaser::inflict_damage(SpaceObject *other) { ! STACKTRACE ! // return; ! if (damage_factor < 0) return; int i; i = damage_factor / 2; --- 335,370 ---- if (sinc_angle) angle = normalize(lpos->get_angle() + relative_angle, PI2); ! ! if (tgt) { if (!tgt->exists()) tgt = NULL;} ! else tgt = NULL; ! ! double d_a; ! if (tgt) ! d_a = normalize(trajectory_angle(tgt) - angle, PI2); ! else { //d_a = pos->get_angle(); ! base_length = lng * (frame_count - frame) / frame_count; } ! length = base_length; ! // state = 0; return; SpaceLine::calculate(); ! ! if (d_a > PI) d_a -= PI2; ! alpha = aim * frame_time; ! if (fabs(d_a) < alpha) alpha = fabs(d_a); ! if (d_a > 0) angle += alpha; ! else angle -= alpha; ! ! d_a = normalize(lpos->get_angle() - angle, PI2); ! if (d_a > PI) d_a -= PI2; ! if (fabs(d_a) > max_angle) ! tgt = NULL; // angle = pos->get_angle() - max_angle * d_a / fabs(d_a); } void JnkdwoLazelLaser::inflict_damage(SpaceObject *other) { ! STACKTRACE; ! // return; ! if (damage_factor < 0) return; int i; i = damage_factor / 2; |
From: <geo...@us...> - 2003-11-11 23:11:59
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv27659/melee Modified Files: mgame.cpp Log Message: added crash-tests to the jnkwndo, I suspect it can crash under rare circumstances / also added lag_frames to error.log Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mgame.cpp 9 Nov 2003 11:26:52 -0000 1.19 --- mgame.cpp 11 Nov 2003 23:11:55 -0000 1.20 *************** *** 460,463 **** --- 460,465 ---- fprintf(f, "timewarp version = %s\n", tw_version()); + fprintf(f, "lag_frames = %i", game->lag_frames); + time_t t; tm *td; *************** *** 487,491 **** // set "enable run-type information" for this feature // (rebuild all after changing that option) ! fprintf(f, "%030s %09.1e %09.1e %09.1e %09.1e %03i 0x%08X 0x%08X 0x%08X\n", typeid(*s).name(), p.x, p.y, v.x, v.y, is, (unsigned int)s, (unsigned int)s->ship, (unsigned int)s->target ); } --- 489,493 ---- // set "enable run-type information" for this feature // (rebuild all after changing that option) ! fprintf(f, "%030s %011.3e %011.3e %011.3e %011.3e %03i 0x%08X 0x%08X 0x%08X\n", typeid(*s).name(), p.x, p.y, v.x, v.y, is, (unsigned int)s, (unsigned int)s->ship, (unsigned int)s->target ); } |
From: <you...@us...> - 2003-11-11 19:52:56
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv13810/source/melee Modified Files: mcontrol.cpp mmain.cpp Log Message: When picking a ship in-game, adding current selection's name and point value to the screen. Index: mcontrol.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mcontrol.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mcontrol.cpp 20 Oct 2003 14:46:14 -0000 1.7 --- mcontrol.cpp 11 Nov 2003 19:52:53 -0000 1.8 *************** *** 208,213 **** SELECT_DIALOG_PIC }; ! char selectPlayer[18]; ! char selectTitleString[100]; int my_list_proc( int msg, DIALOG* d, int c ); --- 208,214 ---- SELECT_DIALOG_PIC }; ! char selectPlayer[18] = ""; ! char selectTitleString[100] = ""; ! char selectShipPrompt[100] = ""; int my_list_proc( int msg, DIALOG* d, int c ); *************** *** 240,244 **** int ret = d_list_proc2( msg, d, c ); if( d->d1 != old_d1 || msg == MSG_START ){ ! ShipType* type = fleet->getShipType(d->d1); BITMAP* panel = NULL; --- 241,254 ---- int ret = d_list_proc2( msg, d, c ); if( d->d1 != old_d1 || msg == MSG_START ){ ! ShipType* type = fleet->getShipType(d->d1); ! ASSERT(type != NULL); ! ! selectDialog[SELECT_DIALOG_TITLE].flags |= D_DIRTY; ! sprintf(selectTitleString, "%s\n%s\n%d of %d points", ! selectShipPrompt, ! (type != NULL) ? type->name : 0, ! (type != NULL) ? type->cost : 0, ! fleet->getCost()); ! BITMAP* panel = NULL; *************** *** 268,276 **** int ret = -1, slot = 0; if (fleet->getSize() == 0) tw_error ("Empty fleet! (prompt:%s)", prompt); ! selectDialog[SELECT_DIALOG_LIST].dp3 = fleet; ! sprintf(selectTitleString, "%s", prompt); slot = -1; while (!always_random) { ! while (key[KEY_ENTER] || key[KEY_SPACE]) poll_keyboard(); ret = tw_do_dialog(window, selectDialog, SELECT_DIALOG_LIST); if (ret == SELECT_DIALOG_INFO) { --- 278,288 ---- int ret = -1, slot = 0; if (fleet->getSize() == 0) tw_error ("Empty fleet! (prompt:%s)", prompt); ! selectDialog[SELECT_DIALOG_LIST].dp3 = fleet; ! strcpy(selectShipPrompt,prompt); ! slot = -1; while (!always_random) { ! while (key[KEY_ENTER] || key[KEY_SPACE]) poll_keyboard(); ! ret = tw_do_dialog(window, selectDialog, SELECT_DIALOG_LIST); if (ret == SELECT_DIALOG_INFO) { Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mmain.cpp 8 Nov 2003 11:19:29 -0000 1.14 --- mmain.cpp 11 Nov 2003 19:52:53 -0000 1.15 *************** *** 494,499 **** Fleet *fleet = player_fleet[i]; if (fleet->getSize() == 0) continue; ! char buffy[512]; ! sprintf(buffy, "%s\n%s\n%d of ??? points", player_name[i], fleet->getTitle(), fleet->getCost()); slot[i] = player_control[i]->choose_ship(window, buffy, fleet); if (player_control[i]->channel != channel_none) { --- 494,504 ---- Fleet *fleet = player_fleet[i]; if (fleet->getSize() == 0) continue; ! char buffy[512]; ! ! if (strlen(fleet->getTitle()) != 0) ! sprintf(buffy, "%s\n%s\n", player_name[i], fleet->getTitle()); ! else ! sprintf(buffy, "%s\n", player_name[i]); ! slot[i] = player_control[i]->choose_ship(window, buffy, fleet); if (player_control[i]->channel != channel_none) { |
From: <you...@us...> - 2003-11-11 07:31:54
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv27119/source Modified Files: scp.cpp Log Message: adding "max cost" to Fleet; adding GUI for changing a fleet's max cost in fleet editor; adding a terrible effect to indicate when a fleet has exceeded its maximum size Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** scp.cpp 11 Nov 2003 06:16:03 -0000 1.17 --- scp.cpp 11 Nov 2003 07:31:51 -0000 1.18 *************** *** 1207,1210 **** --- 1207,1211 ---- char path[80]; char fleetCostString[80] = ""; + char maxFleetCostString[80] = ""; *************** *** 1226,1229 **** --- 1227,1233 ---- int fleetRet; int selectedSlot; + + fleetDialog[FLEET_DIALOG_CURRENT_POINTS_VALUE].dp = fleetCostString; + fleetDialog[FLEET_DIALOG_POINT_LIMIT_BUTTON].dp = maxFleetCostString; *************** *** 1236,1241 **** fleetDialog[FLEET_DIALOG_SORTBY_BUTTON2].dp = Fleet::getSortingMethodName(sortMethod2); ! sprintf(fleetCostString,"%d", fleet->getCost()); ! fleetDialog[FLEET_DIALOG_CURRENT_POINTS_VALUE].dp = fleetCostString; if (sortAscending1) --- 1240,1250 ---- fleetDialog[FLEET_DIALOG_SORTBY_BUTTON2].dp = Fleet::getSortingMethodName(sortMethod2); ! if (fleet->getCost() > fleet->getMaxCost()) ! sprintf(fleetCostString,"!! %d !!", fleet->getCost()); ! else ! sprintf(fleetCostString,"%d", fleet->getCost()); ! ! sprintf(maxFleetCostString,"%d %s", fleet->getMaxCost(), ! Fleet::getFleetCostName(fleet->getMaxCost())); if (sortAscending1) *************** *** 1290,1296 **** case FLEET_DIALOG_LOAD_BUTTON: break; case FLEET_DIALOG_POINT_LIMIT_TEXT: break; ! case FLEET_DIALOG_POINT_LIMIT_BUTTON: ! ! break; --- 1299,1304 ---- case FLEET_DIALOG_LOAD_BUTTON: break; case FLEET_DIALOG_POINT_LIMIT_TEXT: break; ! case FLEET_DIALOG_POINT_LIMIT_BUTTON: ! fleet->cycleMaxFleetCost(); break; |
From: <you...@us...> - 2003-11-11 07:31:54
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv27119/source/melee Modified Files: mfleet.cpp mfleet.h Log Message: adding "max cost" to Fleet; adding GUI for changing a fleet's max cost in fleet editor; adding a terrible effect to indicate when a fleet has exceeded its maximum size Index: mfleet.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mfleet.cpp 21 Oct 2003 02:02:35 -0000 1.11 --- mfleet.cpp 11 Nov 2003 07:31:51 -0000 1.12 *************** *** 37,49 **** ! char * Fleet::sortingMethodName[] = { ! "Name", ! "Cost", ! "Species", ! "Ship Name", ! "Coders", ! "Origin" ! }; --- 37,56 ---- ! char * Fleet::sortingMethodName[] = { ! "Name", ! "Cost", ! "Species", ! "Ship Name", ! "Coders", ! "Origin" ! }; + char * Fleet::fleetCostName[] = { + "Small",//FLEET_SIZE_SMALL = 100, + "Medium",//FLEET_SIZE_MEDIUM = 250, + "Large",//FLEET_SIZE_LARGE = 500, + "Huge",//FLEET_SIZE_HUGE = 1000, + "Massive"//FLEET_SIZE_MASSIVE = 10000 + }; *************** *** 67,71 **** Fleet::Fleet() {STACKTRACE ! cost = 0; memset(title, '\0', MAX_TITLE_LENGTH); }; --- 74,79 ---- Fleet::Fleet() {STACKTRACE ! cost = 0; ! maxFleetCost = (FleetCost)FLEET_COST_DEFAULT; memset(title, '\0', MAX_TITLE_LENGTH); }; *************** *** 181,185 **** char slot_str[8]; ! sort(ships.begin(), ships.end()); if (filename) --- 189,194 ---- char slot_str[8]; ! sort(ships.begin(), ships.end()); ! if (filename) *************** *** 193,197 **** set_config_int(section, "Size", count); ! set_config_string(section, "Title", title); } --- 202,207 ---- set_config_int(section, "Size", count); ! set_config_string(section, "Title", title); ! set_config_int(section, "MaxFleetCost", getMaxCost()); } *************** *** 206,211 **** if (filename) set_config_file(filename); int _fleet_size = get_config_int(section, "Size", 0); ! _fleet_title = get_config_string(section, "Title", ""); ! sprintf(title, _fleet_title); count = 0; --- 216,222 ---- if (filename) set_config_file(filename); int _fleet_size = get_config_int(section, "Size", 0); ! _fleet_title = get_config_string(section, "Title", ""); ! sprintf(title, _fleet_title); ! maxFleetCost = (FleetCost) get_config_int(section, "MaxFleetCost", FLEET_COST_DEFAULT); count = 0; Index: mfleet.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mfleet.h 21 Oct 2003 02:02:35 -0000 1.7 --- mfleet.h 11 Nov 2003 07:31:51 -0000 1.8 *************** *** 11,20 **** using namespace std; //TODO get rid of global variables used by this function; remove this function void init_fleet(); // inits reference_fleet [former shiptype array] ! /** \brief Contains a list of ships. ! */ class Fleet{ --- 11,20 ---- using namespace std; + //TODO get rid of global variables used by this function; remove this function void init_fleet(); // inits reference_fleet [former shiptype array] ! /** \brief Contains a list of ships. */ class Fleet{ *************** *** 25,29 **** typedef vector<MyFleetShipType> MyFleetListType; ! static char * sortingMethodName[]; public: --- 25,31 ---- typedef vector<MyFleetShipType> MyFleetListType; ! static char * sortingMethodName[]; ! static char * fleetCostName[]; ! public: *************** *** 31,37 **** enum { MAX_TITLE_LENGTH = 80 }; - //dunno why this doesn't work in VC++ ... ? - //const static int MAX_TITLE_LENGTH = 80; - enum SortingMethod { SORTING_METHOD_NAME = 0, /**< combined Specied/ship name */ --- 33,36 ---- *************** *** 59,65 **** /** */ ! static char * getSortingMethodName(SortingMethod method) { return sortingMethodName[method]; ! } --- 58,135 ---- /** */ ! static char * getSortingMethodName(SortingMethod method) { ! ASSERT( ! ( (method > MAX_SORTING_METHODS) || (method < 0)) ); ! ! if ( (method > MAX_SORTING_METHODS) || (method < 0)) ! return ""; return sortingMethodName[method]; ! } ! ! enum FleetCost { ! FLEET_COST_SMALL = 100, ! FLEET_COST_MEDIUM = 250, ! FLEET_COST_LARGE = 500, ! FLEET_COST_HUGE = 1000, ! FLEET_COST_MASSIVE = 10000 ! }; ! ! enum { FLEET_COST_DEFAULT = FLEET_COST_LARGE }; ! enum { FIRST_FLEET_COST = FLEET_COST_SMALL }; ! enum { MAX_FLEET_COSTS = FLEET_COST_MASSIVE }; ! ! /** \brief cycles through each of the available preset maximum fleet sizes. ! \return the new fleet size */ ! FleetCost cycleMaxFleetCost() { ! ASSERT (!( (size != FLEET_COST_SMALL) && ! (size != FLEET_COST_MEDIUM) && ! (size != FLEET_COST_LARGE) && ! (size != FLEET_COST_HUGE) && ! (size != FLEET_COST_MASSIVE) )); ! ! switch (maxFleetCost) { ! case FLEET_COST_SMALL: ! maxFleetCost = FLEET_COST_MEDIUM; break; ! case FLEET_COST_MEDIUM: ! maxFleetCost = FLEET_COST_LARGE; break; ! case FLEET_COST_LARGE: ! maxFleetCost = FLEET_COST_HUGE; break; ! case FLEET_COST_HUGE: ! maxFleetCost = FLEET_COST_MASSIVE; break; ! case FLEET_COST_MASSIVE: ! maxFleetCost = FLEET_COST_SMALL; break; ! default: ! ASSERT(0); ! } ! return maxFleetCost; ! } ! ! protected: ! /** \brief the maximum cost this fleet will allow */ ! FleetCost maxFleetCost; ! ! public: ! ! static char * getFleetCostName(FleetCost size) { ! ! ASSERT (!( (size != FLEET_COST_SMALL) && ! (size != FLEET_COST_MEDIUM) && ! (size != FLEET_COST_LARGE) && ! (size != FLEET_COST_HUGE) && ! (size != FLEET_COST_MASSIVE) )); ! ! // this has got to be the worst solution ever :) ! int index = 0; ! switch (size) { ! case FLEET_COST_SMALL: index = 0; break; ! case FLEET_COST_MEDIUM: index = 1; break; ! case FLEET_COST_LARGE: index = 2; break; ! case FLEET_COST_HUGE: index = 3; break; ! case FLEET_COST_MASSIVE: index = 4; break; ! default: ! ASSERT(0); ! } ! return fleetCostName[index]; ! } ! *************** *** 159,168 **** ShipType * operator[](int offset) { return getShipType( offset ); ! } protected: - //STL list /** \brief the title of this fleet*/ --- 229,247 ---- ShipType * operator[](int offset) { return getShipType( offset ); ! } ! ! /** @brief returns the maximum number of ships that this fleet can hold */ ! int getMaxNumberOfShips() { return MAX_FLEET_SIZE; } ! ! /** @brief returns the maximum sum of costs of each ship in the fleet */ ! FleetCost getMaxCost() { return maxFleetCost; } ! ! ! ! protected: /** \brief the title of this fleet*/ *************** *** 173,177 **** /** \brief the list of ships*/ ! MyFleetListType ships; --- 252,257 ---- /** \brief the list of ships*/ ! MyFleetListType ships; ! |
From: <you...@us...> - 2003-11-11 06:16:06
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv16484/source Modified Files: scp.cpp Log Message: fleet editor now shows total cost of fleet Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** scp.cpp 10 Nov 2003 20:08:45 -0000 1.16 --- scp.cpp 11 Nov 2003 06:16:03 -0000 1.17 *************** *** 1179,1187 **** { d_button_proc, 574, 40, 56, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Load", NULL, NULL },//FLEET_DIALOG_LOAD_BUTTON { d_textbox_proc, 390, 60, 128, 20, 255, 0, 0, 0, 0, 0, (void *)"Point Limit", NULL, NULL },//FLEET_DIALOG_POINT_LIMIT_TEXT ! { d_button_proc, 518, 60, 112, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"300", NULL, NULL },//FLEET_DIALOG_POINT_LIMIT_BUTTON { d_textbox_proc, 390, 80, 128, 20, 255, 0, 0, 0, 0, 0, (void *)"Current Points", NULL, NULL },//FLEET_DIALOG_CURRENT_POINTS_TEXT ! { d_textbox_proc, 518, 80, 112, 20, 255, 0, 0, 0, 0, 0, (void *)"100", NULL, NULL },//FLEET_DIALOG_CURRENT_POINTS_VALUE { d_textbox_proc, 390, 120, 64, 20, 255, 0, 0, 0, 0, 0, (void *)"Sort By:", NULL, NULL },//FLEET_DIALOG_SORTBY_TEXT2 ! { d_button_proc, 454, 120, 128, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Cost TODO", NULL, NULL },//FLEET_DIALOG_SORTBY_BUTTON2 { d_button_proc, 582, 120, 16, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"^", NULL, NULL },//FLEET_DIALOG_SORTBY_ASCENDING2 --- 1179,1187 ---- { d_button_proc, 574, 40, 56, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Load", NULL, NULL },//FLEET_DIALOG_LOAD_BUTTON { d_textbox_proc, 390, 60, 128, 20, 255, 0, 0, 0, 0, 0, (void *)"Point Limit", NULL, NULL },//FLEET_DIALOG_POINT_LIMIT_TEXT ! { d_button_proc, 518, 60, 112, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"300\0 ", NULL, NULL },//FLEET_DIALOG_POINT_LIMIT_BUTTON { d_textbox_proc, 390, 80, 128, 20, 255, 0, 0, 0, 0, 0, (void *)"Current Points", NULL, NULL },//FLEET_DIALOG_CURRENT_POINTS_TEXT ! { d_textbox_proc, 518, 80, 112, 20, 255, 0, 0, 0, 0, 0, (void *)"100\0 ", NULL, NULL },//FLEET_DIALOG_CURRENT_POINTS_VALUE { d_textbox_proc, 390, 120, 64, 20, 255, 0, 0, 0, 0, 0, (void *)"Sort By:", NULL, NULL },//FLEET_DIALOG_SORTBY_TEXT2 ! { d_button_proc, 454, 120, 128, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Cost\0 ", NULL, NULL },//FLEET_DIALOG_SORTBY_BUTTON2 { d_button_proc, 582, 120, 16, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"^", NULL, NULL },//FLEET_DIALOG_SORTBY_ASCENDING2 *************** *** 1194,1200 **** 256, 10, 128, 200, 255, 0, 0, 0, 0, 0, (void *)NULL, NULL, NULL },//FLEET_DIALOG_SHIP_PICTURE_BITMAP { d_textbox_proc, 10, 372, 310, 85, 255, 0, 0, 0, 0, 0, (void *)"SHIP PICTURE TODO", NULL, NULL },//FLEET_DIALOG_SHIP_STATS_BITMAP ! { d_textbox_proc, 325, 372, 305, 85, 255, 0, 0, 0, 0, 0, (void *)"Summary Text", NULL, NULL },//FLEET_DIALOG_SHIP_SUMMARY_TEXT { d_button_proc, 10, 460, 64, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Back", NULL, NULL },//FLEET_DIALOG_BACK_BUTTON ! { d_textbox_proc, 74, 460, 556, 20, 255, 0, 0, 0, 0, 0, (void *)"Help Text", NULL, NULL },//FLEET_DIALOG_HELP_TEXT { d_tw_yield_proc, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL }, --- 1194,1200 ---- 256, 10, 128, 200, 255, 0, 0, 0, 0, 0, (void *)NULL, NULL, NULL },//FLEET_DIALOG_SHIP_PICTURE_BITMAP { d_textbox_proc, 10, 372, 310, 85, 255, 0, 0, 0, 0, 0, (void *)"SHIP PICTURE TODO", NULL, NULL },//FLEET_DIALOG_SHIP_STATS_BITMAP ! { d_textbox_proc, 325, 372, 305, 85, 255, 0, 0, 0, 0, 0, (void *)"Summary Text\0 ", NULL, NULL },//FLEET_DIALOG_SHIP_SUMMARY_TEXT { d_button_proc, 10, 460, 64, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Back", NULL, NULL },//FLEET_DIALOG_BACK_BUTTON ! { d_textbox_proc, 74, 460, 556, 20, 255, 0, 0, 0, 0, 0, (void *)"Help Text\0 ", NULL, NULL },//FLEET_DIALOG_HELP_TEXT { d_tw_yield_proc, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL }, *************** *** 1206,1209 **** --- 1206,1211 ---- char tmp[40]; char path[80]; + char fleetCostString[80] = ""; + static Fleet::SortingMethod sortMethod1 = (Fleet::SortingMethod) Fleet::SORTING_METHOD_DEFAULT, *************** *** 1233,1236 **** --- 1235,1242 ---- fleetDialog[FLEET_DIALOG_SORTBY_BUTTON1].dp = Fleet::getSortingMethodName(sortMethod1); fleetDialog[FLEET_DIALOG_SORTBY_BUTTON2].dp = Fleet::getSortingMethodName(sortMethod2); + + sprintf(fleetCostString,"%d", fleet->getCost()); + fleetDialog[FLEET_DIALOG_CURRENT_POINTS_VALUE].dp = fleetCostString; + if (sortAscending1) fleetDialog[FLEET_DIALOG_SORTBY_ASCENDING1].dp = (void *)"^"; *************** *** 1276,1279 **** --- 1282,1286 ---- if (selectedSlot != -1) fleetDialog[FLEET_DIALOG_FLEET_SHIPS_LIST].d1 = selectedSlot; + break; *************** *** 1283,1290 **** case FLEET_DIALOG_LOAD_BUTTON: break; case FLEET_DIALOG_POINT_LIMIT_TEXT: break; ! case FLEET_DIALOG_POINT_LIMIT_BUTTON: break; case FLEET_DIALOG_CURRENT_POINTS_TEXT: break; case FLEET_DIALOG_CURRENT_POINTS_VALUE: break; case FLEET_DIALOG_SORTBY_TEXT2: break; case FLEET_DIALOG_SORTBY_BUTTON2: sortMethod2 = Fleet::cycleSortingMethod(sortMethod2); --- 1290,1302 ---- case FLEET_DIALOG_LOAD_BUTTON: break; case FLEET_DIALOG_POINT_LIMIT_TEXT: break; ! case FLEET_DIALOG_POINT_LIMIT_BUTTON: ! ! ! break; ! case FLEET_DIALOG_CURRENT_POINTS_TEXT: break; case FLEET_DIALOG_CURRENT_POINTS_VALUE: break; case FLEET_DIALOG_SORTBY_TEXT2: break; + case FLEET_DIALOG_SORTBY_BUTTON2: sortMethod2 = Fleet::cycleSortingMethod(sortMethod2); |
From: <you...@us...> - 2003-11-11 04:41:03
|
Update of /cvsroot/timewarp/Util In directory sc8-pr-cvs1:/tmp/cvs-serv3135 Added Files: patch-script.sh Log Message: adding yurnad's patch-making utility. Ironically, this file should probably be skipped from releases and patches --- NEW FILE: patch-script.sh --- #!/bin/sh if [ $2 ]; then NEW_FILELIST=`find $2 -type f "(" -name "*.*" ")" | grep -v CVS[/]`; OUTDIR=TIMEWARP_TEMPDIR; OUTFILE=`date +%D | sed s/[/]/_/g`; mkdir $OUTDIR; for file in $NEW_FILELIST; do basename_file=`ls $file | sed s/$2[/]//g`; dif=`diff -q -P -N $1/$basename_file $2/$basename_file 2>&1`; if [ "$dif" ]; then cd $2; cp --parents $basename_file ../$OUTDIR; cd ..; fi done cd $OUTDIR; tar -cf ../$1_to_$OUTFILE.tar *; cd ..; gzip -f -9 $1_to_$OUTFILE.tar; rm -f -r $OUTDIR; else echo "Usage: patch-script.sh OLD_DIR NEW_DIR"; fi |
From: <you...@us...> - 2003-11-11 04:38:22
|
Update of /cvsroot/timewarp/docs In directory sc8-pr-cvs1:/tmp/cvs-serv2692/docs Modified Files: Interface.txt Log Message: arbitrary commit Index: Interface.txt =================================================================== RCS file: /cvsroot/timewarp/docs/Interface.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Interface.txt 5 Nov 2003 07:53:57 -0000 1.5 --- Interface.txt 11 Nov 2003 04:38:18 -0000 1.6 *************** *** 381,385 **** Section: Confgure Local Players ******************************************** ! Goals: Declares which players are available for a given instance of a game; player availability and options may vary by the selected gametype. Some common options: * declare the player as playing * for each player, set the starting team --- 381,385 ---- Section: Confgure Local Players ******************************************** ! Goals: Declares which players are available for a given instance of a game; player availability and options may vary by the selected gametype. Some options the should appear for some gametypes: * declare the player as playing * for each player, set the starting team |
From: <you...@us...> - 2003-11-10 20:08:49
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv2956/source Modified Files: scp.cpp Log Message: fixed add button Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** scp.cpp 1 Nov 2003 13:24:26 -0000 1.15 --- scp.cpp 10 Nov 2003 20:08:45 -0000 1.16 *************** *** 1,1848 **** ! /* ! * Star Control - TimeWarp ! * ! * scp.cpp - Main project module ! * ! * 25-Jun-2002 ! * ! * - key jamming tester revised to accomodate joystick. ! * - re-added d_tw_yeildslice stuff ! * - improved "debug" button [...3667 lines suppressed...] ! tmp += sprintf(tmp, " %d %d %s", player_team[index], player_config[index], player_type[index]); ! if ((strlen(buf) >= 80)) tw_error("playerListboxGetter string too long"); ! return buf; ! } ! } ! ! char *controlListboxGetter(int index, int *list_size) { ! static char tmp[40]; ! ! tmp[0] = 0; ! if(index < 0) { ! *list_size = num_controls; ! return NULL; ! } else { ! return(control_name[index]); ! } ! } ! ! ! |
From: <geo...@us...> - 2003-11-09 23:53:04
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1:/tmp/cvs-serv25155 Modified Files: twwin.dsp Log Message: project update because of a new ship |
From: <geo...@us...> - 2003-11-09 23:48:42
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv24277 Added Files: shpwolsw.dat shpwolsw.ini shpwolsw.txt Log Message: added new ship (data) --- NEW FILE: shpwolsw.dat --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shpwolsw.ini --- [Info] TWCost = 26 Name1 = Woldanish Name2 = Minesweeper Origin = TW Gfx = GeomanNL Sfx = none Coders = GeomanNL Code = Wolly [Ship] Crew = 30 CrewMax = 30 Batt = 8 BattMax = 8 SpeedMax = 30 AccelRate = 6 TurnRate = 3 RechargeAmount = 1 RechargeRate = 12 WeaponDrain = 4 WeaponRate = 15 SpecialDrain = 1 SpecialRate = 6 HotspotRate = 8 Mass = 20 [Weapon] Range = 15 Velocity = 70 Damage = 2 Armour = 2 [Special] Damage = 1 LifeTime = 30.0 ; lifetime (in seconds). [AI3_Default] --- NEW FILE: shpwolsw.txt --- Woldanish Sweeper Main weapon: Plasma cloud. This slowly loses power as it travels (like a Mycon Plasmoid), but when it receives damage, it adds to its power by absorbing the energy from the blast. If the plasma absorbs too much energy, it breaks into separate clouds. Special weapon: A mine. |
From: <geo...@us...> - 2003-11-09 11:27:24
|
Update of /cvsroot/timewarp/ships/sc1 In directory sc8-pr-cvs1:/tmp/cvs-serv26725/sc1 Modified Files: shpmycpo.txt Log Message: alhordian tweak Index: shpmycpo.txt =================================================================== RCS file: /cvsroot/timewarp/ships/sc1/shpmycpo.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpmycpo.txt 8 Jun 2003 17:55:37 -0000 1.1 --- shpmycpo.txt 9 Nov 2003 11:27:21 -0000 1.2 *************** *** 1,5 **** The Mycon Podship is one of the original ships ! from Star Control 1. They were on the Alliance side. They formed an important addition to the UQ fleets, --- 1,5 ---- The Mycon Podship is one of the original ships ! from Star Control 1. They were on the Hierarchy side. They formed an important addition to the UQ fleets, *************** *** 19,24 **** of organic origin. They can quickly produce new individuals from spores in a hot radiative environment. ! They have a shared memory, forming some huge overmind, ! but which is somewhat incoherent ;) The Mycon were mostly important for their hostile --- 19,23 ---- of organic origin. They can quickly produce new individuals from spores in a hot radiative environment. ! They have a shared memory, which is somewhat incoherent ;) The Mycon were mostly important for their hostile |
From: <geo...@us...> - 2003-11-09 11:27:24
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv26725 Modified Files: shpalhdr.dat shpalhdr.ini shpbatde.ini Log Message: alhordian tweak Index: shpalhdr.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpalhdr.dat,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsGLx2WN and /tmp/cvsURDD4r differ Index: shpalhdr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpalhdr.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpalhdr.ini 1 Nov 2003 13:26:05 -0000 1.6 --- shpalhdr.ini 9 Nov 2003 11:27:21 -0000 1.7 *************** *** 65,72 **** --- 65,74 ---- [Special] + ; (x,y) not used anymore StartX = -0.32 EndX = -0.32 StartY = -0.44 EndY = 0.04 + StartAngle = -185 EndAngle = -5 *************** *** 76,79 **** --- 78,85 ---- Damage = 1 Sustain = 125 + + ; position of the laser + DX = -5 + DY = -17 [AI3_Default] Index: shpbatde.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpbatde.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpbatde.ini 20 Oct 2003 20:40:29 -0000 1.5 --- shpbatde.ini 9 Nov 2003 11:27:21 -0000 1.6 *************** *** 40,43 **** --- 40,44 ---- ; gas cloud :) LifeTime = 3.0 + Damage = 1 |
From: <geo...@us...> - 2003-11-09 11:26:56
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1:/tmp/cvs-serv26649/newships Modified Files: shpalhdr.cpp Log Message: alhordian tweak Index: shpalhdr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpalhdr.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpalhdr.cpp 1 Nov 2003 13:24:26 -0000 1.8 --- shpalhdr.cpp 9 Nov 2003 11:26:52 -0000 1.9 *************** *** 37,42 **** int flashColor; ! double specialStartX, specialStartY; ! double specialEndX, specialEndY; double specialStartAngle, specialEndAngle; double specialStartRange, specialEndRange; --- 37,42 ---- int flashColor; ! // double specialStartX, specialStartY; ! // double specialEndX, specialEndY; double specialStartAngle, specialEndAngle; double specialStartRange, specialEndRange; *************** *** 45,48 **** --- 45,53 ---- double specialDamage; int specialSustain; + + double laser_angle; + int laser_direction; + int laser_direction_change; + Vector2 rP1, rP2; public: *************** *** 53,63 **** virtual int activate_special(); virtual void calculate(); void weapon_flash(); void calculate_laser_sweep(); - - private: - - // int weaponSpriteNumber; - // int justBorn; }; --- 58,64 ---- virtual int activate_special(); virtual void calculate(); + virtual void animate(Frame *f); void weapon_flash(); void calculate_laser_sweep(); }; *************** *** 86,90 **** virtual void calculate(void); - //virtual void animateExplosion(void); void inflict_damage(SpaceObject *other); }; --- 87,90 ---- *************** *** 132,139 **** flashDamage7 = get_config_int("Flash", "Damage7", 0); ! specialStartX = get_config_float("Special", "StartX", 0); ! specialStartY = get_config_float("Special", "StartY", 0); ! specialEndX = get_config_float("Special", "EndX", 0); ! specialEndY = get_config_float("Special", "EndY", 0); specialStartAngle = get_config_float("Special", "StartAngle", 0) * ANGLE_RATIO; specialEndAngle = get_config_float("Special", "EndAngle", 0) * ANGLE_RATIO; --- 132,139 ---- flashDamage7 = get_config_int("Flash", "Damage7", 0); ! // specialStartX = get_config_float("Special", "StartX", 0); ! // specialStartY = get_config_float("Special", "StartY", 0); ! // specialEndX = get_config_float("Special", "EndX", 0); ! // specialEndY = get_config_float("Special", "EndY", 0); specialStartAngle = get_config_float("Special", "StartAngle", 0) * ANGLE_RATIO; specialEndAngle = get_config_float("Special", "EndAngle", 0) * ANGLE_RATIO; *************** *** 147,150 **** --- 147,162 ---- currentSweepTime = 0; //pulling up on sweepIsOn = FALSE; + + laser_angle = specialStartAngle; + laser_direction = 1; + laser_direction_change = 0; + + int dx, dy; + dx = get_config_int("Special", "DX", -5); + dy = get_config_int("Special", "DY", -5); + rP1 = Vector2(dx, dy); + rP2 = Vector2(dx, -dy); + // rP1 = Vector2(-5, -17); + // rP2 = Vector2(-5, 17); } *************** *** 164,172 **** if (sweepIsOn) { ! if (!fire_weapon && fire_special) ! currentSweepTime += frame_time; ! else if (fire_weapon && fire_special) ! currentSweepTime -= frame_time; } } --- 176,194 ---- if (sweepIsOn) { ! // if (!fire_weapon && fire_special) ! // currentSweepTime += frame_time; ! // ! // else if (fire_weapon && fire_special) ! // currentSweepTime -= frame_time; ! currentSweepTime += laser_direction * frame_time; ! if (laser_direction_change > 0) ! laser_direction_change -= frame_time; ! ! if (fire_weapon && laser_direction_change <= 0) ! { ! laser_direction = -laser_direction; ! laser_direction_change = 250; ! } } } *************** *** 178,182 **** --- 200,206 ---- if (fire_special) + { return false; + } AlhordianTorpedo* KT; *************** *** 252,256 **** double fractionDone; ! double X, Y, Angle, Length; if ( currentSweepTime < 0 ) --- 276,281 ---- double fractionDone; ! //double X, Y, ! double Angle, Length; if ( currentSweepTime < 0 ) *************** *** 267,281 **** fractionDone = currentSweepTime / specialTime; ! X = specialStartX * (1-fractionDone) + specialEndX * fractionDone; ! Y = specialStartY * (1-fractionDone) + specialEndY * fractionDone; Angle = specialStartAngle * (1-fractionDone) + specialEndAngle * (fractionDone); Length = specialStartRange * (1-fractionDone) + specialEndRange * (fractionDone); ! game->add(new Laser(this,Angle+angle, palette_color[9], Length, specialDamage, specialSustain, ! this, Vector2(size.y * X, size.y * Y), TRUE)); game->add(new Laser(this,-Angle+angle, palette_color[9], Length, specialDamage, specialSustain, ! this, Vector2(-size.y * X, size.y * Y), TRUE)); } --- 292,313 ---- fractionDone = currentSweepTime / specialTime; ! // X = specialStartX * (1-fractionDone) + specialEndX * fractionDone; ! // Y = specialStartY * (1-fractionDone) + specialEndY * fractionDone; Angle = specialStartAngle * (1-fractionDone) + specialEndAngle * (fractionDone); Length = specialStartRange * (1-fractionDone) + specialEndRange * (fractionDone); ! ! laser_angle = Angle; ! ! Vector2 rP; ! rP = rotate(rP2, PI/2); ! game->add(new Laser(this,Angle+angle, palette_color[9], Length, specialDamage, specialSustain, ! this, rP /*Vector2(size.y * X, size.y * Y)*/, TRUE)); + rP = rotate(rP1, PI/2); + game->add(new Laser(this,-Angle+angle, palette_color[9], Length, specialDamage, specialSustain, ! this, rP/*Vector2(-size.y * X, size.y * Y)*/, TRUE)); } *************** *** 356,359 **** --- 388,409 ---- + + void AlhordianDreadnought::animate(Frame *f) + { + Ship::animate(f); + + int laser_index; + Vector2 P; + + P = pos + rotate(rP1, angle); + laser_index = get_index(angle + laser_angle); + + data->spriteExtra->animate(P, laser_index, f); + + P = pos + rotate(rP2, angle); + laser_index = get_index(angle - laser_angle); + + data->spriteExtra->animate(P, laser_index, f); + } REGISTER_SHIP (AlhordianDreadnought) |