You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/timewarp/source/util/lua In directory sc8-pr-cvs1:/tmp/cvs-serv19203/source/util/lua Removed Files: lapi.c lapi.h lcode.c lcode.h ldebug.c ldebug.h ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c lgc.h llex.c llex.h llimits.h lmem.c lmem.h lobject.c lobject.h lopcodes.c lopcodes.h lparser.c lparser.h lstate.c lstate.h lstring.c lstring.h ltable.c ltable.h ltests.c ltm.c ltm.h lundump.c lundump.h lvm.c lvm.h lzio.c lzio.h Log Message: removed lua source --- lapi.c DELETED --- --- lapi.h DELETED --- --- lcode.c DELETED --- --- lcode.h DELETED --- --- ldebug.c DELETED --- --- ldebug.h DELETED --- --- ldo.c DELETED --- --- ldo.h DELETED --- --- ldump.c DELETED --- --- lfunc.c DELETED --- --- lfunc.h DELETED --- --- lgc.c DELETED --- --- lgc.h DELETED --- --- llex.c DELETED --- --- llex.h DELETED --- --- llimits.h DELETED --- --- lmem.c DELETED --- --- lmem.h DELETED --- --- lobject.c DELETED --- --- lobject.h DELETED --- --- lopcodes.c DELETED --- --- lopcodes.h DELETED --- --- lparser.c DELETED --- --- lparser.h DELETED --- --- lstate.c DELETED --- --- lstate.h DELETED --- --- lstring.c DELETED --- --- lstring.h DELETED --- --- ltable.c DELETED --- --- ltable.h DELETED --- --- ltests.c DELETED --- --- ltm.c DELETED --- --- ltm.h DELETED --- --- lundump.c DELETED --- --- lundump.h DELETED --- --- lvm.c DELETED --- --- lvm.h DELETED --- --- lzio.c DELETED --- --- lzio.h DELETED --- |
From: <you...@us...> - 2003-12-03 07:50:24
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv6607/source Modified Files: scp.cpp Log Message: in fleet editor, ship pictures now show up. This implementation is too slow, fixing it may require some discussion Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** scp.cpp 25 Nov 2003 00:13:12 -0000 1.27 --- scp.cpp 3 Dec 2003 07:50:20 -0000 1.28 *************** *** 1117,1120 **** --- 1117,1121 ---- FLEET_DIALOG_AVAILABLE_SHIPS_TEXT=0, FLEET_DIALOG_SHIP_CATAGORIES_TEXT, + //TEMP, FLEET_DIALOG_SC1_TOGGLE, FLEET_DIALOG_SC2_TOGGLE, *************** *** 1144,1148 **** FLEET_DIALOG_CLEARALL, FLEET_DIALOG_SHIP_PICTURE_BITMAP, ! FLEET_DIALOG_SHIP_STATS_BITMAP, FLEET_DIALOG_SHIP_SUMMARY_TEXT, FLEET_DIALOG_BACK_BUTTON, --- 1145,1149 ---- FLEET_DIALOG_CLEARALL, FLEET_DIALOG_SHIP_PICTURE_BITMAP, ! //FLEET_DIALOG_SHIP_STATS_BITMAP, FLEET_DIALOG_SHIP_SUMMARY_TEXT, FLEET_DIALOG_BACK_BUTTON, *************** *** 1204,1208 **** { 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, // x=30-->x=10 10, 52, 128, 14, 255, 0, 0,D_EXIT | D_SELECTED, 0, 0, (void *)"SC1", NULL, NULL },//FLEET_DIALOG_SC1_TOGGLE --- 1205,1209 ---- { 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, // x=30-->x=10 10, 52, 128, 14, 255, 0, 0,D_EXIT | D_SELECTED, 0, 0, (void *)"SC1", NULL, NULL },//FLEET_DIALOG_SC1_TOGGLE *************** *** 1225,1234 **** { d_button_proc, 197, 121, 16, 17, 255, 0, 0,D_EXIT, 0, 0, (void *)"^", NULL, NULL },//FLEET_DIALOG_SORTBY_ASCENDING1 ! { d_list_proc, 10, 141, 240, 227, 255, 0, 0,D_EXIT, 0, 0, (void *)shippointsListboxGetter, NULL, NULL },//FLEET_DIALOG_AVAILABLE_SHIPS_LIST { d_list_proc2, 390, 141, 240, 227, 255, 0, 0,D_EXIT, 0, 0, (void *)fleetpointsListboxGetter, NULL, NULL },//FLEET_DIALOG_FLEET_SHIPS_LIST // (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) { d_button_proc, 390, 10, 240, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Player 1 Fleet", NULL, NULL },//FLEET_DIALOG_PLAYER_FLEET_BUTTON ! { d_textbox_proc, 390, 40, 128, 20, 255, 0, 0, 0, 0, 0, (void *)"Fleet Title", NULL, NULL },//FLEET_DIALOG_PLAYER_FLEET_TITLE { d_button_proc, 518, 40, 56, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Save", NULL, NULL },//FLEET_DIALOG_SAVE_BUTTON { d_button_proc, 574, 40, 56, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Load", NULL, NULL },//FLEET_DIALOG_LOAD_BUTTON --- 1226,1236 ---- { d_button_proc, 197, 121, 16, 17, 255, 0, 0,D_EXIT, 0, 0, (void *)"^", NULL, NULL },//FLEET_DIALOG_SORTBY_ASCENDING1 ! { scp_fleet_dialog_text_list_proc, ! 10, 141, 240, 227, 255, 0, 0,D_EXIT, 0, 0, (void *)shippointsListboxGetter, NULL, NULL },//FLEET_DIALOG_AVAILABLE_SHIPS_LIST { d_list_proc2, 390, 141, 240, 227, 255, 0, 0,D_EXIT, 0, 0, (void *)fleetpointsListboxGetter, NULL, NULL },//FLEET_DIALOG_FLEET_SHIPS_LIST // (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) { d_button_proc, 390, 10, 240, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Player 1 Fleet", NULL, NULL },//FLEET_DIALOG_PLAYER_FLEET_BUTTON ! { d_button_proc, 390, 40, 128, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Fleet Title", NULL, NULL },//FLEET_DIALOG_PLAYER_FLEET_TITLE { d_button_proc, 518, 40, 56, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Save", NULL, NULL },//FLEET_DIALOG_SAVE_BUTTON { d_button_proc, 574, 40, 56, 20, 255, 0, 0,D_EXIT, 0, 0, (void *)"Load", NULL, NULL },//FLEET_DIALOG_LOAD_BUTTON *************** *** 1247,1252 **** { d_button_proc, 270, 290, 100, 25, 255, 0, 0,D_EXIT, 0, 0, (void *)"Remove All", NULL, NULL },//FLEET_DIALOG_CLEARALL { scp_fleet_dialog_bitmap_proc, ! 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 --- 1249,1257 ---- { d_button_proc, 270, 290, 100, 25, 255, 0, 0,D_EXIT, 0, 0, (void *)"Remove All", NULL, NULL },//FLEET_DIALOG_CLEARALL { scp_fleet_dialog_bitmap_proc, ! 10, 372, 85, 85, 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 *************** *** 1403,1410 **** case FLEET_DIALOG_PLAYER_FLEET_BUTTON: break; ! case FLEET_DIALOG_PLAYER_FLEET_TITLE: break; case FLEET_DIALOG_SAVE_BUTTON: break; case FLEET_DIALOG_LOAD_BUTTON: break; case FLEET_DIALOG_POINT_LIMIT_TEXT: break; case FLEET_DIALOG_POINT_LIMIT_BUTTON: fleet->cycleMaxFleetCost(); --- 1408,1422 ---- case FLEET_DIALOG_PLAYER_FLEET_BUTTON: break; ! ! case FLEET_DIALOG_PLAYER_FLEET_TITLE: ! if(do_dialog(fleet_titleDialog, FLEET_TITLE_DIALOG_BOX) == FLEET_TITLE_DIALOG_OK) ! sprintf(fleet->getTitle(), title_str); ! showTitle(); ! break; ! case FLEET_DIALOG_SAVE_BUTTON: break; case FLEET_DIALOG_LOAD_BUTTON: break; case FLEET_DIALOG_POINT_LIMIT_TEXT: break; + case FLEET_DIALOG_POINT_LIMIT_BUTTON: fleet->cycleMaxFleetCost(); *************** *** 1434,1438 **** case FLEET_DIALOG_CLEARALL: break; case FLEET_DIALOG_SHIP_PICTURE_BITMAP: break; ! case FLEET_DIALOG_SHIP_STATS_BITMAP: break; case FLEET_DIALOG_SHIP_SUMMARY_TEXT: break; case FLEET_DIALOG_BACK_BUTTON: break; --- 1446,1450 ---- case FLEET_DIALOG_CLEARALL: break; case FLEET_DIALOG_SHIP_PICTURE_BITMAP: break; ! //case FLEET_DIALOG_SHIP_STATS_BITMAP: break; case FLEET_DIALOG_SHIP_SUMMARY_TEXT: break; case FLEET_DIALOG_BACK_BUTTON: break; *************** *** 1498,1506 **** }*/ - /*if(fleetRet == FLEET_DIALOG_PLAYER_FLEET_TITLE) { - if(do_dialog(fleet_titleDialog, FLEET_TITLE_DIALOG_BOX) == FLEET_TITLE_DIALOG_OK) - sprintf(fleet->getTitle(), title_str); - showTitle(); - }*/ } while((fleetRet != FLEET_DIALOG_BACK_BUTTON) && (fleetRet != -1)); --- 1510,1513 ---- *************** *** 1518,1555 **** int ret = d_text_list_proc( msg, d, c ); if ( d->d1 != old_d1 || msg == MSG_START || (msg == MSG_IDLE && next_anim_time < get_time()) ) { ! next_anim_time = get_time() + 50 + rand() % 200; ! //next_anim_time = get_time() + 500 + rand() % 3500; ShipType* type = reference_fleet->getShipType(d->d1); ! BITMAP* panel = NULL; ! DATAFILE* data = NULL; ! if (type && type->data) ! data = load_datafile_object(type->data->file, "SHIP_P00_PCX"); ! if(data) { BITMAP* bmp = (BITMAP*)data->dat; BITMAP* tmp = create_bitmap(bmp->w, bmp->h); ! // BITMAP* tmp = create_bitmap_ex( color_depth, bmp->w, bmp->h ); ! blit(bmp, tmp, 0, 0, 0, 0, bmp->w, bmp->h); ! unload_datafile_object(data); ! char obj[32]; sprintf(obj, "SHIP_P0%d_PCX", 1 + rand() % 4); data = load_datafile_object(type->data->file, obj); bmp = (BITMAP*)data->dat; blit(bmp, tmp, 0, 0, 4, 65, bmp->w, bmp->h); ! unload_datafile_object(data); // gamma_correct_bitmap( tmp, gamma_correction, 0 ); ! panel = create_bitmap(128, 200); ! // panel = create_bitmap_ex( color_depth, 128, 200 ); ! stretch_blit(tmp, panel, 0, 0, tmp->w, tmp->h, 0, 0, panel->w, panel->h); ! destroy_bitmap(tmp); ! } - if(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp) - destroy_bitmap( (BITMAP*)fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp ); - fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp = panel; //TODO decide if these next 3 lines should be here scare_mouse(); --- 1525,1623 ---- int ret = d_text_list_proc( msg, d, c ); + static BITMAP* panel = create_bitmap(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].w, + fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].h); + fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp = panel; + + static BITMAP * sprite = create_bitmap(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].w, + fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].h); + static int rotationFrame = 0; + + //selection has changed + if (d->d1 != old_d1) { + {ShipType* type = reference_fleet->getShipType(old_d1); + if (type && type->data) + type->data->unlock();} + + {ShipType* type = reference_fleet->getShipType(d->d1); + if (type && type->data) + type->data->lock();} + + rotationFrame = 0; + } + if ( d->d1 != old_d1 || msg == MSG_START || (msg == MSG_IDLE && next_anim_time < get_time()) ) { ! //next_anim_time = get_time() + 50 + rand() % 200; ! next_anim_time = get_time() + 20; ! ShipType* type = reference_fleet->getShipType(d->d1); + + clear_to_color(sprite, 0); ! if (type && type->data && type->data->spriteShip) { ! ! type->data->spriteShip->draw( ! Vector2(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].w/2, ! fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].h/2) - type->data->spriteShip->size()/2, ! type->data->spriteShip->size(), ! rotationFrame, sprite ! ); ! rotationFrame++; ! if (rotationFrame >= type->data->spriteShip->frames()) ! rotationFrame = 0; ! } ! stretch_blit(sprite, panel, 0, 0, sprite->w, sprite->h, 0, 0, panel->w, panel->h); ! ! ! ! ! //if(data) { ! ! ! //static DATAFILE* data = NULL; ! //if (type && type->data) ! // data = load_datafile_object(type->data->file, "SHIP_P00_PCX"); ! ! /* BITMAP* bmp = (BITMAP*)data->dat; + BITMAP* tmp = create_bitmap(bmp->w, bmp->h); ! //BITMAP* tmp = create_bitmap(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].w, ! // fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].h); ! //blit(bmp, tmp, 0, 0, 0, 0, bmp->w, bmp->h); ! ! stretch_blit(bmp, tmp, ! 0, 0, bmp->w, bmp->h, ! 0, 0, fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].w, ! fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].h);/**/ ! //unload_datafile_object(data); ! ! /*char obj[32]; sprintf(obj, "SHIP_P0%d_PCX", 1 + rand() % 4); data = load_datafile_object(type->data->file, obj); bmp = (BITMAP*)data->dat; blit(bmp, tmp, 0, 0, 4, 65, bmp->w, bmp->h); ! //blit(bmp, tmp, 0, 0, 4, 65, bmp->w, bmp->h); ! ! unload_datafile_object(data);*/ // gamma_correct_bitmap( tmp, gamma_correction, 0 ); ! //panel = create_bitmap(128, 200); ! ! ! ! //destroy_bitmap(sprite); ! ! //stretch_blit(tmp, panel, 0, 0, tmp->w, tmp->h, 0, 0, panel->w, panel->h); ! //destroy_bitmap(tmp); ! //} ! ! //if(fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp) ! // destroy_bitmap( (BITMAP*)fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp ); ! ! //fleetDialog[FLEET_DIALOG_SHIP_PICTURE_BITMAP].dp = panel; ! //TODO decide if these next 3 lines should be here scare_mouse(); *************** *** 1562,1569 **** int scp_fleet_dialog_bitmap_proc(int msg, DIALOG* d, int c) { ! if (msg == MSG_END && d->dp) { destroy_bitmap( (BITMAP*)d->dp ); d->dp = NULL; ! } if (msg != MSG_DRAW || d->dp) --- 1630,1638 ---- int scp_fleet_dialog_bitmap_proc(int msg, DIALOG* d, int c) { ! //TODO address this: bitmap has to be deleted, but MSG_END does not mean the dialog isn't coming back ! /*if (msg == MSG_END && d->dp) { destroy_bitmap( (BITMAP*)d->dp ); d->dp = NULL; ! }*/ if (msg != MSG_DRAW || d->dp) |
From: <yu...@us...> - 2003-11-27 05:45:42
|
Update of /cvsroot/timewarp/Util In directory sc8-pr-cvs1:/tmp/cvs-serv22247/Util Modified Files: timewarp.nsi Added Files: license.txt timewarp.ini Log Message: New Windows Installer. Used MUI. --- NEW FILE: license.txt --- Star Control: TimeWarp is public domain. --- NEW FILE: timewarp.ini --- [Settings] NumFields=3 [Field 1] Type=label Text=Install Options Page Left=0 Right=-1 Top=0 Bottom=10 [Field 2] Type=checkbox Text=Create Group Left=0 Right=-1 Top=20 Bottom=30 State=1 [Field 3] Type=checkbox Text=Create Shortcut Left=0 Right=-1 Top=40 Bottom=50 State=1 Index: timewarp.nsi =================================================================== RCS file: /cvsroot/timewarp/Util/timewarp.nsi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** timewarp.nsi 7 Nov 2003 06:19:59 -0000 1.2 --- timewarp.nsi 27 Nov 2003 05:45:39 -0000 1.3 *************** *** 1,35 **** ! ; timewarp.nsi ! ; ! ; This script is based on example2.nsi. ! ; ! ; It will install TimeWarp into a directory that the user selects. ;-------------------------------- ! !define VER_MAJOR 0.05 ! !define VER_MINOR 8 ! ; The name of the installer Name "TimeWarp" ! SetCompressor bzip2 ! ; The file to write ! OutFile "timewarp-${VER_MAJOR}u${VER_MINOR}.exe" ! ; The default installation directory ! InstallDir $PROGRAMFILES\TimeWarp ! ; Registry key to check for directory (so if you install again, it will ! ; overwrite the old one automatically) ! InstallDirRegKey HKLM SOFTWARE\TimeWarp "Install_Dir" ! ; The text to prompt the user to enter a directory ! ComponentText "This will install Star Control: TimeWarp ${VER_MAJOR}u${VER_MINOR} on your computer. Select which optional components you want installed." ! ; The text to prompt the user to enter a directory ! DirText "Choose a directory to install to:" ;-------------------------------- ; The stuff to install Section "TimeWarp Core (required)" --- 1,88 ---- ! ;NSIS Setup Script ! ! !define VER_VERSION 0 ! !define VER_SUBVERSION 05 ! !define VER_BUILD 9 ! ! !define PRODUCT_NAME "Star Control: TimeWarp" ;-------------------------------- + ;Configuration ! OutFile timewarp-${VER_VERSION}.${VER_SUBVERSION}u${VER_BUILD}.exe ! SetCompressor bzip2 ! InstallDir $PROGRAMFILES\TimeWarp ! InstallDirRegKey HKLM SOFTWARE\TimeWarp "" ! ! ;-------------------------------- ! ! ;Include Modern UI ! !include "MUI.nsh" ! ! ;-------------------------------- ! ;Configuration ! ! ;Names Name "TimeWarp" ! Caption "${PRODUCT_NAME} ${VER_VERSION}.${VER_SUBVERSION}u${VER_BUILD} Setup" ! ;Interface Settings ! !define MUI_ABORTWARNING ! !define MUI_HEADERIMAGE ! !define MUI_ICON "..\scpwin.ico" ! !define MUI_UNICON "..\scpwin.ico" ! !define MUI_COMPONENTSPAGE_SMALLDESC ! ;Pages ! !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PRODUCT_NAME}.\r\n\r\n\r\n$_CLICK" ! !insertmacro MUI_PAGE_WELCOME ! !insertmacro MUI_PAGE_LICENSE "license.txt" ! !insertmacro MUI_PAGE_COMPONENTS ! Page custom CreateShortCutF ! !insertmacro MUI_PAGE_DIRECTORY ! !insertmacro MUI_PAGE_INSTFILES ! !define MUI_FINISHPAGE_LINK "Visit the ${PRODUCT_NAME} website for the latest news" ! !define MUI_FINISHPAGE_LINK_LOCATION "http://www.classicgaming.com/starcontrol/timewarp/" ! ! !define MUI_FINISHPAGE_RUN "$INSTDIR\twwin.exe" ! !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.html + !define MUI_FINISHPAGE_NOREBOOTSUPPORT + + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- + + ;Reserve Files + + ;These files should be inserted before other files in the data block + ;Keep these lines before any File command + ;Only for BZIP2 (solid) compression + + ReserveFile "timewarp.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + + ;-------------------------------- + ;Variables + + Var INI_VALUE + + ;-------------------------------- + ;Languages + + !insertmacro MUI_LANGUAGE "English" + + ;-------------------------------- + ;Installer Sections + + !define SF_SELECTED 1 + ; The stuff to install Section "TimeWarp Core (required)" *************** *** 53,74 **** SetOutPath $INSTDIR\docs File "..\docs\*.*" - SetOutPath $INSTDIR\fleets ! File "..\fleets\*.scf" ! SetOutPath $INSTDIR\scrshots ! File "..\scrshots\*.*" ! SetOutPath $INSTDIR\ships ! File "..\ships\*.*" ! ! SetOutPath $INSTDIR\ships\sc1 ! File "..\ships\sc1\*.*" ! ! SetOutPath $INSTDIR\ships\sc2 ! File "..\ships\sc2\*.*" ! ! SetOutPath $INSTDIR\ships\sc3 ! File "..\ships\sc3\*.*" ; Write the installation path into the registry --- 106,123 ---- SetOutPath $INSTDIR\docs File "..\docs\*.*" SetOutPath $INSTDIR\fleets ! File /r "..\fleets\*.*" SetOutPath $INSTDIR\scrshots ! File /r "..\scrshots\*.*" SetOutPath $INSTDIR\ships ! File /r "..\ships\*.*" ! SetOutPath $INSTDIR\gamex ! File /r "..\gamex\*.*" ! SetOutPath $INSTDIR\gamedata ! File /r "..\gamedata\*.*" ! SetOutPath $INSTDIR\interfaces ! File /r "..\interfaces\*.*" ! SetOutPath $INSTDIR\util ! File /r "..\util\*.*" ; Write the installation path into the registry *************** *** 79,132 **** WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TimeWarp" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" CreateDirectory "$SMPROGRAMS\TimeWarp" CreateShortCut "$SMPROGRAMS\TimeWarp\Uninstall.lnk" "$INSTDIR\uninstall.exe" "Uninstall" CreateShortCut "$SMPROGRAMS\TimeWarp\readme.lnk" "$INSTDIR\readme.html" "Readme.html" CreateShortCut "$SMPROGRAMS\TimeWarp\timewarp.lnk" "$INSTDIR\twwin.exe" "Star Control: TimeWarp" - SectionEnd ! ; optional section (can be disabled by the user) ! Section "Sources" ! SetOutPath $INSTDIR ! File "..\*." ! File "..\*.ico" ! File "..\*.rc" ! SetOutPath $INSTDIR\source ! File "..\source\*.*" ! SetOutPath $INSTDIR\source\ais ! File "..\source\ais\*.*" ! SetOutPath $INSTDIR\source\games ! File "..\source\games\*.*" ! SetOutPath $INSTDIR\source\melee ! File "..\source\melee\*.*" ! SetOutPath $INSTDIR\source\newships ! File "..\source\newships\*.*" ! SetOutPath $INSTDIR\source\other ! File "..\source\other\*.*" ! SetOutPath $INSTDIR\source\sc1ships ! File "..\source\sc1ships\*.*" ! SetOutPath $INSTDIR\source\sc2ships ! File "..\source\sc2ships\*.*" ! SetOutPath $INSTDIR\source\sc3ships ! File "..\source\sc3ships\*.*" ! SetOutPath $INSTDIR\source\twgui ! File "..\source\twgui\*.*" ! SetOutPath $INSTDIR\Util ! File "..\Util\*.html" ! File "..\Util\*.nsi" ! File "..\Util\*.pl" ! ! SectionEnd - ;-------------------------------- ; Uninstaller - UninstallText "This will uninstall Star Control: Time Warp. Hit next to continue." - - ; Uninstall section - Section "Uninstall" --- 128,155 ---- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TimeWarp" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" + + WriteUninstaller "uninstall.exe" + + !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "timewarp.ini" "Field 3" "State" + StrCmp $INI_VALUE "1" "" +2 + CreateShortCut "$DESKTOP\TimeWarp.lnk" "$INSTDIR\twwin.exe" + + !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "timewarp.ini" "Field 2" "State" + StrCmp $INI_VALUE "1" "" +5 CreateDirectory "$SMPROGRAMS\TimeWarp" CreateShortCut "$SMPROGRAMS\TimeWarp\Uninstall.lnk" "$INSTDIR\uninstall.exe" "Uninstall" CreateShortCut "$SMPROGRAMS\TimeWarp\readme.lnk" "$INSTDIR\readme.html" "Readme.html" CreateShortCut "$SMPROGRAMS\TimeWarp\timewarp.lnk" "$INSTDIR\twwin.exe" "Star Control: TimeWarp" ! SectionEnd + Section "Source" SetOutPath $INSTDIR\source ! File /r "..\source\*.*" SectionEnd ;-------------------------------- ; Uninstaller Section "Uninstall" *************** *** 135,203 **** DeleteRegKey HKLM SOFTWARE\TimeWarp - ; remove shortcuts, if any - Delete "$SMPROGRAMS\TimeWarp\*.*" - - Delete "$INSTDIR\docs\*.*" - RMDir "$INSTDIR\docs" - - Delete "$INSTDIR\fleets\*.*" - RMDir "$INSTDIR\fleets" - - Delete "$INSTDIR\scrshots\*.*" - RMDir "$INSTDIR\scrshots" - - Delete "$INSTDIR\ships\sc1\*.*" - RMDir "$INSTDIR\ships\sc1" - - Delete "$INSTDIR\ships\sc2\*.*" - RMDir "$INSTDIR\ships\sc2" - - Delete "$INSTDIR\ships\sc3\*.*" - RMDir "$INSTDIR\ships\sc3" - - Delete "$INSTDIR\ships\*.*" - RMDir "$INSTDIR\ships" ! Delete "$INSTDIR\source\ais\*.*" ! RMDir "$INSTDIR\source\ais" ! ! Delete "$INSTDIR\source\games\*.*" ! RMDir "$INSTDIR\source\games" ! ! Delete "$INSTDIR\source\melee\*.*" ! RMDir "$INSTDIR\source\melee" ! ! Delete "$INSTDIR\source\newships\*.*" ! RMDir "$INSTDIR\source\newships" ! ! Delete "$INSTDIR\source\other\*.*" ! RMDir "$INSTDIR\source\other" ! ! Delete "$INSTDIR\source\sc1ships\*.*" ! RMDir "$INSTDIR\source\sc1ships" ! ! Delete "$INSTDIR\source\sc2ships\*.*" ! RMDir "$INSTDIR\source\sc2ships" ! ! Delete "$INSTDIR\source\sc3ships\*.*" ! RMDir "$INSTDIR\source\sc3ships" ! ! Delete "$INSTDIR\source\twgui\*.*" ! RMDir "$INSTDIR\source\twgui" ! Delete "$INSTDIR\source\util\*.*" ! RMDir "$INSTDIR\source\util" ! Delete "$INSTDIR\source\*.*" ! RMDir "$INSTDIR\source" ! Delete "$INSTDIR\util\*.*" ! RMDir "$INSTDIR\util" ! Delete "$INSTDIR\*.*" ! RMDir "$INSTDIR" ! ; remove directories used ! RMDir "$SMPROGRAMS\TimeWarp" - SectionEnd --- 158,182 ---- DeleteRegKey HKLM SOFTWARE\TimeWarp ! RMDir /r "$INSTDIR" ! ; remove group used ! RMDir /r "$SMPROGRAMS\TimeWarp" ! ; remove shortcuts, if any ! Delete "$DESKTOP\TimeWarp.lnk" ! SectionEnd ! ;-------------------------------- ! ;Installer Functions ! Function .onInit ! ;Extract InstallOptions INI files ! !insertmacro MUI_INSTALLOPTIONS_EXTRACT "timewarp.ini" ! FunctionEnd ! Function CreateShortCutF ! !insertmacro MUI_HEADER_TEXT "${PRODUCT_NAME} Option" "" ! !insertmacro MUI_INSTALLOPTIONS_DISPLAY "timewarp.ini" ! FunctionEnd |
From: <yu...@us...> - 2003-11-27 05:45:42
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1:/tmp/cvs-serv22247 Modified Files: version.txt Log Message: New Windows Installer. Used MUI. |
From: <geo...@us...> - 2003-11-25 23:23:53
|
Update of /cvsroot/timewarp/ships/sc2 In directory sc8-pr-cvs1:/tmp/cvs-serv22615/ships/sc2 Modified Files: shpkohma.ini shputwju.ini shpzfpst.ini Log Message: ini tweaks on MRT request Index: shpkohma.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc2/shpkohma.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpkohma.ini 8 Jun 2003 17:55:40 -0000 1.3 --- shpkohma.ini 25 Nov 2003 23:23:50 -0000 1.4 *************** *** 1,5 **** [Info] SC2Cost = 30 ! TWCost = 32 Name0 = Urquan Name1 = Kohr-Ah --- 1,5 ---- [Info] SC2Cost = 30 ! TWCost = 30 Name0 = Urquan Name1 = Kohr-Ah Index: shputwju.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc2/shputwju.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shputwju.ini 8 Jun 2003 17:55:42 -0000 1.3 --- shputwju.ini 25 Nov 2003 23:23:50 -0000 1.4 *************** *** 1,5 **** [Info] SC2Cost = 22 ! TWCost = 34 Name1 = Utwig Name2 = Jugger --- 1,5 ---- [Info] SC2Cost = 22 ! TWCost = 22 Name1 = Utwig Name2 = Jugger Index: shpzfpst.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc2/shpzfpst.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpzfpst.ini 8 Jun 2003 17:55:42 -0000 1.3 --- shpzfpst.ini 25 Nov 2003 23:23:50 -0000 1.4 *************** *** 32,37 **** [Special] ! Damage = 4 ! Licking = 1 [AI3_Default] --- 32,38 ---- [Special] ! Damage = 12 ;4 ! Licking = 0 ;1 ! ; 0 makes it use "flat" damage [AI3_Default] |
From: <geo...@us...> - 2003-11-25 23:23:53
|
Update of /cvsroot/timewarp/ships/sc1 In directory sc8-pr-cvs1:/tmp/cvs-serv22615/ships/sc1 Modified Files: shpchebr.ini Log Message: ini tweaks on MRT request Index: shpchebr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc1/shpchebr.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpchebr.ini 8 Jun 2003 17:55:34 -0000 1.3 --- shpchebr.ini 25 Nov 2003 23:23:50 -0000 1.4 *************** *** 40,46 **** FuelSap = 8 Armour = 3 ! AccelRate = 17 ! Mass = 4 ! AvoidanceAngle = 37.5 AvoidanceFactor = 3.0 --- 40,46 ---- FuelSap = 8 Armour = 3 ! AccelRate = 20 ;17 ! Mass = 6 ;4 ! AvoidanceAngle = 27.5 ;37.5 AvoidanceFactor = 3.0 |
From: <geo...@us...> - 2003-11-25 00:13:41
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source/gamex Modified Files: gamedata.cpp gamegeneral.cpp gameplanetmission.cpp Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: gamedata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gamedata.cpp 18 Nov 2003 17:18:47 -0000 1.1.1.1 --- gamedata.cpp 25 Nov 2003 00:13:08 -0000 1.2 *************** *** 107,114 **** FILE *f = fopen(filename, "rt"); ! if (!f) ! { ! tw_error("failed to initialize map info"); ! } fscanf(f, "%i", &Nregions); --- 107,111 ---- FILE *f = fopen(filename, "rt"); ! if (!f) { tw_error("failed to initialize map info");} fscanf(f, "%i", &Nregions); *************** *** 133,140 **** FILE *f = fopen(filename, "wt"); ! if (!f) ! { ! tw_error("failed to save map info"); ! } fprintf(f, "%i\n\n", Nregions); --- 130,134 ---- FILE *f = fopen(filename, "wt"); ! if (!f) {tw_error("failed to save map info");} fprintf(f, "%i\n\n", Nregions); *************** *** 318,325 **** ++N; ! if (N > max) ! { ! tw_error("init: too many types"); ! } } --- 312,316 ---- ++N; ! if (N > max){tw_error("init: too many types");} } Index: gamegeneral.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gamegeneral.cpp 18 Nov 2003 17:18:47 -0000 1.1.1.1 --- gamegeneral.cpp 25 Nov 2003 00:13:08 -0000 1.2 *************** *** 454,468 **** period = aperiod; if (physics && period < physics->frame_time * 1E-3) ! { ! tw_error("period is too small"); ! } } bool Periodics::update() { ! if (!physics) ! { ! tw_error("Periodics doesn't work without a physics"); ! } t += physics->frame_time * 1E-3; --- 454,463 ---- period = aperiod; if (physics && period < physics->frame_time * 1E-3) ! {tw_error("period is too small");} } bool Periodics::update() { ! if (!physics){tw_error("Periodics doesn't work without a physics");} t += physics->frame_time * 1E-3; Index: gameplanetmission.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetmission.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gameplanetmission.cpp 18 Nov 2003 17:18:49 -0000 1.1.1.1 --- gameplanetmission.cpp 25 Nov 2003 00:13:08 -0000 1.2 *************** *** 310,314 **** msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); prediction = get_config_int("Network", "Prediction", 50); ! if ((prediction < 0) || (prediction > 100)) tw_error ("Prediction out of bounds (0 < %d < 100)", prediction); log_file("server.ini"); --- 310,314 ---- msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); prediction = get_config_int("Network", "Prediction", 50); ! if ((prediction < 0) || (prediction > 100)) {tw_error ("Prediction out of bounds (0 < %d < 100)", prediction);} log_file("server.ini"); *************** *** 491,498 **** DATAFILE *tmpdat = find_datafile_object(dat, tempstr); ! if (!tmpdat) ! { ! tw_error("no data file object moon"); ! } sprite = new SpaceSprite(tmpdat, 1, SpaceSprite::MASKED | SpaceSprite::MIPMAPED, 1); --- 491,495 ---- DATAFILE *tmpdat = find_datafile_object(dat, tempstr); ! if (!tmpdat){tw_error("no data file object moon");} sprite = new SpaceSprite(tmpdat, 1, SpaceSprite::MASKED | SpaceSprite::MIPMAPED, 1); |
From: <geo...@us...> - 2003-11-25 00:13:41
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source/util Modified Files: errors.cpp errors.h Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: errors.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/errors.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** errors.cpp 2 Nov 2003 22:39:52 -0000 1.6 --- errors.cpp 25 Nov 2003 00:13:08 -0000 1.7 *************** *** 133,136 **** --- 133,137 ---- #if defined DO_STACKTRACE + bool usestacktrace = 0; struct StackTraceData { const char *file; Index: errors.h =================================================================== RCS file: /cvsroot/timewarp/source/util/errors.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** errors.h 21 Nov 2003 10:24:29 -0000 1.7 --- errors.h 25 Nov 2003 00:13:08 -0000 1.8 *************** *** 32,41 **** #ifdef DO_STACKTRACE class UserStackTraceHelper { public: UserStackTraceHelper(const char *file, int line); ~UserStackTraceHelper(); }; ! # define STACKTRACE UserStackTraceHelper _stacktrace_ ## __LINE__ (__FILE__,__LINE__); // this is defined locally in subroutines, so it's de-allocated on exit of the subroutine. #else # define STACKTRACE --- 32,44 ---- #ifdef DO_STACKTRACE + extern bool usestacktrace; class UserStackTraceHelper { public: UserStackTraceHelper(const char *file, int line); ~UserStackTraceHelper(); }; ! # define STACKTRACE if (usestacktrace != 0) { UserStackTraceHelper _stacktrace_ ## __LINE__ (__FILE__,__LINE__); } ! //# define STACKTRACE UserStackTraceHelper _stacktrace_ ## __LINE__ (__FILE__,__LINE__); // this is defined locally in subroutines, so it's de-allocated on exit of the subroutine. + //# define STACKTRACE #else # define STACKTRACE |
From: <geo...@us...> - 2003-11-25 00:13:16
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source/games Modified Files: vgGenSys.cpp Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: vgGenSys.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/vgGenSys.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vgGenSys.cpp 23 Nov 2003 23:52:42 -0000 1.4 --- vgGenSys.cpp 25 Nov 2003 00:13:13 -0000 1.5 *************** *** 12,15 **** --- 12,17 ---- #include "../twgui/twgui.h" + #include "../melee/mlog.h" + #ifndef _V_BODIES_H #include "../other/vbodies.h" *************** *** 53,63 **** SpaceLocation* mapCenter; void setupSprites(void); void setupBinary(SpaceObject* S1, SpaceObject* S2, double radius1, double radius2, double speed1); virtual void init_objects(); ! bool GetSpriteTo64Rot(SpaceSprite *Pics, char *fileName, char *cmdStr, int numSprites = 1, int attribs = -1); SpaceSprite* GetSprite(char *fileName, char *spriteName, int attribs, int rotations=1, int numSprites = 1); bool GetSpriteGroup(SpaceSprite *Pics[], char *fileName, char *cmdStr, int numSprites, int attribs=-1, int firstSpriteNumber=1); SpaceSprite* GetMultiframeSprite(char *fileName, char *spriteName, int attribs, int numberOfFrames); virtual ~VGenSystem(); --- 55,71 ---- SpaceLocation* mapCenter; void setupSprites(void); + void setupBinary(SpaceObject* S1, SpaceObject* S2, double radius1, double radius2, double speed1); virtual void init_objects(); ! ! bool GetSpriteTo64Rot(SpaceSprite *&Pics, char *fileName, char *cmdStr, int numSprites = 1, int attribs = -1); + SpaceSprite* GetSprite(char *fileName, char *spriteName, int attribs, int rotations=1, int numSprites = 1); + bool GetSpriteGroup(SpaceSprite *Pics[], char *fileName, char *cmdStr, int numSprites, int attribs=-1, int firstSpriteNumber=1); + SpaceSprite* GetMultiframeSprite(char *fileName, char *spriteName, int attribs, int numberOfFrames); + virtual ~VGenSystem(); *************** *** 563,567 **** ! bool VGenSystem::GetSpriteTo64Rot(SpaceSprite *Pics, char *fileName, char *cmdStr, int numSprites, int attribs) { --- 571,575 ---- ! bool VGenSystem::GetSpriteTo64Rot(SpaceSprite *&Pics, char *fileName, char *cmdStr, int numSprites, int attribs) { *************** *** 573,582 **** { sprintf(dataStr,cmdStr,num); ! spr=GetSprite(fileName, dataStr, attribs, 64); if(!spr) { return FALSE; } ! Pics=spr; } return TRUE; --- 581,590 ---- { sprintf(dataStr,cmdStr,num); ! spr = GetSprite(fileName, dataStr, attribs, 64); if(!spr) { return FALSE; } ! Pics = spr; } return TRUE; *************** *** 776,807 **** //int i = random(Ninit); ! PopupList *popupl; ! popupl = new PopupList(screen, "interfaces/gametest/popuplist", 0, 0, videosystem.get_font(2), 0); ! popupl->tbl->set_optionlist(functitle, Ninit, makecol(255,255,128)); ! popupl->show(); ! popupl->xshift = 0; ! popupl->yshift = 0; ! popupl->close_on_defocus = false; ! ! ! WindowManager *winman; ! winman = new WindowManager; ! winman->add(popupl); ! ! popupl->setscreen(screen); ! show_mouse(screen); ! unscare_mouse(); ! ! while (!popupl->returnvalueready) { - idle(10); ! winman->calculate(); ! winman->animate(); ! } ! int i; ! i = popupl->returnstatus; --- 784,825 ---- //int i = random(Ninit); + int i; ! // initialization is for non-clients only ... ! if (log->type == Log::log_net1server || log->type == Log::log_normal) { ! PopupList *popupl; ! popupl = new PopupList(screen, "interfaces/gametest/popuplist", 0, 0, videosystem.get_font(2), 0); ! popupl->tbl->set_optionlist(functitle, Ninit, makecol(255,255,128)); ! popupl->show(); ! popupl->xshift = 0; ! popupl->yshift = 0; ! popupl->close_on_defocus = false; ! ! ! WindowManager *winman; ! winman = new WindowManager; ! winman->add(popupl); ! ! popupl->setscreen(screen); ! show_mouse(screen); ! unscare_mouse(); ! ! while (!popupl->returnvalueready) ! { ! idle(10); ! ! winman->calculate(); ! winman->animate(); ! } ! ! i = popupl->returnstatus; ! } ! ! // share the result of the initialization. ! // send (or receive) ... channel_server is locally either the server, or the client. ! log_int(channel_server, i); |
From: <geo...@us...> - 2003-11-25 00:13:15
|
Update of /cvsroot/timewarp/source/games/triggers In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source/games/triggers Modified Files: trtest.cpp Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: trtest.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/triggers/trtest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** trtest.cpp 15 Nov 2003 20:48:07 -0000 1.3 --- trtest.cpp 25 Nov 2003 00:13:12 -0000 1.4 *************** *** 615,619 **** default: ! tw_error("Unknow action var type"); break; } --- 615,619 ---- default: ! {tw_error("Unknow action var type");} break; } |
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source/melee Modified Files: mcontrol.cpp mfleet.cpp mframe.cpp mgame.cpp mlog.cpp mnet1.cpp moptions.cpp msprite.cpp Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: mcontrol.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mcontrol.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mcontrol.cpp 21 Nov 2003 10:24:29 -0000 1.10 --- mcontrol.cpp 25 Nov 2003 00:13:08 -0000 1.11 *************** *** 185,189 **** ship->control = this; if (temporary && (channel != Game::channel_none) && (already != 0) && (already != game->lag_frames)) ! tw_error ("Control::select_ship - bad operation (incompatible with networking)"); } target_stuff() ; --- 185,189 ---- ship->control = this; if (temporary && (channel != Game::channel_none) && (already != 0) && (already != game->lag_frames)) ! {tw_error ("Control::select_ship - bad operation (incompatible with networking)");} } target_stuff() ; *************** *** 279,285 **** return ret; } ! int Control::choose_ship(VideoWindow *window, char * prompt, Fleet *fleet) {STACKTRACE int ret = -1, slot = 0; ! if (fleet->getSize() == 0) tw_error ("Empty fleet! (prompt:%s)", prompt); selectDialog[SELECT_DIALOG_LIST].dp3 = fleet; --- 279,286 ---- return ret; } ! int Control::choose_ship(VideoWindow *window, char * prompt, Fleet *fleet) { ! STACKTRACE; int ret = -1, slot = 0; ! if (fleet->getSize() == 0) {tw_error ("Empty fleet! (prompt:%s)", prompt);} selectDialog[SELECT_DIALOG_LIST].dp3 = fleet; *************** *** 307,312 **** return(slot); } ! void Control::set_target(int i) {STACKTRACE ! if (i >= game->num_targets) tw_error("oscar hamburger!!!!!!!!!"); if (i == -1) { index = i; --- 308,314 ---- return(slot); } ! void Control::set_target(int i) { ! STACKTRACE; ! if (i >= game->num_targets) {tw_error("oscar hamburger!!!!!!!!!");} if (i == -1) { index = i; *************** *** 314,318 **** return; } ! if (!valid_target(game->target[i])) tw_error("oscer hambuger"); index = i; target = game->target[index]; --- 316,320 ---- return; } ! if (!valid_target(game->target[i])) {tw_error("oscer hambuger");} index = i; target = game->target[index]; *************** *** 482,486 **** // ship::calculate function, it may've crashed. // This kinda thing may occur more often in case control is shared among objects ! if (!ship) tw_error("Control::valid_target - !ship"); if (t->sameTeam(ship)) return false; if (!t->exists()) return false; --- 484,488 ---- // ship::calculate function, it may've crashed. // This kinda thing may occur more often in case control is shared among objects ! if (!ship) {tw_error("Control::valid_target - !ship");} if (t->sameTeam(ship)) return false; if (!t->exists()) return false; Index: mfleet.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mfleet.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mfleet.cpp 17 Nov 2003 00:01:59 -0000 1.15 --- mfleet.cpp 25 Nov 2003 00:13:09 -0000 1.16 *************** *** 97,101 **** char k = strlen((*iter)->id); if (k > 64) ! tw_error("serialize_fleet - that's a hell of a long ship id"); memcpy(&buffy[s], &k, sizeof(k)); s += sizeof(k); } --- 97,101 ---- char k = strlen((*iter)->id); if (k > 64) ! {tw_error("serialize_fleet - that's a hell of a long ship id");} memcpy(&buffy[s], &k, sizeof(k)); s += sizeof(k); } *************** *** 145,150 **** else addShipType(t); } ! if (s != psize) ! tw_error("deserialize_fleet - didn't use all the data..."); if (k) delete k; --- 145,149 ---- else addShipType(t); } ! if (s != psize) {tw_error("deserialize_fleet - didn't use all the data...");} if (k) delete k; Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mframe.cpp 12 Nov 2003 02:21:06 -0000 1.16 --- mframe.cpp 25 Nov 2003 00:13:09 -0000 1.17 *************** *** 55,59 **** void Query::begin (SpaceLocation *qtarget, int qlayers, double qrange) {STACKTRACE ! if (qrange < 0) tw_error("Query::begin - negative range"); layers = qlayers; range_sqr = qrange * qrange; --- 55,59 ---- void Query::begin (SpaceLocation *qtarget, int qlayers, double qrange) {STACKTRACE ! if (qrange < 0) {tw_error("Query::begin - negative range");} layers = qlayers; range_sqr = qrange * qrange; *************** *** 136,141 **** } int tmp = qy * QUADS_X + qx; ! if (tmp < 0) tw_error ("tmp was less than 0"); ! if (tmp > QUADS_TOTAL) tw_error ("tmp was too large"); current = physics->quadrant[tmp]; if (!current) goto tail_recurse4; --- 136,141 ---- } int tmp = qy * QUADS_X + qx; ! if (tmp < 0) {tw_error ("tmp was less than 0");} ! if (tmp > QUADS_TOTAL) {tw_error ("tmp was too large");} current = physics->quadrant[tmp]; if (!current) goto tail_recurse4; *************** *** 145,151 **** void Query::next () {STACKTRACE tail_recurse3: ! if (current == current->qnext) { ! tw_error ("Query::next - current = next"); ! } current = current->qnext; if (!current) { --- 145,149 ---- void Query::next () {STACKTRACE tail_recurse3: ! if (current == current->qnext) {tw_error ("Query::next - current = next");} current = current->qnext; if (!current) { *************** *** 168,173 **** ! void Query2::begin (SpaceLocation *qtarget, Uint64 attribute_filter, double qrange) {STACKTRACE ! if (qrange < 0) tw_error("Query::begin - negative range"); if (Uint32(attribute_filter) & ~Uint32(attribute_filter >> 32)) { tw_error("incorrect Query attributes"); --- 166,172 ---- ! void Query2::begin (SpaceLocation *qtarget, Uint64 attribute_filter, double qrange) { ! STACKTRACE; ! if (qrange < 0) {tw_error("Query::begin - negative range");} if (Uint32(attribute_filter) & ~Uint32(attribute_filter >> 32)) { tw_error("incorrect Query attributes"); *************** *** 256,261 **** } int tmp = qy * QUADS_X + qx; ! if (tmp < 0) tw_error ("tmp was less than 0"); ! if (tmp > QUADS_TOTAL) tw_error ("tmp was too large"); current = physics->quadrant[tmp]; if (!current) goto tail_recurse4; --- 255,260 ---- } int tmp = qy * QUADS_X + qx; ! if (tmp < 0) {tw_error ("tmp was less than 0");} ! if (tmp > QUADS_TOTAL) {tw_error ("tmp was too large");} current = physics->quadrant[tmp]; if (!current) goto tail_recurse4; *************** *** 263,269 **** } ! void Query2::next () {STACKTRACE tail_recurse3: ! if (current == current->qnext) tw_error ("Query::next - current = next"); current = current->qnext; if (!current) { --- 262,269 ---- } ! void Query2::next () { ! STACKTRACE; tail_recurse3: ! if (current == current->qnext) {tw_error ("Query::next - current = next");} current = current->qnext; if (!current) { *************** *** 993,999 **** }*/ ! void Physics::add(SpaceLocation *o) {STACKTRACE ! if (o->attributes & ATTRIB_INGAME) tw_error("addItem - already added"); ! if (!o->isLocation()) tw_error("addItem - catastrophic"); //if (!o->_serial) _list(o); --- 993,1000 ---- }*/ ! void Physics::add(SpaceLocation *o) { ! STACKTRACE; ! if (o->attributes & ATTRIB_INGAME) {tw_error("addItem - already added");} ! if (!o->isLocation()) {tw_error("addItem - catastrophic");} //if (!o->_serial) _list(o); *************** *** 1020,1028 **** } ! bool Physics::remove(SpaceLocation *o) {STACKTRACE int i; ! if (!(o->attributes & ATTRIB_INGAME)) tw_error("removeItem - not added"); o->attributes &= ~ATTRIB_INGAME; ! if (!o->isLocation()) tw_error("removeItem - catastrophic"); for (i = 0; i < num_items; i += 1) { if (item[i] == o) { --- 1021,1030 ---- } ! bool Physics::remove(SpaceLocation *o) { ! STACKTRACE; int i; ! if (!(o->attributes & ATTRIB_INGAME)) {tw_error("removeItem - not added");} o->attributes &= ~ATTRIB_INGAME; ! if (!o->isLocation()) {tw_error("removeItem - catastrophic");} for (i = 0; i < num_items; i += 1) { if (item[i] == o) { *************** *** 1037,1042 **** } ! void Physics::add(Presence *p) {STACKTRACE ! if (p->attributes & ATTRIB_INGAME) tw_error("addPresence - already added"); if (p->isLocation()) { add((SpaceLocation*)p); --- 1039,1045 ---- } ! void Physics::add(Presence *p) { ! STACKTRACE; ! if (p->attributes & ATTRIB_INGAME) {tw_error("addPresence - already added");} if (p->isLocation()) { add((SpaceLocation*)p); *************** *** 1053,1059 **** } ! bool Physics::remove(Presence *o) {STACKTRACE int i; ! if (!(o->attributes & ATTRIB_INGAME)) tw_error("removePresence - not added"); if (o->isLocation()) return remove((SpaceLocation*)o); o->attributes &= ~ATTRIB_INGAME; --- 1056,1063 ---- } ! bool Physics::remove(Presence *o) { ! STACKTRACE; int i; ! if (!(o->attributes & ATTRIB_INGAME)) {tw_error("removePresence - not added");} if (o->isLocation()) return remove((SpaceLocation*)o); o->attributes &= ~ATTRIB_INGAME; *************** *** 1179,1185 **** // checking if this can happen? (curious ; GEO) if (item[i]->state < -DEATH_FRAMES) ! { ! tw_error("too many death-frames - should not happen !!"); ! } } --- 1183,1187 ---- // checking if this can happen? (curious ; GEO) if (item[i]->state < -DEATH_FRAMES) ! {tw_error("too many death-frames - should not happen !!");} } Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** mgame.cpp 21 Nov 2003 10:24:29 -0000 1.23 --- mgame.cpp 25 Nov 2003 00:13:09 -0000 1.24 *************** *** 271,275 **** ShipType *type = shiptype(id); if (!type) ! tw_error("Game::create_ship - bad ship id (%s)", id); /*if(!ini) { sprintf(buffer, "ships/shp%s.ini", id); --- 271,275 ---- ShipType *type = shiptype(id); if (!type) ! {tw_error("Game::create_ship - bad ship id (%s)", id);} /*if(!ini) { sprintf(buffer, "ships/shp%s.ini", id); *************** *** 290,294 **** Control *c = create_control(channel, control); if (!c) ! tw_error("bad Control type!"); c->temporary = true; Ship *s = create_ship(id, c, pos, angle, team); --- 290,294 ---- Control *c = create_control(channel, control); if (!c) ! {tw_error("bad Control type!");} c->temporary = true; Ship *s = create_ship(id, c, pos, angle, team); *************** *** 307,312 **** } ! void Game::decrease_latency() {STACKTRACE ! if (lag_frames <= 1) tw_error("latency decreased too far"); if (CHECKSUM_CHANNEL) { log->unbuffer(channel_server + Game::_channel_buffered, NULL, 2); --- 307,313 ---- } ! void Game::decrease_latency() { ! STACKTRACE; ! if (lag_frames <= 1) {tw_error("latency decreased too far");} if (CHECKSUM_CHANNEL) { log->unbuffer(channel_server + Game::_channel_buffered, NULL, 2); *************** *** 330,340 **** char buffer[16384]; ! if (fl > 16000) ! tw_error("blah"); memcpy(buffer, tmpdata, fl); free(tmpdata); log_int(channel, fl); ! if (fl > 16000) ! tw_error("blah"); log_data(channel, buffer, fl); fleet->deserialize(buffer, fl); --- 331,339 ---- char buffer[16384]; ! if (fl > 16000) {tw_error("blah");} memcpy(buffer, tmpdata, fl); free(tmpdata); log_int(channel, fl); ! if (fl > 16000) {tw_error("blah");} log_data(channel, buffer, fl); fleet->deserialize(buffer, fl); *************** *** 930,939 **** i = strlen(type->name); memcpy(buffy, type->name, i); ! if (i > 127) tw_error("long gamename1"); log_int (channel_init, i); ! if (i > 127) tw_error("long gamename2"); log_data(channel_init, buffy, i); buffy[i] = 0; ! if (strcmp(buffy, type->name)) tw_error("wrong game type"); i = rand(); --- 929,938 ---- i = strlen(type->name); memcpy(buffy, type->name, i); ! if (i > 127) {tw_error("long gamename1");} log_int (channel_init, i); ! if (i > 127) {tw_error("long gamename2");} log_data(channel_init, buffy, i); buffy[i] = 0; ! if (strcmp(buffy, type->name)) {tw_error("wrong game type");} i = rand(); *************** *** 984,988 **** msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); prediction = get_config_int("Network", "Prediction", 50); ! if ((prediction < 0) || (prediction > 100)) tw_error ("Prediction out of bounds (0 < %d < 100)", prediction); log_file("server.ini"); --- 983,987 ---- msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); prediction = get_config_int("Network", "Prediction", 50); ! if ((prediction < 0) || (prediction > 100)) {tw_error ("Prediction out of bounds (0 < %d < 100)", prediction);} log_file("server.ini"); *************** *** 1066,1071 **** void Game::change_view(const char * name) {STACKTRACE View *v = get_view(name, view); ! if (!v) ! tw_error("Game::change_view - invalid view name"); if (view) v->replace(view); --- 1065,1069 ---- void Game::change_view(const char * name) {STACKTRACE View *v = get_view(name, view); ! if (!v) {tw_error("Game::change_view - invalid view name");} if (view) v->replace(view); Index: mlog.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mlog.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mlog.cpp 21 Nov 2003 10:20:44 -0000 1.4 --- mlog.cpp 25 Nov 2003 00:13:10 -0000 1.5 *************** *** 27,32 **** } ! void Log::set_direction ( int channel, char direction ) {STACKTRACE ! if (channel < 0) tw_error("set_direction - channel < 0"); if (channel >= log_num) { expand_logs(channel+1); --- 27,33 ---- } ! void Log::set_direction ( int channel, char direction ) { ! STACKTRACE; ! if (channel < 0) { tw_error("set_direction - channel < 0"); } if (channel >= log_num) { expand_logs(channel+1); *************** *** 36,41 **** } ! char Log::get_direction ( int channel ) {STACKTRACE ! if (channel < 0) tw_error("get_direction - channel < 0"); if (channel >= log_num) { expand_logs(channel+1); --- 37,43 ---- } ! char Log::get_direction ( int channel ) { ! STACKTRACE; ! if (channel < 0) {tw_error("get_direction - channel < 0");} if (channel >= log_num) { expand_logs(channel+1); *************** *** 85,90 **** return; } ! void Log::_unlog(int channel, void *data, int size) {STACKTRACE ! if (log_len[channel] < log_pos[channel] + size) tw_error ("Game::_unlog - went past end (%d+%d/%d on %d)", log_pos[channel], size, log_len[channel], channel); memcpy(data, log_data[channel]+log_pos[channel], size); log_pos[channel] += size; --- 87,93 ---- return; } ! void Log::_unlog(int channel, void *data, int size) { ! STACKTRACE; ! if (log_len[channel] < log_pos[channel] + size) {tw_error ("Game::_unlog - went past end (%d+%d/%d on %d)", log_pos[channel], size, log_len[channel], channel);} memcpy(data, log_data[channel]+log_pos[channel], size); log_pos[channel] += size; *************** *** 122,126 **** f = pack_fopen_chunk(f, 0); i = pack_igetl ( f); ! if (i <= oi) tw_error("invalid log file"); if (i >= log_num) expand_logs(i+1); int l = pack_igetl ( f); --- 125,129 ---- f = pack_fopen_chunk(f, 0); i = pack_igetl ( f); ! if (i <= oi) { tw_error("invalid log file"); } if (i >= log_num) expand_logs(i+1); int l = pack_igetl ( f); *************** *** 129,133 **** if (tl > l) tl = l; int k = pack_fread(buffy, tl, f); ! if (k == 0) tw_error("invalid log file"); l -= k; _log(i, buffy, tl); --- 132,136 ---- if (tl > l) tl = l; int k = pack_fread(buffy, tl, f); ! if (k == 0) { tw_error("invalid log file"); } l -= k; _log(i, buffy, tl); *************** *** 138,144 **** return; } ! void Log::expand_logs(int num_channels) {STACKTRACE int old_log_num = log_num; ! if (num_channels <= log_num) tw_error ("Log::expand_logs - shrinking logs?"); log_num = num_channels; log_data = (unsigned char**) realloc(log_data, sizeof(char*) * log_num); --- 141,148 ---- return; } ! void Log::expand_logs(int num_channels) { ! STACKTRACE; int old_log_num = log_num; ! if (num_channels <= log_num) { tw_error ("Log::expand_logs - shrinking logs?"); } log_num = num_channels; log_data = (unsigned char**) realloc(log_data, sizeof(char*) * log_num); *************** *** 157,165 **** } int Log::ready(int channel) { ! if (channel < 0) tw_error ("log_ready - negative channel!"); if (channel >= log_num) return 0; return log_len[channel] - log_pos[channel]; } ! int Log::file_ready(const char *fname, void **location) {STACKTRACE if (log_num <= channel_file_data) return -1; int i = 0, j = 0; --- 161,170 ---- } int Log::ready(int channel) { ! if (channel < 0) { tw_error ("log_ready - negative channel!"); } if (channel >= log_num) return 0; return log_len[channel] - log_pos[channel]; } ! int Log::file_ready(const char *fname, void **location) { ! STACKTRACE; if (log_num <= channel_file_data) return -1; int i = 0, j = 0; *************** *** 178,182 **** memcpy(&k, (log_data[channel_file_names] + i), sizeof(int)); ! if (j+k > log_len[channel_file_data]) tw_error ("Log::file_ready - uh, that's bad"); if (location) *location = log_data[channel_file_data] + j; return k; --- 183,187 ---- memcpy(&k, (log_data[channel_file_names] + i), sizeof(int)); ! if (j+k > log_len[channel_file_data]) { tw_error ("Log::file_ready - uh, that's bad"); } if (location) *location = log_data[channel_file_data] + j; return k; *************** *** 206,210 **** int i, j = 0; f = pack_fopen(fname, F_READ); ! if (!f) tw_error("tw_log_file - bad file name %s", fname); while (1) { i = pack_fread(buffy, 1024, f); --- 211,215 ---- int i, j = 0; f = pack_fopen(fname, F_READ); ! if (!f) { tw_error("tw_log_file - bad file name %s", fname); } while (1) { i = pack_fread(buffy, 1024, f); *************** *** 231,235 **** char zeros[128]; if (!size) return false;//return true? error? ! if (channel < 0) tw_error ("Log::log - negative channel!"); if (channel >= log_num) { expand_logs(channel+1); --- 236,240 ---- char zeros[128]; if (!size) return false;//return true? error? ! if (channel < 0) { tw_error ("Log::log - negative channel!"); } if (channel >= log_num) { expand_logs(channel+1); *************** *** 237,241 **** if (data == NULL) { data = zeros; ! if (size > 128) tw_error("Log::buffer - overflow"); memset(zeros, 0, size); } --- 242,246 ---- if (data == NULL) { data = zeros; ! if (size > 128) { tw_error("Log::buffer - overflow"); } memset(zeros, 0, size); } *************** *** 252,256 **** char zeros[128]; if (!size) return false;//return true? error? ! if (channel < 0) tw_error ("Log::unbuffer - negative channel!"); if (channel >= log_num) { expand_logs(channel+1); --- 257,261 ---- char zeros[128]; if (!size) return false;//return true? error? ! if (channel < 0) { tw_error ("Log::unbuffer - negative channel!"); } if (channel >= log_num) { expand_logs(channel+1); *************** *** 258,262 **** if (data == NULL) { data = zeros; ! if (size > 128) tw_error("Log::buffer - overflow"); } --- 263,267 ---- if (data == NULL) { data = zeros; ! if (size > 128) { tw_error("Log::buffer - overflow"); } } *************** *** 296,305 **** } ! void PlaybackLog::set_direction (int channel, char direction) {STACKTRACE tw_error("set_direction - your not supposed to do that in a demo playback!"); return; } ! void PlaybackLog::set_all_directions( char direction ) {STACKTRACE tw_error("set_all_directions - your not supposed to do that in a demo playback!"); return; --- 301,312 ---- } ! void PlaybackLog::set_direction (int channel, char direction) { ! STACKTRACE; tw_error("set_direction - your not supposed to do that in a demo playback!"); return; } ! void PlaybackLog::set_all_directions( char direction ) { ! STACKTRACE; tw_error("set_all_directions - your not supposed to do that in a demo playback!"); return; Index: mnet1.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mnet1.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mnet1.cpp 11 Oct 2003 21:01:01 -0000 1.4 --- mnet1.cpp 25 Nov 2003 00:13:11 -0000 1.5 *************** *** 23,27 **** char *tmp = buffy; int c = 15; ! if ((unsigned short int)size > max_message_length + sizeof(GameEvent)) tw_error("GameEventMessage - message overflow"); //if (source == Game::channel_server) tmp += sprintf(tmp, "Server says: "); //else if (source == Game::channel_client) tmp += sprintf(tmp, "Client says: "); --- 23,27 ---- char *tmp = buffy; int c = 15; ! if ((unsigned short int)size > max_message_length + sizeof(GameEvent)) { tw_error("GameEventMessage - message overflow"); } //if (source == Game::channel_server) tmp += sprintf(tmp, "Server says: "); //else if (source == Game::channel_client) tmp += sprintf(tmp, "Client says: "); *************** *** 65,70 **** return 0; } ! int write_length_code (int max, int *clen, int len, unsigned char *where) {STACKTRACE ! if (len <= 0) tw_error( "write_length_code -- bad length"); if (max < 1) return -1; if (len < 255) { --- 65,71 ---- return 0; } ! int write_length_code (int max, int *clen, int len, unsigned char *where) { ! STACKTRACE; ! if (len <= 0) { tw_error( "write_length_code -- bad length"); } if (max < 1) return -1; if (len < 255) { *************** *** 111,122 **** } ! void NetLog::send_packet() {STACKTRACE int i, j, k, pos = 8; ! if (!net.isConnected()) tw_error("NetLog::send_packet() - no connection!"); for (i = 0; i < log_num; i += 1) if (log_dir[i] & direction_write) { j = log_len[i] - log_transmitted[i]; if (j > 0) { buffy[pos] = i & 255; ! if (i > 255) tw_error ("NetLog::send_packet - channel # exceeds 8 bits"); pos += 1; write_length_code(12, &k, j, &buffy[pos]); --- 112,124 ---- } ! void NetLog::send_packet() { ! STACKTRACE; int i, j, k, pos = 8; ! if (!net.isConnected()) { tw_error("NetLog::send_packet() - no connection!"); } for (i = 0; i < log_num; i += 1) if (log_dir[i] & direction_write) { j = log_len[i] - log_transmitted[i]; if (j > 0) { buffy[pos] = i & 255; ! if (i > 255) { tw_error ("NetLog::send_packet - channel # exceeds 8 bits"); } pos += 1; write_length_code(12, &k, j, &buffy[pos]); *************** *** 144,152 **** return; } ! void NetLog::recv_packet() {STACKTRACE int pos, len; int i, j, k, l; len = net.recv(4, 4, &buffy); ! if (len != 4) tw_error ("NetLog::recv_packet -- net.recv error (1)"); len = buffy[0] + (buffy[1] << 8) + (buffy[2] << 16) + (buffy[3] << 24); if (len & 0x80000000) { --- 146,155 ---- return; } ! void NetLog::recv_packet() { ! STACKTRACE; int pos, len; int i, j, k, l; len = net.recv(4, 4, &buffy); ! if (len != 4) { tw_error ("NetLog::recv_packet -- net.recv error (1)"); } len = buffy[0] + (buffy[1] << 8) + (buffy[2] << 16) + (buffy[3] << 24); if (len & 0x80000000) { *************** *** 159,191 **** ping = (actual_time - (buffy[6] + (buffy[7] << 8))) & 65535 ; len -= 8; ! if (len != net.recv(len, len, &buffy)) tw_error( "NetLog::recv_packet -- net.recv error (2)"); pos = 0; while (pos < len) { i = buffy[pos]; ! if (i < 0) tw_error("NegLog::recv_packet - data came in on a negative channel %d", i); if (i >= log_num) expand_logs(i+1); ! if (!(log_dir[i] & direction_read)) tw_error("NetLog::recv_packet -- data on wrong channel %d", i); pos += 1; l = read_length_code(len-pos, &j, &k, &buffy[pos]); ! if (l < 0) tw_error ("NetLog::recv_packet -- read_length_code failed"); pos += j; if (i >= log_num) expand_logs(i+1); ! if (!(log_dir[i] & direction_read)) tw_error( "recieved data on wrong channel"); Log::_log(i, &buffy[pos], k); pos += k; } ! if (pos != len) tw_error ("NetLog::recv_packet -- missaligned packet!!!"); return; } ! void NetLog::send_code(unsigned int code) {STACKTRACE ! if (!(code & 0x80000000)) tw_error ("NetLog::send_special -- bade code!"); net.send(sizeof(unsigned int), &code); return; } ! void NetLog::send_message(char *string) {STACKTRACE int i; i = sprintf((char*)&buffy[4], "remote: %s", string); ! if (i > 1000) tw_error ("net1_send_message -- message length exceeds maximum"); buffy[0] = i & 255; buffy[1] = (i >> 8) & 255; --- 162,195 ---- ping = (actual_time - (buffy[6] + (buffy[7] << 8))) & 65535 ; len -= 8; ! if (len != net.recv(len, len, &buffy)) { tw_error( "NetLog::recv_packet -- net.recv error (2)"); } pos = 0; while (pos < len) { i = buffy[pos]; ! if (i < 0) { tw_error("NegLog::recv_packet - data came in on a negative channel %d", i); } if (i >= log_num) expand_logs(i+1); ! if (!(log_dir[i] & direction_read)) { tw_error("NetLog::recv_packet -- data on wrong channel %d", i); } pos += 1; l = read_length_code(len-pos, &j, &k, &buffy[pos]); ! if (l < 0) { tw_error ("NetLog::recv_packet -- read_length_code failed"); } pos += j; if (i >= log_num) expand_logs(i+1); ! if (!(log_dir[i] & direction_read)) { tw_error( "recieved data on wrong channel"); } Log::_log(i, &buffy[pos], k); pos += k; } ! if (pos != len) { tw_error ("NetLog::recv_packet -- missaligned packet!!!"); } return; } ! void NetLog::send_code(unsigned int code) { ! STACKTRACE; ! if (!(code & 0x80000000)) { tw_error ("NetLog::send_special -- bade code!"); } net.send(sizeof(unsigned int), &code); return; } ! void NetLog::send_message(char *string) {STACKTRACE; int i; i = sprintf((char*)&buffy[4], "remote: %s", string); ! if (i > 1000) { tw_error ("net1_send_message -- message length exceeds maximum"); } buffy[0] = i & 255; buffy[1] = (i >> 8) & 255; *************** *** 210,214 **** case NET1_CODE_MESSAGE: { int len = code - NET1_CODE_MESSAGE; ! if (len > 1000) tw_error ("net1_handle_code -- message length exceeds maximum"); net.recv(len, len, &buffy); buffy[len] = 0; --- 214,218 ---- case NET1_CODE_MESSAGE: { int len = code - NET1_CODE_MESSAGE; ! if (len > 1000) { tw_error ("net1_handle_code -- message length exceeds maximum"); } net.recv(len, len, &buffy); buffy[len] = 0; Index: moptions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/moptions.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** moptions.cpp 15 Nov 2003 20:48:06 -0000 1.9 --- moptions.cpp 25 Nov 2003 00:13:11 -0000 1.10 *************** *** 212,217 **** if ((x == x2) && (y == y2)) break; } ! if(!resolution[0]) ! tw_error("Resolution error"); video_dialog[DIALOG_VIDEO_RESLIST].d1 = i; --- 212,216 ---- if ((x == x2) && (y == y2)) break; } ! if(!resolution[0]) { tw_error("Resolution error"); } video_dialog[DIALOG_VIDEO_RESLIST].d1 = i; *************** *** 219,223 **** 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; } --- 218,222 ---- 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; } Index: msprite.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/msprite.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** msprite.cpp 21 Nov 2003 10:24:29 -0000 1.10 --- msprite.cpp 25 Nov 2003 00:13:12 -0000 1.11 *************** *** 980,988 **** int SpaceSprite::collide(int x, int y, int i, int ox, int oy, int oi, SpaceSprite *other) ! {STACKTRACE ! if (i >= count) tw_error("SpaceSprite::collide - index1 %d >= count1 %d", i, count); ! if (oi >= other->count) tw_error("SpaceSprite::collide - index2 %d >= count2 %d", oi, other->count); ! if (i < 0) tw_error("SpaceSprite::collide - index1 %d < count1 %d", i, count); ! if (oi < 0) tw_error("SpaceSprite::collide - index2 %d < count2 %d", oi, other->count); return (check_pmask_collision(m[i], other->m[oi], x, y, ox, oy)); } --- 980,989 ---- int SpaceSprite::collide(int x, int y, int i, int ox, int oy, int oi, SpaceSprite *other) ! { ! STACKTRACE; ! if (i >= count) { tw_error("SpaceSprite::collide - index1 %d >= count1 %d", i, count); } ! if (oi >= other->count) { tw_error("SpaceSprite::collide - index2 %d >= count2 %d", oi, other->count); } ! if (i < 0) { tw_error("SpaceSprite::collide - index1 %d < count1 %d", i, count); } ! if (oi < 0) { tw_error("SpaceSprite::collide - index2 %d < count2 %d", oi, other->count); } return (check_pmask_collision(m[i], other->m[oi], x, y, ox, oy)); } |
From: <geo...@us...> - 2003-11-25 00:13:15
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source/newships Modified Files: shptaume.cpp Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: shptaume.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaume.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shptaume.cpp 26 Oct 2003 10:43:17 -0000 1.8 --- shptaume.cpp 25 Nov 2003 00:13:12 -0000 1.9 *************** *** 179,182 **** --- 179,189 ---- sprite_index += ic*64; + if (sprite_index < 0 || sprite_index >= sprite->frames()) + { + tw_error("wrong number of frames!!"); + //1740 + //ic==12 + } + if (locked_rail) { tt = unit_vector(angle); *************** *** 342,346 **** TauMercurySpark::TauMercurySpark (SpaceLocation *creator, double ox, double oy, double oangle, double ov, int olifetime, int blah_or, int og, int ob, double od, double relativity, double odamage) : ! SpaceLine(creator, Vector2(ox,oy), oangle, 0, 0), lifetime(olifetime), lifetime_max(olifetime), r(blah_or), g(og), b(ob) --- 349,353 ---- TauMercurySpark::TauMercurySpark (SpaceLocation *creator, double ox, double oy, double oangle, double ov, int olifetime, int blah_or, int og, int ob, double od, double relativity, double odamage) : ! SpaceLine(creator, Vector2(ox,oy), oangle, 1, 0), lifetime(olifetime), lifetime_max(olifetime), r(blah_or), g(og), b(ob) |
From: <geo...@us...> - 2003-11-25 00:13:15
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv23646/source Modified Files: scp.cpp Log Message: added .ini setting for controlling stacktrace -- added "{ }" around tw_error statements (it's an evil macro!) -- tau-mercury/ varith'sgame debug Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** scp.cpp 19 Nov 2003 22:10:56 -0000 1.26 --- scp.cpp 25 Nov 2003 00:13:12 -0000 1.27 *************** *** 697,700 **** --- 697,704 ---- set_config_file("client.ini"); + #ifdef DO_STACKTRACE + usestacktrace = get_config_int("System", "UseStack", 0); + #endif + int screen_width = 640, screen_height = 480, screen_bpp = 32; int fullscreen = 0; |
From: <geo...@us...> - 2003-11-24 22:13:27
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv30966/source/melee Modified Files: mship.cpp Log Message: fixed little bugger (my frames check wasn't used correctly) Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** mship.cpp 23 Nov 2003 10:05:01 -0000 1.20 --- mship.cpp 24 Nov 2003 22:13:24 -0000 1.21 *************** *** 507,513 **** } ! // changed GEO - just to be sure you don't exceed #frames. // sprite_index = get_index(angle); ! sprite_index = get_index(angle, PI/2, sprite->frames()); SpaceObject::calculate(); --- 507,520 ---- } ! // changed GEO - just to be sure you don't exceed #frames if #frames<64 (the assumed value here...). // sprite_index = get_index(angle); ! //sprite_index = get_index(angle, PI/2, sprite->frames()); ! // (geo) actually, this introduces a big bug if the ship has >64 frames in ! // the ship sprite -- eg the tau mercury. ! if (sprite->frames() > 64) ! sprite_index = get_index(angle); ! else ! sprite_index = get_index(angle, PI/2, sprite->frames()); ! SpaceObject::calculate(); |
From: <geo...@us...> - 2003-11-24 22:12:32
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv30774/source/melee Modified Files: mshppan.cpp Log Message: re-added AA for ship panel Index: mshppan.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshppan.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mshppan.cpp 22 Nov 2003 18:16:31 -0000 1.14 --- mshppan.cpp 24 Nov 2003 22:12:29 -0000 1.15 *************** *** 121,126 **** // blit(panel, screen, 0, 0, panel_x, panel_y, 64, 100); // blit(captain, screen, 0, 0, captain_x, captain_y, CAPTAIN_WIDTH, CAPTAIN_HEIGHT); ! aa_set_mode(AA_NO_AA); aa_stretch_blit(panel, screen, 0, 0, panel->w, panel->h, panel_x, panel_y, panel_width, panel_height); release_screen(); } --- 121,128 ---- // blit(panel, screen, 0, 0, panel_x, panel_y, 64, 100); // blit(captain, screen, 0, 0, captain_x, captain_y, CAPTAIN_WIDTH, CAPTAIN_HEIGHT); ! // int a = aa_get_mode(); ! // aa_set_mode(AA_NO_AA); aa_stretch_blit(panel, screen, 0, 0, panel->w, panel->h, panel_x, panel_y, panel_width, panel_height); + // aa_set_mode(a); release_screen(); } *************** *** 140,145 **** acquire_screen(); // blit(captain, screen, 0, 0, captain_x, captain_y, CAPTAIN_WIDTH, CAPTAIN_HEIGHT); ! aa_set_mode(AA_NO_AA); aa_stretch_blit(panel, screen, 0, 0, panel->w, panel->h, panel_x, panel_y, panel_width, panel_height); release_screen(); return; --- 142,149 ---- acquire_screen(); // blit(captain, screen, 0, 0, captain_x, captain_y, CAPTAIN_WIDTH, CAPTAIN_HEIGHT); ! // int a = aa_get_mode(); ! // aa_set_mode(AA_NO_AA); aa_stretch_blit(panel, screen, 0, 0, panel->w, panel->h, panel_x, panel_y, panel_width, panel_height); + // aa_set_mode(a); release_screen(); return; |
From: <geo...@us...> - 2003-11-23 23:54:21
|
Update of /cvsroot/timewarp/gamex/doc In directory sc8-pr-cvs1:/tmp/cvs-serv24478 Added Files: gamex-dialogue-editor.txt gamex-manual.txt Removed Files: gamex - dialogue editor.txt gamex - manual.txt Log Message: the filenames contained spaces, which messes up the update-patch script --- NEW FILE: gamex-dialogue-editor.txt --- --------------- DIALOGUE EDITOR --------------- How: The dialog basically consists of pieces of text, branching to other pieces of text. Each piece can be either an "alien answer" or an "captain question" in SC2. Note that often, a alien answer can be followed by several questions of the captain; similarly, a single question by the captain can give different answers based on game settings. ------------- the interface ------------- Top rect. field: shows the alien info (alien picture). Top field: shows the text. Bottom field: shows parts of text of the pieces this text links to. "P" button: goes to the previous piece of text. "+" button: adds a new link, (and jumps to that new piece of text ??). "refresh": reloads the text (only works if you're still within the same piece of text) checkbox: initial state of the text (is immediately accessible as a dialogue, or hidden until activated by some trigger). -- todo: "rem": not supported yet (should delete this piece of text) triggers (yeah, difficult...) --> perhaps best, a "variable" name, which can change now and then ? --- NEW FILE: gamex-manual.txt --- ----- START ----- Press the FG button in the timewarp screen; it's on the bottom right. Currently this loads the hyperspace map. ---------------------------- NAVIGATING BETWEEN GAMETYPES ---------------------------- The game starts in hyperspace. If you want to jump to another gametype that's not yet "attached", use: left-control + + 1: loads the starmap + 2: loads the dialog editor ESC: exits a gametype, and returns to the parent game. ----------- THE STARMAP ----------- left-mouse changes the "active" star. left-control move the "active" star according to the mouse position. left-mouse places the "active" star, if it's attached to the mouse position right-mouse centers the new map location - zooms in = zooms out 'A' (1) adds a default new star, or (2) changes the star type provided it's being held by the mouse. --- gamex - dialogue editor.txt DELETED --- --- gamex - manual.txt DELETED --- |
From: <geo...@us...> - 2003-11-23 23:52:45
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1:/tmp/cvs-serv24212/source/games Modified Files: vgGenSys.cpp Log Message: vgensys modification, with a extra menu at the start ... Index: vgGenSys.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/vgGenSys.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vgGenSys.cpp 8 Jun 2003 16:40:31 -0000 1.3 --- vgGenSys.cpp 23 Nov 2003 23:52:42 -0000 1.4 *************** *** 10,13 **** --- 10,15 ---- #include "../melee/mview.h" + #include "../twgui/twgui.h" + #ifndef _V_BODIES_H #include "../other/vbodies.h" *************** *** 16,23 **** class VGenSystem : public NormalGame { public: ! SpaceSprite* AstSpr1[64]; ! SpaceSprite* AstSpr2[64]; ! SpaceSprite* AstSpr3[64]; ! SpaceSprite* AstSpr4[64]; SpaceSprite* PlanetMoon; SpaceSprite* PlanetHabitable; --- 18,25 ---- class VGenSystem : public NormalGame { public: ! SpaceSprite* AstSpr1; ! SpaceSprite* AstSpr2; ! SpaceSprite* AstSpr3; ! SpaceSprite* AstSpr4; SpaceSprite* PlanetMoon; SpaceSprite* PlanetHabitable; *************** *** 25,32 **** SpaceSprite* PlanetRockball; SpaceSprite* PlanetGasGiant; ! SpaceSprite* Flare1[64]; ! SpaceSprite* Flare2[64]; ! SpaceSprite* Flare3[64]; ! SpaceSprite* Flare4[64]; SpaceSprite* BrownDwarfSpr; SpaceSprite* RedDwarfSpr; --- 27,34 ---- SpaceSprite* PlanetRockball; SpaceSprite* PlanetGasGiant; ! SpaceSprite* Flare1; ! SpaceSprite* Flare2; ! SpaceSprite* Flare3; ! SpaceSprite* Flare4; SpaceSprite* BrownDwarfSpr; SpaceSprite* RedDwarfSpr; *************** *** 38,43 **** SpaceSprite* RedGiantSpr; SpaceSprite* BlueGiantSpr; ! SpaceSprite* NeutronStarSpr[64]; ! SpaceSprite* BlackHoleSpr[64]; SpaceSprite* DustCloudSpr; SpaceSprite* GasCloudSpr[2]; --- 40,45 ---- SpaceSprite* RedGiantSpr; SpaceSprite* BlueGiantSpr; ! SpaceSprite* NeutronStarSpr; ! SpaceSprite* BlackHoleSpr; SpaceSprite* DustCloudSpr; SpaceSprite* GasCloudSpr[2]; *************** *** 53,57 **** void setupBinary(SpaceObject* S1, SpaceObject* S2, double radius1, double radius2, double speed1); virtual void init_objects(); ! bool GetSpriteTo64Rot(SpaceSprite *Pics[], char *fileName, char *cmdStr, int numSprites = 1, int attribs = -1); SpaceSprite* GetSprite(char *fileName, char *spriteName, int attribs, int rotations=1, int numSprites = 1); --- 55,59 ---- void setupBinary(SpaceObject* S1, SpaceObject* S2, double radius1, double radius2, double speed1); virtual void init_objects(); ! bool GetSpriteTo64Rot(SpaceSprite *Pics, char *fileName, char *cmdStr, int numSprites = 1, int attribs = -1); SpaceSprite* GetSprite(char *fileName, char *spriteName, int attribs, int rotations=1, int numSprites = 1); *************** *** 59,72 **** SpaceSprite* GetMultiframeSprite(char *fileName, char *spriteName, int attribs, int numberOfFrames); virtual ~VGenSystem(); - }; ! class VAncientBattlefield : public VGenSystem { ! virtual void init_objects(void); }; ! void VAncientBattlefield::init_objects(void) { int i; ! VGenSystem::init_objects(); for(i=0; i<20; i++) { game->add(new VDustCloud()); --- 61,102 ---- SpaceSprite* GetMultiframeSprite(char *fileName, char *spriteName, int attribs, int numberOfFrames); virtual ~VGenSystem(); ! void init_objectsVAncientBattlefield(); ! void init_objectsVSpaceStationGame(); ! void init_objectsVImperialCapitol(); ! void init_objectsVDefendedPlanet(); ! void init_objectsVMineField(); ! void init_objectsVSysNebula(); ! void init_objectsVSysDusty(); ! void init_objectsVSysGassy(); ! void init_objectsVSysBlueGiant(); ! void init_objectsVSysWhiteDwarf(); ! void init_objectsVSysWhiteStar(); ! void init_objectsVSysYellowThreePlanets(); ! void init_objectsVSysVoid(); ! void init_objectsVSysBrownDwarf(); ! void init_objectsVSysBinRedDwarf(); ! void init_objectsVSysBinRedGiantNeutron(); ! void init_objectsVSysHypermass(); ! void init_objectsVSysTartarus(); ! void init_objectsVSysSmallAsteroids(); ! void init_objectsVSysLargeAsteroids(); ! void init_objectsVSysHeavyAsteroids(); ! void init_objectsVSysExtremeAsteroids(); ! void init_objectsVSysMetallicAsteroids(); ! ! typedef void (VGenSystem::* type_func) (); ! type_func funclist[32]; ! char *functitle[32]; ! int Ninit; ! void register_init(type_func f, char *description); }; ! ! ! void VGenSystem::init_objectsVAncientBattlefield() { int i; ! //VGenSystem::init_objects(); for(i=0; i<20; i++) { game->add(new VDustCloud()); *************** *** 81,91 **** - class VSpaceStationGame : public VGenSystem { - virtual void init_objects(void); - }; ! void VSpaceStationGame::init_objects(void) { VDeepSpaceStation* DSS; ! VGenSystem::init_objects(); DSS = new VDeepSpaceStation(); game->add(DSS); --- 111,118 ---- ! void VGenSystem::init_objectsVSpaceStationGame() { VDeepSpaceStation* DSS; ! //VGenSystem::init_objects(); DSS = new VDeepSpaceStation(); game->add(DSS); *************** *** 96,107 **** } - class VImperialCapitol : public VGenSystem { - virtual void init_objects(void); - }; ! void VImperialCapitol::init_objects() { VHabitablePlanet* VHP; VGroundDefenseLaser *GDL; ! VGenSystem::init_objects(); VHP = new VHabitablePlanet(); game->add(VHP); --- 123,132 ---- } ! ! void VGenSystem::init_objectsVImperialCapitol() { VHabitablePlanet* VHP; VGroundDefenseLaser *GDL; ! //VGenSystem::init_objects(); VHP = new VHabitablePlanet(); game->add(VHP); *************** *** 137,147 **** - class VDefendedPlanet : public VGenSystem { - virtual void init_objects(void); - }; ! void VDefendedPlanet::init_objects(void) { VRockballPlanet* VRP; ! VGenSystem::init_objects(); VRP = new VRockballPlanet(); game->add(VRP); --- 162,169 ---- ! void VGenSystem::init_objectsVDefendedPlanet(void) { VRockballPlanet* VRP; ! //VGenSystem::init_objects(); VRP = new VRockballPlanet(); game->add(VRP); *************** *** 153,164 **** - class VMineField : public VGenSystem { - virtual void init_objects(void); - }; ! void VMineField::init_objects(void) { int i; VSpaceMine* VSM; ! VGenSystem::init_objects(); for(i=0; i<90; i++){ VSM = (new VSpaceMine()); --- 175,183 ---- ! void VGenSystem::init_objectsVMineField(void) { int i; VSpaceMine* VSM; ! //VGenSystem::init_objects(); for(i=0; i<90; i++){ VSM = (new VSpaceMine()); *************** *** 173,183 **** } - class VSysNebula : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysNebula::init_objects(void) { game->add(new VNebula()); ! VGenSystem::init_objects(); game->add(new VSmallAsteroid()); game->add(new VLargeAsteroid()); --- 192,200 ---- } ! ! void VGenSystem::init_objectsVSysNebula(void) { game->add(new VNebula()); ! //VGenSystem::init_objects(); game->add(new VSmallAsteroid()); game->add(new VLargeAsteroid()); *************** *** 185,204 **** } - class VSysDusty : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysDusty::init_objects(void) { ! VGenSystem::init_objects(); for(int i=0; i<33; i++) game->add(new VDustCloud()); } - class VSysGassy : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysGassy::init_objects(void) { ! VGenSystem::init_objects(); for(int i=0; i<33; i++) game->add(new VGasCloud()); --- 202,217 ---- } ! ! void VGenSystem::init_objectsVSysDusty(void) { ! //VGenSystem::init_objects(); for(int i=0; i<33; i++) game->add(new VDustCloud()); } ! ! void VGenSystem::init_objectsVSysGassy(void) { ! //VGenSystem::init_objects(); for(int i=0; i<33; i++) game->add(new VGasCloud()); *************** *** 206,242 **** - class VSysBlueGiant : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysBlueGiant::init_objects(void) { ! VGenSystem::init_objects(); game->add(new VBlueGiant()); } - class VSysWhiteDwarf : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysWhiteDwarf::init_objects(void) { ! VGenSystem::init_objects(); game->add(new VWhiteDwarf()); } - class VSysWhiteStar : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysWhiteStar::init_objects(void) { ! VGenSystem::init_objects(); game->add(new VWhiteStar()); } - class VSysYellowThreePlanets : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysYellowThreePlanets::init_objects(void) { int i; VYellowStar* YS; --- 219,247 ---- ! ! void VGenSystem::init_objectsVSysBlueGiant(void) { ! //VGenSystem::init_objects(); game->add(new VBlueGiant()); } ! ! void VGenSystem::init_objectsVSysWhiteDwarf(void) { ! //VGenSystem::init_objects(); game->add(new VWhiteDwarf()); } ! ! void VGenSystem::init_objectsVSysWhiteStar(void) { ! //VGenSystem::init_objects(); game->add(new VWhiteStar()); } ! ! void VGenSystem::init_objectsVSysYellowThreePlanets(void) { int i; VYellowStar* YS; *************** *** 248,252 **** VMoon* M3; OrbitHandler* OH; ! VGenSystem::init_objects(); YS = new VYellowStar(); RP = new VRockballPlanet(); --- 253,257 ---- VMoon* M3; OrbitHandler* OH; ! //VGenSystem::init_objects(); YS = new VYellowStar(); RP = new VRockballPlanet(); *************** *** 285,315 **** } - class VSysVoid : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysVoid :: init_objects(void) { ! VGenSystem::init_objects(); } - class VSysBrownDwarf : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysBrownDwarf::init_objects(void) { ! VGenSystem::init_objects(); game->add(new VBrownDwarf()); } - class VSysBinRedDwarf : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysBinRedDwarf::init_objects(void) { int i; VRedDwarf* RD1; VRedDwarf* RD2; ! VGenSystem::init_objects(); RD1 = new VRedDwarf(); RD2 = new VRedDwarf(); --- 290,314 ---- } ! ! void VGenSystem :: init_objectsVSysVoid(void) { ! //VGenSystem::init_objects(); } ! ! void VGenSystem::init_objectsVSysBrownDwarf(void) { ! //VGenSystem::init_objects(); game->add(new VBrownDwarf()); } ! ! void VGenSystem::init_objectsVSysBinRedDwarf(void) { int i; VRedDwarf* RD1; VRedDwarf* RD2; ! //VGenSystem::init_objects(); RD1 = new VRedDwarf(); RD2 = new VRedDwarf(); *************** *** 329,341 **** - class VSysBinRedGiantNeutron : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysBinRedGiantNeutron::init_objects(void) { int i; VRedGiant* RG1; VNeutronStar* NS2; ! VGenSystem::init_objects(); RG1 = new VRedGiant(); NS2 = new VNeutronStar(); --- 328,338 ---- ! ! void VGenSystem::init_objectsVSysBinRedGiantNeutron(void) { int i; VRedGiant* RG1; VNeutronStar* NS2; ! //VGenSystem::init_objects(); RG1 = new VRedGiant(); NS2 = new VNeutronStar(); *************** *** 353,364 **** } - class VSysHypermass : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysHypermass::init_objects(void) { int i; VHypermass* H1; ! VGenSystem::init_objects(); H1 = new VHypermass(); game->add(H1); --- 350,359 ---- } ! ! void VGenSystem::init_objectsVSysHypermass(void) { int i; VHypermass* H1; ! //VGenSystem::init_objects(); H1 = new VHypermass(); game->add(H1); *************** *** 373,386 **** } - class VSysTartarus : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysTartarus::init_objects(void) { int i; VHypermass* H1; VHypermass* H2; VBlueGiant* BG; ! VGenSystem::init_objects(); H1 = new VHypermass(); H2 = new VHypermass(); --- 368,379 ---- } ! ! void VGenSystem::init_objectsVSysTartarus(void) { int i; VHypermass* H1; VHypermass* H2; VBlueGiant* BG; ! //VGenSystem::init_objects(); H1 = new VHypermass(); H2 = new VHypermass(); *************** *** 405,437 **** } - class VSysSmallAsteroids : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysSmallAsteroids::init_objects(void) { int i; ! VGenSystem::init_objects(); for(i=0; i<35; i++) game->add(new VSmallAsteroid()); } - class VSysLargeAsteroids : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysLargeAsteroids::init_objects(void) { int i; ! VGenSystem::init_objects(); for(i=0;i<30; i++) game->add(new VLargeAsteroid()); } - class VSysHeavyAsteroids : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysHeavyAsteroids::init_objects(void) { int i; ! VGenSystem::init_objects(); for (i=0; i<4; i++) game->add(new VMetalShard()); --- 398,421 ---- } ! void VGenSystem::init_objectsVSysSmallAsteroids(void) { int i; ! //VGenSystem::init_objects(); for(i=0; i<35; i++) game->add(new VSmallAsteroid()); } ! void VGenSystem::init_objectsVSysLargeAsteroids(void) { int i; ! //VGenSystem::init_objects(); for(i=0;i<30; i++) game->add(new VLargeAsteroid()); } ! void VGenSystem::init_objectsVSysHeavyAsteroids(void) { int i; ! //VGenSystem::init_objects(); for (i=0; i<4; i++) game->add(new VMetalShard()); *************** *** 444,454 **** } - class VSysExtremeAsteroids : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysExtremeAsteroids::init_objects(void) { int i; ! VGenSystem::init_objects(); for (i=0; i<5; i++) game->add(new VMetalShard()); --- 428,435 ---- } ! void VGenSystem::init_objectsVSysExtremeAsteroids(void) { int i; ! //VGenSystem::init_objects(); for (i=0; i<5; i++) game->add(new VMetalShard()); *************** *** 461,471 **** } - class VSysMetallicAsteroids : public VGenSystem { - virtual void init_objects(void); - }; ! void VSysMetallicAsteroids::init_objects(void) { int i; ! VGenSystem::init_objects(); for(i=0; i<30; i++) game->add(new VMetalAsteroid()); --- 442,449 ---- } ! void VGenSystem::init_objectsVSysMetallicAsteroids(void) { int i; ! //VGenSystem::init_objects(); for(i=0; i<30; i++) game->add(new VMetalAsteroid()); *************** *** 475,478 **** --- 453,464 ---- + + // --------------------------------------------------------------------------- + + // --------------------------------------------------------------------------- + + + + void VGenSystem::setupBinary(SpaceObject* S1, SpaceObject* S2, double radius1, double radius2, double speed1) { OrbitHandler* OH; *************** *** 542,553 **** error("File error, things pictures. Bailing out..."); ! VMetalShard::SetMySprite(AstSpr1[0]); ! VMetalAsteroid::SetMySprite(AstSpr2[0]); ! VSmallAsteroid::SetMySprite(AstSpr3[0]); ! VLargeAsteroid::SetMySprite(AstSpr4[0]); ! VRedFlare::SetMySprite(Flare1[0]); ! VOrangeFlare::SetMySprite(Flare2[0]); ! VYellowFlare::SetMySprite(Flare3[0]); ! VWhiteFlare::SetMySprite(Flare4[0]); VDustCloud::SetMySprite(DustCloudSpr); VGasCloud::SetMySprite1(GasCloudSpr[0]); --- 528,539 ---- error("File error, things pictures. Bailing out..."); ! VMetalShard::SetMySprite(AstSpr1); ! VMetalAsteroid::SetMySprite(AstSpr2); ! VSmallAsteroid::SetMySprite(AstSpr3); ! VLargeAsteroid::SetMySprite(AstSpr4); ! VRedFlare::SetMySprite(Flare1); ! VOrangeFlare::SetMySprite(Flare2); ! VYellowFlare::SetMySprite(Flare3); ! VWhiteFlare::SetMySprite(Flare4); VDustCloud::SetMySprite(DustCloudSpr); VGasCloud::SetMySprite1(GasCloudSpr[0]); *************** *** 567,572 **** VRedGiant::SetMySprite(RedGiantSpr); VBlueGiant::SetMySprite(BlueGiantSpr); ! VNeutronStar::SetMySprite(NeutronStarSpr[0]); ! VHypermass::SetMySprite(BlackHoleSpr[0]); VSpaceMine::SetMySprite(SpaceMineSpr, SpaceMineExplosionSpr); VDefSat::SetMySprite(DefSatSpr); --- 553,558 ---- VRedGiant::SetMySprite(RedGiantSpr); VBlueGiant::SetMySprite(BlueGiantSpr); ! VNeutronStar::SetMySprite(NeutronStarSpr); ! VHypermass::SetMySprite(BlackHoleSpr); VSpaceMine::SetMySprite(SpaceMineSpr, SpaceMineExplosionSpr); VDefSat::SetMySprite(DefSatSpr); *************** *** 576,592 **** } - void VGenSystem::init_objects() { - size *= 1; - prepare(); - VGenSystem::setupSprites(); - mapCenter = new SpaceLocation(NULL, Vector2(0,0), 0); - add(new Stars()); - VMetalShard::InitStatics(); - VSmallAsteroid::InitStatics(); - VLargeAsteroid::InitStatics(); - VMetalAsteroid::InitStatics(); - } ! bool VGenSystem::GetSpriteTo64Rot(SpaceSprite *Pics[], char *fileName, char *cmdStr, int numSprites, int attribs) { --- 562,567 ---- } ! bool VGenSystem::GetSpriteTo64Rot(SpaceSprite *Pics, char *fileName, char *cmdStr, int numSprites, int attribs) { *************** *** 603,607 **** return FALSE; } ! Pics[num]=spr; } return TRUE; --- 578,582 ---- return FALSE; } ! Pics=spr; } return TRUE; *************** *** 681,685 **** { sprintf(dataStr,cmdStr,num); ! message.print(500,5,dataStr); spr=GetSprite(fileName, dataStr, attribs, 1); if(!spr) --- 656,660 ---- { sprintf(dataStr,cmdStr,num); ! message.print(500,5,dataStr); spr=GetSprite(fileName, dataStr, attribs, 1); if(!spr) *************** *** 694,711 **** VGenSystem::~VGenSystem(void) { ! int i; //NormalGame::~NormalGame(); ! for(i=0; i<64; i++) { ! delete AstSpr1[i]; ! delete AstSpr2[i]; ! delete AstSpr3[i]; ! delete AstSpr4[i]; ! delete Flare1[i]; ! delete Flare2[i]; ! delete Flare3[i]; ! delete Flare4[i]; ! delete NeutronStarSpr[i]; ! delete BlackHoleSpr[i]; ! } delete PlanetMoon; delete PlanetHabitable; --- 669,686 ---- VGenSystem::~VGenSystem(void) { ! // int i; //NormalGame::~NormalGame(); ! //for(i=0; i<64; i++) { ! delete AstSpr1; ! delete AstSpr2; ! delete AstSpr3; ! delete AstSpr4; ! delete Flare1; ! delete Flare2; ! delete Flare3; ! delete Flare4; ! delete NeutronStarSpr; ! delete BlackHoleSpr; ! //} delete PlanetMoon; delete PlanetHabitable; *************** *** 724,727 **** --- 699,710 ---- delete BlueGiantSpr; } + + + + + class GeneralMelee : public NormalGame { + virtual void init_objects(void); + }; + /* REGISTER_GAME ( VSysVoid, "V-Void"); *************** *** 750,751 **** --- 733,823 ---- */ + + + + void VGenSystem::register_init(type_func f, char *description) + { + funclist[Ninit] = f; + functitle[Ninit] = description; + ++Ninit; + } + + + void VGenSystem::init_objects() { + size *= 1; + prepare(); + + // interface, and init-objects using the interface ... + Ninit = 0; + register_init(&VGenSystem::init_objectsVAncientBattlefield, "Ancient battlefield"); + register_init(&VGenSystem::init_objectsVSpaceStationGame, "Station"); + register_init(&VGenSystem::init_objectsVImperialCapitol, "Imperial capital"); + register_init(&VGenSystem::init_objectsVDefendedPlanet, "Defended planet"); + register_init(&VGenSystem::init_objectsVMineField, "Mine field"); + register_init(&VGenSystem::init_objectsVSysNebula, "Nebula"); + register_init(&VGenSystem::init_objectsVSysDusty, "Dusty"); + register_init(&VGenSystem::init_objectsVSysGassy, "Gassy"); + register_init(&VGenSystem::init_objectsVSysBlueGiant, "Blue giant"); + register_init(&VGenSystem::init_objectsVSysWhiteDwarf, "White dwarf"); + register_init(&VGenSystem::init_objectsVSysWhiteStar, "White star"); + register_init(&VGenSystem::init_objectsVSysYellowThreePlanets, "Yellow three planets"); + register_init(&VGenSystem::init_objectsVSysVoid, "Void"); + register_init(&VGenSystem::init_objectsVSysBrownDwarf, "Brown dwarf"); + register_init(&VGenSystem::init_objectsVSysBinRedDwarf, "Red dwarf"); + register_init(&VGenSystem::init_objectsVSysBinRedGiantNeutron, "Red giant neutron"); + register_init(&VGenSystem::init_objectsVSysHypermass, "Hypermass"); + register_init(&VGenSystem::init_objectsVSysTartarus, "Tartarus"); + register_init(&VGenSystem::init_objectsVSysSmallAsteroids, "Small asteroids"); + register_init(&VGenSystem::init_objectsVSysLargeAsteroids, "Large asteroids"); + register_init(&VGenSystem::init_objectsVSysHeavyAsteroids, "Heavy asteroids"); + register_init(&VGenSystem::init_objectsVSysExtremeAsteroids, "Extreme asteroids"); + register_init(&VGenSystem::init_objectsVSysMetallicAsteroids, "Metallic asteroids"); + + //int i = random(Ninit); + + + PopupList *popupl; + popupl = new PopupList(screen, "interfaces/gametest/popuplist", 0, 0, videosystem.get_font(2), 0); + popupl->tbl->set_optionlist(functitle, Ninit, makecol(255,255,128)); + popupl->show(); + popupl->xshift = 0; + popupl->yshift = 0; + popupl->close_on_defocus = false; + + + WindowManager *winman; + winman = new WindowManager; + winman->add(popupl); + + popupl->setscreen(screen); + show_mouse(screen); + unscare_mouse(); + + while (!popupl->returnvalueready) + { + idle(10); + + winman->calculate(); + winman->animate(); + } + + int i; + i = popupl->returnstatus; + + + VGenSystem::setupSprites(); + mapCenter = new SpaceLocation(NULL, Vector2(0,0), 0); + add(new Stars()); + VMetalShard::InitStatics(); + VSmallAsteroid::InitStatics(); + VLargeAsteroid::InitStatics(); + VMetalAsteroid::InitStatics(); + + + // call the selected init routine : + (this->*funclist[i])(); + + } + + + REGISTER_GAME(VGenSystem, "Varith Systems") |
From: <geo...@us...> - 2003-11-23 23:52:01
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1:/tmp/cvs-serv24084/source/twgui Modified Files: area.cpp area.h twgui.cpp twgui.h Log Message: twgui modifications ... Index: area.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/area.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** area.cpp 23 Nov 2003 10:00:52 -0000 1.10 --- area.cpp 23 Nov 2003 23:51:57 -0000 1.11 *************** *** 651,654 **** --- 651,655 ---- flag.focus = true; + handle_focus(); if (flag.focus != flag.lastfocus && button_event) button_event->handle_focus(); *************** *** 660,663 **** --- 661,665 ---- flag.focus = false; + handle_defocus(); if (flag.focus != flag.lastfocus && button_event) button_event->handle_defocus(); *************** *** 704,707 **** --- 706,710 ---- { flag.left_mouse_press = true; + handle_lpress(); if (button_event) button_event->handle_lpress(); *************** *** 711,714 **** --- 714,718 ---- { flag.left_mouse_hold = true; + handle_lhold(); if (button_event) button_event->handle_lhold(); *************** *** 718,721 **** --- 722,726 ---- { flag.left_mouse_release = true; + handle_lrelease(); if (button_event) button_event->handle_lrelease(); *************** *** 726,729 **** --- 731,735 ---- { flag.right_mouse_press = true; + handle_rpress(); if (button_event) button_event->handle_rpress(); Index: area.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/area.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** area.h 23 Nov 2003 10:53:39 -0000 1.11 --- area.h 23 Nov 2003 23:51:57 -0000 1.12 *************** *** 216,219 **** --- 216,237 ---- virtual void handle_menu_focus_loss(); + virtual void handle_char(int c) {}; + virtual void handle_uchar(int c) {}; + virtual void handle_focus() {}; + virtual void handle_defocus() {}; + virtual void handle_click() {}; + virtual void handle_doubleclick() {}; + virtual void handle_gotmouse() {}; + virtual void handle_lostmouse() {}; + virtual void handle_wheel(int c) {}; + virtual void handle_lpress() {}; + virtual void handle_mpress() {}; + virtual void handle_rpress() {}; + virtual void handle_lrelease() {}; + virtual void handle_mrelease() {}; + virtual void handle_rrelease() {}; + virtual void handle_lhold() {}; + virtual void handle_mhold() {}; + virtual void handle_rhold() {}; }; Index: twgui.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twgui.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** twgui.cpp 23 Nov 2003 10:00:52 -0000 1.11 --- twgui.cpp 23 Nov 2003 23:51:57 -0000 1.12 *************** *** 1704,1707 **** --- 1704,1709 ---- option.disable_othermenu = true; option.place_relative2mouse = true; + + close_on_defocus = true; } *************** *** 1827,1830 **** --- 1829,1835 ---- void PopupGeneral::handle_focus_loss() { + if (!close_on_defocus) + return; + if (mouse.left.hold()) { *************** *** 1851,1855 **** void PopupGeneral::check_end() { ! if (!hidden && !hasfocus) // to prevent this from being called twice, due to recursive call to handle_focus() in hide() { //tw_error("PopupList : Losing focus !!"); --- 1856,1860 ---- void PopupGeneral::check_end() { ! if (!hidden && !hasfocus && close_on_defocus) // to prevent this from being called twice, due to recursive call to handle_focus() in hide() { //tw_error("PopupList : Losing focus !!"); *************** *** 1942,1945 **** --- 1947,1963 ---- // special push button type for that, I can just as well let this (new) class // access the state of that general button type. + + + // (well, the following one isn't using a button, the one below is...) + PopupList::PopupList(BITMAP *outputscreen, char *ident, int axshift, int ayshift, + FONT *afont, char **aoptionslist) + : + PopupGeneral(ident, axshift, ayshift, outputscreen) + { + tbl = new TextButtonList(this, "TEXT/", -1, -1, afont, &scroll); + tbl->set_optionlist(aoptionslist, makecol(0,0,0)); + + doneinit(); // closes the datafile + } PopupList::PopupList(AreaGeneral *atrigger, char *ident, int axshift, int ayshift, Index: twgui.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twgui.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** twgui.h 22 Nov 2003 23:10:34 -0000 1.9 --- twgui.h 23 Nov 2003 23:51:57 -0000 1.10 *************** *** 390,394 **** // origin relative to the creators' position PopupGeneral(AreaGeneral *creator, char *identbranch, int axshift, int ayshift); ! PopupGeneral::PopupGeneral(char *identbranch, int axshift, int ayshift, BITMAP *outputscreen); ~PopupGeneral(); virtual void init_components(char *identbranch); --- 390,394 ---- // origin relative to the creators' position PopupGeneral(AreaGeneral *creator, char *identbranch, int axshift, int ayshift); ! PopupGeneral(char *identbranch, int axshift, int ayshift, BITMAP *outputscreen); ~PopupGeneral(); virtual void init_components(char *identbranch); *************** *** 410,413 **** --- 410,417 ---- // closed; otherwise it returns -1. int getvalue(); + + // this toggles whether the list is auto-closed when focus is lost, or remains + // focus even if the mouse moves out of sight of the list... + bool close_on_defocus; }; *************** *** 461,464 **** --- 465,472 ---- // char **optionslist; + + // just a "list" item ... not really a popup thing + PopupList(BITMAP *outputscreen, char *ident, int axshift, int ayshift, + FONT *afont, char **aaoptionslist); // origin relative to the creators' position |
From: <geo...@us...> - 2003-11-23 16:21:08
|
Update of /cvsroot/timewarp/source/games/triggers In directory sc8-pr-cvs1:/tmp/cvs-serv31519/source/games/triggers Modified Files: tredit.cpp Log Message: a few more interface updates Index: tredit.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/triggers/tredit.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tredit.cpp 26 Oct 2003 10:43:17 -0000 1.2 --- tredit.cpp 23 Nov 2003 16:21:05 -0000 1.3 *************** *** 195,206 **** int k; k = iy*Nx+ix; ! b[k] = new TextButton(Amain, "button", (ix+0.5)*dx, (iy+0.5)*dy, usefont); b[k]->set_text("", makecol(0,0,0)); } } ! line_del = new Button(Amain, "linedel", 0, 0, 0); ! run_game = new Button(Amain, "rungame", 750, 0, 0); --- 195,206 ---- int k; k = iy*Nx+ix; ! b[k] = new TextButton(Amain, "button/", (ix+0.5)*dx, (iy+0.5)*dy, usefont); b[k]->set_text("", makecol(0,0,0)); } } ! line_del = new Button(Amain, "linedel/", 0, 0, 0); ! run_game = new Button(Amain, "rungame/", 750, 0, 0); *************** *** 216,220 **** Aedit->hide(); ! editarea = new TextEditBox(Aedit, "text", 0, 0, usefont, edittxt, maxedittxt); editarea->set_textcolor(makecol(0,0,0)); --- 216,220 ---- Aedit->hide(); ! editarea = new TextEditBox(Aedit, "text/", 0, 0, usefont, edittxt, maxedittxt); editarea->set_textcolor(makecol(0,0,0)); *************** *** 778,781 **** ! REGISTER_GAME(GameTriggerEdit, "Miaauuuw") --- 778,781 ---- ! REGISTER_GAME(GameTriggerEdit, "trigger editor test") |
From: <geo...@us...> - 2003-11-23 16:21:08
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1:/tmp/cvs-serv31519/source/games Modified Files: gmissions.cpp Log Message: a few more interface updates Index: gmissions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gmissions.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gmissions.cpp 23 Nov 2003 10:01:54 -0000 1.14 --- gmissions.cpp 23 Nov 2003 16:21:05 -0000 1.15 *************** *** 817,823 **** --- 817,825 ---- // start the mission // ok .. when a mission is played, it's deleted, and can't be played again ... what to do about that ?! + /* DISABLED FOR THE RELEASE by Geo. Dialog* dialog = new Dialog; dialog->Conversate("dialog.lua"); delete dialog; + */ SubGame *g; g = missionlist[k]->initgame(); |
From: <geo...@us...> - 2003-11-23 16:21:08
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1:/tmp/cvs-serv31519/source/gamex Modified Files: gamedialogue.cpp Log Message: a few more interface updates Index: gamedialogue.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedialogue.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gamedialogue.cpp 18 Nov 2003 17:18:47 -0000 1.1.1.1 --- gamedialogue.cpp 23 Nov 2003 16:21:05 -0000 1.2 *************** *** 1,8 **** - /* - Problems: - 1. Q/A perturbed. Need way to distinguish between them - 2. how to select another branch ? - */ #include <allegro.h> --- 1,3 ---- *************** *** 140,144 **** showline_Nlines = Nlines(dialo->T); //A = new TextEditBox(R, "A", -1, -1, usefont, showline(dialo.A, showline_num), 0); ! A = new TextInfoArea(R, "A", -1, -1, usefont); // all text should fit on 1 window - no scroll needed !! //A->set_textcolor(tcol); --- 135,139 ---- showline_Nlines = Nlines(dialo->T); //A = new TextEditBox(R, "A", -1, -1, usefont, showline(dialo.A, showline_num), 0); ! A = new TextInfoArea(R, "A/", -1, -1, usefont); // all text should fit on 1 window - no scroll needed !! //A->set_textcolor(tcol); *************** *** 147,151 **** ! B = new TextList(R, "B", -1, -1, usefont); --- 142,146 ---- ! B = new TextList(R, "B/", -1, -1, usefont); |
From: <geo...@us...> - 2003-11-23 16:21:08
|
Update of /cvsroot/timewarp/source/gamex/edit In directory sc8-pr-cvs1:/tmp/cvs-serv31519/source/gamex/edit Modified Files: edit_dialogue.cpp Log Message: a few more interface updates Index: edit_dialogue.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/edit_dialogue.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** edit_dialogue.cpp 18 Nov 2003 17:18:51 -0000 1.1.1.1 --- edit_dialogue.cpp 23 Nov 2003 16:21:04 -0000 1.2 *************** *** 224,247 **** //strcpy(Qtext, "a\n b\n c\n d\n e\n f\n g\n h\n i"); ! T = new TextEditBox(R, "text", -1, -1, usefont, dialo->T, 256); T->set_textcolor(tcol); ! B = new TextList(R, "branches", -1, -1, usefont); ! refresh = new Button(R, "refresh", -1, -1, 0); Bplus = new Button(R, "addbranch", -1, -1, 0); // Bmin = new Button(R, "Bmin", -1, -1, 0); ! bprev = new Button(R, "prevbranch", -1, -1, 0); // bnext = new Button(R, "next", -1, -1, 0); ! dialostatus = new SwitchButton(R, "state", -1, -1, 0); // add a text-button for the race pic, and a popup for the race list selection ?! ! raceselect = new TextButton(R, "race", -1, -1, usefont); raceselect->set_text(dialo->racepic, makecol(255,255,0)); --- 224,247 ---- //strcpy(Qtext, "a\n b\n c\n d\n e\n f\n g\n h\n i"); ! T = new TextEditBox(R, "text/", -1, -1, usefont, dialo->T, 256); T->set_textcolor(tcol); ! B = new TextList(R, "branches/", -1, -1, usefont); ! refresh = new Button(R, "refresh/", -1, -1, 0); Bplus = new Button(R, "addbranch", -1, -1, 0); // Bmin = new Button(R, "Bmin", -1, -1, 0); ! bprev = new Button(R, "prevbranch/", -1, -1, 0); // bnext = new Button(R, "next", -1, -1, 0); ! dialostatus = new SwitchButton(R, "state/", -1, -1, 0); // add a text-button for the race pic, and a popup for the race list selection ?! ! raceselect = new TextButton(R, "race/", -1, -1, usefont); raceselect->set_text(dialo->racepic, makecol(255,255,0)); |
From: <geo...@us...> - 2003-11-23 10:53:42
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1:/tmp/cvs-serv7836/source/twgui Modified Files: area.h gametest.cpp gametest.h Log Message: added the possibility to bind Game::functions to mouse events in the twgui. Index: area.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/area.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** area.h 23 Nov 2003 10:19:10 -0000 1.10 --- area.h 23 Nov 2003 10:53:39 -0000 1.11 *************** *** 31,34 **** --- 31,88 ---- }; + /* + This can be used to define behaviour of certain buttons in Game:: + functions (that saves you the trouble of accessing the mouse flags and + defining if statements). Example of use: + + + (step 1) for a particular game, define a specific buttonevent class + + typedef void (TWgui::* ftest) (); + + class GameButtonEvent : public ButtonEvent + { + public: + TWgui *g; + ftest funcpress, funchold; + + GameButtonEvent(TWgui *refgame, ftest reffuncpress, ftest reffunchold) + { + g = refgame; + funcpress = reffuncpress; + funchold = reffunchold; + }; + + virtual void handle_lpress() + { + if (funcpress) + (g->*funcpress) (); + }; + + virtual void handle_lhold() + { + if (funchold) + (g->*funchold) (); + }; + }; + + (step 2) + + define somewhere + + TWgui::myfunc() + { + //content + } + + (step 3) + + assign to a button by + + mybutton->bind(new GameButtonEvent(this, 0, &TWgui::myfunc)); + + + */ + class AreaReserve; Index: gametest.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/gametest.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gametest.cpp 23 Nov 2003 10:01:54 -0000 1.12 --- gametest.cpp 23 Nov 2003 10:53:39 -0000 1.13 *************** *** 1,29 **** - /* - TIMEWARP - - - voor de ship-selection - - always random - - commentaar bovenop (player #) - - - en een Normalgame in-game control panel erbij !! - - oftewel, een volledig functioneel in-game menu-systeem !!! - - in een melee-type sub-game - - (joepie!!) - - - shortcut toetsen laten werken - ook de pijltjes toetsen ... - - - automatisch een ander menu openen (soft touch optie). - - - only works for 32 bpp color depth ?! - */ - - // Three distinctions: 1. area detection and definition, 2. bitmap feedback - // (possibly 3: you can define very specific button classes with all their data - // in there) - - // This makes (imo) best use of classes and their - // overloading (specialization) abilities. I think that's the most general way and can support - // a wide variety of implementations. #include <allegro.h> --- 1,3 ---- *************** *** 60,63 **** --- 34,39 ---- + + /* class ShipPanelToggeable : public ShipPanel *************** *** 354,358 **** zoomin = new Button(meleemenu, "ZOOMIN/", -1, -1, KEY_EQUALS, 1); ! zoomin->bind(new ZoomEvent(this)); zoomout = new Button(meleemenu, "ZOOMOUT/", -1, -1, KEY_MINUS, 1); --- 330,334 ---- zoomin = new Button(meleemenu, "ZOOMIN/", -1, -1, KEY_EQUALS, 1); ! zoomin->bind(new GameButtonEvent(this, 0, &TWgui::handle_zoom_in)); zoomout = new Button(meleemenu, "ZOOMOUT/", -1, -1, KEY_MINUS, 1); Index: gametest.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/gametest.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gametest.h 23 Nov 2003 10:01:54 -0000 1.6 --- gametest.h 23 Nov 2003 10:53:39 -0000 1.7 *************** *** 17,20 **** --- 17,22 ---- + + //class TWgui : public GameLayer class TWgui : public NormalGame *************** *** 69,82 **** void handle_zoom_in(); - class ZoomEvent : public ButtonEvent { - public: - TWgui *g; - ZoomEvent(TWgui *ag) {g = ag;}; - virtual void handle_lhold(){g->handle_zoom_in();}; - } *zoom_event; - }; --- 71,105 ---- void handle_zoom_in(); }; + + typedef void (TWgui::* ftest) (); + + class GameButtonEvent : public ButtonEvent + { + public: + TWgui *g; + ftest funcpress, funchold; + + GameButtonEvent(TWgui *refgame, ftest reffuncpress, ftest reffunchold) + { + g = refgame; + funcpress = reffuncpress; + funchold = reffunchold; + }; + + virtual void handle_lpress() + { + if (funcpress) + (g->*funcpress) (); + }; + + virtual void handle_lhold() + { + if (funchold) + (g->*funchold) (); + }; + }; |
From: <geo...@us...> - 2003-11-23 10:19:16
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1:/tmp/cvs-serv3383/source/twgui Modified Files: area.h Log Message: woops, left a small test in there Index: area.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/area.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** area.h 23 Nov 2003 10:00:52 -0000 1.9 --- area.h 23 Nov 2003 10:19:10 -0000 1.10 *************** *** 43,47 **** void bind(ButtonEvent *be) {button_event = be;}; ! void bind_lhold(void *f()) { xxx = f; }; bool selected; // a general-purpose flag; is set if left mouse is held; this can --- 43,47 ---- void bind(ButtonEvent *be) {button_event = be;}; ! // void bind_lhold(void *f()) { xxx = f; }; bool selected; // a general-purpose flag; is set if left mouse is held; this can |
From: <geo...@us...> - 2003-11-23 10:05:05
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv1788/source/melee Modified Files: mship.cpp Log Message: added extra check on sprite_index for dead objects Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mship.cpp 18 Nov 2003 16:57:48 -0000 1.19 --- mship.cpp 23 Nov 2003 10:05:01 -0000 1.20 *************** *** 506,510 **** angle -= PI2; } ! sprite_index = get_index(angle); SpaceObject::calculate(); --- 506,514 ---- angle -= PI2; } ! ! // changed GEO - just to be sure you don't exceed #frames. ! // sprite_index = get_index(angle); ! sprite_index = get_index(angle, PI/2, sprite->frames()); ! SpaceObject::calculate(); *************** *** 524,528 **** a->accelerate(this, vel.angle(), vv, MAX_SPEED); a->accelerate(this, random(PI2), ! 0.01*random(101)*scale_velocity(25)*sqrt((15+mass)/35), MAX_SPEED); a->collide_flag_anyone = a->collide_flag_sameship = a->collide_flag_sameteam = 0; --- 528,532 ---- a->accelerate(this, vel.angle(), vv, MAX_SPEED); a->accelerate(this, random(PI2), ! random(1.0)*scale_velocity(25)*sqrt((15+mass)/35), MAX_SPEED); a->collide_flag_anyone = a->collide_flag_sameship = a->collide_flag_sameteam = 0; *************** *** 531,535 **** death_counter += frame_time; ! if (death_counter > 700 * (15+mass)/35) //smaller ships will make smaller explosions state = 0; //die already --- 535,539 ---- death_counter += frame_time; ! if (death_counter > 700 * (15+mass)/35 || death_counter > 3000) //smaller ships will make smaller explosions ; GEO: but a real upper limit is also good to have state = 0; //die already *************** *** 938,941 **** --- 942,950 ---- attributes |= ATTRIB_UNDETECTABLE; + + // extra check + // note that if this happens, there's something wrong in the ships' constructor... + if (sprite_index >= sprite->frames()) + sprite_index = 0; return; |