You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <geo...@us...> - 2004-01-04 22:07:05
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1:/tmp/cvs-serv31200/twgui Modified Files: gametest2.cpp twbutton.cpp twbuttontypes.cpp twbuttontypes.h twgui.cpp twgui.h twhelpers.cpp twhelpers.h twmenuexamples.cpp twmenuexamples.h twpopup.cpp twpopup.h twwindow.cpp twwindow.h utils.cpp Log Message: full-game source update Index: gametest2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/gametest2.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gametest2.cpp 12 Dec 2003 15:58:01 -0000 1.1 --- gametest2.cpp 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 197,201 **** bmp = create_bitmap_ex(32, bmp2->w, bmp2->h); blit(bmp2, bmp, 0, 0, 0, 0, bmp2->w, bmp2->h); ! destroy_bitmap(bmp2); } else if (data->type == DAT_BITMAP) // useful in case you prefer a panel bmp { --- 197,201 ---- bmp = create_bitmap_ex(32, bmp2->w, bmp2->h); blit(bmp2, bmp, 0, 0, 0, 0, bmp2->w, bmp2->h); ! del_bitmap(&bmp2); } else if (data->type == DAT_BITMAP) // useful in case you prefer a panel bmp { *************** *** 232,236 **** if (data->type == DAT_RLE_SPRITE) ! destroy_bitmap(bmp); //unload_datafile_object(data); } else { --- 232,236 ---- if (data->type == DAT_RLE_SPRITE) ! del_bitmap(&bmp); //unload_datafile_object(data); } else { *************** *** 260,264 **** { ++i; ! destroy_bitmap(fleet_bmp[i]); } --- 260,264 ---- { ++i; ! del_bitmap(&fleet_bmp[i]); } Index: twbutton.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbutton.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twbutton.cpp 12 Dec 2003 15:58:01 -0000 1.1 --- twbutton.cpp 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 604,608 **** mainwindow->scalepos(&pos); // is normally called by the other init(); ! if (!k) { tw_error("Could not find the bmp on the background image"); --- 604,608 ---- mainwindow->scalepos(&pos); // is normally called by the other init(); ! if (!k && mainwindow->autoplace) { tw_error("Could not find the bmp on the background image"); Index: twbuttontypes.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbuttontypes.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** twbuttontypes.cpp 19 Dec 2003 08:52:54 -0000 1.3 --- twbuttontypes.cpp 4 Jan 2004 22:07:00 -0000 1.4 *************** *** 31,40 **** Button::~Button() { ! if (bmp_default) ! destroy_bitmap(bmp_default); ! if (bmp_focus) ! destroy_bitmap(bmp_focus); ! if (bmp_selected) ! destroy_bitmap(bmp_selected); } --- 31,37 ---- Button::~Button() { ! del_bitmap(&bmp_default); ! del_bitmap(&bmp_focus); ! del_bitmap(&bmp_selected); } *************** *** 88,93 **** Area::~Area() { ! if (markfordeletion && backgr) ! destroy_bitmap(backgr); } --- 85,90 ---- Area::~Area() { ! if (markfordeletion) ! del_bitmap(&backgr); } *************** *** 99,104 **** if (newb) { ! if (markfordeletion && backgr) ! destroy_bitmap(backgr); backgr = newb; --- 96,101 ---- if (newb) { ! if (markfordeletion) ! del_bitmap(&backgr); backgr = newb; *************** *** 112,117 **** if (newb) { ! if (markfordeletion && backgr) ! destroy_bitmap(backgr); // hmm, well, don't do this, leave that to the program that created it !! backgr = newb; --- 109,114 ---- if (newb) { ! if (markfordeletion) ! del_bitmap(&backgr); // hmm, well, don't do this, leave that to the program that created it !! backgr = newb; *************** *** 120,123 **** --- 117,131 ---- } + void Area::overwritebackgr(BITMAP *newb, double scale, int col) + { + if (newb && backgr) + { + clear_to_color(backgr, col); + stretch_blit(newb, backgr, 0, 0, newb->w, newb->h, + 0, 0, newb->w * scale, newb->h * scale); + } + } + + void Area::animate() *************** *** 167,172 **** //if (backgr) // destroy_bitmap(backgr); ! if (drawarea) ! destroy_bitmap(drawarea); } --- 175,179 ---- //if (backgr) // destroy_bitmap(backgr); ! del_bitmap(&drawarea); } *************** *** 223,230 **** SwitchButton::~SwitchButton() { ! if (bmp_on) ! destroy_bitmap(bmp_on); ! if (bmp_off) ! destroy_bitmap(bmp_off); } --- 230,235 ---- SwitchButton::~SwitchButton() { ! del_bitmap(&bmp_on); ! del_bitmap(&bmp_off); } *************** *** 328,333 **** ScrollBar::~ScrollBar() { ! if (button) ! destroy_bitmap(button); } --- 333,337 ---- ScrollBar::~ScrollBar() { ! del_bitmap(&button); } Index: twbuttontypes.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbuttontypes.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** twbuttontypes.h 19 Dec 2003 08:52:54 -0000 1.5 --- twbuttontypes.h 4 Jan 2004 22:07:00 -0000 1.6 *************** *** 43,46 **** --- 43,47 ---- virtual void changebackgr(char *fname); virtual void changebackgr(BITMAP *newb); + virtual void overwritebackgr(BITMAP *newb, double scale, int col); virtual void animate(); // shouldn't be changed. Index: twgui.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twgui.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** twgui.cpp 12 Dec 2003 15:55:06 -0000 1.13 --- twgui.cpp 4 Jan 2004 22:07:00 -0000 1.14 *************** *** 26,30 **** AreaTablet(menu, identbranch, asciicode, akeepkey) { ! scroll.setup(mainwindow, identbranch, &scroll); } --- 26,30 ---- AreaTablet(menu, identbranch, asciicode, akeepkey) { ! scroll.setup(mainwindow, identbranch);//, &scroll); } *************** *** 94,98 **** text_mode(-1); ! textout_centre(drawarea, usefont, text, xcentre, ycentre, text_color); } --- 94,99 ---- text_mode(-1); ! if (text) ! textout_centre(drawarea, usefont, text, xcentre, ycentre, text_color); } *************** *** 120,127 **** optionlist = 0; N = 0; selected = false; ! scroll.setup(mainwindow, identbranch, &scroll); scroll.set(0, 0, 1, 0, 1, 1); --- 121,129 ---- optionlist = 0; N = 0; + Nreserved = N; selected = false; ! scroll.setup(mainwindow, identbranch);//, &scroll); scroll.set(0, 0, 1, 0, 1, 1); *************** *** 177,180 **** --- 179,184 ---- N = 0; + Nreserved = N; + scroll.Ny = 0; scroll.set(0, 0, 1, 0, 1, 1); *************** *** 205,220 **** N = aN; if (N == 0) return; // in case there's an empty list if (N > 0) ! optionlist = new char* [N]; // reserve space for that many pointers to strings. else optionlist = 0; ! for ( i = 0; i < N; ++i ) { ! optionlist[i] = new char[strlen(aoptionlist[i]) + 1 ]; ! strcpy(optionlist[i], aoptionlist[i]); } --- 209,230 ---- N = aN; + Nreserved = N; + if (N == 0) return; // in case there's an empty list + if (N > 0) ! optionlist = new char* [Nreserved]; // reserve space for that many pointers to strings. else optionlist = 0; ! if (optionlist) { ! for ( i = 0; i < N; ++i ) ! { ! optionlist[i] = new char[strlen(aoptionlist[i]) + 1 ]; ! strcpy(optionlist[i], aoptionlist[i]); ! } } *************** *** 223,226 **** --- 233,263 ---- + void TextList::add_optionlist(char *newstr) + { + if (!optionlist) + { + Nreserved = 128; + optionlist = new char* [Nreserved]; + } + + if (N >= Nreserved) + { + // re-allocate memory ... + char **tmp; + Nreserved += 128; + tmp = new char* [Nreserved]; // reserve new space + for ( int i = 0; i < N; ++i ) + tmp[i] = optionlist[i]; // copy content + delete optionlist; // delete old stuff + optionlist = tmp; // point to the new space + } + + optionlist[N] = new char[strlen(newstr) + 1 ]; + strcpy(optionlist[N], newstr); + ++N; + scroll.set(0, 0, 1, N , 1, Nshow); + } + + // if the mouse is clicked within the window: void TextList::handle_lpress() *************** *** 315,319 **** } ! if (optionlist[i] && strlen(optionlist[i]) < 20) textout(drawarea, usefont, optionlist[i], ix, iy, c); } --- 352,356 ---- } ! if (optionlist[i])// && strlen(optionlist[i]) < 20) textout(drawarea, usefont, optionlist[i], ix, iy, c); } *************** *** 341,353 **** { usefont = afont; ! Htxt = text_height(usefont); text_color = makecol(0,0,0); ! maxchars = amaxtext; textinfo = 0; localcopy = 0; ! set_textinfo(atext, maxchars); //scroll = ascroll; --- 378,390 ---- { usefont = afont; ! // Htxt = text_height(usefont); text_color = makecol(0,0,0); ! // maxchars = amaxtext; textinfo = 0; localcopy = 0; ! set_textinfo(atext, amaxtext); //scroll = ascroll; *************** *** 355,359 **** // scroll.set(0, 0, 1, 0, 1, 1); ! Nshow = int(size.y / Htxt) - 1; // -1, because item 0 is also shown... // just display some passive information. Clicking doesn't need to give action by default. --- 392,396 ---- // scroll.set(0, 0, 1, 0, 1, 1); ! // Nshow = int(size.y / Htxt) - 1; // -1, because item 0 is also shown... // just display some passive information. Clicking doesn't need to give action by default. *************** *** 370,389 **** } ! ! void TextInfoArea::set_textinfo(char *newtext, int Nchars) { if (textinfo) delete textinfo; if (localcopy) delete localcopy; localcopy = new char [Nchars+1]; ! strncpy(localcopy, newtext, Nchars); localcopy[Nchars] = 0; ! textinfo = new TextInfo(usefont, drawarea, localcopy, Nchars); ! textinfo->reset(&scroll); ! scroll.set_sel(0, 0); } --- 407,439 ---- } ! // the following could be used for editing text that's stored elsewhere ! void TextInfoArea::set_textinfo_unbuffered(char *newtext, int Nchars) { if (textinfo) delete textinfo; + textinfo = new TextInfo(usefont, drawarea, newtext, Nchars); + + textinfo->reset(&scroll); + scroll.set_sel(0, 0); + } + + + // the following is used to display text, and keep it safe from harm by + // other external factors. + void TextInfoArea::set_textinfo(char *newtext, int Nchars) + { + if (localcopy) delete localcopy; localcopy = new char [Nchars+1]; ! if (newtext) ! strncpy(localcopy, newtext, Nchars); ! else ! localcopy[0] = 0; localcopy[Nchars] = 0; ! set_textinfo_unbuffered(localcopy, Nchars); } *************** *** 465,474 **** //usefont = afont; text = atext; ! //maxchars = amaxtext; // a short line? ! textinfo = new TextInfo(afont, drawarea, text, maxchars); ! textinfo->reset(&scroll); ! charpos = strlen(textinfo->textinfo); int i; --- 515,529 ---- //usefont = afont; text = atext; ! maxchars = amaxtext; // a short line? ! textinfo = 0; ! //textinfo = new TextInfo(afont, drawarea, text, amaxtext); ! //textinfo->reset(&scroll); ! this->set_textinfo_unbuffered(text, amaxtext); ! if (textinfo->textinfo) ! charpos = strlen(textinfo->textinfo); ! else ! charpos = 0; int i; *************** *** 481,488 **** lastpressed = -1; - //scroll.set(0, 0, 1, 0, 1, 1); - - //scrollcontrol.ver(this, identbranch, &scroll); - int x, y; --- 536,539 ---- *************** *** 500,504 **** TextEditBox::~TextEditBox() { ! delete textinfo; } --- 551,557 ---- TextEditBox::~TextEditBox() { ! // the following is deleted in the mother function. ! //if (textinfo) ! // delete textinfo; } *************** *** 545,552 **** ! void TextEditBox::text_reset(char *newtext) { textinfo->textinfo = newtext; text = newtext; text_reset(); } --- 598,607 ---- ! void TextEditBox::text_reset(char *newtext, int N) { textinfo->textinfo = newtext; text = newtext; + textinfo->Nchars = N; + maxchars = N; text_reset(); } *************** *** 556,564 **** textinfo->reset(&scroll); ! ! // check if charpos still has an acceptable position. ! // note that Nchars does not include the zero at the end of the line... ! if (charpos > textinfo->Nchars) ! charpos = textinfo->Nchars; int xs, ys; --- 611,617 ---- textinfo->reset(&scroll); ! ! if (charpos > (int)strlen(text)) ! charpos = strlen(text)-1; int xs, ys; *************** *** 575,578 **** --- 628,632 ---- void TextEditBox::calculate() { + if (textinfo->textinfo != text) {tw_error("text mismatch");} TextInfoArea::calculate(); *************** *** 672,676 **** // ++m; // nah, don't delete, otherwise you can't undelete a line, purely ! memmove(&text[charpos-m], &text[charpos], (maxchars-m)-charpos); text[maxchars-m] = 0; --- 726,730 ---- // ++m; // nah, don't delete, otherwise you can't undelete a line, purely ! memmove(&text[charpos-m], &text[charpos], (maxchars-m)-charpos); text[maxchars-m] = 0; *************** *** 744,748 **** // TextInfoArea::subanimate(); ! text_mode(-1); int i; --- 798,802 ---- // TextInfoArea::subanimate(); ! text_mode(-1); int i; *************** *** 788,792 **** ! // draw a line at "charpos" ... but how ?? int xc, yc; --- 842,846 ---- ! // draw a line at "charpos" ... int xc, yc; *************** *** 805,809 **** ! --- 859,866 ---- ! char *TextEditBox::get_text() ! { ! return text; ! } *************** *** 860,867 **** MatrixIcons::~MatrixIcons() { ! if (overlay) ! destroy_bitmap(overlay); ! if (tmp) ! destroy_bitmap(tmp); if (itemproperty) delete itemproperty; --- 917,923 ---- MatrixIcons::~MatrixIcons() { ! del_bitmap(&overlay); ! del_bitmap(&tmp); ! if (itemproperty) delete itemproperty; Index: twgui.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twgui.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** twgui.h 12 Dec 2003 15:55:06 -0000 1.11 --- twgui.h 4 Jan 2004 22:07:00 -0000 1.12 *************** *** 57,60 **** --- 57,61 ---- class TextList : public AreaTabletScrolled { + int Nreserved; public: *************** *** 73,78 **** void clear_optionlist(); ! void set_optionlist(char **aoptionlist, int color); void set_optionlist(char **aoptionlist, int aN, int color); void set_selected(int iy); --- 74,80 ---- void clear_optionlist(); ! void set_optionlist(char **aoptionlist, int color); // overwrite a list. void set_optionlist(char **aoptionlist, int aN, int color); + void add_optionlist(char *newstr); // add one item to an existing list. void set_selected(int iy); *************** *** 100,104 **** { protected: ! int maxchars; char *localcopy; TextInfo *textinfo; --- 102,106 ---- { protected: ! int maxchars; // you can't add chars beyond that char *localcopy; TextInfo *textinfo; *************** *** 112,116 **** FONT *usefont; ! int Htxt, Nshow; int text_color; --- 114,118 ---- FONT *usefont; ! //int Htxt, Nshow; int text_color; *************** *** 118,121 **** --- 120,124 ---- void set_textinfo(char *atextinfo); void set_textinfo(char *atextinfo, int Nchars); + void set_textinfo_unbuffered(char *newtext, int Nchars); virtual void subanimate(); *************** *** 130,134 **** { protected: - char *text;//[128]; // can hold 1 line of text. int charpos; --- 133,136 ---- *************** *** 138,153 **** int lastpressed; int repeattime, lasttime; - int text_color; - - //TextInfo *textinfo; - public: TextEditBox(TWindow *menu, char *identbranch, FONT *afont, char *atext, int amaxtext); virtual ~TextEditBox(); - //FONT *usefont; - virtual void calculate(); virtual void subanimate(); --- 140,152 ---- int lastpressed; int repeattime, lasttime; public: + char *text;//[128]; // can hold 1 line of text. + int text_color; + TextEditBox(TWindow *menu, char *identbranch, FONT *afont, char *atext, int amaxtext); virtual ~TextEditBox(); virtual void calculate(); virtual void subanimate(); *************** *** 155,160 **** virtual void handle_lpress(); ! void clear_text(); ! void show_text(); // set the typematic delay to "atime" milliseconds (default = 100) --- 154,159 ---- virtual void handle_lpress(); ! // void clear_text(); ! // void show_text(); // set the typematic delay to "atime" milliseconds (default = 100) *************** *** 163,167 **** void text_reset(); ! void text_reset(char *newtext); }; --- 162,168 ---- void text_reset(); ! void text_reset(char *newtext, int N); ! ! char *get_text(); }; Index: twhelpers.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twhelpers.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twhelpers.cpp 12 Dec 2003 15:58:01 -0000 1.1 --- twhelpers.cpp 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 158,161 **** --- 158,172 ---- } + // return the horizontal relative position if possible; otherwise the + // vertical, or a default value. + double ScrollControl::get_relpos() + { + if (scrollhor) + return scrollhor->relpos; + if (scrollvert) + return scrollvert->relpos; + return 0; + } + *************** *** 235,239 **** // This loads the required buttons. ! void ScrollControl::setup_hor(TWindow *A, char *id, ScrollControl *scr) { --- 246,250 ---- // This loads the required buttons. ! void ScrollControl::setup_hor(TWindow *A, char *id)//, ScrollControl *scr) { *************** *** 264,273 **** } ! scr->left = left; ! scr->right = right; ! scr->scrollhor = scrollhor; } ! void ScrollControl::setup_ver(TWindow *A, char *id, ScrollControl *scr) { char id2[128]; --- 275,284 ---- } ! // scr->left = left; ! // scr->right = right; ! // scr->scrollhor = scrollhor; } ! void ScrollControl::setup_ver(TWindow *A, char *id)//, ScrollControl *scr) { char id2[128]; *************** *** 288,311 **** if (!scrollvert->isvalid()) { A->rem(scrollvert); delete scrollvert; scrollvert = 0; } ! scr->up = up; ! scr->down = down; ! scr->scrollvert = scrollvert; } ! void ScrollControl::setup_hor(EmptyButton *A, char *id, ScrollControl *scr) { ! setup_hor(A->mainwindow, id, scr); } ! void ScrollControl::setup_ver(EmptyButton *A, char *id, ScrollControl *scr) { ! setup_ver(A->mainwindow, id, scr); } ! void ScrollControl::setup(TWindow *A, char *id, ScrollControl *scr) { ! setup_hor(A, id, scr); ! setup_ver(A, id, scr); } --- 299,322 ---- if (!scrollvert->isvalid()) { A->rem(scrollvert); delete scrollvert; scrollvert = 0; } ! // scr->up = up; ! // scr->down = down; ! // scr->scrollvert = scrollvert; } ! void ScrollControl::setup_hor(EmptyButton *A, char *id)//, ScrollControl *scr) { ! setup_hor(A->mainwindow, id);//, scr); } ! void ScrollControl::setup_ver(EmptyButton *A, char *id)//, ScrollControl *scr) { ! setup_ver(A->mainwindow, id);//, scr); } ! void ScrollControl::setup(TWindow *A, char *id)//, ScrollControl *scr) { ! setup_hor(A, id);//, scr); ! setup_ver(A, id);//, scr); } *************** *** 336,343 **** Nchars = aNchars; - Htxt = text_height(usefont); text_color = makecol(0,0,0); ! Nshow = int(bmp->h / Htxt) - 1; // -1, because item 0 is also shown... } --- 347,356 ---- Nchars = aNchars; Htxt = text_height(usefont); text_color = makecol(0,0,0); ! Nshow = int(bmp->h / Htxt); ! ! if (Nshow == 0) ! Nshow = 1; // force at least 1 line to be displayed, even if text doesn't fit entirely in the window ! } *************** *** 356,360 **** Nlines = 0; linestart[0] = 0; ! if (textinfo[0] == 0) // empty text { Nlines = 1; // even empty text has 1 line to hold the cursor. --- 369,373 ---- Nlines = 0; linestart[0] = 0; ! if (! textinfo || textinfo[0] == 0) // empty text { Nlines = 1; // even empty text has 1 line to hold the cursor. *************** *** 464,468 **** ! // map coordinate to character number int TextInfo::getcharpos(int x, int y) { --- 477,511 ---- ! // map (x) coordinate to character number ! int TextInfo::getcharpos(char *scantxt, int x, int max) ! { ! int i; ! i = 0; ! ! double len, charlen, lastcharlen; ! len = 0; ! charlen = 0; ! ! while (scantxt[i] != 0 && i < max) ! { ! char txt[2]; ! txt[0] = scantxt[i]; ! txt[1] = 0; ! ! lastcharlen = charlen; ! charlen = text_length(usefont, txt); ! ! len += 0.5 * (charlen + lastcharlen); // so that sensitivity is to the center of the character ! ! if (len > x) ! break; ! ! ++i; ! } ! ! return i; ! } ! ! // map (x,y) coordinate to character number int TextInfo::getcharpos(int x, int y) { *************** *** 482,488 **** { int n; ! n = linestart[iline] + x; ! if (n > (int)strlen(textinfo)) ! n = strlen(textinfo); return n; --- 525,532 ---- { int n; ! int n1; ! n1 = linestart[iline]; ! ! n = n1 + getcharpos(&textinfo[n1], x, 1000); return n; *************** *** 491,509 **** // on this line, find the char-position left-closest to the x value ! int n, len; ! ! len = 0; ! ! for ( n = linestart[iline]; n < linestart[iline+1]-1; ++n ) ! { ! char txt[2]; ! txt[0] = textinfo[n]; ! txt[1] = 0; - len += text_length(usefont, txt); ! if (len > x) ! return n; ! } --- 535,544 ---- // on this line, find the char-position left-closest to the x value ! int n; ! int n1 = linestart[iline]; ! int max = linestart[iline+1] - linestart[iline] - 1; ! n = n1 + getcharpos(&textinfo[n1], x, max); Index: twhelpers.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twhelpers.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twhelpers.h 12 Dec 2003 15:58:01 -0000 1.1 --- twhelpers.h 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- void set_percent_pos_x(double alpha); void set_percent_pos_y(double alpha); + double get_relpos(); void add(int dx, int dy); void check_pos(); *************** *** 37,46 **** ScrollBar *scrollhor, ScrollBar *scrollvert); ! void setup_hor(TWindow *A, char *id, ScrollControl *scr); ! void setup_ver(TWindow *A, char *id, ScrollControl *scr); ! void setup_hor(EmptyButton *A, char *id, ScrollControl *scr); ! void setup_ver(EmptyButton *A, char *id, ScrollControl *scr); // set up both the horizontal and vertical bar (provided the graphics exist) ! void setup(TWindow *A, char *id, ScrollControl *scr); }; --- 38,47 ---- ScrollBar *scrollhor, ScrollBar *scrollvert); ! void setup_hor(TWindow *A, char *id);//, ScrollControl *scr); ! void setup_ver(TWindow *A, char *id);//, ScrollControl *scr); ! void setup_hor(EmptyButton *A, char *id);//, ScrollControl *scr); ! void setup_ver(EmptyButton *A, char *id);//, ScrollControl *scr); // set up both the horizontal and vertical bar (provided the graphics exist) ! void setup(TWindow *A, char *id);//, ScrollControl *scr); }; *************** *** 59,63 **** int linestart[maxlines]; ! int Nlines, Nchars; FONT *usefont; --- 60,64 ---- int linestart[maxlines]; ! int Nlines, Nchars, maxchars; FONT *usefont; *************** *** 73,77 **** --- 74,80 ---- //void set_textinfo(char *atextinfo, int Nchars); + int getcharpos(char *txt, int x, int max); void getxy(int charpos, int *x, int *y); + int getcharpos(int x, int y); void changeline(int *charpos, int line1, int line2); Index: twmenuexamples.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twmenuexamples.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twmenuexamples.cpp 12 Dec 2003 15:58:01 -0000 1.1 --- twmenuexamples.cpp 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 43,48 **** PopupTextInfo::~PopupTextInfo() { ! if (tia) ! delete tia; } --- 43,48 ---- PopupTextInfo::~PopupTextInfo() { ! //if (tia) ! // delete tia; } *************** *** 118,123 **** // delete the list ! if (tbl) ! delete tbl; } --- 118,125 ---- // delete the list ! // well, no, don't do this, cause it's a button and is deleted as part ! // of the button list in the twwindow. ! //if (tbl) ! // delete tbl; } *************** *** 167,170 **** --- 169,174 ---- PopupFleetSelection::~PopupFleetSelection() { + // no ... this is deleted as part of the deletion of the button list in twwindow + /* if (icons) delete icons; *************** *** 175,178 **** --- 179,183 ---- if (alwaysrandom) delete alwaysrandom; + */ } *************** *** 272,274 **** --- 277,596 ---- + + + + + + + + FileBrowser::FileBrowser(EmptyButton *creator, char *ident, int axshift, int ayshift, FONT *afont) + : + PopupList(creator, ident, "list_", axshift, ayshift, afont, 0) + { + strcpy(dir, "."); // you can't get below this (which is the game directory) + strcpy(fname, "none"); + + downdir = new Button(this, "downdir_"); + + selection = false; + + reset_dirlist(); + + required_ext[0] = 0; + } + + + FileBrowser::~FileBrowser() + { + //delete downdir; + } + + + void FileBrowser::set_dir(char *newdir) + { + strcpy(dir, newdir); + reset_dirlist(); + } + + + + void FileBrowser::set_ext(char *ext) + { + strcpy(required_ext, "."); + strcat(required_ext, ext); + } + + + void FileBrowser::reset_dirlist() + { + int err; + al_ffblk info; + + tbl->clear_optionlist(); + + char scanname[512]; + strcpy(scanname, dir); + strcat(scanname, "/*"); + + // first check the directories, after that the normal files. + int i = 0; + + err = al_findfirst(scanname, &info, FA_DIREC | FA_ARCH); + + while (!err) + { + if (strcmp(info.name, ".") && strcmp(info.name, "..") ) + { + char tmp[512]; + strcpy(tmp, info.name); + + if ((info.attrib & FA_DIREC) != 0) + strcat(tmp, "/"); + + else if (required_ext[0] != 0) + { + // check if this file has a valid extension (if needed) + char *ext2 = &tmp[strlen(tmp)-strlen(required_ext)]; + if (strcmp(required_ext, ext2)) + tmp[0] = 0; + } + + if (tmp[0] != 0) + { + tbl->add_optionlist(tmp); + + if (i < 2048) + fattr[i] = info.attrib; + + ++i; + } + } + + err = al_findnext(&info); + } + + al_findclose(&info); + } + + + void FileBrowser::calculate() + { + PopupList::calculate(); + + if (disabled) + return; + + // go down one directory. + if (downdir->flag.left_mouse_press) + { + char *tmp; // right-most char + tmp = strrchr(dir, '/'); + if (tmp) + { + tmp[0] = 0; // remove that sub-dir from the string + reset_dirlist(); + } + } + + + if (tbl->flag.left_mouse_press) + { + // change directory, OR, select a file ... + + int k; + k = tbl->getk(); + + if (k >= 0 && tbl->optionlist) // if the dir is not empty... + { + if ((fattr[k] & FA_DIREC) != 0) + { + // change directory... and refresh the filelist + strcat(dir, "/"); + strcat(dir, tbl->optionlist[k]); + if (dir[strlen(dir)-1] == '/') // remove this / again, cause it's only for display + dir[strlen(dir)-1] = 0; + reset_dirlist(); + } else + // do NOT check for fa_arch here, cause a file is often not an archive + { + // select the file ... + selection = true; + } + + } + } + } + + + // this calls close with return value + void FileBrowser::check_end() + { + if (selection) + { + selection = false; + int k = tbl->getk(); + + // to save work elsewhere, construct the filename + strcpy(fname, dir); + strcat(fname, "/"); + strcat(fname, tbl->optionlist[k]); + + // also supply the filename-index separately, could be useful sometimes? + close(k); + } + } + + + + + + + + + + + + void ValueStr::set(valuetypes atype, char *adescr, double amin, double amax) + { + type = atype; + strncpy(descr, adescr, sizeof(descr)-1); + min = amin; + max = amax; + + value = 0.0; + + if (atype == vtype_float) + strcpy(format, "%10.2f"); + else + strcpy(format, "%10.0f"); + } + + double ValueStr::getval() + { + if (type == vtype_float) + return value; + else + return (int)value; + } + + + + + ValueEdit::ValueEdit(TWindow *menu, char *identbranch, FONT *afont, int aNmax) + : + EmptyButton(menu, identbranch) + { + Nmax = aNmax; + values = new ValueStr* [Nmax]; + + int i; + for ( i = 0; i < Nmax; ++i ) + { + values[i] = new ValueStr(); + values[i]->descr[0] = 0; // an empty description string + // indicates the end of the list. + } + + // load a text-field, edit-field, and a scrollbar + + char tmp[512]; + + strcpy(tmp, identbranch); + strcat(tmp, "info_"); + info = new TextButton(menu, tmp, afont); + info->passive = false; + + strcpy(tmp, identbranch); + strcat(tmp, "edit_"); + edit = new TextEditBox(menu, tmp, afont, edit_text, sizeof(edit_text)); + + scroll.setup(menu, identbranch); + + isel = 0; + + barpos = -1; + do_init = true; + + } + + ValueEdit::~ValueEdit() + { + int i; + for ( i = 0; i < Nmax; ++i ) + delete values[i]; + + delete values; + } + + + void ValueEdit::edit_update() + { + sprintf(edit->text, values[isel]->format, values[isel]->value); + } + + + void ValueEdit::calculate() + { + EmptyButton::calculate(); + + // the scrollbar: + double oldpos = barpos; + barpos = scroll.get_relpos(); + if (barpos > 0.999999) + barpos = 0.999999; + + int k = 4; // power of increase + + if (barpos != oldpos) + { + double min = values[isel]->min; + double max = values[isel]->max; + + double value; + + if (barpos < 1E-5) + value = min; + else + value = min + (max - min) * exp(k * log(barpos)); + + values[isel]->value = value; + edit_update(); + } + + // clicking on the info button, changes the selected value that you want + // to edit. + + int lastisel = isel; + + if (info->flag.left_mouse_press) + { + ++isel; + if (values[isel]->descr[0] == 0 || isel >= Nmax) // end of the list. + isel = 0; + } + + if (info->flag.right_mouse_press) + { + --isel; + if (isel < 0) + isel = Nmax-1; + + while (values[isel]->descr[0] == 0 && isel > 0) + --isel; + } + + if (isel != lastisel || do_init) + { + do_init = false; // needed because of external manipulation of the lists + info->set_text(values[isel]->descr, makecol(250,250,250)); + edit_update(); + //sprintf(edit->text, "Hello there !!"); + edit->text_reset(); + + double min = values[isel]->min; + double max = values[isel]->max; + double value = values[isel]->value; + scroll.set_percent_pos_x(exp( log( (value - min)/(max - min) ) / k)); + } + } Index: twmenuexamples.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twmenuexamples.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twmenuexamples.h 12 Dec 2003 15:58:01 -0000 1.1 --- twmenuexamples.h 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 143,145 **** --- 143,212 ---- + class FileBrowser : public PopupList + { + public: + bool selection; + Button *downdir; + + char dir[512]; // max filename length + char fname[512]; + int fattr[2048]; // can handle max 2048 files. + + char required_ext[64]; + void set_ext(char *ext); + + FileBrowser(EmptyButton *creator, char *ident, int axshift, int ayshift, FONT *afont); + virtual ~FileBrowser(); + + virtual void calculate(); + + void reset_dirlist(); + + virtual void check_end(); + + void set_dir(char *newdir); + }; + + + + + + enum valuetypes {vtype_int=0, vtype_float=1}; + + class ValueStr + { + public: + char format[16]; + char descr[64]; + double min, max, value; + valuetypes type; // int or float + + void set(valuetypes atype, char *adescr, double amin, double amax); + double getval(); + }; + + + class ValueEdit : public EmptyButton + { + public: + int Nmax, isel; + bool do_init; + ValueStr **values; + + double barpos; + char edit_text[512]; + + TextButton *info; + TextEditBox *edit; + ScrollControl scroll; + + ValueEdit(TWindow *menu, char *identbranch, FONT *afont, int Nmax); + virtual ~ValueEdit(); + + void edit_update(); + + virtual void calculate(); + }; + + #endif Index: twpopup.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twpopup.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twpopup.cpp 12 Dec 2003 15:58:01 -0000 1.1 --- twpopup.cpp 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 114,127 **** int Popup::getvalue() { ! if (!returnvalueready) ! return -1; // otherwise it's undefined ! returnvalueready = false; return returnstatus; } void Popup::enable() { --- 114,141 ---- + // call this once (true) to probe if the popup has completed its function; it + // resets its "ready" status as well. + bool Popup::ready() + { + if (returnvalueready) + { + returnvalueready = false; + return true; + } else + return false; + } + + // call this to get a int-value from some selection mechanism (eg a list) int Popup::getvalue() { ! // if (!returnvalueready) ! // return -1; // otherwise it's undefined ! ready(); return returnstatus; } + // restore the ability to do calculations and actions void Popup::enable() { *************** *** 135,139 **** { show(); // (more general than enable) ! returnvalueready = false; } --- 149,153 ---- { show(); // (more general than enable) ! ready(); } Index: twpopup.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twpopup.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twpopup.h 12 Dec 2003 15:58:01 -0000 1.1 --- twpopup.h 4 Jan 2004 22:07:00 -0000 1.2 *************** *** 35,38 **** --- 35,39 ---- bool returnvalueready; + bool ready(); virtual void calculate(); Index: twwindow.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twwindow.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** twwindow.cpp 19 Dec 2003 08:52:54 -0000 1.5 --- twwindow.cpp 4 Jan 2004 22:07:00 -0000 1.6 *************** *** 14,17 **** --- 14,25 ---- + // this destroys the bitmap (if it exists i.e. isn't set to 0), + // and resets the pointer to 0 + void del_bitmap(BITMAP **bmp) + { + if (*bmp) + destroy_bitmap(*bmp); + *bmp = 0; + } *************** *** 69,72 **** --- 77,81 ---- default_W = get_config_int(0, "res", 800); + autoplace = get_config_int(0, "autoplace", 1); //default_W = def_W; scale = double(screen->w) / double(default_W); *************** *** 87,91 **** strcpy(check_char, "none"); backgr_forsearch = 0; ! if (backgr) { //BITMAP *b; --- 96,100 ---- strcpy(check_char, "none"); backgr_forsearch = 0; ! if (backgr && autoplace != 0) { //BITMAP *b; *************** *** 148,154 **** TWindow::~TWindow() { ! //if (originalscreen) destroy_bitmap(originalscreen); ! if (drawarea) destroy_bitmap(drawarea); ! if (backgr) destroy_bitmap(backgr); // of course ;) but it's worth checking again, since it's not required to call this, --- 157,176 ---- TWindow::~TWindow() { ! // remove this window item from the list of windows ! // also, delete other windows that are in the same list. ! if (prev) ! { ! prev->next = 0; // so that "prev" doesn't know "this" exists ! delete prev; ! } ! if (next) ! { ! next->prev = 0; // so that "next" doesn't know "this" exists ! delete next; ! } ! ! //if (originalscreen) del_bitmap(originalscreen); ! del_bitmap(&drawarea); ! del_bitmap(&backgr); // of course ;) but it's worth checking again, since it's not required to call this, *************** *** 156,160 **** doneinit(); ! if (backgr_forsearch) destroy_bitmap(backgr_forsearch); //if (datafile) unload_datafile(datafile); --- 178,182 ---- doneinit(); ! //del_bitmap(backgr_forsearch); //if (datafile) unload_datafile(datafile); *************** *** 167,174 **** b = button; button = button->next; ! button->prev = 0; // to avoid disaster as the next button is deleted... delete b; } } --- 189,198 ---- b = button; button = button->next; ! if (button) ! button->prev = 0; // to avoid disaster as the next button is deleted... delete b; } + } *************** *** 367,372 **** tmpbmp = load_bitmap(objname, 0); bmp = clone_bitmap(bpp, tmpbmp, scale, vidmem); ! if (tmpbmp) ! destroy_bitmap(tmpbmp); return bmp; --- 391,395 ---- tmpbmp = load_bitmap(objname, 0); bmp = clone_bitmap(bpp, tmpbmp, scale, vidmem); ! del_bitmap(&tmpbmp); return bmp; *************** *** 375,379 **** void TWindow::doneinit() { ! if (backgr_forsearch) destroy_bitmap(backgr_forsearch); //if (datafile) unload_datafile(datafile); } --- 398,402 ---- void TWindow::doneinit() { ! del_bitmap(&backgr_forsearch); //if (datafile) unload_datafile(datafile); } *************** *** 542,546 **** --- 565,572 ---- if (disabled) + { + grabbedmouse = false; // just to be sure, that if a window is "closed", its value is reset return; + } // mouse.bmp.restore(); // resets the mouse pointer. Index: twwindow.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twwindow.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twwindow.h 19 Dec 2003 08:52:54 -0000 1.4 --- twwindow.h 4 Jan 2004 22:07:00 -0000 1.5 *************** *** 23,26 **** --- 23,29 ---- #include "twbutton.h" + void del_bitmap(BITMAP **bmp); + + class EmptyButton; *************** *** 37,40 **** --- 40,48 ---- { public: + + int autoplace; + // true: then the auto-search is used to place a bitmap somewhere, and also + // there's always a check to see if this is needed; + // false: then the ini positions are used and neither checked nor updated. // managing a list of (related) windows Index: utils.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/utils.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** utils.cpp 13 Dec 2003 14:31:56 -0000 1.7 --- utils.cpp 4 Jan 2004 22:07:00 -0000 1.8 *************** *** 10,13 **** --- 10,14 ---- //#include "twgui.h" + #include "twwindow.h" normalmouse Tmouse; *************** *** 100,104 **** blit(convert, dest, 0, 0, 0, 0, W, H); ! destroy_bitmap(convert); --- 101,105 ---- blit(convert, dest, 0, 0, 0, 0, W, H); ! del_bitmap(&convert); *************** *** 112,116 **** { blit(dest, convert, 0, 0, 0, 0, W, H); ! // destroy_bitmap(dest); dest = convert; } --- 113,117 ---- { blit(dest, convert, 0, 0, 0, 0, W, H); ! del_bitmap(&dest); dest = convert; } |
From: <geo...@us...> - 2004-01-04 22:07:04
|
Update of /cvsroot/timewarp/source/sc3ships In directory sc8-pr-cvs1:/tmp/cvs-serv31200/sc3ships Modified Files: shpexqen.cpp Log Message: full-game source update Index: shpexqen.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpexqen.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpexqen.cpp 1 Nov 2003 13:24:26 -0000 1.4 --- shpexqen.cpp 4 Jan 2004 22:07:00 -0000 1.5 *************** *** 150,155 **** if (!(ship && ship->exists())) { ship = 0; ! return; } --- 150,156 ---- if (!(ship && ship->exists())) { + state = 0; // remove the weapon when the ship is destroyed. ship = 0; ! return; } |
From: <geo...@us...> - 2004-01-04 22:07:03
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1:/tmp/cvs-serv31200/other Modified Files: planet3d.cpp Log Message: full-game source update Index: planet3d.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/planet3d.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** planet3d.cpp 19 Dec 2003 23:33:35 -0000 1.13 --- planet3d.cpp 4 Jan 2004 22:07:00 -0000 1.14 *************** *** 439,442 **** --- 439,443 ---- int k = i + image_size/2; + if (k >= image_size) continue; jmin[k] = 100000; jmax[k] = 0; *************** *** 446,451 **** if ((i*i+j*j) < visual_size*visual_size) { ! int k = i + image_size/2; int m = j + image_size/2; if (m < jmin[k]) --- 447,453 ---- if ((i*i+j*j) < visual_size*visual_size) { ! //-int k = i + image_size/2; int m = j + image_size/2; + if (m >= image_size) continue; if (m < jmin[k]) *************** *** 631,638 **** --- 633,644 ---- int k = (i+image_size/2) * image_size + j + image_size/2; + if (k >= image_size*image_size) + k = image_size*image_size - 1; + int mx2, my2; mx2 = (int)base_map[k].lon; if (mx2 >= mapW) mx2 -= mapW; my2 = (int)base_map[k].lat; + if (my2 >= mapH) my2 -= mapH; base_map_linear[k] = mx2 + my2 * 2*mapW; // twice cause there's an extra copy *************** *** 697,701 **** rad += spin * (frame_time/1000.0); ! while (rad >= 360.0) rad-=360.0; } --- 703,708 ---- rad += spin * (frame_time/1000.0); ! while (rad >= 360 ) rad -= 360; ! while (rad < 0) rad += 360; // in case of anti-spin } *************** *** 716,719 **** --- 723,727 ---- double dl = mapW*rad/360.0; + while (dl >= mapW) dl -= mapW; unsigned int* imageptr = (unsigned int*) image32bit->dat; *************** *** 746,749 **** --- 754,758 ---- base_sorted += 2*jmin[i]; + for (j = jmin[i]; j <= jmax[i]; j++) { *************** *** 911,915 **** xor ah, ah mov edx, speccol ! mov al, byte ptr [edx] mul specshade add ax, bx --- 920,924 ---- xor ah, ah mov edx, speccol ! mov al, byte ptr [edx] // THIS CAN CRASH !! (dunno why) mul specshade add ax, bx |
From: <geo...@us...> - 2004-01-04 22:07:03
|
Update of /cvsroot/timewarp/source/gamex/stuff In directory sc8-pr-cvs1:/tmp/cvs-serv31200/gamex/stuff Modified Files: space_body.cpp space_body.h Log Message: full-game source update Index: space_body.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/stuff/space_body.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** space_body.cpp 22 Dec 2003 09:37:08 -0000 1.3 --- space_body.cpp 4 Jan 2004 22:07:00 -0000 1.4 *************** *** 1,2 **** --- 1,3 ---- + #include <string.h> #include "../../melee.h" *************** *** 132,136 **** image_size = bmp->w; ! double min_light = 0.3; double max_light = 1.0; --- 133,137 ---- image_size = bmp->w; ! double min_light = 0.5; double max_light = 1.0; *************** *** 305,312 **** MapObj *MapEditor::create_mapobj(Vector2 pos) { ! return new MapObj(0, pos, 0, Tedit->showspr()); } void MapEditor::calculate() { --- 306,363 ---- MapObj *MapEditor::create_mapobj(Vector2 pos) { ! return new MapObj(0, pos, 0, Tedit->tv->makespr()); ! } ! ! ! void MapEditor::replace() ! { ! int k; ! k = selection->starnum; ! ! objmap->sub[k]->type = Tedit->tv->isel; ! //delete selection-> ! selection->rem_sprite(); ! selection->set_sprite(Tedit->tv->makespr()); } + void MapEditor::add() + { + // just make a new selection + selection = create_mapobj(ptr->pos); + g->add(selection); + + moveselection = true; + + // also ... add it to the map ?? with default settings .. + selection->starnum = objmap->add(maplevel); // level 1 = stars + + int k; + k = selection->starnum; + objmap->sub[k]->type = Tedit->tv->isel; + //delete selection->get_sprite(); + selection->set_sprite(Tedit->tv->makespr()); + } + + void MapEditor::move() + { + selection->pos = ptr->pos; + staywithin(0, &(selection->pos), map_size); + + + int k; + k = selection->starnum; + objmap->sub[k]->position = selection->pos / scalepos; + + maphaschanged = true; + } + + void MapEditor::newselection() + { + selection = (MapObj*) ptr->selection; + g->maparea->flag.left_mouse_press = false; + } + + void MapEditor::calculate() { *************** *** 322,334 **** if (selection && moveselection) { ! selection->pos = ptr->pos; ! staywithin(0, &(selection->pos), map_size); ! ! ! int k; ! k = selection->starnum; ! objmap->sub[k]->position = selection->pos / scalepos; ! ! maphaschanged = true; } --- 373,377 ---- if (selection && moveselection) { ! move(); } *************** *** 356,362 **** ptr->selection && ptr->selection->id == MAPOBJ_ID) { ! selection = (MapObj*) ptr->selection; ! ! g->maparea->flag.left_mouse_press = false; } --- 399,403 ---- ptr->selection && ptr->selection->id == MAPOBJ_ID) { ! newselection(); } *************** *** 369,376 **** if (selection) { ! int k; ! k = selection->starnum; ! objmap->sub[k]->type = Tedit->isel; ! selection->set_sprite(Tedit->showspr()); } } --- 410,414 ---- if (selection) { ! replace(); } } *************** *** 378,394 **** if (bnew->flag.left_mouse_press && !moveselection) { ! // just make a new selection ! selection = create_mapobj(ptr->pos); ! g->add(selection); ! ! moveselection = true; ! ! // also ... add it to the map ?? with default settings .. ! selection->starnum = objmap->add(maplevel); // level 1 = stars ! ! int k; ! k = selection->starnum; ! objmap->sub[k]->type = Tedit->isel; ! selection->set_sprite(Tedit->showspr()); } --- 416,420 ---- if (bnew->flag.left_mouse_press && !moveselection) { ! add(); } *************** *** 398,443 **** ! IconTV::IconTV(char *ident, int xcenter, int ycenter, BITMAP *outputscreen) : ! Popup(ident, xcenter, ycenter, outputscreen) { ! tv = new Area(this, "plot_"); ! bdec = new Button(this, "dec_"); ! binc = new Button(this, "inc_"); - sprlist = 0; N = 0; isel = 0; - } ! IconTV::~IconTV() ! { ! } ! void IconTV::setsprites(SpaceSprite **asprlist, int aN) { ! sprlist = asprlist; ! N = aN; - isel = 0; - - tv->changebackgr(sprlist[0]->get_bitmap(0)); } ! ! void IconTV::calculate() { ! if (disabled) ! return; ! ! Popup::calculate(); ! if (bdec->flag.left_mouse_press || binc->flag.left_mouse_press) { ! if (binc->flag.left_mouse_press) ++isel; ! if (bdec->flag.left_mouse_press) --isel; --- 424,471 ---- ! ! ! ! TVarea::TVarea(TWindow *menu, char *identbranch, int asciicode, bool akeepkey) : ! Area(menu, identbranch, asciicode, akeepkey) { ! // char tmp[512]; ! ! // strcpy(tmp, identbranch); ! // strcat(tmp, "dec_"); ! // bdec = new Button(menu, tmp); ! // strcpy(tmp, identbranch); ! // strcat(tmp, "inc_"); ! // binc = new Button(menu, tmp); N = 0; isel = 0; ! blist = 0; + f = 1.0; + } ! TVarea::~TVarea() { ! if (blist) ! delete blist; } ! void TVarea::calculate() { ! Area::calculate(); ! //if (bdec->flag.left_mouse_press || binc->flag.left_mouse_press) ! if (flag.left_mouse_press || flag.right_mouse_press) { ! //if (binc->flag.left_mouse_press) ! if (flag.left_mouse_press) ++isel; ! //if (bdec->flag.left_mouse_press) ! if (flag.right_mouse_press) --isel; *************** *** 448,461 **** isel = 0; ! tv->changebackgr(sprlist[isel]->get_bitmap(0)); } } ! SpaceSprite *IconTV::showspr() { ! return sprlist[isel]; } --- 476,584 ---- isel = 0; ! //changebackgr(blist[isel]); ! overwritebackgr(blist[isel], f, makecol(0,0,0)); } } ! void TVarea::newlist(int aN) { ! if (blist) ! delete blist; ! ! N = aN; ! blist = new BITMAP* [N]; } + void TVarea::initnewlist() + { + // check the common scaling factor ... cause the biggest bitmap should + // still fit in the window ... + f = 1.0; + int i; + for ( i = 0; i < N; ++i ) + { + double x; + + x = double(backgr->w) / double(blist[i]->w); + if (x < f) + f = x; + + x = double(backgr->h) / double(blist[i]->h); + if (x < f) + f = x; + } + + set_sel(0); + } + + void TVarea::set(BITMAP **list, int aN) + { + newlist(aN); + + int i; + for ( i = 0; i < N; ++i ) + blist[i] = list[i]; + + initnewlist(); + } + + void TVarea::set(SpaceSprite **list, int aN) + { + newlist(aN); + + int i; + for ( i = 0; i < N; ++i ) + blist[i] = list[i]->get_bitmap(0); + + initnewlist(); + } + + void TVarea::set_sel(int newsel) + { + if (!(newsel >= 0 && newsel < N)) + return; + + isel = newsel; + overwritebackgr(blist[isel], f, makecol(0,0,0)); + } + + + BITMAP *TVarea::show() + { + return blist[isel]; + } + + + SpaceSprite *TVarea::makespr() + { + return new SpaceSprite(blist[isel]); + } + + + + IconTV::IconTV(char *ident, int xcenter, int ycenter, BITMAP *outputscreen) + : + Popup(ident, xcenter, ycenter, outputscreen) + { + tv = new TVarea(this, "plot_"); + } + + IconTV::~IconTV() + { + } + + + + void IconTV::calculate() + { + if (disabled) + return; + + Popup::calculate(); + + } + + *************** *** 492,495 **** --- 615,624 ---- + void MapObj::rem_sprite() + { + // removes the sprite that was assigned to it + delete sprite; + } + *************** *** 502,505 **** --- 631,638 ---- MapObj(creator, opos, oangle, osprite) { + // copy the original sprite, cause it's going to be altered. + sprite = 0; + set_sprite(osprite); + layer = LAYER_SHOTS; *************** *** 514,521 **** sunpos = osunpos; - // copy the original sprite, cause it's going to be altered. - sprite = 0; - set_sprite(osprite); - //id = ID_SOLAR_BODY; starnum = bodynum; --- 647,650 ---- *************** *** 529,533 **** SolarBody::~SolarBody() { ! if (sprite) delete sprite; } --- 658,662 ---- SolarBody::~SolarBody() { ! if (sprite) // delete internal copy delete sprite; } *************** *** 552,556 **** { if (sprite) ! delete sprite; origsprite = new_sprite; --- 681,685 ---- { if (sprite) ! delete sprite; // delete the internal copy origsprite = new_sprite; *************** *** 559,562 **** --- 688,699 ---- drawshadow(); + } + + + void SolarBody::rem_sprite() + { + // removes the sprite that was assigned to it ... and + // that's the one pointed to by origsprite + delete origsprite; } Index: space_body.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/stuff/space_body.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** space_body.h 19 Dec 2003 08:52:54 -0000 1.2 --- space_body.h 4 Jan 2004 22:07:00 -0000 1.3 *************** *** 15,37 **** ! class IconTV : public Popup { ! SpaceSprite **sprlist; int N; - Area *tv; Button *bdec, *binc; ! public: ! int isel; ! IconTV(char *ident, int xcenter, int ycenter, BITMAP *outputscreen); ! virtual ~IconTV(); virtual void calculate(); - void setsprites(SpaceSprite **asprlist, int aN); ! SpaceSprite *showspr(); }; --- 15,53 ---- ! class TVarea : public Area { ! public: ! BITMAP **blist; int N; + int isel; + double f; Button *bdec, *binc; ! void set(BITMAP **list, int aN); ! void set(SpaceSprite **list, int aN); ! BITMAP *show(); ! SpaceSprite *makespr(); ! void newlist(int aN); ! void initnewlist(); ! void set_sel(int newsel); ! ! TVarea(TWindow *menu, char *identbranch, int asciicode = 0, bool akeepkey = 0); ! virtual ~TVarea(); virtual void calculate(); + }; ! class IconTV : public Popup ! { ! public: ! TVarea *tv; ! ! IconTV(char *ident, int xcenter, int ycenter, BITMAP *outputscreen); ! virtual ~IconTV(); ! ! virtual void calculate(); }; *************** *** 51,54 **** --- 67,72 ---- virtual void animate(Frame *f); virtual void calculate(); + + virtual void rem_sprite(); }; *************** *** 59,63 **** { protected: - MapObj *selection;//*lastselection, GameBare *g; --- 77,80 ---- *************** *** 76,79 **** --- 93,98 ---- public: + MapObj *selection; + bool maphaschanged; *************** *** 82,85 **** --- 101,108 ---- virtual void calculate(); + virtual void newselection(); + virtual void replace(); + virtual void add(); + virtual void move(); void set_game(GameBare *agame, MousePtr *aptr); *************** *** 118,121 **** --- 141,145 ---- virtual void set_sprite ( SpaceSprite *sprite ); + virtual void rem_sprite(); void drawshadow(); }; |
From: <geo...@us...> - 2004-01-04 22:07:03
|
Update of /cvsroot/timewarp/source/gamex/edit In directory sc8-pr-cvs1:/tmp/cvs-serv31200/gamex/edit Modified Files: edit_dialogue.cpp edit_dialogue.h Log Message: full-game source update Index: edit_dialogue.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/edit_dialogue.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** edit_dialogue.cpp 14 Dec 2003 22:19:56 -0000 1.4 --- edit_dialogue.cpp 4 Jan 2004 22:07:00 -0000 1.5 *************** *** 12,15 **** --- 12,18 ---- + + static int current_dialog_version = 0; + // create a dialogue structure *************** *** 19,26 **** --- 22,32 ---- Ntriggers = 0; mother = 0; + id[0] = 0; } Dialo::~Dialo() { + // if you delete this thing, you also need to delete all the nodes following it. + discard_branches(); } *************** *** 47,50 **** --- 53,63 ---- fs->read(&version); + // depending on the version, you can tweak the stuff below, in case you're + // dealing with an important old dialog ... + if (version != current_dialog_version) + { + tw_error("version conversion is not yet supported"); + } + fs->read(&state); *************** *** 57,60 **** --- 70,75 ---- fs->initstring(racepic, sizeof(racepic)); + fs->initstring(id, sizeof(id)); + // also, read all the branches. int i; *************** *** 70,73 **** --- 85,90 ---- void Dialo::write(FileStore *fs) { + // write the new version. + version = current_dialog_version; fs->write(version); *************** *** 82,85 **** --- 99,104 ---- fs->writestring(racepic); + fs->writestring(id); + // also, write all the branches. int i; *************** *** 117,120 **** --- 136,140 ---- + // remove a branch, and all the branches following it... void Dialo::rembranch(int index) { *************** *** 138,143 **** ! Dialo dialo; --- 158,173 ---- + // discards all subnodes. + void Dialo::discard_branches() + { + int i; + for (i = 0; i < Nbranches; ++i) + { + delete branch[i]; + } + } + ! //Dialo dialo; *************** *** 149,165 **** void GameDialogue::init() { int i; scare_mouse(); GameBare::init(); ! double H = 2000; ! size = Vector2(H, H); prepare(); - // find somewhere a list of all the available race-dialogue bitmaps --- 179,235 ---- + void GameDialogue::init_dialog(char *fname) + { + if (fs) + delete fs; + + fs = new FileStore(fname); + + if (firstdialo) + delete firstdialo; + + firstdialo = new Dialo(); + + firstdialo->read(fs); + + dialo = firstdialo; + + // initialize the interface so that you can edit and navigate the dialog tree + initeditor(dialo); + } + + + void GameDialogue::save_dialog() + { + fs->seek(0); // you've to rewind the file first ... + firstdialo->write(fs); + } + + void GameDialogue::init() { + fs = 0; + dialo = 0; + firstdialo = 0; + int i; + if (!window) { + window = new VideoWindow(); + window->preinit(); + } + change_view("Hero"); + + wininfo.init( Vector2(800,800), 800.0, view->frame ); + wininfo.zoomlimit(size.x); + wininfo.scaletowidth(size.x); // zoom out to this width. + scare_mouse(); GameBare::init(); ! size = Vector2(100,100); prepare(); // find somewhere a list of all the available race-dialogue bitmaps *************** *** 188,201 **** Blist[i] = new char [32]; - // initialize dialogue data: - // question - - firstdialo = new Dialo(); - - fs = new FileStore("gamex/dialogue/test.dialogue2"); - firstdialo->read(fs); - - dialo = firstdialo; - // initialize menu system. --- 258,261 ---- *************** *** 219,227 **** - - - - - --- 279,282 ---- *************** *** 229,234 **** int tcol = makecol(255,255,128); ! //strcpy(Qtext, "a\n b\n c\n d\n e\n f\n g\n h\n i"); ! Tedit = new TextEditBox(T, "text/", usefont, dialo->T, 256); Tedit->set_textcolor(tcol); --- 284,288 ---- int tcol = makecol(255,255,128); ! Tedit = new TextEditBox(T, "text/", usefont, 0, 0); Tedit->set_textcolor(tcol); *************** *** 237,247 **** ! refresh = new Button(T, "refresh_", 0); Bplus = new Button(T, "addbranch_", 0); - // Bmin = new Button(R, "Bmin", 0); bprev = new Button(T, "prevbranch_", 0); - // bnext = new Button(R, "next", 0); dialostatus = new SwitchButton(T, "state_", 0); --- 291,301 ---- ! bload = new Button(T, "load_", 0); ! ! bsave = new Button(T, "save_", 0); Bplus = new Button(T, "addbranch_", 0); bprev = new Button(T, "prevbranch_", 0); dialostatus = new SwitchButton(T, "state_", 0); *************** *** 250,270 **** raceselect = new TextButton(T, "race_", usefont); - raceselect->set_text(dialo->racepic, makecol(255,255,0)); raceselect->passive = false; popupraceselect = new PopupList(raceselect, "gamex/interface/dialogeditor/raceselect", "text/", -20, -20, usefont, 0); popupraceselect->tbl->set_optionlist(racepiclist, Nracepiclist, makecol(255,255,128)); popupraceselect->hide(); ! //popupraceselect->setscreen(T->drawarea); - // winman = new WindowManager; - // winman->add(R); T->add(popupraceselect); T->tree_doneinit(); ! initeditor(dialo); // no need for tic-info. --- 304,339 ---- raceselect = new TextButton(T, "race_", usefont); raceselect->passive = false; + nodeid = new TextEditBox(T, "nodeid_", usefont, 0, 0); + nodeid->set_textcolor(tcol); + popupraceselect = new PopupList(raceselect, "gamex/interface/dialogeditor/raceselect", "text/", -20, -20, usefont, 0); popupraceselect->tbl->set_optionlist(racepiclist, Nracepiclist, makecol(255,255,128)); popupraceselect->hide(); ! ! fb = new FileBrowser(bload, "gamex/interface/filebrowser", 0, 0, usefont); ! fb->tbl->text_color = makecol(255,255,0); ! fb->set_dir("gamex/gamedata/races"); ! fb->set_ext("dialog"); T->add(popupraceselect); + T->add(fb); T->tree_doneinit(); ! ! // initialize dialogue data ! ! char fname[128]; ! strcpy(fname, "gamex/gamedata/races/"); ! strcat(fname, "earthling"); // the race name ! strcat(fname, "/"); ! strcat(fname, "test.dialog"); // the dialog name ! ! init_dialog(fname); ! // no need for tic-info. *************** *** 275,283 **** void GameDialogue::quit() { ! // update the changes in memory ! fs->seek(0); // you've to rewind the file first ... ! dialo->write(fs); ! delete fs; int i; --- 344,355 ---- void GameDialogue::quit() { ! // disable auto-save ? Cause you got a save-button for that... ! // save_dialog(); ! if (fs) ! delete fs; ! ! if (firstdialo) ! delete firstdialo; int i; *************** *** 293,299 **** set_mouse_sprite(0); // the default mouse sprite. show_mouse(screen); // ???????? - //show_mouse(); - GameBare::quit(); } --- 365,370 ---- set_mouse_sprite(0); // the default mouse sprite. show_mouse(screen); // ???????? + GameBare::quit(); } *************** *** 310,314 **** for ( i = 0; i < dialo->Nbranches; ++i ) { - //d.read(dialo.branch[i], &dstore); d = dialo->branch[i]; --- 381,384 ---- *************** *** 325,331 **** dialostatus->state = dialo->state; ! Tedit->text_reset(dialo->T); raceselect->set_text(dialo->racepic, makecol(255,255,0)); } --- 395,403 ---- dialostatus->state = dialo->state; ! Tedit->text_reset(dialo->T, Ntext); raceselect->set_text(dialo->racepic, makecol(255,255,0)); + + nodeid->text_reset(dialo->id, sizeof(dialo->id)); } *************** *** 336,358 **** return; ! GameBare::calculate(); ! ! ! //FULL_REDRAW = true; ! //R->tree_calculate(); ! ! ! /* ! // well... save the dialogue when needed (not to disk, but in memory). ! ! if (refresh->flag.left_mouse_press) ! { ! //dialo.write(); ! dialo.refresh(&dstore); ! ! initeditor(dialo); ! } ! */ --- 408,414 ---- return; ! wininfo.center(0.5*size); ! GameBare::calculate(); *************** *** 361,365 **** if (Bplus->flag.left_mouse_press) { - //dialo.write(&dstore); Dialo *d = new Dialo(); --- 417,420 ---- *************** *** 373,377 **** strcpy(d->racepic, dialo->racepic); // inherit info // well, this creates a new dialogue thingy :) - //d.write(&dstore); dialo->addbranch(d); --- 428,431 ---- *************** *** 391,399 **** // load the data from the mother branch (if it's has a mother). if (dialo->mother) ! { ! //dialo->write(&dstore); ! ! //dialo->read(dialo.mother, &dstore); ! dialo = dialo->mother; initeditor(dialo); --- 445,449 ---- // load the data from the mother branch (if it's has a mother). if (dialo->mother) ! { dialo = dialo->mother; initeditor(dialo); *************** *** 405,409 **** // go forth to the currently selected branch - //if (bnext->flag.left_mouse_press) if (Tlist->flag.left_mouse_press) { --- 455,458 ---- *************** *** 415,425 **** if (i >= 0 && i < dialo->Nbranches) // shouldn't be necessary ?! { - // write the current data. - //dialo.write(&dstore); - dialo = dialo->branch[i]; - - //dialo.read(k, &dstore); - initeditor(dialo); } --- 464,468 ---- *************** *** 447,450 **** --- 490,505 ---- + // check if a new file is selected + // then you load a existing file ... + if (fb->ready()) + { + init_dialog(fb->fname); + } + + if (bsave->flag.left_mouse_press) + { + save_dialog(); + } + } *************** *** 456,466 **** GameBare::animate(frame); - - - //show_mouse(frame->surface); - //T->tree_setscreen(view->frame->surface); - //T->tree_animate(); - //show_mouse(view->frame->surface); - //scare_mouse(); } --- 511,514 ---- Index: edit_dialogue.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/edit/edit_dialogue.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit_dialogue.h 14 Dec 2003 22:19:56 -0000 1.3 --- edit_dialogue.h 4 Jan 2004 22:07:00 -0000 1.4 *************** *** 43,46 **** --- 43,48 ---- char T[Ntext]; // text + char id[64]; + // text can also activate triggers ... but that's not supported yet ... *************** *** 54,57 **** --- 56,61 ---- Dialo *branch[maxbranches]; Dialo *mother; // the mother + + void discard_branches(); }; *************** *** 67,70 **** --- 71,76 ---- char *Blist[maxbranches]; + FileBrowser *fb; + virtual void init(); virtual void quit(); *************** *** 77,80 **** --- 83,88 ---- void initeditor(Dialo *dialo); + void init_dialog(char *fname); + void save_dialog(); int Nracepiclist; *************** *** 82,89 **** ! TextEditBox *Tedit; TextList *Tlist; ! Button *refresh, *Bplus, *bprev; SwitchButton *dialostatus; --- 90,97 ---- ! TextEditBox *Tedit, *nodeid; TextList *Tlist; ! Button *bload, *bsave, *Bplus, *bprev; SwitchButton *dialostatus; |
From: <geo...@us...> - 2004-01-04 22:07:03
|
Update of /cvsroot/timewarp/source/gamex/general In directory sc8-pr-cvs1:/tmp/cvs-serv31200/gamex/general Modified Files: sprites.cpp sprites.h Log Message: full-game source update Index: sprites.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/general/sprites.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sprites.cpp 19 Nov 2003 23:51:45 -0000 1.2 --- sprites.cpp 4 Jan 2004 22:07:00 -0000 1.3 *************** *** 13,16 **** --- 13,107 ---- + void scale_bitmap32(BITMAP **bmp, double a) + { + int w, h; + + w = int((*bmp)->w * a + 0.5); + h = int((*bmp)->h * a + 0.5); + + if (w == 0) w = 1; + if (h == 0) h = 1; + + BITMAP *tmp; + tmp = create_bitmap_ex(32, w, h); + + stretch_blit(*bmp, tmp, 0, 0, (*bmp)->w, (*bmp)->h, 0, 0, w, h); + + destroy_bitmap(*bmp); + *bmp = tmp; + } + + + + void load_bitmap32(BITMAP **bmp, char *fname) + { + *bmp = load_bitmap(fname, 0); + + // map_bmp should have 32 bit depth, because colors are assumed to come from + // a 32 bpp depth image. Loading from disk is sometimes (or often) 24 bit. + BITMAP *tmp; + tmp = create_bitmap_ex(32, (*bmp)->w, (*bmp)->h); + clear_to_color(tmp, makecol32(255,0,255)); + blit(*bmp, tmp, 0, 0, 0, 0, tmp->w, tmp->h); + destroy_bitmap(*bmp); + *bmp = tmp; + } + + + + + + void balance(double *r, double *g, double *b) + { + double max; + max = *r; + if (*g > max) + max = *g; + if (*b > max) + max = *b; + + *r /= max; + *g /= max; + *b /= max; + } + + + void avcolor(BITMAP *bmp, double *r, double *g, double *b) + { + *r = 0; + *g = 0; + *b = 0; + int N = 0; + + int ix, iy; + + for ( iy = 0; iy < bmp->h; ++iy) + { + for ( ix = 0; ix < bmp->w; ++ix) + { + + int col, rr, gg, bb; + + col = getpixel(bmp, ix, iy); + rr = getr32(col); + gg = getg32(col); + bb = getb32(col); + + if (rr != 255 || gg != 0 || bb != 255) + { + *r += rr; + *g += gg; + *b += bb; + ++N; + } + + } + } + + *r /= (255 * N); + *g /= (255 * N); + *b /= (255 * N); + } + void colorize(SpaceSprite *spr, double mr, double mg, double mb) *************** *** 39,42 **** --- 130,137 ---- g *= mg; b *= mb; + + if (r > 255) r = 255; + if (g > 255) g = 255; + if (b > 255) b = 255; col = makecol32(r,g,b); *************** *** 46,49 **** --- 141,179 ---- } + } + + + void brighten(SpaceSprite *spr) + { + BITMAP *bmp; + + bmp = spr->get_bitmap(0); + + int ix, iy; + + int max = 0; + + for ( iy = 0; iy < bmp->h; ++iy) + { + for ( ix = 0; ix < bmp->w; ++ix) + { + + int col, r, g, b; + + col = getpixel(bmp, ix, iy); + r = getr32(col); + g = getg32(col); + b = getb32(col); + + if (r > max) max = r; + if (g > max) max = g; + if (b > max) max = b; + } + } + + double scale; + scale = double(255) / double(max); + + colorize(spr, scale, scale, scale); } Index: sprites.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/general/sprites.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sprites.h 19 Nov 2003 23:51:45 -0000 1.2 --- sprites.h 4 Jan 2004 22:07:00 -0000 1.3 *************** *** 4,7 **** --- 4,14 ---- void colorize(SpaceSprite *spr, double mr, double mg, double mb); + void brighten(SpaceSprite *spr); + + void balance(double *r, double *g, double *b); + + + void avcolor(BITMAP *bmp, double *r, double *g, double *b); + void load_bitmaps(BITMAP **bmp, char *dirname, char *filename, int N); *************** *** 9,12 **** --- 16,24 ---- void replace_color(BITMAP *bmp, int col1, int col2); + + void load_bitmap32(BITMAP **bmp, char *fname); + + void scale_bitmap32(BITMAP **bmp, double a); + |
From: <geo...@us...> - 2004-01-04 22:07:02
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1:/tmp/cvs-serv31200 Modified Files: scp.cpp Log Message: full-game source update Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** scp.cpp 11 Dec 2003 23:26:23 -0000 1.29 --- scp.cpp 4 Jan 2004 22:06:59 -0000 1.30 *************** *** 613,616 **** --- 613,623 ---- meleedata.init(); + ///* + disable(); + play_fg(&scp, SCPGUI_MUSIC); + enable(); + showTitle(); + //*/ + int mainRet; do { *************** *** 638,649 **** showTitle(); break; ! // /* ! case MAIN_DIALOG_FG: // for future use (Rob) disable(); play_fg(&scp, SCPGUI_MUSIC); enable(); break; - // */ } } while((mainRet != MAIN_DIALOG_EXIT) && (mainRet != -1)); --- 645,655 ---- showTitle(); break; ! case MAIN_DIALOG_FG: disable(); play_fg(&scp, SCPGUI_MUSIC); enable(); + showTitle(); break; } } while((mainRet != MAIN_DIALOG_EXIT) && (mainRet != -1)); |
From: <geo...@us...> - 2004-01-04 13:09:33
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1:/tmp/cvs-serv26694 Modified Files: shpleimu.cpp shpmekpi.cpp shpyurpa.cpp Log Message: ship tweak Index: shpleimu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpleimu.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpleimu.cpp 20 Oct 2003 11:00:44 -0000 1.5 --- shpleimu.cpp 4 Jan 2004 13:09:30 -0000 1.6 *************** *** 21,24 **** --- 21,27 ---- virtual int activate_weapon(); virtual int activate_special(); + + void engage_forward(double dweight); + void engage_backward(double dweight); }; *************** *** 46,54 **** ! int LeiMule::activate_weapon() ! { ! STACKTRACE ! ! Vector2 P0; double A0, R0, Aweapon; --- 49,54 ---- ! void LeiMule::engage_forward(double dweight) ! { Vector2 P0; double A0, R0, Aweapon; *************** *** 80,97 **** aoffs = -i * Aweapon; ! add(new Shot(this, rpos, angle + aoffs, ! weaponVelocity, weaponDamage, weaponRange, weaponArmour, ! this, data->spriteWeapon, 0.0)); } - - return TRUE; } ! int LeiMule::activate_special() { - STACKTRACE - - Vector2 P0; double A0, R0, Aweapon; --- 80,95 ---- aoffs = -i * Aweapon; ! Shot *s; ! s = new Shot(this, rpos, angle + aoffs, ! weaponVelocity, weaponDamage * dweight, weaponRange, weaponArmour, ! this, data->spriteWeapon, 0.0); ! s->isblockingweapons = true; ! add(s); } } ! void LeiMule::engage_backward(double dweight) { Vector2 P0; double A0, R0, Aweapon; *************** *** 123,130 **** aoffs = -i * Aweapon + PI; ! add(new Shot(this, rpos, angle + aoffs, ! specialVelocity, specialDamage, specialRange, specialArmour, ! this, data->spriteSpecial, 0.0)); } return TRUE; --- 121,156 ---- aoffs = -i * Aweapon + PI; ! Shot *s; ! s = new Shot(this, rpos, angle + aoffs, ! specialVelocity, specialDamage * dweight, specialRange, specialArmour, ! this, data->spriteSpecial, 0.0); ! s->isblockingweapons = true; ! add(s); } + } + + int LeiMule::activate_weapon() + { + STACKTRACE; + + engage_forward(1); + + engage_backward(1); + + return TRUE; + } + + + int LeiMule::activate_special() + { + STACKTRACE; + + // do something else, but what + // fire a dummy shot to confuse/irritate the enemy; this costs no energy. + + engage_forward(0); + + engage_backward(0); + return TRUE; Index: shpmekpi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpmekpi.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpmekpi.cpp 26 Oct 2003 10:43:17 -0000 1.9 --- shpmekpi.cpp 4 Jan 2004 13:09:30 -0000 1.10 *************** *** 16,24 **** double specialTurnperiod, specialDamage, specialDamageperiod; ! MeknikChainsaw* saw[2]; ! double sawangle[2]; public: MeknikPincer(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code); void getinformed(int itype, SpaceLocation *other); --- 16,26 ---- double specialTurnperiod, specialDamage, specialDamageperiod; ! int Nsaws; ! MeknikChainsaw **saw; ! double sawangle, *sawrefangle; public: MeknikPincer(Vector2 opos, double shipAngle, ShipData *shipData, unsigned int code); + virtual ~MeknikPincer(); void getinformed(int itype, SpaceLocation *other); *************** *** 41,45 **** class MeknikChainsaw : public SpaceObject { ! double turnperiod, damage, damageperiod, dist; double lifetime, sawtime, inflict_time; MeknikPincer *refship; --- 43,47 ---- class MeknikChainsaw : public SpaceObject { ! double damage, damageperiod, dist, maxdist; double lifetime, sawtime, inflict_time; MeknikPincer *refship; *************** *** 47,51 **** public: MeknikChainsaw(MeknikPincer *oship, double odist, double a, ! double turnperiod, double damage, double damageperiod, SpaceSprite *ospr); --- 49,53 ---- public: MeknikChainsaw(MeknikPincer *oship, double odist, double a, ! double damage, double damageperiod, SpaceSprite *ospr); *************** *** 93,103 **** specialDamageperiod = get_config_float("Special", "Damageperiod", 1.0); ! saw[0] = 0; ! saw[1] = 0; ! sawangle[0] = 0; ! sawangle[1] = 0; } --- 95,116 ---- specialDamageperiod = get_config_float("Special", "Damageperiod", 1.0); ! Nsaws = 3; ! saw = new MeknikChainsaw* [Nsaws]; ! sawrefangle = new double [Nsaws]; ! int i; ! for ( i = 0; i < Nsaws; ++i ) ! { ! saw[i] = 0; ! sawrefangle[i] = i * PI2 / Nsaws; ! } ! sawangle = 0.0; } + MeknikPincer::~MeknikPincer() + { + delete saw; + delete sawrefangle; + } *************** *** 113,117 **** this, data->spriteWeapon)); ! vel += rockVelocity * unit_vector(angle); } } --- 126,131 ---- this, data->spriteWeapon)); ! if (vel.length() < speed_max) ! vel += rockVelocity * unit_vector(angle); } } *************** *** 155,176 **** STACKTRACE // for re-activation, require minimum batt. ! if (!saw[0] || !saw[1]) if (batt < 4) return FALSE; int i; ! for ( i = 0; i < 2; ++i ) { int d; ! if ( i == 0 ) ! d = 1; ! else ! d = -1; if (!saw[i]) { ! saw[i] = new MeknikChainsaw(this, 60.0, sawangle[i], ! specialTurnperiod * d, specialDamage, specialDamageperiod, data->spriteSpecial); add(saw[i]); --- 169,191 ---- STACKTRACE // for re-activation, require minimum batt. ! if (!saw[0]) if (batt < 4) return FALSE; int i; ! for ( i = 0; i < Nsaws; ++i ) { int d; ! //if ( i == 0 ) ! // d = 1; ! //else ! // d = -1; ! d = 1; // same direction. if (!saw[i]) { ! saw[i] = new MeknikChainsaw(this, 60.0, sawangle + sawrefangle[i], ! specialDamage, specialDamageperiod, data->spriteSpecial); add(saw[i]); *************** *** 184,196 **** void MeknikPincer::calculate() { ! STACKTRACE int i; ! for ( i = 0; i < 2; ++i ) { if ( !(saw[i] && saw[i]->exists()) ) saw[i] = 0; else ! sawangle[i] = saw[i]->angle; } --- 199,224 ---- void MeknikPincer::calculate() { ! STACKTRACE; int i; ! for ( i = 0; i < Nsaws; ++i ) { if ( !(saw[i] && saw[i]->exists()) ) saw[i] = 0; else ! saw[i]->angle = sawangle + sawrefangle[i]; ! } ! ! for ( i = 0; i < Nsaws; ++i ) ! if (saw[i]) ! break; ! ! if (i < Nsaws) // if there's a saw alive, increase angle. ! { ! sawangle += PI2 * frame_time*1E-3 / specialTurnperiod; ! if (angle > PI) ! angle -= PI2; ! if (angle < -PI) ! angle += PI2; } *************** *** 201,205 **** int MeknikPincer::handle_damage(SpaceLocation* source, double normal, double direct) { ! STACKTRACE /* if (source->isAsteroid()) --- 229,233 ---- int MeknikPincer::handle_damage(SpaceLocation* source, double normal, double direct) { ! STACKTRACE; /* if (source->isAsteroid()) *************** *** 219,223 **** MeknikChainsaw::MeknikChainsaw(MeknikPincer *oship, double odist, double a, ! double oturnperiod, double odamage, double odamageperiod, SpaceSprite *ospr) : --- 247,251 ---- MeknikChainsaw::MeknikChainsaw(MeknikPincer *oship, double odist, double a, ! double odamage, double odamageperiod, SpaceSprite *ospr) : *************** *** 225,232 **** { refship = oship; ! turnperiod = oturnperiod; damage = odamage; damageperiod = odamageperiod; ! dist = odist; angle = a; --- 253,263 ---- { refship = oship; ! //turnperiod = oturnperiod; damage = odamage; damageperiod = odamageperiod; ! ! maxdist = odist; ! dist = 0.5 * maxdist; ! angle = a; *************** *** 238,241 **** --- 269,274 ---- layer = LAYER_SPECIAL; + set_depth(DEPTH_SHIPS - 0.1); + isblockingweapons = true; } *************** *** 280,283 **** --- 313,317 ---- } + /* angle += PI2 * dt / turnperiod; if (angle > PI) *************** *** 285,292 **** --- 319,332 ---- if (angle < -PI) angle += PI2; + */ sprite_index = get_index(angle) + i*64; //sprite_index = i * 64; i = sprite->frames(); + + if (dist < maxdist) + dist += 0.5 * maxdist * dt; // it takes 1 second to appear fully. + else + dist = maxdist; pos = refship->pos + dist * unit_vector(angle+PI/2); Index: shpyurpa.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpyurpa.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpyurpa.cpp 20 Oct 2003 11:01:06 -0000 1.10 --- shpyurpa.cpp 4 Jan 2004 13:09:30 -0000 1.11 *************** *** 13,53 **** class YuryulMissile : public HomingMissile { ! public: ! YuryulMissile(YuryulPatriot* ocreator, double ox, double oy, double oangle, double ov, ! int odamage, double orange, int oarmour, double oturnrate, SpaceLocation* opos, SpaceSprite* osprite, SpaceObject* otarget); Ship* creator; ! int lifetimeTimer; double relativity; double facingAngle; double framesToIgnition; ! int isActivated; int burnFrames1; ! int burnFrames2; int coastFrames; double acceleration; ! int wasCoasting; ! int thrustOn; ! double coastVelocity; ! double burnVelocity1; ! double burnVelocity2; ! void thrust_on(void); virtual void calculate(void); ! virtual void inflict_damage(SpaceObject *other); ! }; class YuryulRam : public Missile { public: ! YuryulPatriot* creator; ! Vector2 relativePosition; ! double angleOffset; ! int RamNumber; ! int decayFrames; ! int decayAmount; ! int decayCount; ! YuryulRam(YuryulPatriot* creator, Vector2 relativePosition, ! double oangle, double angleOffset, ! double ov, double odamage, double orange, double oarmour); ! ~YuryulRam(); ! virtual void calculate(void); }; --- 13,53 ---- class YuryulMissile : public HomingMissile { ! public: ! YuryulMissile(YuryulPatriot* ocreator, double ox, double oy, double oangle, double ov, ! int odamage, double orange, int oarmour, double oturnrate, SpaceLocation* opos, SpaceSprite* osprite, SpaceObject* otarget); Ship* creator; ! int lifetimeTimer; double relativity; double facingAngle; double framesToIgnition; ! int isActivated; int burnFrames1; ! int burnFrames2; int coastFrames; double acceleration; ! int wasCoasting; ! int thrustOn; ! double coastVelocity; ! double burnVelocity1; ! double burnVelocity2; ! void thrust_on(void); virtual void calculate(void); ! virtual void inflict_damage(SpaceObject *other); ! }; class YuryulRam : public Missile { public: ! YuryulPatriot* creator; ! Vector2 relativePosition; ! double angleOffset; ! int RamNumber; ! int decayFrames; ! int decayAmount; ! int decayCount; ! YuryulRam(YuryulPatriot* creator, Vector2 relativePosition, ! double oangle, double angleOffset, ! double ov, double odamage, double orange, double oarmour); ! ~YuryulRam(); ! virtual void calculate(void); }; *************** *** 55,135 **** class YuryulPatriot : public Ship { public: ! double shipTurnAccelRate; ! double shipTurnSpeedMax; ! ! double weaponRange; ! double weaponVelocity; ! int weaponDamage; ! int weaponArmour; ! double weaponRelativity; ! ! int specialDamage; ! int specialArmour; ! double specialReleaseAngle; ! double specialReleaseAngleRad; ! int specialDecayFrames; ! ! double thrustRange; ! double thrustVelocity; ! int thrustDamage; ! int thrustArmour; ! double thrustRelativity; ! ! //int gunToFire; ! ! public: ! ! YuryulRam* Ram1; ! YuryulRam* Ram2; ! ! YuryulPatriot(Vector2 opos, double angle, ShipData *data, unsigned int code); ! ! protected: ! ~YuryulPatriot(); ! virtual void calculate(); ! virtual int activate_weapon(); ! virtual int activate_special(); ! virtual void death(); ! virtual void calculate_turn_left(); ! virtual void calculate_turn_right(); ! virtual void calculate_thrust(); }; YuryulPatriot::YuryulPatriot(Vector2 opos, double angle, ShipData *data, unsigned int code) ! : ! Ship(opos, angle, data, code) ! { ! shipTurnAccelRate = scale_acceleration(get_config_float("Ship", "TurnAccelRate", 0)); ! shipTurnSpeedMax = scale_velocity(get_config_float("Ship", "TurnSpeedMax", 0)); ! ! weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); ! weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); ! weaponDamage = get_config_int("Weapon", "Damage", 0); ! weaponArmour = get_config_int("Weapon", "Armour", 0); ! weaponRelativity = get_config_int("Weapon", "Relativity", 0); ! ! ! specialDamage = get_config_int("Special", "Damage", 0); ! specialArmour = get_config_int("Special", "Armour", 0); ! specialReleaseAngle = get_config_float("Special", "ReleaseAngle", 0); ! specialReleaseAngleRad = specialReleaseAngle * ANGLE_RATIO; ! specialDecayFrames = get_config_int("Special", "DecayFrames", 0); ! ! thrustRange = scale_range(get_config_float("Thrust", "Range", 0)); ! thrustVelocity = scale_velocity(get_config_float("Thrust", "Velocity", 0)); ! thrustDamage = get_config_int("Thrust", "Damage", 0); ! thrustArmour = get_config_int("Thrust", "Armour", 0); ! thrustRelativity = get_config_float("Thrust", "Relativity", 0); ! Ram1 = NULL; ! Ram2 = NULL; ! } YuryulPatriot::~YuryulPatriot(void) { ! if(Ram1!=NULL) ! Ram1->creator = NULL; ! if(Ram2!=NULL) ! Ram2->creator = NULL; } --- 55,139 ---- class YuryulPatriot : public Ship { public: ! double shipTurnAccelRate; ! double shipTurnSpeedMax; ! ! double weaponRange; ! double weaponVelocity; ! int weaponDamage; ! int weaponArmour; ! double weaponRelativity; ! ! int specialDamage; ! int specialArmour; ! double specialReleaseAngle; ! double specialReleaseAngleRad; ! int specialDecayFrames; ! ! double thrustRange; ! double thrustVelocity; ! int thrustDamage; ! int thrustArmour; ! double thrustRelativity; ! ! //int gunToFire; ! Vector2 ramrelpos; ! ! public: ! ! YuryulRam* Ram1; ! YuryulRam* Ram2; ! ! YuryulPatriot(Vector2 opos, double angle, ShipData *data, unsigned int code); ! ! protected: ! ~YuryulPatriot(); ! virtual void calculate(); ! virtual int activate_weapon(); ! virtual int activate_special(); ! virtual void death(); ! virtual void calculate_turn_left(); ! virtual void calculate_turn_right(); ! virtual void calculate_thrust(); }; YuryulPatriot::YuryulPatriot(Vector2 opos, double angle, ShipData *data, unsigned int code) ! : ! Ship(opos, angle, data, code) ! { ! shipTurnAccelRate = scale_acceleration(get_config_float("Ship", "TurnAccelRate", 0)); ! shipTurnSpeedMax = scale_velocity(get_config_float("Ship", "TurnSpeedMax", 0)); ! ! weaponRange = scale_range(get_config_float("Weapon", "Range", 0)); ! weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0)); ! weaponDamage = get_config_int("Weapon", "Damage", 0); ! weaponArmour = get_config_int("Weapon", "Armour", 0); ! weaponRelativity = get_config_int("Weapon", "Relativity", 0); ! ! ! specialDamage = get_config_int("Special", "Damage", 0); ! specialArmour = get_config_int("Special", "Armour", 0); ! specialReleaseAngle = get_config_float("Special", "ReleaseAngle", 0); ! specialReleaseAngleRad = specialReleaseAngle * ANGLE_RATIO; ! specialDecayFrames = get_config_int("Special", "DecayFrames", 0); ! ! thrustRange = scale_range(get_config_float("Thrust", "Range", 0)); ! thrustVelocity = scale_velocity(get_config_float("Thrust", "Velocity", 0)); ! thrustDamage = get_config_int("Thrust", "Damage", 0); ! thrustArmour = get_config_int("Thrust", "Armour", 0); ! thrustRelativity = get_config_float("Thrust", "Relativity", 0); ! ! Ram1 = NULL; ! Ram2 = NULL; ! ramrelpos.x = get_config_float("Special", "RamXrel", 0); ! ramrelpos.y = get_config_float("Special", "RamYrel", 0); ! } YuryulPatriot::~YuryulPatriot(void) { ! if(Ram1!=NULL) ! Ram1->creator = NULL; ! if(Ram2!=NULL) ! Ram2->creator = NULL; } *************** *** 137,209 **** void YuryulPatriot::death(void) { STACKTRACE ! Ship::death(); } int YuryulPatriot::activate_weapon() { STACKTRACE ! game->add(new Missile(this, Vector2(size.y*(0.00), (size.y * +0.00)), ! angle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, ! this, data->spriteWeapon)); ! return(TRUE); } int YuryulPatriot::activate_special() { STACKTRACE ! if(Ram1!=NULL) Ram1->state = 0; ! if(Ram2!=NULL) Ram2->state = 0; ! Ram1 = new YuryulRam(this, Vector2(this->size.x * (0.5), this->size.x * (0.6)), this->angle, -1.0 * this->specialReleaseAngleRad, ! this->vel.magnitude(), this->specialDamage, -1.0, this->specialArmour); ! Ram1->angleOffset = this->specialReleaseAngleRad * (-1.0); ! Ram1->RamNumber = 1; ! Ram2 = new YuryulRam(this, Vector2(this->size.x * (-0.5), this->size.x * (0.6)), this->angle, +1.0 * this->specialReleaseAngleRad, ! this->vel.magnitude(), this->specialDamage, -1.0, this->specialArmour); ! Ram2->angleOffset = this->specialReleaseAngleRad * (1.0); ! Ram2->RamNumber = 2; ! game->add(Ram1); ! game->add(Ram2); ! return(TRUE); } void YuryulPatriot::calculate(void) { STACKTRACE ! if(Ram1!=NULL) { ! Ram1->decayCount += frame_time; ! if(Ram1->decayCount > this->specialDecayFrames) { ! Ram1->state = 0; ! Ram1=NULL; ! } ! } ! if(Ram2!=NULL) { ! Ram2->decayCount += frame_time; ! if(Ram2->decayCount > this->specialDecayFrames) { ! Ram2->state = 0; ! Ram2=NULL; ! } ! } ! Ship::calculate(); } void YuryulPatriot::calculate_turn_left(void) { STACKTRACE ! Ship::calculate_turn_left(); ! //if(turn_left)accelerate_gravwhip(this, angle, shipTurnAccelRate * frame_time, shipTurnSpeedMax); ! } void YuryulPatriot::calculate_turn_right(void) { STACKTRACE ! Ship::calculate_turn_right(); ! //if(turn_right)accelerate_gravwhip(this, angle, shipTurnAccelRate * frame_time, shipTurnSpeedMax); ! } void YuryulPatriot::calculate_thrust(void) { STACKTRACE ! Ship::calculate_thrust(); } YuryulRam::YuryulRam(YuryulPatriot* ocreator, Vector2 relPos, double oangle, double oangleOffset, double ov, double odamage, double orange, double oarmour) ! : //Missile::Missile(SpaceLocation *creator, Vector2 rpos, double oangle, // double ov, double odamage, double orange, double oarmour, --- 141,213 ---- void YuryulPatriot::death(void) { STACKTRACE ! Ship::death(); } int YuryulPatriot::activate_weapon() { STACKTRACE ! game->add(new Missile(this, Vector2(size.y*(0.00), (size.y * +0.00)), ! angle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, ! this, data->spriteWeapon)); ! return(TRUE); } int YuryulPatriot::activate_special() { STACKTRACE ! if(Ram1!=NULL) Ram1->state = 0; ! if(Ram2!=NULL) Ram2->state = 0; ! Ram1 = new YuryulRam(this, Vector2(this->size.x * (ramrelpos.x), this->size.x * (ramrelpos.y)), this->angle, -1.0 * this->specialReleaseAngleRad, ! this->vel.magnitude(), this->specialDamage, -1.0, this->specialArmour); ! Ram1->angleOffset = this->specialReleaseAngleRad * (-1.0); ! Ram1->RamNumber = 1; ! Ram2 = new YuryulRam(this, Vector2(this->size.x * (-ramrelpos.x), this->size.x * (ramrelpos.y)), this->angle, +1.0 * this->specialReleaseAngleRad, ! this->vel.magnitude(), this->specialDamage, -1.0, this->specialArmour); ! Ram2->angleOffset = this->specialReleaseAngleRad * (1.0); ! Ram2->RamNumber = 2; ! game->add(Ram1); ! game->add(Ram2); ! return(TRUE); } void YuryulPatriot::calculate(void) { STACKTRACE ! if(Ram1!=NULL) { ! Ram1->decayCount += frame_time; ! if(Ram1->decayCount > this->specialDecayFrames) { ! Ram1->state = 0; ! Ram1=NULL; ! } ! } ! if(Ram2!=NULL) { ! Ram2->decayCount += frame_time; ! if(Ram2->decayCount > this->specialDecayFrames) { ! Ram2->state = 0; ! Ram2=NULL; ! } ! } ! Ship::calculate(); } void YuryulPatriot::calculate_turn_left(void) { STACKTRACE ! Ship::calculate_turn_left(); ! //if(turn_left)accelerate_gravwhip(this, angle, shipTurnAccelRate * frame_time, shipTurnSpeedMax); ! } void YuryulPatriot::calculate_turn_right(void) { STACKTRACE ! Ship::calculate_turn_right(); ! //if(turn_right)accelerate_gravwhip(this, angle, shipTurnAccelRate * frame_time, shipTurnSpeedMax); ! } void YuryulPatriot::calculate_thrust(void) { STACKTRACE ! Ship::calculate_thrust(); } YuryulRam::YuryulRam(YuryulPatriot* ocreator, Vector2 relPos, double oangle, double oangleOffset, double ov, double odamage, double orange, double oarmour) ! : //Missile::Missile(SpaceLocation *creator, Vector2 rpos, double oangle, // double ov, double odamage, double orange, double oarmour, *************** *** 216,238 **** ov, odamage, orange, oarmour, ocreator, ocreator->data->spriteExtra, 0.0) ! { ! relativePosition = relPos; ! creator = ocreator; ! this->pos = creator->pos; ! angleOffset = oangleOffset; ! this->angle = oangle + oangleOffset; ! decayFrames = 0; ! decayAmount = 0; ! decayCount = 0; } YuryulRam::~YuryulRam(void) { ! if(creator!=NULL) { ! if(RamNumber == 1) ! creator->Ram1 = NULL; ! if(RamNumber == 2) ! creator->Ram2 = NULL; ! } } --- 220,242 ---- ov, odamage, orange, oarmour, ocreator, ocreator->data->spriteExtra, 0.0) ! { ! relativePosition = relPos; ! creator = ocreator; ! this->pos = creator->pos; ! angleOffset = oangleOffset; ! this->angle = oangle + oangleOffset; ! decayFrames = 0; ! decayAmount = 0; ! decayCount = 0; } YuryulRam::~YuryulRam(void) { ! if(creator!=NULL) { ! if(RamNumber == 1) ! creator->Ram1 = NULL; ! if(RamNumber == 2) ! creator->Ram2 = NULL; ! } } *************** *** 240,283 **** void YuryulRam::calculate(void) { STACKTRACE ! // changed GEO ! if(!(creator && creator->exists()) ) ! { ! creator = 0; ! state = 0; ! return; ! } ! this->changeDirection(creator->angle + this->angleOffset); ! this->pos = creator->pos; ! this->vel = creator->vel; ! pos = normalize(pos + rotate(relativePosition, -PI/2+creator->get_angle())); ! Missile::calculate(); } YuryulMissile::YuryulMissile(YuryulPatriot* ocreator, double ox, double oy, double oangle, double ov, ! int odamage, double orange, int oarmour, double oturnrate, SpaceLocation* opos, SpaceSprite* osprite, SpaceObject* otarget) ! : ! HomingMissile(ocreator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, oturnrate, opos, osprite, otarget) ! { explosionSprite = data->spriteWeaponExplosion; facingAngle=oangle; ! isActivated=0; ! this->relativity = 1.0; ! thrustOn = FALSE; ! lifetimeTimer = 0; ! } void YuryulMissile::calculate(void) { STACKTRACE ! Missile::calculate(); } void YuryulMissile::inflict_damage(SpaceObject *other) { STACKTRACE ! Shot::inflict_damage(other); } void YuryulMissile::thrust_on(void) { ! ;} REGISTER_SHIP ( YuryulPatriot ) --- 244,287 ---- void YuryulRam::calculate(void) { STACKTRACE ! // changed GEO ! if(!(creator && creator->exists()) ) ! { ! creator = 0; ! state = 0; ! return; ! } ! this->changeDirection(creator->angle + this->angleOffset); ! this->pos = creator->pos; ! this->vel = creator->vel; ! pos = normalize(pos + rotate(relativePosition, -PI/2+creator->get_angle())); ! Missile::calculate(); } YuryulMissile::YuryulMissile(YuryulPatriot* ocreator, double ox, double oy, double oangle, double ov, ! int odamage, double orange, int oarmour, double oturnrate, SpaceLocation* opos, SpaceSprite* osprite, SpaceObject* otarget) ! : ! HomingMissile(ocreator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, oturnrate, opos, osprite, otarget) ! { explosionSprite = data->spriteWeaponExplosion; facingAngle=oangle; ! isActivated=0; ! this->relativity = 1.0; ! thrustOn = FALSE; ! lifetimeTimer = 0; ! } void YuryulMissile::calculate(void) { STACKTRACE ! Missile::calculate(); } void YuryulMissile::inflict_damage(SpaceObject *other) { STACKTRACE ! Shot::inflict_damage(other); } void YuryulMissile::thrust_on(void) { ! ;} REGISTER_SHIP ( YuryulPatriot ) |
From: <geo...@us...> - 2004-01-04 13:08:48
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv26577 Modified Files: shpleimu.ini shpleimu.txt Log Message: ship tweak Index: shpleimu.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpleimu.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpleimu.ini 26 Oct 2003 10:43:16 -0000 1.3 --- shpleimu.ini 4 Jan 2004 13:08:45 -0000 1.4 *************** *** 23,30 **** WeaponDrain = 2 ! WeaponRate = 8 ! SpecialDrain = 2 ! SpecialRate = 10 HotspotRate = 5 --- 23,30 ---- WeaponDrain = 2 ! WeaponRate = 6 ! SpecialDrain = 0 ! SpecialRate = 6 ; mimic weaponrate HotspotRate = 5 Index: shpleimu.txt =================================================================== RCS file: /cvsroot/timewarp/ships/shpleimu.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shpleimu.txt 26 Oct 2003 10:43:16 -0000 1.2 --- shpleimu.txt 4 Jan 2004 13:08:45 -0000 1.3 *************** *** 3,4 **** --- 3,10 ---- nicknamed like this for its ferocious backward attack... + Main weapon: fires shots forward/backward + + Special: fires *dummy* shots forward/backward, called REAL: Realistic Enhanced Agressive Lightforms. + + The shots block other weapons, so the REAL shots can also be used to take down incoming missiles, just like the real shots. + |
From: <geo...@us...> - 2003-12-30 09:30:21
|
Update of /cvsroot/timewarp/ships/sc1 In directory sc8-pr-cvs1:/tmp/cvs-serv29056 Modified Files: shpmmrxf.ini Log Message: extra name Index: shpmmrxf.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc1/shpmmrxf.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpmmrxf.ini 8 Jun 2003 17:55:36 -0000 1.3 --- shpmmrxf.ini 30 Dec 2003 09:30:15 -0000 1.4 *************** *** 68,72 **** [Names] ! NumNames = 16 CaptName1 = Qir-nha CaptName2 = Jhe-qir --- 68,72 ---- [Names] ! NumNames = 17 CaptName1 = Qir-nha CaptName2 = Jhe-qir *************** *** 85,86 **** --- 85,87 ---- CaptName15 = Nhuh-na CaptName16 = Hrnm-hm + CaptName17 = Mnm-hmm |
From: <geo...@us...> - 2003-12-30 09:27:42
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv28692 Modified Files: mship.cpp mship.h Log Message: fixing captain_name array size bug Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mship.cpp 22 Dec 2003 10:29:44 -0000 1.22 --- mship.cpp 30 Dec 2003 09:27:35 -0000 1.23 *************** *** 370,373 **** --- 370,374 ---- int i; i = get_config_int("Names", "NumNames", 0); + int L = sizeof(captain_name); if (i) { char buffy[16]; *************** *** 375,380 **** const char *tmp = get_config_string("Names", buffy, ""); i = strlen(tmp); ! strncpy(captain_name, tmp, 16); ! if (i >= 16) i = 15; captain_name[i] = '\0'; } --- 376,381 ---- const char *tmp = get_config_string("Names", buffy, ""); i = strlen(tmp); ! strncpy(captain_name, tmp, L); ! if (i >= L) i = L-1; captain_name[i] = '\0'; } Index: mship.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mship.h 13 Dec 2003 14:31:35 -0000 1.12 --- mship.h 30 Dec 2003 09:27:38 -0000 1.13 *************** *** 128,132 **** int special_sample; int hotspot_rate; ! char captain_name[13]; SpaceSprite *spritePanel; --- 128,132 ---- int special_sample; int hotspot_rate; ! char captain_name[16]; SpaceSprite *spritePanel; |
From: <geo...@us...> - 2003-12-30 09:17:09
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv27210 Modified Files: shpalabc.ini shpayrbs.ini shpxaaar.ini Log Message: captain names of Frungy Index: shpalabc.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpalabc.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpalabc.ini 15 Nov 2003 11:04:18 -0000 1.5 --- shpalabc.ini 30 Dec 2003 09:17:05 -0000 1.6 *************** *** 81,82 **** --- 81,89 ---- + [Names] + NumNames = 5 + CaptName1 = Yylyilt + CaptName2 = Osfysrs + CaptName3 = Khryslth + CaptName4 = J'kyyrf + CaptName5 = Vyxyrm Index: shpayrbs.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpayrbs.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpayrbs.ini 26 Oct 2003 10:43:16 -0000 1.3 --- shpayrbs.ini 30 Dec 2003 09:17:05 -0000 1.4 *************** *** 43,46 **** --- 43,52 ---- SpecialFreq = 3 + [Names] + NumNames = 3 + CaptName1 = Hiuth + CaptName2 = Casthir + CaptName3 = Vethethi + Index: shpxaaar.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpxaaar.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shpxaaar.ini 17 Oct 2003 18:04:09 -0000 1.2 --- shpxaaar.ini 30 Dec 2003 09:17:05 -0000 1.3 *************** *** 32,33 **** --- 32,38 ---- [Special] + + [Names] + NumNames = 2 + CaptName1 = Mezr + CaptName2 = Vyvnt |
From: <yu...@us...> - 2003-12-29 20:45:16
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1:/tmp/cvs-serv6637 Modified Files: Doxyfile Log Message: Dot support, nothing bad even if you does not have it, but better install :) |
From: <geo...@us...> - 2003-12-29 13:48:37
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv22600 Modified Files: shpyurpa.dat shpyurpa.ini Log Message: graphics adjustment of the special Index: shpyurpa.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpyurpa.dat,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsLGTqBb and /tmp/cvsgAMnLe differ Index: shpyurpa.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpyurpa.ini,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpyurpa.ini 29 Dec 2003 13:22:47 -0000 1.4 --- shpyurpa.ini 29 Dec 2003 13:48:31 -0000 1.5 *************** *** 42,45 **** --- 42,47 ---- ReleaseAngle = 30 DecayFrames = 9000 + RamXrel = 0.6 + RamYrel = 0.85 ;[Thrust] |
From: <geo...@us...> - 2003-12-29 13:22:56
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv18298 Modified Files: shpalhdr.ini shpgahmo.dat shpgahmo.ini shpyurpa.dat shpyurpa.ini Log Message: new graphics for Yuryul and Gahmur by Mercutio Index: shpalhdr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpalhdr.ini,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpalhdr.ini 29 Dec 2003 01:07:34 -0000 1.8 --- shpalhdr.ini 29 Dec 2003 13:22:47 -0000 1.9 *************** *** 88,92 **** Weapon_Range = 55 Special = No_Front ! Special2 = Feild ;Special3 = Precedence Special3 = Defense --- 88,92 ---- Weapon_Range = 55 Special = No_Front ! Special2 = Field ;Special3 = Precedence Special3 = Defense Index: shpgahmo.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpgahmo.dat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsOuoVm0 and /tmp/cvsMNGtkR differ Index: shpgahmo.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpgahmo.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpgahmo.ini 8 Jun 2003 17:55:00 -0000 1.1 --- shpgahmo.ini 29 Dec 2003 13:22:47 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- Coders = Varith Code = GahmurMonitor + Gfx = Mercutio [Ship] *************** *** 14,20 **** Batt = 40 BattMax = 40 ! SpeedMax = 30.5 ! AccelRate = 6.25 ! TurnRate = 8 RechargeAmount = 1 RechargeRate = 3.5 --- 15,22 ---- Batt = 40 BattMax = 40 ! ; It's a Behemoth, so move like one. ! SpeedMax = 27 ! AccelRate = 3 ! TurnRate = 6 RechargeAmount = 1 RechargeRate = 3.5 *************** *** 58,62 **** ;1.0 would be 'normal' behavior ! AlwaysFireOnEmptyBattery = 0 AlwaysFireOnMaxChargeTime = 0 --- 60,65 ---- ;1.0 would be 'normal' behavior ! ; There's no feedback to know you're charging otherwise. Helps the AI, too. ! AlwaysFireOnEmptyBattery = 1 AlwaysFireOnMaxChargeTime = 0 *************** *** 74,83 **** [AI3_Default] ! Weapon = Hold ! Weapon2 = Feild ! Weapon_Range = 15 ! Weapon2 = Precedence ! Special = Narrow ! Special_Range = 10 [Names] --- 77,93 ---- [AI3_Default] ! ; Hold's logic is a bit hosed, so we work around. ! Weapon = Field ! ; Another safety net to make sure he DOES SOMETHING! ! Weapon2 = Always_When_Full ! ; Reset the main gun, by snatching control every once in a while. ! Special = Precedence ! ; Trick him into taking the shot. ! Special2 = Field ! ; Just long enough to charge up a decent shot. ! Special_Timer = 2 ! ; How to you convince him to face his opponent? ! Tactic = Direct ! [Names] Index: shpyurpa.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpyurpa.dat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsiPrXv4 and /tmp/cvsWoMtB0 differ Index: shpyurpa.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpyurpa.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpyurpa.ini 8 Jun 2003 17:55:30 -0000 1.3 --- shpyurpa.ini 29 Dec 2003 13:22:47 -0000 1.4 *************** *** 7,10 **** --- 7,11 ---- Origin = TW Coders = Varith + Gfx = Mercutio Code = YuryulPatriot |
From: <geo...@us...> - 2003-12-29 01:07:38
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv12433 Modified Files: shpalhdr.dat shpalhdr.ini Log Message: new graphics by mercutio Index: shpalhdr.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpalhdr.dat,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvs94LMRW and /tmp/cvsksFUpV differ Index: shpalhdr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpalhdr.ini,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpalhdr.ini 9 Nov 2003 11:27:21 -0000 1.7 --- shpalhdr.ini 29 Dec 2003 01:07:34 -0000 1.8 *************** *** 72,76 **** StartAngle = -185 ! EndAngle = -5 StartRange = 3 EndRange = 8 --- 72,76 ---- StartAngle = -185 ! EndAngle = -5 StartRange = 3 EndRange = 8 *************** *** 80,85 **** ; position of the laser ! DX = -5 ! DY = -17 [AI3_Default] --- 80,85 ---- ; position of the laser ! DX = -40 ;-5 ! DY = -34 ;-35 [AI3_Default] |
From: <geo...@us...> - 2003-12-23 14:10:22
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1:/tmp/cvs-serv9067 Modified Files: shpalckr.ini shpbatde.ini shpbubex.ini shpchoex.ini shpconho.ini shpdajem.ini shpducla.ini shpdyzha.ini shpestgu.ini shpforsh.ini shpfresc.ini shphotsp.ini Log Message: adding names Index: shpalckr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpalckr.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpalckr.ini 2 Nov 2003 12:11:53 -0000 1.5 --- shpalckr.ini 23 Dec 2003 14:10:19 -0000 1.6 *************** *** 45,48 **** --- 45,58 ---- [Extra] + [Names] + NumNames = 6 + CaptName1 = Istirm + CaptName2 = Vesnr + CaptName3 = Mrendk + CaptName4 = Ofjernnx + CaptName5 = Nithlaich + CaptName6 = Geuhn + + [AI3_Default] Weapon = Narrow *************** *** 53,54 **** --- 63,66 ---- Special3 = Defense SpecialFreq = 2 + + Index: shpbatde.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpbatde.ini,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpbatde.ini 22 Nov 2003 17:03:48 -0000 1.7 --- shpbatde.ini 23 Dec 2003 14:10:19 -0000 1.8 *************** *** 53,55 **** DieShip = 4 DiePlanet = 8 ! GravRange = 25 \ No newline at end of file --- 53,65 ---- DieShip = 4 DiePlanet = 8 ! GravRange = 25 ! ! [Names] ! NumNames = 6 ! CaptName1 = Thlemm ! CaptName2 = Mthr ! CaptName3 = Fphumhm ! CaptName4 = Olmthm ! CaptName5 = Kmmkuhnm ! CaptName6 = Mmmhuh ! Index: shpbubex.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpbubex.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpbubex.ini 8 Jun 2003 17:54:56 -0000 1.3 --- shpbubex.ini 23 Dec 2003 14:10:19 -0000 1.4 *************** *** 41,44 **** --- 41,52 ---- AbsorberShield = 1 + [Names] + NumNames = 5 + CaptName1 = Fint + CaptName2 = Ervai + CaptName3 = Holce + CaptName4 = Germt + CaptName5 = Deckvel + [AI3_Default] Special = Front Index: shpchoex.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpchoex.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpchoex.ini 23 Nov 2003 09:58:22 -0000 1.5 --- shpchoex.ini 23 Dec 2003 14:10:19 -0000 1.6 *************** *** 59,64 **** [Names] ! NumNames = 3 CaptName1 = Chadisastu CaptName2 = Kiluyn CaptName3 = Minjerox --- 59,67 ---- [Names] ! NumNames = 6 CaptName1 = Chadisastu CaptName2 = Kiluyn CaptName3 = Minjerox + CaptName4 = Zingxex + CaptName5 = Keyrt + CaptName6 = Ulurt \ No newline at end of file Index: shpconho.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpconho.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpconho.ini 8 Jun 2003 17:54:57 -0000 1.3 --- shpconho.ini 23 Dec 2003 14:10:19 -0000 1.4 *************** *** 44,47 **** --- 44,54 ---- Frames = 4000 + [Names] + NumNames = 4 + CaptName1 = Lidje + CaptName2 = Kijhrl + CaptName3 = Nailckk + CaptName4 = Texkre + [AI3_Default] Weapon = Narrow Index: shpdajem.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpdajem.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpdajem.ini 8 Jun 2003 17:54:57 -0000 1.3 --- shpdajem.ini 23 Dec 2003 14:10:19 -0000 1.4 *************** *** 80,83 **** --- 80,91 ---- RedeployTime = 3000 + [Names] + NumNames = 5 + CaptName1 = Tetetrey + CaptName2 = Lokokor + CaptName3 = Vivivnern + CaptName4 = Dililone + CaptName5 = Kalkalknar + [AI3_Default] Weapon = Narrow Index: shpducla.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpducla.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpducla.ini 26 Oct 2003 10:43:16 -0000 1.5 --- shpducla.ini 23 Dec 2003 14:10:19 -0000 1.6 *************** *** 63,66 **** --- 63,71 ---- ; arm_maxangle + arc_corr should be less than 90 degrees ! + [Names] + NumNames = 2 + CaptName1 = Uthrey + CaptName2 = Reileyc + [AI3_Default] Special = Defense Index: shpdyzha.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpdyzha.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpdyzha.ini 18 Oct 2003 16:34:18 -0000 1.6 --- shpdyzha.ini 23 Dec 2003 14:10:19 -0000 1.7 *************** *** 47,50 **** --- 47,57 ---- BurnFrames2 = 6000 + [Names] + NumNames = 4 + CaptName1 = Zuyrn + CaptName2 = Palkyyr + CaptName3 = Iriri + CaptName4 = Chixrede + [AI3_Default] Weapon = Narrow Index: shpestgu.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpestgu.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpestgu.ini 8 Jun 2003 17:54:59 -0000 1.3 --- shpestgu.ini 23 Dec 2003 14:10:19 -0000 1.4 *************** *** 38,41 **** --- 38,48 ---- ExplosionSpeed = 0.75 + [Names] + NumNames = 4 + CaptName1 = Gogh + CaptName2 = Apple + CaptName3 = Rembrandt + CaptName4 = DaVinci + [AI3_Default] Special = Max_Battery Index: shpforsh.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpforsh.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpforsh.ini 8 Jun 2003 17:54:59 -0000 1.3 --- shpforsh.ini 23 Dec 2003 14:10:19 -0000 1.4 *************** *** 39,40 **** --- 39,48 ---- Loss = 1 newGFX = 1 + + [Names] + NumNames = 4 + CaptName1 = Esseys + CaptName2 = Alseis + CaptName3 = Desussel + CaptName4 = Fssres + Index: shpfresc.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpfresc.ini,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpfresc.ini 18 Oct 2003 16:34:18 -0000 1.4 --- shpfresc.ini 23 Dec 2003 14:10:19 -0000 1.5 *************** *** 42,43 **** --- 42,49 ---- TurnRate = 5 + [Names] + NumNames = 3 + CaptName1 = Loothz + CaptName2 = Vigszizr + CaptName3 = Brecciex + Index: shphotsp.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shphotsp.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shphotsp.ini 8 Jun 2003 17:55:02 -0000 1.3 --- shphotsp.ini 23 Dec 2003 14:10:19 -0000 1.4 *************** *** 46,47 **** --- 46,54 ---- Damage = 8 Armour = 8 + + [Names] + NumNames = 2 + CaptName1 = Shirstenm + CaptName2 = Tiurm + + |
From: <geo...@us...> - 2003-12-22 12:03:23
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1:/tmp/cvs-serv27082/melee Modified Files: mframe.cpp mframe.h mgame.cpp mgame.h mview.cpp Log Message: full-game melee update Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mframe.cpp 19 Dec 2003 23:33:35 -0000 1.19 --- mframe.cpp 22 Dec 2003 12:03:17 -0000 1.20 *************** *** 1381,1383 **** --- 1381,1395 ---- + void Physics::ship_died(Ship *who, SpaceLocation *source) + { + // nothing ... + } + + void Physics::object_died(SpaceObject *who, SpaceLocation *source) + { + if (who && who->isShip()) + { + ship_died((Ship*)who, source); + } + } \ No newline at end of file Index: mframe.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mframe.h 19 Dec 2003 23:33:35 -0000 1.11 --- mframe.h 22 Dec 2003 12:03:17 -0000 1.12 *************** *** 132,135 **** --- 132,139 ---- // to init parameters of space-objects... virtual void log_file (const char *fname); + + // to handle the death of objects in the game ... + virtual void object_died(SpaceObject *who, SpaceLocation *source); + virtual void ship_died(Ship *who, SpaceLocation *source); }; Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mgame.cpp 22 Dec 2003 10:29:44 -0000 1.26 --- mgame.cpp 22 Dec 2003 12:03:17 -0000 1.27 *************** *** 669,677 **** focus[focus_index]->attributes |= ATTRIB_ACTIVE_FOCUS; - gametargets.calculate(); Physics::calculate(); view->calculate(this); --- 669,677 ---- focus[focus_index]->attributes |= ATTRIB_ACTIVE_FOCUS; Physics::calculate(); + gametargets.calculate(); view->calculate(this); *************** *** 747,751 **** } ! void Game::ship_died(Ship *who, SpaceLocation *source) {STACKTRACE if (source && source->data) { Music *tmp = NULL; --- 747,755 ---- } ! ! void Game::ship_died(Ship *who, SpaceLocation *source) ! { ! STACKTRACE; ! if (source && source->data) { Music *tmp = NULL; *************** *** 756,759 **** --- 760,772 ---- } return; + } + + + void Game::object_died(SpaceObject *who, SpaceLocation *source) + { + if (who && who->isShip()) + { + ship_died((Ship*)who, source); + } } Index: mgame.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mgame.h 22 Dec 2003 10:29:44 -0000 1.12 --- mgame.h 22 Dec 2003 12:03:17 -0000 1.13 *************** *** 116,119 **** --- 116,120 ---- // using Physics::animate; + virtual void object_died(SpaceObject *who, SpaceLocation *source); virtual void ship_died(Ship *who, SpaceLocation *source); *************** *** 197,200 **** --- 198,202 ---- int show_fps; unsigned char local_checksum, client_checksum, server_checksum; + }; Index: mview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mview.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mview.cpp 14 Dec 2003 14:20:58 -0000 1.11 --- mview.cpp 22 Dec 2003 12:03:18 -0000 1.12 *************** *** 34,41 **** Vector2 space_size; // game-pixels ! Vector2 space_corner; // game-pixels : uppper left corner ! Vector2 space_center_nowrap;// game-pixels : center, non-wrapped ! Vector2 space_vel; // game-pixels / millisecond : center ! Vector2 space_center; // game-pixels : center --- 34,41 ---- Vector2 space_size; // game-pixels ! Vector2 space_corner = 0; // game-pixels : uppper left corner ! Vector2 space_center_nowrap = 0;// game-pixels : center, non-wrapped ! Vector2 space_vel = 0; // game-pixels / millisecond : center ! Vector2 space_center = 0; // game-pixels : center |
From: <geo...@us...> - 2003-12-22 12:03:20
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1:/tmp/cvs-serv27082/gamex Modified Files: ai_fleet.cpp ai_fleet.h gamemelee.cpp gamemelee.h gameproject.cpp gameproject.h Log Message: full-game melee update Index: ai_fleet.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/ai_fleet.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ai_fleet.cpp 18 Nov 2003 17:18:47 -0000 1.1.1.1 --- ai_fleet.cpp 22 Dec 2003 12:03:17 -0000 1.2 *************** *** 9,12 **** --- 9,14 ---- #include "gamedata.h" + #include "ai_fleet.h" + // later on, this is a "detail" *************** *** 19,22 **** --- 21,86 ---- + + + ControlWussieFG::ControlWussieFG (const char *name) + : + ControlWussie(name, 0) + { + } + + void ControlWussieFG::calculate() + { + + if (!exists()) return; + + target_stuff(); + + if (ship) { + if (!ship->exists() || (ship->death_counter != -1)) { + //message.print(5000, 12, "Ship died in frame %d", game->frame_number); + select_ship( NULL, NULL); + } + else keys = think(); + } + + if (!ship) { + keys = 0; + if (temporary) state = 0; + } + + } + + + + + + + ControlHumanFG::ControlHumanFG (const char *name) + : + ControlHuman(name, 0) + { + } + + void ControlHumanFG::calculate() + { + + if (!exists()) return; + + target_stuff(); + + if (ship) { + if (!ship->exists() || (ship->death_counter != -1)) { + //message.print(5000, 12, "Ship died in frame %d", game->frame_number); + select_ship( NULL, NULL); + } + else keys = think(); + } + + if (!ship) { + keys = 0; + if (temporary) state = 0; + } + + } Index: ai_fleet.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/ai_fleet.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ai_fleet.h 18 Nov 2003 17:18:47 -0000 1.1.1.1 --- ai_fleet.h 22 Dec 2003 12:03:17 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- + #include "../ais.h" + + class FleetFormation { *************** *** 11,14 **** --- 14,36 ---- virtual void attack(Vector2 pos); }; + + + + + class ControlHumanFG : public ControlHuman + { + public: + ControlHumanFG (const char *name); + virtual void calculate(); + }; + + + class ControlWussieFG : public ControlWussie + { + public: + ControlWussieFG (const char *name); + virtual void calculate(); + }; + Index: gamemelee.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamemelee.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gamemelee.cpp 22 Dec 2003 09:37:08 -0000 1.5 --- gamemelee.cpp 22 Dec 2003 12:03:17 -0000 1.6 *************** *** 35,131 **** - class InitShipGeneral - { - public: - //InitShipGeneral(char *id, char *base); - void set(char *id, char *base); - char idname[128]; - std::string filebase; - virtual Ship *spawnship(Vector2 opos, double oangle, int allyflag) {return 0;}; - ShipData *getdata(); - }; - - void InitShipGeneral::set(char *id, char *base) - { - strcpy(idname, id); - filebase = base; - } - - ShipData *InitShipGeneral::getdata() - { - ShipData *sd; - sd = shipdata( (filebase + ".dat").c_str() ); // check the list - sd->load(); // load the sprites into the data (is only done if that's still needed). - return sd; - } - - - class InitShipOrzne : public InitShipGeneral - { - public: - InitShipOrzne() {set("orzne", "ships/sc2/shporzne");}; - virtual Ship *spawnship(Vector2 opos, double oangle, int allyflag) - {return new OrzNemesis(opos, oangle, getdata(), allyflag);}; - }; - - - - int Nships = 0; - InitShipGeneral *shiplist[64]; - - void add2shipslist(InitShipGeneral *s) - { - shiplist[Nships] = s; - ++Nships; - } - - void initshipslist() - { - add2shipslist( new InitShipOrzne() ); - } - - - Ship *createship(char *id, Vector2 opos, double oangle, int allyflag) - { - int i; - for ( i = 0; i < Nships; ++i ) - { - if (strcmp(id, shiplist[i]->idname) == 0) - return shiplist[i]->spawnship(opos, oangle, allyflag); - } - return 0; - } - #include "../melee.h" #include "../melee/mframe.h" ! Ship *GameMelee::create_ship(const char *id, Vector2 pos, double angle, int team) { Control *c = 0; int channel = 0; ! c = getController("WussieBot", "whatever", channel); ! if (!c) { ! tw_error("Game::create_control - bad control type"); } ! // c->load(file, config); add(c); 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); ! ini = buffer; ! } ! log_file(buffer);*/ ! // log_file(type->file); ! set_config_file(type->file); ! // if (team == 0) team = new_team(); Ship *s = type->get_ship(pos, angle, get_code(new_ship(), team)); if (c) c->select_ship(s, id); ! // add_target(s); s->attributes |= ATTRIB_NOTIFY_ON_DEATH; return s; --- 35,72 ---- #include "../melee.h" #include "../melee/mframe.h" ! #include "ai_fleet.h" ! ! Ship *GameMelee::create_ship(const char *id, bool human, Vector2 pos, double angle, int team) { Control *c = 0; int channel = 0; ! if (human) ! { ! c = new ControlHumanFG("whatever"); ! } else { ! c = new ControlWussieFG("whatever"); } ! if (!c) { tw_error("Game::create_control - bad control type"); } ! ! c->load("scp.ini", "Config0"); // only does something for "humans" add(c); ShipType *type = shiptype(id); ! if (!type) {tw_error("Game::create_ship - bad ship id (%s)", id);} ! ! log_file(type->file); ! Ship *s = type->get_ship(pos, angle, get_code(new_ship(), team)); + add(s); + if (c) c->select_ship(s, id); ! ! targets->add(s); s->attributes |= ATTRIB_NOTIFY_ON_DEATH; return s; *************** *** 168,182 **** - // wininfo.init( Vector2(200,200), 800.0, tempframe ); wininfo.zoomlimit(size.x); wininfo.scaletowidth(size.x); // zoom out to this width. - initshipslist(); ! // Stars requires game->log, which I can't, nor need (imo), to support for a (single player) full-game ! //physics = 0; ! //add(new Stars()); ! //physics = this; int i; --- 109,118 ---- wininfo.zoomlimit(size.x); wininfo.scaletowidth(size.x); // zoom out to this width. ! add(new Stars()); int i; *************** *** 185,205 **** team_player = new_team(); Ship *s; for ( i = 0; i < enemyfleet->Nships; ++i ) { ! //s = createship(enemyfleet->info->name, Vector2(0,0), 0, team_player); ! s = create_ship(enemyfleet->info->name, Vector2(0,0), 0, team_player); ! s->layer = LAYER_SHIPS; ! s->collide_flag_anyone = ALL_LAYERS; ! add(s); ! // s->hashotspots = false; } - // take control of one of those ships... - player = s; } --- 121,143 ---- team_player = new_team(); + team_enemy = new_team(); Ship *s; + // human ship: + s = create_ship("kzedr", true, Vector2(0,0), 0, team_player); + + // take control of one of those ships... + player = s; + + + // computer ships: for ( i = 0; i < enemyfleet->Nships; ++i ) { ! s = create_ship(enemyfleet->info->name, false, Vector2(0,0), 0, team_enemy); } } *************** *** 234,238 **** ! wininfo.center(player->pos); --- 172,181 ---- ! // center the screen on the player ship ! if (player && player->exists()) ! wininfo.center(player->pos); ! ! else ! player = 0; *************** *** 248,251 **** --- 191,195 ---- // } + /* // the human controlled ship: override any AI orders *************** *** 270,273 **** --- 214,218 ---- if (key[KEY_RSHIFT]) player->fire_special = true; + */ Index: gamemelee.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamemelee.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gamemelee.h 22 Dec 2003 09:37:08 -0000 1.3 --- gamemelee.h 22 Dec 2003 12:03:17 -0000 1.4 *************** *** 17,21 **** XFleet *enemyfleet; ! TeamCode team_player, team_aliens; virtual void init(); --- 17,21 ---- XFleet *enemyfleet; ! TeamCode team_player, team_enemy; virtual void init(); *************** *** 36,40 **** ! virtual Ship *create_ship(const char *id, Vector2 pos, double angle, int team); }; --- 36,40 ---- ! virtual Ship *create_ship(const char *id, bool human, Vector2 pos, double angle, int team); }; Index: gameproject.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameproject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gameproject.cpp 19 Dec 2003 23:33:35 -0000 1.7 --- gameproject.cpp 22 Dec 2003 12:03:17 -0000 1.8 *************** *** 377,380 **** --- 377,381 ---- Physics::prepare(); ::physics = this; // same as the game pointer ... + ::targets = &gametargets; return; } *************** *** 614,617 **** --- 615,619 ---- ::space_zoom = wininfo.zoomlevel; ::space_center = wininfo.mapcenter; + ::space_center_nowrap += min_delta(wininfo.mapcenter, space_center_nowrap, map_size); ::space_view_size = wininfo.framesize; *************** *** 630,633 **** --- 632,638 ---- Physics::calculate(); + + // maintain/update target list (remove dead objects) + gametargets.calculate(); if (T && !next) Index: gameproject.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameproject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gameproject.h 19 Dec 2003 23:33:35 -0000 1.7 --- gameproject.h 22 Dec 2003 12:03:17 -0000 1.8 *************** *** 12,15 **** --- 12,17 ---- #include "gamegeneral.h" + #include "../melee/mtarget.h" + extern BITMAP *game_screen; *************** *** 132,135 **** --- 134,138 ---- void show_ticinfo(Frame *f, Histograph *tic_history, Histograph *render_history, double hist_power); + Targets gametargets; }; |
From: <geo...@us...> - 2003-12-22 12:03:20
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1:/tmp/cvs-serv27082/ais Modified Files: c_wussie.cpp Log Message: full-game melee update Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** c_wussie.cpp 20 Oct 2003 11:00:06 -0000 1.7 --- c_wussie.cpp 22 Dec 2003 12:03:17 -0000 1.8 *************** *** 601,605 **** void ControlWussie::select_ship (Ship * ship_pointer, const char *ship_name) { ! STACKTRACE char tmp[20]; --- 601,605 ---- void ControlWussie::select_ship (Ship * ship_pointer, const char *ship_name) { ! STACKTRACE; char tmp[20]; |
From: <geo...@us...> - 2003-12-22 10:31:50
|
Update of /cvsroot/timewarp/gamex/interface/starmap/edit In directory sc8-pr-cvs1:/tmp/cvs-serv12582/interface/starmap/edit Added Files: plot_backgr.bmp Log Message: no message --- NEW FILE: plot_backgr.bmp --- (This appears to be a binary file; contents omitted.) |
From: <geo...@us...> - 2003-12-22 10:30:25
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1:/tmp/cvs-serv12347 Modified Files: twwin.dsp Log Message: added mtarget.cpp/h |
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1:/tmp/cvs-serv12007/newships Modified Files: shpayrbs.cpp shpbipka.cpp shpearc3.cpp shpkatas.cpp shpkatpo.cpp shpquasi.cpp shpquawr.cpp shprogsq.cpp shptauhu.cpp shpwassu.cpp Log Message: putting the "targets" into a separate class (instead of being part of Game) Index: shpayrbs.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpayrbs.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpayrbs.cpp 27 Oct 2003 22:19:26 -0000 1.15 --- shpayrbs.cpp 22 Dec 2003 10:29:44 -0000 1.16 *************** *** 379,383 **** // remove this thing from the game target list. //removefromtargetlist(this); ! game->rem_target(this); } else --- 379,383 ---- // remove this thing from the game target list. //removefromtargetlist(this); ! targets->rem(this); } else *************** *** 416,421 **** // add it back to the target list of the game ! if (!isintargetlist(this)) ! game->add_target(this); } --- 416,421 ---- // add it back to the target list of the game ! if (!targets->isintargetlist(this)) ! targets->add(this); } Index: shpbipka.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbipka.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpbipka.cpp 30 Oct 2003 20:41:02 -0000 1.9 --- shpbipka.cpp 22 Dec 2003 10:29:44 -0000 1.10 *************** *** 128,133 **** left->change_owner( this ); right->change_owner( this ); ! game->add_target( left ); ! game->add_target( right ); left->shooting = true; id = 0; /* this is nothing */ --- 128,133 ---- left->change_owner( this ); right->change_owner( this ); ! targets->add( left ); ! targets->add( right ); left->shooting = true; id = 0; /* this is nothing */ *************** *** 350,354 **** // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! game->rem_target(this); left->control = control; right->control = control; --- 350,354 ---- // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! targets->rem(this); left->control = control; right->control = control; Index: shpearc3.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpearc3.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpearc3.cpp 30 Oct 2003 20:41:02 -0000 1.10 --- shpearc3.cpp 22 Dec 2003 10:29:44 -0000 1.11 *************** *** 96,101 **** pos += unit_vector(angle) * 28; //!!! int i; ! for (i=0; i < game->num_targets; i++) { ! tgt = game->target[i]; if ((tgt != this) && (!tgt->sameShip(this)) && (!tgt->sameTeam(this)) && (!tgt->isInvisible()) && (distance(tgt) <= 1.2*(weaponRange + abs(vel)*game->shot_relativity))) { --- 96,101 ---- pos += unit_vector(angle) * 28; //!!! int i; ! for (i=0; i < targets->N; i++) { ! tgt = targets->item[i]; if ((tgt != this) && (!tgt->sameShip(this)) && (!tgt->sameTeam(this)) && (!tgt->isInvisible()) && (distance(tgt) <= 1.2*(weaponRange + abs(vel)*game->shot_relativity))) { Index: shpkatas.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkatas.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpkatas.cpp 30 Oct 2003 21:51:20 -0000 1.7 --- shpkatas.cpp 22 Dec 2003 10:29:44 -0000 1.8 *************** *** 42,46 **** // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! game->rem_target(morph); update_panel = true; --- 42,46 ---- // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! targets->rem(morph); update_panel = true; Index: shpkatpo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkatpo.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpkatpo.cpp 30 Oct 2003 19:30:33 -0000 1.13 --- shpkatpo.cpp 22 Dec 2003 10:29:44 -0000 1.14 *************** *** 178,182 **** // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! game->rem_target(this); collide_flag_anyone = collide_flag_sameteam = collide_flag_sameship = 0; id = 0; // get immaterial --- 178,182 ---- // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! targets->rem(this); collide_flag_anyone = collide_flag_sameteam = collide_flag_sameship = 0; id = 0; // get immaterial Index: shpquasi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquasi.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpquasi.cpp 26 Oct 2003 10:43:17 -0000 1.9 --- shpquasi.cpp 22 Dec 2003 10:29:44 -0000 1.10 *************** *** 240,244 **** add(tmp); ! game->add_target(tmp); // separation from the engine pushes the ship it away a little --- 240,244 ---- add(tmp); ! targets->add(tmp); // separation from the engine pushes the ship it away a little *************** *** 248,252 **** // remove this thing from the target list ! game->rem_target(this); // check all existing objects, and if they're targetting --- 248,252 ---- // remove this thing from the target list ! targets->rem(this); // check all existing objects, and if they're targetting *************** *** 262,266 **** // add this thing to the targetlist ! game->add_target(this); } --- 262,266 ---- // add this thing to the targetlist ! targets->add(this); } Index: shpquawr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquawr.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpquawr.cpp 20 Oct 2003 11:00:50 -0000 1.9 --- shpquawr.cpp 22 Dec 2003 10:29:44 -0000 1.10 *************** *** 185,191 **** double r = 99999; int i; ! for (i = 0; i < game->num_targets; i += 1) { ! if (control->valid_target(game->target[i]) && (distance(game->target[i]) < r)) { ! t = game->target[i]; r = distance(t); } --- 185,191 ---- double r = 99999; int i; ! for (i = 0; i < targets->N; i += 1) { ! if (control->valid_target(targets->item[i]) && (distance(targets->item[i]) < r)) { ! t = targets->item[i]; r = distance(t); } Index: shprogsq.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shprogsq.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shprogsq.cpp 30 Oct 2003 20:41:02 -0000 1.11 --- shprogsq.cpp 22 Dec 2003 10:29:44 -0000 1.12 *************** *** 221,225 **** game->add(fighter[i]); ! game->add_target(fighter[i]); // make this targetable (isn't done by default?) fighter[i]->pos = fighter[i]->idealpos; --- 221,225 ---- game->add(fighter[i]); ! targets->add(fighter[i]); // make this targetable (isn't done by default?) fighter[i]->pos = fighter[i]->idealpos; *************** *** 242,246 **** // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! game->rem_target(this); // not used in queries --- 242,246 ---- // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! targets->rem(this); // not used in queries Index: shptauhu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptauhu.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shptauhu.cpp 30 Oct 2003 20:41:02 -0000 1.6 --- shptauhu.cpp 22 Dec 2003 10:29:44 -0000 1.7 *************** *** 204,208 **** // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! game->rem_target(this); } --- 204,208 ---- // game->num_targets--; // game->target[i] = game->target[game->num_targets]; ! targets->rem(this); } *************** *** 258,262 **** recharge_amount = 0; //restore target ! game->add_target(this); pos = ee; batt = 0; --- 258,262 ---- recharge_amount = 0; //restore target ! targets->add(this); pos = ee; batt = 0; Index: shpwassu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpwassu.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpwassu.cpp 1 Nov 2003 13:24:26 -0000 1.11 --- shpwassu.cpp 22 Dec 2003 10:29:45 -0000 1.12 *************** *** 280,284 **** SpecialActivated = TRUE; ! game->add_target(tmp); } --- 280,284 ---- SpecialActivated = TRUE; ! targets->add(tmp); } |
From: <geo...@us...> - 2003-12-22 10:29:48
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1:/tmp/cvs-serv12007/sc2ships Modified Files: shpslypr.cpp Log Message: putting the "targets" into a separate class (instead of being part of Game) Index: shpslypr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpslypr.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpslypr.cpp 12 Oct 2003 02:03:01 -0000 1.9 --- shpslypr.cpp 22 Dec 2003 10:29:45 -0000 1.10 *************** *** 218,223 **** double r = 99999; int i; ! for (i = 0; i < game->num_targets; i += 1) { ! SpaceObject *s = game->target[i]; if (s && s->exists() && control->valid_target(s) && (distance(s) < r)) { t = s; --- 218,223 ---- double r = 99999; int i; ! for (i = 0; i < targets->N; i += 1) { ! SpaceObject *s = targets->item[i]; if (s && s->exists() && control->valid_target(s) && (distance(s) < r)) { t = s; |
From: <geo...@us...> - 2003-12-22 10:29:48
|
Update of /cvsroot/timewarp/source/sc1ships In directory sc8-pr-cvs1:/tmp/cvs-serv12007/sc1ships Modified Files: shpandgu.cpp shpsyrpe.cpp Log Message: putting the "targets" into a separate class (instead of being part of Game) Index: shpandgu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpandgu.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpandgu.cpp 26 Oct 2003 10:43:17 -0000 1.6 --- shpandgu.cpp 22 Dec 2003 10:29:44 -0000 1.7 *************** *** 168,173 **** if (ship && ship->exists() && ship->control && ship->control->ship) { ! for (i = 0; i < game->num_targets; i += 1) { ! SpaceObject *s = game->target[i]; if (ship->control->valid_target(s) && (distance(s) < r) && !s->isInvisible()) { r = distance(s); --- 168,173 ---- if (ship && ship->exists() && ship->control && ship->control->ship) { ! for (i = 0; i < targets->N; i += 1) { ! SpaceObject *s = targets->item[i]; if (ship->control->valid_target(s) && (distance(s) < r) && !s->isInvisible()) { r = distance(s); *************** *** 177,182 **** } else { ! for (i = 0; i < game->num_targets; i += 1) { ! SpaceObject *s = game->target[i]; if (s->sameTeam(this) && (distance(s) < r) && !s->isInvisible()) { r = distance(s); --- 177,182 ---- } else { ! for (i = 0; i < targets->N; i += 1) { ! SpaceObject *s = targets->item[i]; if (s->sameTeam(this) && (distance(s) < r) && !s->isInvisible()) { r = distance(s); Index: shpsyrpe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpsyrpe.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpsyrpe.cpp 26 Oct 2003 10:43:17 -0000 1.6 --- shpsyrpe.cpp 22 Dec 2003 10:29:44 -0000 1.7 *************** *** 56,61 **** minDist = specialRange + (size.x / 2.0); int j; ! for (j = 0; j < game->num_targets; j += 1) { ! Ship *target = (Ship*) game->target[j]; if (!target->isShip()) continue; if (!control->valid_target(target)) continue; --- 56,61 ---- minDist = specialRange + (size.x / 2.0); int j; ! for (j = 0; j < targets->N; j += 1) { ! Ship *target = (Ship*) targets->item[j]; if (!target->isShip()) continue; if (!control->valid_target(target)) continue; |