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/gamex/interface/starmap/edit In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/starmap/edit Removed Files: backgr.bmp dec_default.bmp inc_default.bmp info.txt new_default.bmp plot_backgr.bmp plot_default.bmp replace_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- dec_default.bmp DELETED --- --- inc_default.bmp DELETED --- --- info.txt DELETED --- --- new_default.bmp DELETED --- --- plot_backgr.bmp DELETED --- --- plot_default.bmp DELETED --- --- replace_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/planetview/edit In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/planetview/edit Removed Files: backgr.bmp cancel_default.bmp dec_default.bmp inc_default.bmp info.txt plot_default.bmp select_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- cancel_default.bmp DELETED --- --- dec_default.bmp DELETED --- --- inc_default.bmp DELETED --- --- info.txt DELETED --- --- plot_default.bmp DELETED --- --- select_default.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:52
|
Update of /cvsroot/timewarp/gamex/interface/starmap In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/starmap Removed Files: backgr.bmp info.txt map_backgr.bmp zoomin_default.bmp zoomout_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- info.txt DELETED --- --- map_backgr.bmp DELETED --- --- zoomin_default.bmp DELETED --- --- zoomout_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/planetview In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/planetview Removed Files: backgr.bmp exit_default.bmp info.txt map_backgr.bmp starname_backgr.bmp zoomin_default.bmp zoomout_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- exit_default.bmp DELETED --- --- info.txt DELETED --- --- map_backgr.bmp DELETED --- --- starname_backgr.bmp DELETED --- --- zoomin_default.bmp DELETED --- --- zoomout_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/planetscan In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/planetscan Removed Files: backgr.bmp exit_default.bmp info.txt map_backgr.bmp starname_backgr.bmp surface_backgr.bmp zoomin_default.bmp zoomout_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- exit_default.bmp DELETED --- --- info.txt DELETED --- --- map_backgr.bmp DELETED --- --- starname_backgr.bmp DELETED --- --- surface_backgr.bmp DELETED --- --- zoomin_default.bmp DELETED --- --- zoomout_default.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:48
|
Update of /cvsroot/timewarp/gamex/interface/melee In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/melee Removed Files: backgr.bmp info.txt map_backgr.bmp zoomin_default.bmp zoomout_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- info.txt DELETED --- --- map_backgr.bmp DELETED --- --- zoomin_default.bmp DELETED --- --- zoomout_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/hyperspace In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/hyperspace Removed Files: backgr.bmp exit_default.bmp info.txt map_backgr.bmp radar_backgr.bmp starname_backgr.bmp zoomin_default.bmp zoomout_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- exit_default.bmp DELETED --- --- info.txt DELETED --- --- map_backgr.bmp DELETED --- --- radar_backgr.bmp DELETED --- --- starname_backgr.bmp DELETED --- --- zoomin_default.bmp DELETED --- --- zoomout_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/dialogeditor/text In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/dialogeditor/text Removed Files: backgr.bmp barver_backgr.bmp barver_button.bmp down_default.bmp up_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- barver_backgr.bmp DELETED --- --- barver_button.bmp DELETED --- --- down_default.bmp DELETED --- --- up_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/dialogeditor/raceselect/text In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/dialogeditor/raceselect/text Removed Files: backgr.bmp barver_backgr.bmp barver_button.bmp down_default.bmp up_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- barver_backgr.bmp DELETED --- --- barver_button.bmp DELETED --- --- down_default.bmp DELETED --- --- up_default.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:45
|
Update of /cvsroot/timewarp/gamex/interface/dialogeditor/raceselect In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/dialogeditor/raceselect Removed Files: backgr.bmp info.txt Log Message: removing gamex data --- backgr.bmp DELETED --- --- info.txt DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:45
|
Update of /cvsroot/timewarp/gamex/interface/dialogeditor/branches In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/dialogeditor/branches Removed Files: backgr.bmp down_default.bmp up_default.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- --- down_default.bmp DELETED --- --- up_default.bmp DELETED --- |
Update of /cvsroot/timewarp/gamex/interface/dialogeditor In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/dialogeditor Removed Files: addbranch_default.bmp backgr.bmp info.txt prevbranch_default.bmp race_backgr.bmp refresh_default.bmp state_off.bmp state_on.bmp Log Message: removing gamex data --- addbranch_default.bmp DELETED --- --- backgr.bmp DELETED --- --- info.txt DELETED --- --- prevbranch_default.bmp DELETED --- --- race_backgr.bmp DELETED --- --- refresh_default.bmp DELETED --- --- state_off.bmp DELETED --- --- state_on.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:45
|
Update of /cvsroot/timewarp/gamex/interface/dialogeditor/addbranch In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/dialogeditor/addbranch Removed Files: default.bmp Log Message: removing gamex data --- default.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:43
|
Update of /cvsroot/timewarp/gamex/interface/aliendialog/B In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/aliendialog/B Removed Files: backgr.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:43
|
Update of /cvsroot/timewarp/gamex/interface/aliendialog/A In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/aliendialog/A Removed Files: backgr.bmp Log Message: removing gamex data --- backgr.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:43
|
Update of /cvsroot/timewarp/gamex/interface/aliendialog In directory sc8-pr-cvs1:/tmp/cvs-serv553/interface/aliendialog Removed Files: backgr.bmp backgr.psp info.txt Log Message: removing gamex data --- backgr.bmp DELETED --- --- backgr.psp DELETED --- --- info.txt DELETED --- |
Update of /cvsroot/timewarp/gamex/hyperspace In directory sc8-pr-cvs1:/tmp/cvs-serv553/hyperspace Removed Files: blacksphere01.bmp info.txt player_01.bmp radar_player_01.bmp radar_small_red_01.bmp radar_small_yellow_01.bmp star_blobA_01.bmp star_blobA_02.bmp star_blobA_03.bmp star_blobA_04.bmp star_blobA_05.bmp star_blobA_06.bmp star_blobB_01.bmp star_blobB_02.bmp star_blobB_03.bmp star_blobB_04.bmp star_blobB_05.bmp star_blobB_06.bmp star_blobC_01.bmp star_blobC_02.bmp star_blobC_03.bmp star_blobC_04.bmp star_blobC_05.bmp star_blobC_06.bmp star_blobD_01.bmp star_small_red_01.bmp star_small_yellow_01.bmp Log Message: removing gamex data --- blacksphere01.bmp DELETED --- --- info.txt DELETED --- --- player_01.bmp DELETED --- --- radar_player_01.bmp DELETED --- --- radar_small_red_01.bmp DELETED --- --- radar_small_yellow_01.bmp DELETED --- --- star_blobA_01.bmp DELETED --- --- star_blobA_02.bmp DELETED --- --- star_blobA_03.bmp DELETED --- --- star_blobA_04.bmp DELETED --- --- star_blobA_05.bmp DELETED --- --- star_blobA_06.bmp DELETED --- --- star_blobB_01.bmp DELETED --- --- star_blobB_02.bmp DELETED --- --- star_blobB_03.bmp DELETED --- --- star_blobB_04.bmp DELETED --- --- star_blobB_05.bmp DELETED --- --- star_blobB_06.bmp DELETED --- --- star_blobC_01.bmp DELETED --- --- star_blobC_02.bmp DELETED --- --- star_blobC_03.bmp DELETED --- --- star_blobC_04.bmp DELETED --- --- star_blobC_05.bmp DELETED --- --- star_blobC_06.bmp DELETED --- --- star_blobD_01.bmp DELETED --- --- star_small_red_01.bmp DELETED --- --- star_small_yellow_01.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:42
|
Update of /cvsroot/timewarp/gamex/help In directory sc8-pr-cvs1:/tmp/cvs-serv553/help Removed Files: dialogeditor.txt Log Message: removing gamex data --- dialogeditor.txt DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:42
|
Update of /cvsroot/timewarp/gamex/gamedata/races/earthling In directory sc8-pr-cvs1:/tmp/cvs-serv553/gamedata/races/earthling Removed Files: colonies.ini fleet.bmp race.ini Log Message: removing gamex data --- colonies.ini DELETED --- --- fleet.bmp DELETED --- --- race.ini DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:42
|
Update of /cvsroot/timewarp/gamex/doc In directory sc8-pr-cvs1:/tmp/cvs-serv553/doc Removed Files: gamex-dialogue-editor.txt gamex-manual.txt Log Message: removing gamex data --- gamex-dialogue-editor.txt DELETED --- --- gamex-manual.txt DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:41
|
Update of /cvsroot/timewarp/gamex/dialogue/Race01 In directory sc8-pr-cvs1:/tmp/cvs-serv553/dialogue/Race01 Removed Files: enc_planet.bmp Log Message: removing gamex data --- enc_planet.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:41
|
Update of /cvsroot/timewarp/gamex/dialogue In directory sc8-pr-cvs1:/tmp/cvs-serv553/dialogue Removed Files: racepics.txt test.dialogue test.dialogue2 Log Message: removing gamex data --- racepics.txt DELETED --- --- test.dialogue DELETED --- --- test.dialogue2 DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:41
|
Update of /cvsroot/timewarp/gamex/backgr In directory sc8-pr-cvs1:/tmp/cvs-serv553/backgr Removed Files: backgr_star_01.bmp backgr_star_02.bmp backgr_star_03.bmp Log Message: removing gamex data --- backgr_star_01.bmp DELETED --- --- backgr_star_02.bmp DELETED --- --- backgr_star_03.bmp DELETED --- |
From: <geo...@us...> - 2004-01-04 22:14:41
|
Update of /cvsroot/timewarp/gamex In directory sc8-pr-cvs1:/tmp/cvs-serv553 Removed Files: c mapinfo.txt mapinfo.txt planetmooninfo.txt spacebodies.txt Log Message: removing gamex data --- c mapinfo.txt DELETED --- --- mapinfo.txt DELETED --- --- planetmooninfo.txt DELETED --- --- spacebodies.txt DELETED --- |
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1:/tmp/cvs-serv31200/gamex Modified Files: gamedata.cpp gamedata.h gamedialogue.cpp gamedialogue.h gamegeneral.cpp gamegeneral.h gamehyper.cpp gamehyper.h gamemelee.cpp gamemelee.h gameplanetscan.cpp gameplanetscan.h gameplanetview.cpp gameplanetview.h gameproject.cpp gamesolarview.cpp gamesolarview.h gamestarmap.cpp gamestarmap.h projectx.cpp Log Message: full-game source update Index: gamedata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gamedata.cpp 22 Dec 2003 09:37:08 -0000 1.5 --- gamedata.cpp 4 Jan 2004 22:06:59 -0000 1.6 *************** *** 11,19 **** #include "gamedata.h" IndexTypeList *startypelist; IndexTypeList *planettypelist; ! IndexTypeList *moontypelist; PlayerInfo playerinfo; --- 11,20 ---- #include "gamedata.h" + #include "gamegeneral.h" IndexTypeList *startypelist; IndexTypeList *planettypelist; ! IndexTypeList *surfacetypelist; PlayerInfo playerinfo; *************** *** 35,38 **** --- 36,41 ---- iplanet = get_config_int(0, "Planet", -1); imoon = get_config_int(0, "Moon", -1); // of planets and moons + + RU = get_config_float(0, "RU", 0); } *************** *** 49,52 **** --- 52,57 ---- set_config_int(0, "Moon", imoon); //set_config_int(0, "PlanetCode", iplanetcode); + + set_config_float(0, "RU", RU); } *************** *** 54,63 **** --- 59,82 ---- void PlayerInfo::sync(LocalPlayerInfo *p) { + // pos = p->pos; + // angle = p->angle; + + // this is now turned around, cause "old" settings are forgotten + // when you re-appear "there" + p->pos = pos; + p->angle = angle; + p->vel = vel; + } + + void PlayerInfo::sync2(LocalPlayerInfo *p) + { pos = p->pos; angle = p->angle; + vel = p->vel; } + // For each game, you'll need some physical object to represent part of // the general player information, which is relevant for that aspect of *************** *** 108,114 **** void MapEverything::init(char *filename) { ! startypelist = new IndexTypeList(maxstartypes, "startypes.txt"); ! planettypelist = new IndexTypeList(maxplanettypes, "planettypes.txt"); ! moontypelist = new IndexTypeList(maxplanettypes, "moontypes.txt"); FILE *f = fopen(filename, "rt"); --- 127,133 ---- void MapEverything::init(char *filename) { ! startypelist = new IndexTypeList("gamex/types/star_*.ini"); ! planettypelist = new IndexTypeList("gamex/types/planet_*.ini"); ! surfacetypelist = new IndexTypeList("gamex/planetscan/surface_*.ini"); FILE *f = fopen(filename, "rt"); *************** *** 207,215 **** if (level == 3) ! type = moontypelist->get_index(chartype); ! fscanf(f, "%lf %lf", &position.x, &position.y); fscanf(f, "%i\n\n", &Nsub); sub = new MapSpacebody* [Nsub]; --- 226,236 ---- if (level == 3) ! type = planettypelist->get_index(chartype); ! fscanf(f, "%lf %lf %X", &position.x, &position.y, &id); fscanf(f, "%i\n\n", &Nsub); + if (Nsub < 0 || Nsub > 20) {tw_error("error: invalid system");} + sub = new MapSpacebody* [Nsub]; *************** *** 250,257 **** if (level == 3) ! fprintf(f, "%s %s\n", base, moontypelist->type[this->type].type_string); ! fprintf(f, "%s %lf %lf\n", base, position.x, position.y); fprintf(f, "%s %i\n\n", base, Nsub); --- 271,278 ---- if (level == 3) ! fprintf(f, "%s %s\n", base, planettypelist->type[this->type].type_string); ! fprintf(f, "%s %lf %lf %X\n", base, position.x, position.y, id); fprintf(f, "%s %i\n\n", base, Nsub); *************** *** 279,282 **** --- 300,304 ---- sub[Nsub]->init(0, level); // the level does not matter. + ++Nsub; *************** *** 302,342 **** ! IndexTypeList::IndexTypeList(int omax, char *fname) { ! max = omax; ! type = new IndexType [max]; ! ! FILE *f; ! char line[512]; ! ! strcpy(line, "gamex/types/"); ! strcat(line, fname); ! f = fopen(line, "rt"); ! if (!f) ! { ! error("File does not exist [%s]", line); ! } ! ! N = 0; ! while (fgets(line, 512, f)) ! { ! // get rid of the \n character as well... ! int L = strlen(line); ! if (L > 0 && line[L-1] == '\n') ! { ! --L; ! line[L] = 0; ! } ! ! type[N].type_string = new char [L]; ! strcpy(type[N].type_string, line); ! ++N; ! if (N > max){tw_error("init: too many types");} } ! fclose(f); } --- 324,342 ---- ! IndexTypeList::IndexTypeList(char *scanname) { ! char **templist; ! createfilelist(&templist, &N, scanname, 1); ! type = new IndexType [N]; ! int i; ! for ( i = 0; i < N; ++i ) ! { ! type[i].type_string = templist[i]; } ! delete templist; } *************** *** 355,359 **** ! int IndexTypeList::get_index(char *typestr) { int i; --- 355,359 ---- ! int IndexTypeList::get_index(char *typestr, int defaultval) { int i; *************** *** 365,369 **** if (i == N) // no match ! return -1; else return i; // a match --- 365,369 ---- if (i == N) // no match ! return defaultval; else return i; // a match *************** *** 403,406 **** --- 403,412 ---- iplanet = 0; imoon = 0; + + modified = false; + + dialogname[0] = 0; + + strcpy(id, "none"); } *************** *** 420,441 **** } ! void RaceSettlement::animate_starmap(Frame *f) { - if (!patrol.range) - return; - BITMAP *bmp = f->surface; ! // in case of the starmap, show the circles of influence ! int R; ! Vector2 P; ! P = corner(mapeverything.region[0]->sub[istar]->position * mapeverything.region[0]->scalepos); ! R = patrol.range * mapeverything.region[0]->scalepos * space_zoom; ! //void circlefill(BITMAP *bmp, int x, int y, int radius, int color); ! circlefill(bmp, P.x, P.y, R, race->color); } --- 426,488 ---- } ! void RaceSettlement::animate_map(Frame *f, int imap) { BITMAP *bmp = f->surface; ! MapSpacebody *starmap = 0, *solarmap = 0, *planetmap = 0; ! starmap = mapeverything.region[0]; ! if (istar >= 0) ! solarmap = starmap->sub[istar]; ! if (iplanet >= 0) ! planetmap = solarmap->sub[iplanet]; ! switch (imap) ! { ! case 1: ! { ! // a star map ! if (!patrol.range || !starmap) ! return; ! ! // in case of the starmap, show the circles of influence ! ! int R; ! Vector2 P; ! ! P = corner(starmap->sub[istar]->position * starmap->scalepos); ! ! R = patrol.range * starmap->scalepos * space_zoom; ! ! //void circlefill(BITMAP *bmp, int x, int y, int radius, int color); ! circlefill(bmp, P.x, P.y, R, race->color); ! break; ! } ! ! case 2: ! { ! // a solar map ! if (!solarmap || (iplanet >= solarmap->Nsub) || (istar != playerinfo.istar) ) ! return; ! ! int R; ! Vector2 P; ! ! P = corner(solarmap->sub[iplanet]->position * solarmap->scalepos); ! ! R = 80 * space_zoom; ! ! //void circlefill(BITMAP *bmp, int x, int y, int radius, int color); ! circle(bmp, P.x, P.y, R, race->color); ! ! break; ! } ! ! // I suppose we don't need to bother about the planet-view map: that's a bit ! // useless since the location is pretty obvious or not ? ! ! } } *************** *** 449,456 **** RaceSettlement(arace) { ! // this is a default colony of 10 K individuals (1 million). ! population = 10; ! population *= race->cinfo.start_population_multiplier; calculate(); --- 496,505 ---- RaceSettlement(arace) { ! // this is a default colony of 10 K individuals. ! initpop = 10; ! population = initpop * race->cinfo.start_population_multiplier; ! ! hidden = false; calculate(); *************** *** 476,483 **** --- 525,555 ---- + // note that "pop" is the "default population", which is then adjusted ... + void RaceColony::set_info(double pop, char *adialogname) + { + modified = true; + initpop = pop; + population = initpop * race->cinfo.start_population_multiplier; + strcpy(dialogname, adialogname); + } + void RaceColony::changeowner(RaceInfo *newrace) + { + // if it's not a new race + if (newrace == race) + return; + + // it's a new race: the old race loses it in the list, the new one retrieves it + race->remlist(this); + newrace->add(this); + + race = newrace; + + modified = true; + } + *************** *** 496,501 **** strcpy(cinfo.env_type, "gaia"); ! cinfo.doubling_period = 10.0; // 10 years to double the population cinfo.start_population_multiplier = 1.0; } --- 568,575 ---- strcpy(cinfo.env_type, "gaia"); ! cinfo.doubling_period = 25.0; // 25 years to double the population cinfo.start_population_multiplier = 1.0; + + modified = false; } *************** *** 523,526 **** --- 597,635 ---- lastcol = rc; + rc->modified = true; + } + + void RaceInfo::remlist(RaceColony *rc) + { + RaceSettlement *current; + + if (firstcol == rc) + firstcol = (RaceColony*) rc->next; + else + { + + current = firstcol; + while (current && current->next != rc) + current = current->next; + + if (!current) + return; + + current->next = rc->next; + } + + current = firstcol; + + while (current && current->next) + current = current->next; + + lastcol = (RaceColony*)current; + } + + void RaceInfo::rem(RaceColony *rc) + { + remlist(rc); + + delete rc; } *************** *** 549,553 **** rc->locate(istar, iplan, imoon); ! rc->population = get_config_float(colid, "population", 0); rc->calculate(); --- 658,668 ---- rc->locate(istar, iplan, imoon); ! rc->initpop = get_config_float(colid, "initpop", 0); ! rc->population = get_config_float(colid, "population", 0); ! ! strcpy(rc->dialogname, get_config_string(colid, "dialog", "")); ! ! rc->hidden = get_config_int(colid, "hidden", 0); ! strcpy(rc->id, get_config_string(colid, "id", "")); rc->calculate(); *************** *** 556,560 **** ! void RaceInfo::animate_starmap(Frame *f) { RaceSettlement *current; --- 671,730 ---- ! // saves to disk, but only if needed ? ! ! void RaceInfo::write_colonies(char *ininame) ! { ! set_config_file(ininame); ! ! bool mod = false; ! int N = 0; ! ! RaceColony *rc; ! rc = firstcol; ! ! while (rc) ! { ! ++N; ! mod |= rc->modified; ! rc = (RaceColony*)rc->next; ! } ! ! if (!mod) ! return; // no need to save if there's no change ! ! // save all the colonies ! ! set_config_int(0, "N", N); ! ! int i = 0; ! ! rc = firstcol; ! ! while (rc) ! { ! ! char colid[64]; ! sprintf(colid, "colony%03i", i); ! ! set_config_int(colid, "star", rc->istar); ! set_config_int(colid, "planet", rc->iplanet); ! set_config_int(colid, "moon", rc->imoon); ! ! set_config_float(colid, "initpop", rc->initpop); ! set_config_float(colid, "population", rc->population); ! ! set_config_string(colid, "dialog", rc->dialogname); ! ! set_config_int(colid, "hidden", rc->hidden); ! set_config_string(colid, "id", rc->id ); ! ! rc = (RaceColony*)rc->next; ! ++i; ! } ! } ! ! ! ! void RaceInfo::animate_map(Frame *f, int imap) { RaceSettlement *current; *************** *** 563,567 **** while (current) { ! current->animate_starmap(f); current = current->next; } --- 733,737 ---- while (current) { ! current->animate_map(f, imap); current = current->next; } *************** *** 573,576 **** --- 743,764 ---- + // returns true, if this race already has some kind of settlement at this location + RaceColony *RaceInfo::find_colony(int istar, int iplan, int imoon) + { + RaceColony *current; + current = firstcol; + + while (current) + { + if (current->istar == istar && current->iplanet == iplan && current->imoon == imoon) + break; + + current = (RaceColony*)current->next; + } + + return current; + } + + RaceManager::RaceManager() *************** *** 661,664 **** --- 849,854 ---- } + al_findclose(&info); + } *************** *** 673,695 **** { char fname[512]; - strcpy(fname, "gamex/gamedata/races/"); - strcat(fname, current->id); - strcat(fname, "/race.ini"); - set_config_file(fname); - - int r, g, b; - r = getr(current->color); - g = getg(current->color); - b = getb(current->color); ! set_config_int("color", "r", r); ! set_config_int("color", "g", g); ! set_config_int("color", "b", b); - set_config_float("colony", "doublingperiod", current->cinfo.doubling_period); - set_config_float("colony", "startpopmultiplier", current->cinfo.start_population_multiplier); - set_config_string("colony", "envtype", current->cinfo.env_type); current = current->next; } --- 863,897 ---- { char fname[512]; ! // this only writes if the basic race info is changed ! if (current->modified) ! { ! strcpy(fname, "gamex/gamedata/races/"); ! strcat(fname, current->id); ! strcat(fname, "/race.ini"); ! set_config_file(fname); ! ! int r, g, b; ! r = getr(current->color); ! g = getg(current->color); ! b = getb(current->color); ! ! set_config_int("color", "r", r); ! set_config_int("color", "g", g); ! set_config_int("color", "b", b); ! ! set_config_float("colony", "doublingperiod", current->cinfo.doubling_period); ! set_config_float("colony", "startpopmultiplier", current->cinfo.start_population_multiplier); ! set_config_string("colony", "envtype", current->cinfo.env_type); ! } + strcpy(fname, "gamex/gamedata/races/"); + strcat(fname, current->id); + strcat(fname, "/colonies.ini"); + // this only writes if one of the colonies was modified. + current->write_colonies(fname); + current = current->next; } *************** *** 699,703 **** ! void RaceManager::animate_starmap(Frame *f) { RaceInfo *current; --- 901,905 ---- ! void RaceManager::animate_map(Frame *f, int imap) { RaceInfo *current; *************** *** 706,712 **** while (current) { ! current->animate_starmap(f); current = current->next; } } --- 908,951 ---- while (current) { ! current->animate_map(f, imap); ! current = current->next; ! } ! } ! ! ! // return the Raceinfo with the specified id ... ! RaceInfo *RaceManager::get(char *useid) ! { ! RaceInfo *current; ! current = first; ! ! while (current) ! { ! if (strcmp(current->id, useid) == 0) ! return current; current = current->next; } + + return current; } + + + RaceColony *RaceManager::findcolony(int istar, int iplan, int imoon) + { + RaceInfo *ri; + RaceColony *rc; + + rc = 0; + ri = first; + + while (ri) + { + rc = ri->find_colony(istar, iplan, imoon); + if (rc) break; + + ri = ri->next; + } + + return rc; + } Index: gamedata.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gamedata.h 22 Dec 2003 09:37:08 -0000 1.5 --- gamedata.h 4 Jan 2004 22:06:59 -0000 1.6 *************** *** 16,20 **** { public: ! char env_type[64]; double doubling_period; // double population in "years" double start_population_multiplier; --- 16,20 ---- { public: ! char env_type[64]; double doubling_period; // double population in "years" double start_population_multiplier; *************** *** 46,50 **** { public: ! virtual void animate_starmap(Frame *f) {}; }; --- 46,50 ---- { public: ! virtual void animate_map(Frame *f, int imap) {}; }; *************** *** 53,59 **** { protected: - RaceInfo *race; public: RaceSettlement *next; int istar, iplanet, imoon; --- 53,65 ---- { protected: public: + RaceInfo *race; + char id[80]; + + char dialogname[128]; // name of the file; should be located in the races' subdirectory!! + + bool modified; + RaceSettlement *next; int istar, iplanet, imoon; *************** *** 67,71 **** virtual void calculate(); ! virtual void animate_starmap(Frame *f); }; --- 73,78 ---- virtual void calculate(); ! virtual void animate_map(Frame *f, int imap); ! }; *************** *** 76,83 **** public: RaceColony(RaceInfo *arace); ! double population; virtual void calculate(); }; --- 83,97 ---- public: + int hidden; // if true, the colony has complete-radiosilence and + // won't show up; should be possible to activate it (using it's id?). + RaceColony(RaceInfo *arace); ! double population, initpop; virtual void calculate(); + + virtual void set_info(double pop, char *adialogname); + + void changeowner(RaceInfo *newrace); }; *************** *** 87,90 **** --- 101,106 ---- { public: + bool modified; + RaceInfo *next; *************** *** 106,118 **** virtual void calculate(); ! virtual void animate_starmap(Frame *f); ColonyRaceInfo cinfo; RaceColony *firstcol, *lastcol; void init_colonies(char *ininame); void add(RaceColony *rc); ! char shipid[16]; }; --- 122,140 ---- virtual void calculate(); ! virtual void animate_map(Frame *f, int imap); ColonyRaceInfo cinfo; RaceColony *firstcol, *lastcol; + void init_colonies(char *ininame); + void write_colonies(char *ininame); + void add(RaceColony *rc); + void remlist(RaceColony *rc); + void rem(RaceColony *rc); ! RaceColony *find_colony(int istar, int iplan, int imoon); ! char shipid[16]; }; *************** *** 133,137 **** void writeracelist(); ! virtual void animate_starmap(Frame *f); }; --- 155,163 ---- void writeracelist(); ! virtual void animate_map(Frame *f, int imap); ! ! RaceInfo *get(char *useid); ! ! virtual RaceColony *findcolony(int istar, int iplan, int imoon); }; *************** *** 146,150 **** char *configfilename; public: ! Vector2 pos; double angle; --- 172,176 ---- char *configfilename; public: ! Vector2 pos, vel; double angle; *************** *** 161,165 **** --- 187,199 ---- void init(char *filename); void write(); + void sync(LocalPlayerInfo *p); + void sync2(LocalPlayerInfo *p); + + double RU; // your pile of money ... + + // cargo bay + double mineral_weight[16]; + double bio_weight; }; *************** *** 183,190 **** --- 217,237 ---- + class MapSpacebody; + + class SpacebodyInfo + { + public: + virtual void init(MapSpacebody *planet) {}; + virtual void write(MapSpacebody *planet) {}; + }; + + + // the branches class MapSpacebody { public: + SpacebodyInfo *info; + //char type[32]; int type; // the char version should be in a table - why ... because indexed stuff is easier to work with!! *************** *** 194,197 **** --- 241,245 ---- double scalepos; + int id; int Nsub; MapSpacebody **sub; // at most 3 moons. *************** *** 238,245 **** IndexType *type; ! IndexTypeList(int max, char *fname); ~IndexTypeList(); ! int get_index(char *typestr); }; --- 286,293 ---- IndexType *type; ! IndexTypeList(char *fname); ~IndexTypeList(); ! int get_index(char *typestr, int defaultval = -1); }; *************** *** 247,258 **** extern IndexTypeList *startypelist; extern IndexTypeList *planettypelist; ! extern IndexTypeList *moontypelist; ! ! const int maxstartypes = 128; ! const int maxplanettypes = 128; ! const int maxmoontypes = 128; ! // also includes the moon types ! ! #endif --- 295,300 ---- extern IndexTypeList *startypelist; extern IndexTypeList *planettypelist; ! //extern IndexTypeList *moontypelist; // moons or small planets are not distinguishable ! extern IndexTypeList *surfacetypelist; #endif Index: gamedialogue.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedialogue.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gamedialogue.cpp 14 Dec 2003 22:19:55 -0000 1.4 --- gamedialogue.cpp 4 Jan 2004 22:06:59 -0000 1.5 *************** *** 13,17 **** ! --- 13,17 ---- ! static const int BlistLen = 128; *************** *** 70,74 **** void GameAliendialog::init_menu() { ! T = new TWindow("gamex/interface/aliendialog", 10, 10, game_screen, true); maparea = 0; } --- 70,74 ---- void GameAliendialog::init_menu() { ! T = new TWindow("gamex/interface/aliendialog", 0, 0, game_screen, true); maparea = 0; } *************** *** 77,80 **** --- 77,98 ---- void GameAliendialog::init() { + if (!window) { + window = new VideoWindow(); + window->preinit(); + } + prepare(); + change_view("Hero"); + //view->window->locate(0,0,0,0, 0,1,0,1); + + size = Vector2(100,100); + wininfo.init( Vector2(800,800), 800.0, view->frame ); + wininfo.zoomlimit(size.x); + wininfo.scaletowidth(size.x); // zoom out to this width. + + int i; + for ( i = 0; i < maxbranches; ++i ) + Blist[i] = new char [BlistLen]; + + scare_mouse(); *************** *** 88,105 **** - int i; - for ( i = 0; i < maxbranches; ++i ) - Blist[i] = new char [128]; - - - // read the root branch !! - fs = new FileStore("gamex/dialogue/test.dialogue2"); - firstdialo = new Dialo(); - - firstdialo->read(fs); - - dialo = firstdialo; - - // initialize menu system. --- 106,109 ---- *************** *** 120,162 **** FONT *usefont = videosystem.get_font(i); - // view->frame->prepare(); - - - // the background for this race is : - - strcpy(racefile, ""); - //strcpy(racefile, "gamex/dialogue/"); - //strcat(racefile, dialo.racepic); - //racepic = load_bitmap(racefile, 0); - - - - - - int tcol = makecol(255,255,128); - // ??? - showline_num = 0; - showline_Nlines = Nlines(dialo->T); - //A = new TextEditBox(R, "A", -1, -1, usefont, showline(dialo.A, showline_num), 0); A = new TextInfoArea(T, "A/", usefont, 0, 0); // all text should fit on 1 window - no scroll needed !! ! //A->set_textcolor(tcol); ! ! // ???? ! //A->changebackgr(racefile); ! B = new TextList(T, "B/", usefont); - //winman = new WindowManager; - //winman->add(R); T->tree_doneinit(); initBlist(dialo); - } --- 124,141 ---- FONT *usefont = videosystem.get_font(i); int tcol = makecol(255,255,128); A = new TextInfoArea(T, "A/", usefont, 0, 0); // all text should fit on 1 window - no scroll needed !! ! A->passive = false; B = new TextList(T, "B/", usefont); T->tree_doneinit(); + // dialo should be defined BEFORE the game is initialized by a call to set_colony initBlist(dialo); } *************** *** 171,176 **** scare_mouse(); set_mouse_sprite(0); // the default mouse sprite. ! show_mouse(screen); // ???????? ! //show_mouse(); GameBare::quit(); --- 150,154 ---- scare_mouse(); set_mouse_sprite(0); // the default mouse sprite. ! show_mouse(screen); GameBare::quit(); *************** *** 181,184 **** --- 159,165 ---- void GameAliendialog::initBlist(Dialo *dialo) { + // make small changes, to change e.g. captain name or ship name to the correct on + preptext(dialo->T); + Dialo *d; *************** *** 199,207 **** //d->read(dialo->branch[i], &dstore); d = dialo->branch[i]; if (d->state) { ! strncpy(Blist[k], d->T, 127); ! Blist[k][127] = 0; //branchindex[k] = d->n; dialo_selected[k] = d; // ??? --- 180,190 ---- //d->read(dialo->branch[i], &dstore); d = dialo->branch[i]; + + preptext(d->T); if (d->state) { ! strncpy(Blist[k], d->T, BlistLen-1); ! Blist[k][BlistLen-1] = 0; //branchindex[k] = d->n; dialo_selected[k] = d; // ??? *************** *** 238,253 **** void GameAliendialog::calculate() { if (next) return; GameBare::calculate(); ! //FULL_REDRAW = true; ! //T->tree_calculate(); ! ! ! ! if (A->flag.left_mouse_press) { --- 221,240 ---- void GameAliendialog::calculate() { + if (!dialo) // if there's no dialogue defined... then it's no use to continue + { + tw_error("Dialog is missing!"); + quit(); + return; + } + if (next) return; + wininfo.center( 0.5*size ); + GameBare::calculate(); ! if (A->flag.left_mouse_press || keyhandler.keyhit[KEY_SPACE]) { *************** *** 258,298 **** char *txt = showline(dialo->T, showline_num); A->set_textinfo( txt, strlen(txt) ); ! } else { ! ! // change state, and go back to parent ! dialo->state = 0; ! //dialo.write(&dstore); // you've to store in the temp-mem blocks. ! //dialo.read(dialo.mother, &dstore); ! if (dialo->mother) { ! dialo = dialo->mother; ! // the parent's parent is the real on you've to get (since doing once ! // goes back to the question node, going back one further goes to ! // the alien-talk node. if (dialo->mother) { - // disable the question node, and go back - // (a bit simple ... should really only be done after checking that - // all sub-questions are disabled already - but this is a simple - // test case). - dialo->state = 0; - dialo = dialo->mother; ! ! initBlist(dialo); } } ! } - } // go forth to the currently selected branch ! //if (bnext->flag.left_mouse_press) ! if (B->flag.left_mouse_press) { // load the data from the child branch. --- 245,301 ---- char *txt = showline(dialo->T, showline_num); A->set_textinfo( txt, strlen(txt) ); + } + } ! // this can also happen, if you return from a child node after the last ! // question has been answered ... in that case, suddenly all subbranches ! // are "done" and then this node has to collapse as well. ! if (showline_num == showline_Nlines) ! { ! ! // change state, and go back to parent ! // hmm, no, only do this if all sub-questions are "done" ! int i; ! for ( i = 0; i < dialo->Nbranches; ++i ) ! if (dialo->branch[i]->state) ! break; ! if (i == dialo->Nbranches) { ! dialo->state = 0; ! if (dialo->mother) { dialo = dialo->mother; ! // the parent's parent is the real on you've to get (since doing once ! // goes back to the question node, going back one further goes to ! // the alien-talk node. ! if (dialo->mother) ! { ! // disable the question node, and go back ! // (a bit simple ... should really only be done after checking that ! // all sub-questions are disabled already - but this is a simple ! // test case). ! dialo->state = 0; ! ! dialo = dialo->mother; ! ! initBlist(dialo); ! ! // since you return, that means that the previous ! // node has already been "done" ! showline_num = showline_Nlines; ! } } } ! } // go forth to the currently selected branch + // but, you should only enable this, if the "alien" text is completely read ! if (B->flag.left_mouse_press && showline_num == showline_Nlines) { // load the data from the child branch. *************** *** 341,344 **** --- 344,445 ---- //scare_mouse(); } + + + + void GameAliendialog::set_colony(RaceColony *rc) + { + if (rc->dialogname[0] == 0) // no filename defined. + return; + + // load the dialog for this colony ?! + + char fname [512]; + strcpy(fname, "gamex/gamedata/races/"); + strcat(fname, rc->race->id); + strcat(fname, "/"); + strcat(fname, rc->dialogname); + + + // read the root branch !! + fs = new FileStore(fname); + firstdialo = new Dialo(); + + firstdialo->read(fs); + + dialo = firstdialo; + + + } + + + char playername[64]; + char shipname[64]; + + struct fgNamePtr + { + char id[64]; + char *ptr; + + void set(char *newid, char *newptr); + }; + + void fgNamePtr::set(char *newid, char *newptr) + { + strcpy(id, newid); + ptr = newptr; + } + + + // NOTE: this does not check for end-of-text... + void replace_text(char *txt, char *rem, char *ins) + { + int L; + L = strlen(txt) + 1; // include 0. + + int k; + k = strlen(ins) - strlen(rem); + if (k > 0) + memmove(&txt[k], &txt[0], L-k); + if (k < 0) + memmove(&txt[0], &txt[-k], L+k); + + memcpy(&txt[0], ins, strlen(ins)); + } + + + void GameAliendialog::preptext(char *t) + { + strcpy(playername, "zelnick"); + strcpy(shipname, "titanic"); + // <player> insert player name there + // <ship> insert ship name there + + + int N = 2; + fgNamePtr ptr[2]; + + ptr[0].set("<player>", playername); + ptr[1].set("<ship>", shipname); + + int i = 0; + while ( t[i] ) + { + char *id; + id = &t[i]; + + int k; + for ( k = 0; k < N; ++k ) + { + if (strncmp(id, ptr[k].id, strlen(ptr[k].id)) == 0) + { + // succesful comparison; replace the string + replace_text(id, ptr[k].id, ptr[k].ptr); + } + } + + ++i; + } + } + Index: gamedialogue.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedialogue.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gamedialogue.h 14 Dec 2003 22:19:55 -0000 1.3 --- gamedialogue.h 4 Jan 2004 22:06:59 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- #include "gameproject.h" #include "edit/edit_dialogue.h" + #include "gamedata.h" #include "edit/disk_stuff.h" *************** *** 41,47 **** int showline_num, showline_Nlines; ! char show_line[256]; char *showline(char *text, int num); int Nlines(char *text); }; --- 42,53 ---- int showline_num, showline_Nlines; ! char show_line[2048]; char *showline(char *text, int num); int Nlines(char *text); + + void preptext(char *t); + + public: + void set_colony(RaceColony *rc); }; Index: gamegeneral.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gamegeneral.cpp 22 Dec 2003 09:37:08 -0000 1.7 --- gamegeneral.cpp 4 Jan 2004 22:06:59 -0000 1.8 *************** *** 433,436 **** --- 433,443 ---- } + void WindowInfo::zoomlimit(double min, double max) + { + minzoom = min; + //maxzoom = 1.0; + maxzoom = max; + } + void WindowInfo::scaletowidth(double W) { *************** *** 581,582 **** --- 588,666 ---- s->pos = center + Prel; } + + + + + void createfilelist(char ***list, int *N, char *scanname, int remext) + { + int err; + al_ffblk info; + + + // first, a iteration + *N = 0; + err = al_findfirst(scanname, &info, FA_ARCH); + while (!err) + { + if (strcmp(info.name, ".") && strcmp(info.name, "..") ) + ++(*N); + err = al_findnext(&info); + } + al_findclose(&info); + + // allocate memory for the filenames + *list = new char* [(*N)]; + + + // read the filenames + int i; + + i = 0; + err = al_findfirst(scanname, &info, FA_ARCH); + + while (!err) + { + if (strcmp(info.name, ".") && strcmp(info.name, "..") ) + { + if (!remext) + { + (*list)[i] = new char [strlen(info.name)+1]; + strcpy((*list)[i], info.name); + } else { + + // copy the "*" wildcard part of the filename, and not the rest. + char tmpstr[512], *tmp; + int i1, i2; + + tmp = strrchr(scanname, '/'); + i1 = 0; + while (tmp[i1+1] == info.name[i1] && info.name[i1] != 0) + ++i1; + + int L1, L2; + L1 = strlen(scanname); + L2 = strlen(info.name); + + i2 = 1; + while (scanname[L1-i2] == info.name[L2-i2] && i2 < L1 && i2 < L2) + ++i2; + + int k; + for ( k = i1; k <= L2-i2; ++k ) + { + tmpstr[k-i1] = info.name[k]; + } + tmpstr[k-i1] = 0; + + (*list)[i] = new char [strlen(tmpstr)+1]; + strcpy((*list)[i], tmpstr); + } + ++i; + } + + err = al_findnext(&info); + } + + al_findclose(&info); + } + Index: gamegeneral.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gamegeneral.h 15 Dec 2003 20:51:12 -0000 1.3 --- gamegeneral.h 4 Jan 2004 22:06:59 -0000 1.4 *************** *** 9,12 **** --- 9,14 ---- void makevideobmp(BITMAP *&bmp); + void createfilelist(char ***list, int *N, char *scanname, int remext); + class MousePtr : public SpaceObject *************** *** 41,44 **** --- 43,47 ---- void set_zoom(double z); void zoomlimit(double W); + void zoomlimit(double min, double max); void scaletowidth(double W); // zoom out to this width. void testzoom(); Index: gamehyper.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamehyper.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gamehyper.cpp 22 Dec 2003 09:37:08 -0000 1.4 --- gamehyper.cpp 4 Jan 2004 22:06:59 -0000 1.5 *************** *** 23,26 **** --- 23,27 ---- static const int ID_FLEET_HYPER = 0x09837491; + double r_visual = 40.0; // size of the radar map; outside this, it's no use to draw/ calculate fleets inline double sqr(double x) *************** *** 71,77 **** vel = speed * unit_vector(angle); double R; R = distance(follow); ! if (R > 1000) state = 0; } --- 72,82 ---- vel = speed * unit_vector(angle); + // when the target is out of range (i.e., when the ship's not visible on + // radar anymore) then this hyperfleet is deleted. double R; R = distance(follow); ! ! double s = mapeverything.region[0]->scalepos; ! if (R > s * r_visual * 1.1) state = 0; } *************** *** 104,109 **** double r; ! r -= (P - player->pos / scalepos).length(); ! if (r < b->patrol.range) --- 109,113 ---- double r; ! r = (P - player->pos / scalepos).length(); if (r < b->patrol.range) *************** *** 114,118 **** density = 0.01; ! density = 1; chance = (player->vel.length() + enemyspeed) * frame_time / scalepos; --- 118,122 ---- density = 0.01; ! density = 0.1; chance = (player->vel.length() + enemyspeed) * frame_time / scalepos; *************** *** 122,128 **** if (random(1.0) < chance) { // create a "enemy" object ... but how ? HyperFleet *fl; ! fl = new HyperFleet(0, player->pos+Vector2(100,100), 0, a->fleetsprite); add(fl); fl->speed = enemyspeed; --- 126,136 ---- if (random(1.0) < chance) { + Vector2 offset; + offset = r_visual * unit_vector(random(PI2)); + offset *= starmap->scalepos; + // create a "enemy" object ... but how ? HyperFleet *fl; ! fl = new HyperFleet(0, player->pos+offset, 0, a->fleetsprite); add(fl); fl->speed = enemyspeed; *************** *** 512,515 **** --- 520,525 ---- } + radarenemyspr = create_sprite( "gamex/hyperspace/radar_enemy_01.bmp", SpaceSprite::MASKED ); + radarplayerspr = create_sprite( "gamex/hyperspace/radar_player_01.bmp", SpaceSprite::MASKED ); *************** *** 622,626 **** if (!hardexit) // game is not quitted completely ! playerinfo.sync(player); delete tic_history; tic_history = NULL; --- 632,636 ---- if (!hardexit) // game is not quitted completely ! playerinfo.sync2(player); delete tic_history; tic_history = NULL; *************** *** 653,658 **** if (!hardexit) { ! player->angle = playerinfo.angle; // first, update the angle ... ! playerinfo.sync(player); // check if the starmap hasn't changed (by editing) --- 663,667 ---- if (!hardexit) { ! playerinfo.sync(player); // info equals local player // check if the starmap hasn't changed (by editing) *************** *** 717,720 **** --- 726,732 ---- double dt = frame_time * 1E-3; + // just in case you jump to another game and back and this setting can be + // changed then ... + starmap->scalepos = scalepos; *************** *** 896,899 **** --- 908,938 ---- } + // draw all (enemy) hyperspace fleets + + for ( i = 0; i < num_items; ++i ) + { + SpaceLocation *o = item[i]; + + if (o->id == ID_FLEET_HYPER) + { + // fleet position relative to player position (in star coord system). + Vector2 D; + D = (o->pos - player->pos) / scalepos; + + if ( fabs(D.x) < L && fabs(D.y) < L ) + { + D *= submap->w / double(2*L); // note, L is the half-width... + + Vector2 s; + s = radarenemyspr->size(0); + D -= 0.5 * Vector2(s.x, s.y); + + D += 0.5 * Vector2(submap->w, submap->h); + + bmp = radarenemyspr->get_bitmap(0); + masked_blit(bmp, submap, 0, 0, D.x, D.y, bmp->w, bmp->h); + } + } + } Index: gamehyper.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamehyper.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gamehyper.h 22 Dec 2003 09:37:08 -0000 1.4 --- gamehyper.h 4 Jan 2004 22:06:59 -0000 1.5 *************** *** 78,82 **** SpaceSprite *star_hyperspr[32], *star_radarspr[32], ! *radarplayerspr; //BITMAP *submap; --- 78,82 ---- SpaceSprite *star_hyperspr[32], *star_radarspr[32], ! *radarplayerspr, *radarenemyspr; //BITMAP *submap; Index: gamemelee.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamemelee.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gamemelee.cpp 22 Dec 2003 12:03:17 -0000 1.6 --- gamemelee.cpp 4 Jan 2004 22:07:00 -0000 1.7 *************** *** 262,263 **** --- 262,270 ---- + void GameMelee::ship_died(Ship *who, SpaceLocation *source) + { + // increase money of the player ... + playerinfo.RU += 100; + } + + Index: gamemelee.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamemelee.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gamemelee.h 22 Dec 2003 12:03:17 -0000 1.4 --- gamemelee.h 4 Jan 2004 22:07:00 -0000 1.5 *************** *** 37,40 **** --- 37,42 ---- virtual Ship *create_ship(const char *id, bool human, Vector2 pos, double angle, int team); + + virtual void ship_died(Ship *who, SpaceLocation *source); }; Index: gameplanetscan.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetscan.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gameplanetscan.cpp 19 Dec 2003 23:33:35 -0000 1.2 --- gameplanetscan.cpp 4 Jan 2004 22:07:00 -0000 1.3 *************** *** 22,25 **** --- 22,683 ---- #include "stuff/space_body.h" + #include "../melee/mshot.h" + + + static GamePlanetscan::ThePlaya *localplayer; + + + [...967 lines suppressed...] + + + void GamePlanetscan::handle_edge(SpaceLocation *s) + { + while (s->pos.x < 0) s->pos.x += map_size.x; + while (s->pos.x > map_size.x) s->pos.x -= map_size.x; + + if (s->pos.y < 0) + { + s->pos.y = 0; + s->vel.y = 0; + } + + if (s->pos.y > map_size.y-1E-6) + { + s->pos.y = map_size.y-1E-6; + s->vel.y = 0; + } } Index: gameplanetscan.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetscan.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gameplanetscan.h 19 Dec 2003 23:33:35 -0000 1.2 --- gameplanetscan.h 4 Jan 2004 22:07:00 -0000 1.3 *************** *** 11,16 **** --- 11,20 ---- + class Mineral; + class Lifeform; + class GamePlanetscan : public GameBare { + public: Area *surf_area; // SpaceObject *solarbody; *************** *** 22,26 **** --- 26,39 ---- { public: + double mineral_weight[16], bio_weight, tot_min_weight; + double max_weight; + ThePlaya(SpaceSprite *osprite, PlayerInfo *playinf); + void handle_mineral(Mineral *m); + void handle_life(Lifeform *l); + + int activate_weapon(); + + SpaceSprite *weaponsprite; }; *************** *** 35,40 **** --- 48,56 ---- virtual void animate(Frame *frame); + virtual void handle_edge(SpaceLocation *s); + BITMAP *map_bmp; SpaceSprite *playerspr; //*planetspr; + //double scalesurface; }; Index: gameplanetview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetview.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gameplanetview.cpp 22 Dec 2003 09:37:08 -0000 1.8 --- gameplanetview.cpp 4 Jan 2004 22:07:00 -0000 1.9 *************** *** 19,25 **** #include "gameplanetview.h" ! // the 2 possible subgames : #include "gameplanetscan.h" #include "gamemelee.h" #include "stuff/space_body.h" --- 19,26 ---- #include "gameplanetview.h" ! // the possible subgames : #include "gameplanetscan.h" #include "gamemelee.h" + #include "gamedialogue.h" #include "stuff/space_body.h" *************** *** 69,73 **** // create star objects ?! int istar, iplanet; - MapSpacebody *starmap, *solarmap, *planetmap; starmap = mapeverything.region[0]; // use the starmap of the 1st region --- 70,73 ---- *************** *** 81,84 **** --- 81,88 ---- iplanet = 0; + // for testing: + playerinfo.istar = istar; + playerinfo.iplanet = iplanet; + solarmap = starmap->sub[istar]; // use the solarsystem belonging to that star planetmap = solarmap->sub[iplanet]; // use the planet (and moons) belonging to that planet orbit. *************** *** 86,92 **** // Button that displays the name of the planet. ! TextEditBox *starname; ! starname = new TextEditBox(T, "starname_", usefont, planetmap->name, 128); starname->set_textcolor(makecol(255,255,0)); // (on exit, you should copy the (edited) name to the star/planet structure. --- 90,96 ---- // Button that displays the name of the planet. ! starname = new TextEditBox(T, "starname_", usefont, planetmap->name, sizeof(planetmap->name)); starname->set_textcolor(makecol(255,255,0)); + strcpy(oldstarname, planetmap->name); // (on exit, you should copy the (edited) name to the star/planet structure. *************** *** 107,114 **** // load the planet data ! char txt[512]; ! sprintf(txt, "gamex/planetview/planet_%s_01.bmp", ! planettypelist->type[planetmap->type].type_string); ! planetspr = create_sprite( txt, SpaceSprite::MASKED ); Vector2 Poffs; --- 111,123 ---- // load the planet data ! // load planet/moon sprites ! planetspr = new SpaceSprite* [planettypelist->N]; ! int i; ! for ( i = 0; i < planettypelist->N; ++i ) ! { ! char tmp[512]; ! sprintf(tmp, "gamex/solarview/planet_%s_01.bmp", planettypelist->type[i].type_string); ! planetspr[i] = create_sprite( tmp, SpaceSprite::MASKED ); ! } Vector2 Poffs; *************** *** 121,125 **** Vector2 sunpos; sunpos = centerpos - relplanetpos; // "offset center" of the ellips. ! solarbody = new SolarBody(0, centerpos, 0.0, planetspr, sunpos, iplanet, sunpos+Poffs, R, b, makecol(115,0,0)); --- 130,136 ---- Vector2 sunpos; sunpos = centerpos - relplanetpos; // "offset center" of the ellips. ! int k; ! k = planetmap->type; ! solarbody = new SolarBody(0, centerpos, 0.0, planetspr[k], sunpos, iplanet, sunpos+Poffs, R, b, makecol(115,0,0)); *************** *** 129,140 **** solarbody->id = ID_MAP_PLANET; // so that it's not editable by the mapeditor - // load moon sprites - int i; - for ( i = 0; i < moontypelist->N; ++i ) - { - char tmp[512]; - sprintf(tmp, "gamex/planetview/moon_%s_01.bmp", moontypelist->type[i].type_string); - moonspr[i] = create_sprite( tmp, SpaceSprite::MASKED ); - } // load the star data --- 140,143 ---- *************** *** 153,157 **** int k; k = planetmap->sub[i]->type; ! solarbody = new SolarBody(0, P, 0.0, moonspr[k], centerpos+relplanetpos, i, centerpos+Poffs, R, b, col); --- 156,160 ---- int k; k = planetmap->sub[i]->type; ! solarbody = new SolarBody(0, P, 0.0, planetspr[k], centerpos+relplanetpos, i, centerpos+Poffs, R, b, col); *************** *** 176,181 **** // test ! player->pos = Vector2(0,0); ! player->angle = 0.25 * PI; --- 179,184 ---- // test ! // player->pos = Vector2(0,0); ! // player->angle = 0.25 * PI; *************** *** 204,208 **** bnew = new Button(Tedit, "new_"); breplace = new Button(Tedit, "replace_"); ! Tedit->setsprites(moonspr, moontypelist->N); T->add(Tedit); --- 207,211 ---- bnew = new Button(Tedit, "new_"); breplace = new Button(Tedit, "replace_"); ! Tedit->tv->set(planetspr, planettypelist->N); T->add(Tedit); *************** *** 230,243 **** int i; ! for ( i = 0; i < moontypelist->N; ++i ) ! delete moonspr[i]; if (!hardexit) // game is not quitted completely { playerinfo.iplanet = -1; // cause you've left the planet orbit playerinfo.angle = player->angle; } else ! playerinfo.sync(player); if (mapeditor->maphaschanged) --- 233,255 ---- int i; ! for ( i = 0; i < planettypelist->N; ++i ) ! delete planetspr[i]; if (!hardexit) // game is not quitted completely { + // set the player position exactly equal to the planet for appearing in solar orbit + MapSpacebody *solarmap; + solarmap = mapeverything.region[0]->sub[playerinfo.istar]; + playerinfo.pos = solarmap->sub[playerinfo.iplanet]->position * solarmap->scalepos; + playerinfo.vel = 0; + playerinfo.iplanet = -1; // cause you've left the planet orbit playerinfo.angle = player->angle; } else ! playerinfo.sync2(player); ! ! if (strcmp(planetmap->name, oldstarname)) ! mapeditor->maphaschanged = true; if (mapeditor->maphaschanged) *************** *** 254,258 **** void GamePlanetview::refocus() { ! playerinfo.sync(player); } --- 266,271 ---- void GamePlanetview::refocus() { ! // not needed here ... ! //playerinfo.sync(player); } *************** *** 353,363 **** playerinfo.imoon = -1; // it's not a moon, but the planet then. if (!gamerequest && !next) { ! GamePlanetscan *g; ! g = new GamePlanetscan(); gamerequest = g; } } } --- 366,395 ---- playerinfo.imoon = -1; // it's not a moon, but the planet then. + // Now, check if the planet is used by a race (a colony), if so, + // we should show a dialog screen; otherwise, we can suffice with + // showing the planet surface which you can then explore... + if (!gamerequest && !next) { ! RaceColony *rc; ! rc = racelist.findcolony(playerinfo.istar, playerinfo.iplanet, playerinfo.imoon); + GameBare *g; + + if (rc != 0) + { + GameAliendialog *ad; + ad = new GameAliendialog(); + ad->set_colony(rc); + g = ad; + } else { + + //GamePlanetscan *g; + g = new GamePlanetscan(); + } + gamerequest = g; } + } } Index: gameplanetview.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetview.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gameplanetview.h 19 Dec 2003 08:52:54 -0000 1.5 --- gameplanetview.h 4 Jan 2004 22:07:00 -0000 1.6 *************** *** 27,31 **** --- 27,34 ---- // contents of Tedit Button *bnew, *breplace; + TextEditBox *starname; + char oldstarname[128]; //int istarselect; + MapSpacebody *starmap, *solarmap, *planetmap; MapEditor2 *mapeditor; *************** *** 61,65 **** virtual void checknewgame(); ! SpaceSprite *planetspr, *playerspr, *fleetspr, *moonspr[32]; virtual void init_menu(); --- 64,68 ---- virtual void checknewgame(); ! SpaceSprite **planetspr, *playerspr, *fleetspr; virtual void init_menu(); Index: gameproject.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameproject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gameproject.cpp 22 Dec 2003 12:03:17 -0000 1.8 --- gameproject.cpp 4 Jan 2004 22:07:00 -0000 1.9 *************** *** 16,19 **** --- 16,21 ---- BITMAP *game_screen, *game_screen1, *game_screen2; + static bool usepageflip = false; + GameBare::GameBare() *************** *** 48,51 **** --- 50,64 ---- state = 0; + + // if there's a window, delete the window. + // this also recursively deletes all windows that are connected to it (next/prev) + if (T) + delete T; + + if (hardexit && prev) + { + prev->hardexit = true; + prev->quit(); + } } *************** *** 61,69 **** { case KEY_ESC: quit(); return true; break; - } return false; --- 74,89 ---- { case KEY_ESC: + hardexit = false; + quit(); + return true; + break; + + case KEY_Q: + hardexit = true; quit(); return true; break; } + return false; *************** *** 158,162 **** ! tempframe = new Frame2(1024); init_menu(); --- 178,182 ---- ! tempframe = 0; init_menu(); *************** *** 170,173 **** --- 190,195 ---- if (maparea) { + tempframe = new Frame2(1024); + tempframe->setsurface(maparea->backgr); *************** *** 178,182 **** --- 200,206 ---- tic_history = new Histograph(128); render_history = new Histograph(128); + ti = true; + ti = false; // enable mouse drawing using the allegro pointer. *************** *** 243,248 **** return; - bool usepageflip = false; - // switch drawing screen if (usepageflip) --- 267,270 ---- *************** *** 260,271 **** double t = get_time2(); ! tempframe->full_redraw = true; ! FULL_REDRAW = true; ! tempframe->erase(); ! tempframe->prepare(); ! ! acquire_bitmap(tempframe->surface); ! animate(tempframe); ! release_bitmap(tempframe->surface); acquire_bitmap(game_screen); --- 282,298 ---- double t = get_time2(); ! // Game animation ; is all re-directed to maparea. ! // (if there's no maparea, game's not animated) ! if (tempframe) ! { ! tempframe->full_redraw = true; ! FULL_REDRAW = true; ! tempframe->erase(); ! tempframe->prepare(); ! ! acquire_bitmap(tempframe->surface); ! animate(tempframe); ! release_bitmap(tempframe->surface); ! } acquire_bitmap(game_screen); *************** *** 412,415 **** --- 439,444 ---- game_screen1 = create_video_bitmap(screen->w, screen->h); game_screen2 = create_video_bitmap(screen->w, screen->h); + // game_screen2 can also be used to store stuff, which is then blitted at once + // onto the game screen. if (!(game_screen1 && game_screen2)) { *************** *** 428,439 **** void GameProject::quit() { ! if (game_screen1) ! show_video_bitmap(game_screen1); ! if (game_screen1) ! destroy_bitmap(game_screen1); ! if (game_screen2) ! destroy_bitmap(game_screen2); // result of an empty project: nothing to do, also on exiting it --- 457,469 ---- void GameProject::quit() { ! // if (game_screen1) ! // show_video_bitmap(game_screen1); ! del_bitmap(&game_screen1); ! del_bitmap(&game_screen2); ! ! // AAARGH ! // don't know how to restore the original "screen" !! // result of an empty project: nothing to do, also on exiting it *************** *** 692,697 **** tmp = "BAD!"; message.print(dur, 12, "render time: %.3fms (that's %s)", rt, tmp); ! message.print(dur, 12, "debug: %d", debug_value); ! message.print(dur, 12, "shipdatas loaded: %d", shipdatas_loaded); message.animate(f); --- 722,727 ---- tmp = "BAD!"; message.print(dur, 12, "render time: %.3fms (that's %s)", rt, tmp); ! //message.print(dur, 12, "debug: %d", debug_value); ! //message.print(dur, 12, "shipdatas loaded: %d", shipdatas_loaded); message.animate(f); Index: gamesolarview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamesolarview.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gamesolarview.cpp 19 Dec 2003 23:33:35 -0000 1.5 --- gamesolarview.cpp 4 Jan 2004 22:07:00 -0000 1.6 *************** *** 2,5 **** --- 2,6 ---- #include <allegro.h> #include <stdio.h> + #include <string.h> //#include <string.h> *************** *** 18,21 **** --- 19,54 ---- #include "stuff/backgr_stars.h" + #include "../twgui/twgui.h" + #include "../twgui/twmenuexamples.h" + + #include "general/sprites.h" + #include "gamestarmap.h" + + + static GameSolarview *gsolar; + + + + // scan the normal files: + + void set_filelist(TextList *tl, char *scanname) + { + int err; + al_ffblk info; + + tl->clear_optionlist(); + + err = al_findfirst(scanname, &info, FA_ARCH); + + while (!err) + { + if (strcmp(info.name, ".") && strcmp(info.name, "..") ) + tl->add_optionlist(info.name); + + err = al_findnext(&info); + } + + al_findclose(&info); + } *************** *** 99,103 **** SolarBody *s; ! s = new SolarBody(0, pos, 0.0, Tedit->showspr(), mapcenter, Tedit->isel, mapcenter+Poffs, R, b, col // ellips information ); --- 132,136 ---- SolarBody *s; ! s = new SolarBody(0, pos, 0.0, Tedit->tv->makespr(), mapcenter, Tedit->tv->isel, mapcenter+Poffs, R, b, col // ellips information ); *************** *** 107,139 **** ! void MapEditor2::calculate() { ! MapEditor::calculate(); - if (selection && moveselection) - { - SolarBody *s; - s = (SolarBody*) selection; ! s->stayhere = s->pos; // in this case, movement is allowed ... ! Vector2 Poffs; ! int col; ! double R; ! ellipsparams(s->pos - mapcenter, s->ellipsb, ! R, Poffs, col); ! s->ellipsR = R; ! s->ellipscol = col; ! s->ellipscenter = mapcenter + Poffs; ! s->drawshadow(); ! } } --- 140,253 ---- ! ! void MapEditor2::move() { ! MapEditor::move(); + SolarBody *s; + s = (SolarBody*) selection; + + s->stayhere = s->pos; // in this case, movement is allowed ... + + Vector2 Poffs; + int col; + double R; + + ellipsparams(s->pos - mapcenter, s->ellipsb, + R, Poffs, col); + + s->ellipsR = R; + s->ellipscol = col; + s->ellipscenter = mapcenter + Poffs; + + s->drawshadow(); + } ! void MapEditor2::replace() ! { ! MapEditor::replace(); ! isurfacetype = gsolar->tv2->isel; ! colorizeobj((SolarBody*) selection); ! gsolar->save_surface(); ! } ! ! void MapEditor2::newselection() ! { ! // if a new planet is selected, read its info from the star file ! ! MapEditor::newselection(); ! ! gsolar->init_surface(); ! ! isurfacetype = gsolar->tv2->isel; ! ! // also ... the planet picture is ... ! int k; ! k = selection->starnum; ! Tedit->tv->set_sel( gsolar->solarmap->sub[k]->type ); ! } ! ! ! ! void MapEditor2::colorizeobj(SolarBody *s) ! { ! s->drawshadow(); ! // this resets the sprite and adds shade ? ! ! SpaceSprite *spr = s->get_sprite(); ! ! double rc, gc, bc, r_ref, g_ref, b_ref; ! avcolor( gsolar->surfacebmp[isurfacetype], &r_ref, &g_ref, &b_ref); ! double temperature = 5500.0; ! ! double rat, gat, bat; // extra atmospheric weight. ! rat = 0.7; // you don't have that on a starship, ! gat = 0.6; // but well, this makes it more understandable ! bat = 0.4; // for us earthdwellers ... otherwise the sun would look slightly blueish ... ! // the blue reduction is somewhat exaggerated ! ! rc = spec_r(temperature) * rat * r_ref; ! gc = spec_g(temperature) * gat * g_ref; ! bc = spec_b(temperature) * bat * b_ref; ! ! balance(&rc, &gc, &bc); ! colorize(spr, rc, gc, bc); ! brighten(spr); } + void MapEditor2::add() + { + //GameSolarview *gs = (GameSolarview*)physics; + + MapEditor::add(); + + // you need a new random number (plus check it doesn't exist yet) + int id; + for (;;) + { + id = random(); + // check all things in the list ... but you've to start at the root ?! + } + + + // set other stuff as well ... the surface parameter, eg... and color + // the sprite based on this thingy !! + + isurfacetype = gsolar->tv2->isel; + + colorizeobj((SolarBody*) selection); + + + // write stuff to a .ini file ... + + gsolar->save_surface(); + } + *************** *** 154,157 **** --- 268,272 ---- void GameSolarview::init() { + gsolar = this; GameBare::init(); *************** *** 169,180 **** // create star objects ?! ! int istar; ! MapSpacebody *starmap, *solarmap; starmap = mapeverything.region[0]; // use the starmap of the 1st region // playerinfo.istar = 0; istar = playerinfo.istar; if (istar < 0) istar = 0; solarmap = starmap->sub[istar]; // use the solarsystem belonging to that star --- 284,299 ---- // create star objects ?! ! starmap = mapeverything.region[0]; // use the starmap of the 1st region // playerinfo.istar = 0; + int istar; istar = playerinfo.istar; if (istar < 0) + { istar = 0; + playerinfo.istar = istar; + } + starnum = istar; solarmap = starmap->sub[istar]; // use the solarsystem belonging to that star *************** *** 205,208 **** --- 324,328 ---- // load planet sprites + planettypespr = new SpaceSprite* [planettypelist->N]; int i; for ( i = 0; i < planettypelist->N; ++i ) *************** *** 210,217 **** char tmp[512]; sprintf(tmp, "gamex/solarview/planet_%s_01.bmp", planettypelist->type[i].type_string); ! planetspr[i] = create_sprite( tmp, SpaceSprite::MASKED ); } // load the planet data for ( i = 0; i < solarmap->Nsub; ++i ) { --- 330,349 ---- char tmp[512]; sprintf(tmp, "gamex/solarview/planet_%s_01.bmp", planettypelist->type[i].type_string); ! planettypespr[i] = create_sprite( tmp, SpaceSprite::MASKED ); ! } ! ! // load surface bitmaps ! surfacebmp = new BITMAP* [surfacetypelist->N]; ! for ( i = 0; i < surfacetypelist->N; ++i ) ! { ! char tmp[512]; ! sprintf(tmp, "gamex/planetscan/surface_%s_01.bmp", surfacetypelist->type[i].type_string); ! load_bitmap32(&surfacebmp[i], tmp); ! scale_bitmap32(&surfacebmp[i], 0.2); } // load the planet data + + for ( i = 0; i < solarmap->Nsub; ++i ) { *************** *** 227,232 **** k = solarmap->sub[i]->type; ! solarbody = new SolarBody(0, solarmap->sub[i]->position, 0.0, planetspr[k], sunpos, i, ! sunpos+Poffs, R, b, col // ellips information ); solarmap->sub[i]->o = solarbody; --- 359,394 ---- k = solarmap->sub[i]->type; ! planetspr = new SpaceSprite(planettypespr[k]->get_bitmap(0)); ! // change the color according to the surface and the star... ! ! char tmp[512]; ! sprintf(tmp, "gamex/gamedata/surface/%08X.ini", solarmap->sub[i]->id); ! set_config_file(tmp); ! strcpy(tmp, get_config_string(0, "surface", "default")); ! k = surfacetypelist->get_index(tmp, 0); ! ! double rc, gc, bc, r_ref, g_ref, b_ref; ! avcolor(surfacebmp[k], &r_ref, &g_ref, &b_ref); ! double temperature = 5500.0; ! ! double rat, gat, bat; // extra atmospheric weight. ! rat = 0.7; // you don't have that on a starship, ! gat = 0.6; // but well, this makes it more understandable ! bat = 0.4; // for us earthdwellers ... otherwise the sun would look slightly blueish ... ! // the blue reduction is somewhat exaggerated ! ! rc = spec_r(temperature) * rat * r_ref; ! gc = spec_g(temperature) * gat * g_ref; ! bc = spec_b(temperature) * bat * b_ref; ! ! balance(&rc, &gc, &bc); ! colorize(planetspr, rc, gc, bc); ! brighten(planetspr); ! ! ! ! solarbody = new SolarBody(0, solarmap->sub[i]->position, 0.0, ! planetspr, ! sunpos, i, sunpos+Poffs, R, b, col // ellips information ); solarmap->sub[i]->o = solarbody; *************** *** 257,265 **** add(ptr); ! Tedit = new IconTV("gamex/interface/starmap/edit", 400, 200, game_screen); Tedit->exclusive = false; bnew = new Button(Tedit, "new_"); breplace = new Button(Tedit, "replace_"); ! Tedit->setsprites(planetspr, planettypelist->N); T->add(Tedit);... [truncated message content] |