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: Rob <geo...@us...> - 2005-10-05 20:22:03
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32530/source/melee Modified Files: mshppan.cpp Log Message: panel graphics fix Index: mshppan.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshppan.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mshppan.cpp 3 Sep 2005 19:49:45 -0000 1.21 --- mshppan.cpp 5 Oct 2005 20:21:52 -0000 1.22 *************** *** 275,279 **** // erase to default greyish panel color ! erasecolor = tw_color(100,100,100); x1 = xl; y1 = 12; --- 275,279 ---- // erase to default greyish panel color ! erasecolor = getpixel(panel, 2, 2);//tw_color(100,100,100); x1 = xl; y1 = 12; |
From: Rob <geo...@us...> - 2005-10-05 20:21:39
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32436/source/util Modified Files: errors.cpp Log Message: bug-hunt changes Index: errors.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/errors.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** errors.cpp 3 Sep 2005 19:49:45 -0000 1.14 --- errors.cpp 5 Oct 2005 20:21:28 -0000 1.15 *************** *** 431,435 **** //char tw_error_str[tw_error_str_len]; ! void caught_error(const char *format, ...) { char error_string[4096]; if (format) { --- 431,442 ---- //char tw_error_str[tw_error_str_len]; ! void caught_error(const char *format, ...) ! { ! ! #ifdef _DEBUG ! // in debug mode, crash right away, that is much easier. ! *(int*)0 = 0; ! #endif ! char error_string[4096]; if (format) { *************** *** 464,468 **** volatile int _crash_detected = 0; ! static void _crash_detector() { int i = get_time(); if (_crash_detected) { --- 471,477 ---- volatile int _crash_detected = 0; ! static void _crash_detector() ! { ! int i = get_time(); if (_crash_detected) { |
From: Rob <geo...@us...> - 2005-10-05 20:21:38
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32436/source/melee Modified Files: mframe.cpp Log Message: bug-hunt changes Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** mframe.cpp 27 Sep 2005 22:03:55 -0000 1.49 --- mframe.cpp 5 Oct 2005 20:21:27 -0000 1.50 *************** *** 644,648 **** } ! inline void check_vector_sanity(Vector2 &v) { #ifdef _DEBUG --- 644,648 ---- } ! static void check_vector_sanity(Vector2 &v) { #ifdef _DEBUG *************** *** 1075,1089 **** } - #ifdef _DEBUG - SpaceObject *c1 = this; - SpaceObject *c2 = other; - if (fabs(c1->vel.x) > 1E6 || fabs(c1->vel.y) > 1E6 || fabs(c2->vel.x) > 1E6 || fabs(c2->vel.y) > 1E6 ) - { - int a1 = c1->canCollide(c2); - int a2 = c2->canCollide(c1); - bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); - tw_error("velocity error in collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); - } - #endif Vector2 nd; --- 1075,1078 ---- *************** *** 1107,1110 **** --- 1096,1110 ---- } + #ifdef _DEBUG + SpaceObject *c1 = this; + SpaceObject *c2 = other; + if (fabs(c1->vel.x) > 1E6 || fabs(c1->vel.y) > 1E6 || fabs(c2->vel.x) > 1E6 || fabs(c2->vel.y) > 1E6 ) + { + int a1 = c1->canCollide(c2); + int a2 = c2->canCollide(c1); + bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); + tw_error("velocity error in collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); + } + #endif return; *************** *** 1585,1588 **** --- 1585,1589 ---- continue; + #ifdef _DEBUG //if (i == 1 && game_time == 100) tw_error("debug me!"); if (fabs(item[i]->vel.x) > 1E6 || fabs(item[i]->vel.y) > 1E6) *************** *** 1590,1593 **** --- 1591,1596 ---- tw_error("velocity error in %s", item[i]->get_identity()); } + #endif + item[i]->pos = normalize(item[i]->pos + item[i]->vel * frame_time, map_size); } *************** *** 1649,1652 **** --- 1652,1672 ---- tw_error("This item [%s] is not in-game", item[i]->get_identity()); } + + //xxx this is an expensive test !! + #ifdef _DEBUG + int k; + for (k = 0; k < num_items; k += 1) + { + if (!item[k]->exists()) + continue; + + //if (i == 1 && game_time == 100) tw_error("debug me!"); + if (fabs(item[k]->vel.x) > 1E6 || fabs(item[k]->vel.y) > 1E6) + { + tw_error("velocity error involving %s and %s", item[k]->get_identity(), item[i]->get_identity()); + } + } + #endif + } *************** *** 1725,1728 **** --- 1745,1756 ---- if (dead_presences[i]->state == -DEATH_FRAMES) { + #ifdef _DEBUG + Presence *p = dead_presences[i]; + const char *name = p->get_identity(); + SpaceLocation *l = 0; + SpaceObject *o = 0; + if (p->isLocation()) l = (SpaceLocation*) p; + if (p->isObject()) o = (SpaceObject*) p; + #endif delete dead_presences[i]; *************** *** 1875,1878 **** --- 1903,1908 ---- j = 0; + physics_allowed = true; + for ( i = 0; i < num_presences; ++i ) { *************** *** 2097,2100 **** --- 2127,2143 ---- for (i = 0; i < nc; i += 1) { + #ifdef _DEBUG + SpaceObject *c1 = col[i*2]; + SpaceObject *c2 = col[i*2+1]; + if (fabs(c1->vel.x) > 1E6 || fabs(c1->vel.y) > 1E6 || fabs(c2->vel.x) > 1E6 || fabs(c2->vel.y) > 1E6 ) + { + tw_error("velocity error prior to collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); + } + #endif + } + + for (i = 0; i < nc; i += 1) + { + col[i*2]->collide(col[i*2+1]); *************** *** 2107,2111 **** int a2 = c2->canCollide(c1); bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); ! tw_error("velocity error in collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); } #endif --- 2150,2154 ---- int a2 = c2->canCollide(c1); bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); ! tw_error("velocity error after collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); } #endif |
From: Rob <geo...@us...> - 2005-10-05 20:21:05
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32330/source/melee Modified Files: mshpdata.cpp Log Message: graphics color fix Index: mshpdata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshpdata.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mshpdata.cpp 27 Sep 2005 22:03:55 -0000 1.15 --- mshpdata.cpp 5 Oct 2005 20:20:57 -0000 1.16 *************** *** 224,227 **** --- 224,233 ---- void ShipData::unlock() { references -= 1; + + if (references < 0) + { + tw_error("Too few references."); + } + if (!islocked() && auto_unload) { unload(); |
From: Rob <geo...@us...> - 2005-10-05 20:20:18
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32132/source/newships Modified Files: shpducla.cpp shpgerhe.cpp shpradfi.cpp shpsefn2.cpp shptauar.cpp Log Message: Changes due to a velocity overflow bug-hunting Index: shpsefn2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsefn2.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpsefn2.cpp 28 Aug 2005 20:34:08 -0000 1.13 --- shpsefn2.cpp 5 Oct 2005 20:20:04 -0000 1.14 *************** *** 479,482 **** --- 479,494 ---- } + #ifdef _DEBUG + SpaceObject *c1 = this; + SpaceObject *c2 = other; + if (fabs(c1->vel.x) > 1E6 || fabs(c1->vel.y) > 1E6 || fabs(c2->vel.x) > 1E6 || fabs(c2->vel.y) > 1E6 ) + { + int a1 = c1->canCollide(c2); + int a2 = c2->canCollide(c1); + bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); + tw_error("velocity error in collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); + } + #endif + return 1; } *************** *** 1050,1054 **** V2 = 2 * ship->speed_max; if ( V1 > V2 ) ! ship->vel *= V2 / V1; } --- 1062,1066 ---- V2 = 2 * ship->speed_max; if ( V1 > V2 ) ! ship->scale_vel(V2 / V1); } *************** *** 1058,1062 **** V2 = 2 * ((Ship*) hooktarget)->speed_max; if ( V1 > V2 ) ! hooktarget->vel *= V2 / V1; } --- 1070,1074 ---- V2 = 2 * ((Ship*) hooktarget)->speed_max; if ( V1 > V2 ) ! hooktarget->scale_vel(V2 / V1); } Index: shptauar.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptauar.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** shptauar.cpp 28 Aug 2005 20:34:08 -0000 1.20 --- shptauar.cpp 5 Oct 2005 20:20:04 -0000 1.21 *************** *** 400,403 **** --- 400,404 ---- { STACKTRACE; + //xxx d<0 is possible.. sprite->animate(pos, index_base + (int)(19.89 * d / range), space); } Index: shpducla.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpducla.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** shpducla.cpp 28 Aug 2005 20:34:07 -0000 1.21 --- shpducla.cpp 5 Oct 2005 20:20:03 -0000 1.22 *************** *** 511,514 **** --- 511,526 ---- } + #ifdef _DEBUG + SpaceObject *c1 = this; + SpaceObject *c2 = other; + if (fabs(c1->vel.x) > 1E6 || fabs(c1->vel.y) > 1E6 || fabs(c2->vel.x) > 1E6 || fabs(c2->vel.y) > 1E6 ) + { + int a1 = c1->canCollide(c2); + int a2 = c2->canCollide(c1); + bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); + tw_error("velocity error in collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); + } + #endif + return 1; } Index: shpradfi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpradfi.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpradfi.cpp 11 Jul 2005 00:25:32 -0000 1.8 --- shpradfi.cpp 5 Oct 2005 20:20:04 -0000 1.9 *************** *** 82,87 **** if (shipmode) { ! // damage also adds to your battery. ! handle_fuel_sap(this, -battmultiplier * normal); } --- 82,90 ---- if (shipmode) { ! // damage also adds to your battery... let's make this the absolute value of the damage ;) ! handle_fuel_sap(this, -battmultiplier * fabs(normal)); ! ! if (batt < 0) ! batt = 0; } *************** *** 121,124 **** --- 124,129 ---- if (r > 0.999) r = 0.999; + if (r < 0) + r = 0; index = int( r * data->spriteSpecial->frames()); Index: shpgerhe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgerhe.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** shpgerhe.cpp 28 Aug 2005 20:34:08 -0000 1.24 --- shpgerhe.cpp 5 Oct 2005 20:20:03 -0000 1.25 *************** *** 904,907 **** --- 904,909 ---- mother = creator; + copy_values(mother); + dangle = 0.0; *************** *** 939,942 **** --- 941,947 ---- angle += dangle; + while (angle > PI) angle -= PI2; + while (angle < -PI) angle += PI2; + // acceleration: accelerate_gravwhip(this, angle, accel_rate * frame_time, speed_max); |
From: Rob <geo...@us...> - 2005-10-05 20:20:12
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32132/source/other Modified Files: shippart.cpp Log Message: Changes due to a velocity overflow bug-hunting Index: shippart.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/shippart.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shippart.cpp 28 Aug 2005 20:32:16 -0000 1.15 --- shippart.cpp 5 Oct 2005 20:20:04 -0000 1.16 *************** *** 54,57 **** --- 54,66 ---- } + static void check_vector_sanity(Vector2 &v) + { + #ifdef _DEBUG + if (fabs(v.x) > 1E6 || fabs(v.y) > 1E6 ) + { + tw_error("invalid velocity change"); + } + #endif + } // change velocities of the ship and all its parts *************** *** 71,74 **** --- 80,85 ---- parts[i]->vel += dvel; + + check_vector_sanity(parts[i]->vel); } } *************** *** 113,135 **** relangle = orelangle; layer = LAYER_SHIPS; set_depth(DEPTH_SHIPS-0.1); // the ship should come first in calculations. - mass = owner->mass; oldpos = pos; oldvel = vel; - // these values aren't really used ... I think ... - crew = owner->crew; - crew_max = owner->crew_max; - batt = owner->batt; - batt_max = owner->batt_max; - recharge_rate = owner->recharge_rate; - - recharge_step = recharge_rate; - recharge_amount = owner->recharge_amount; - turn_rate = owner->turn_rate; - accel_rate = owner->accel_rate; - sprite_uncrewed = spr_uncrewed; --- 124,135 ---- relangle = orelangle; + copy_values(owner); + layer = LAYER_SHIPS; set_depth(DEPTH_SHIPS-0.1); // the ship should come first in calculations. oldpos = pos; oldvel = vel; sprite_uncrewed = spr_uncrewed; *************** *** 171,174 **** --- 171,175 ---- vel = owner->vel; + check_vector_sanity(vel); // THIS SHOULD BE REPLACED BY ADDING ROTATIONAL VELOCITY ... *************** *** 181,184 **** --- 182,187 ---- Ship::calculate(); + check_vector_sanity(vel); + if ( !(owner && owner->exists()) ) { *************** *** 193,196 **** --- 196,202 ---- else collider = 0; + + check_vector_sanity(vel); + // otherwise, you shouldn't touch the current ship-part settings, // instead let the owner handle this case. The vel/ pos are needed *************** *** 263,266 **** --- 269,274 ---- owner->change_vel(dvel); + + check_vector_sanity(vel); } *************** *** 271,274 **** --- 279,285 ---- owner->change_pos(dpos); + + check_vector_sanity(vel); + check_vector_sanity(pos); } *************** *** 315,318 **** --- 326,331 ---- vel = ownerpart->vel; + check_vector_sanity(vel); + check_vector_sanity(pos); } |
From: Rob <geo...@us...> - 2005-09-27 22:04:04
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362/source/melee Modified Files: mcbodies.cpp mframe.cpp mitems.cpp mmain.cpp mshpdata.cpp msprite.cpp Log Message: It appears that there's a possible overflow of the mask-array in case of an irregular sprite, because of use of a single default width; default width is therefore removed from the SpaceSprite, and the (artificial) separation between regular/irregular is removed. This has consequences throughout the game code. Index: mshpdata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshpdata.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mshpdata.cpp 15 Sep 2005 09:00:44 -0000 1.14 --- mshpdata.cpp 27 Sep 2005 22:03:55 -0000 1.15 *************** *** 147,153 **** tw_error("save_spacesprite2 - error"); ! BITMAP *tmp = create_bitmap(int(ss->width() * 8), int(ss->height() * 8)); for (i = 0; i < ss->frames(); i += 1) { ! blit(ss->get_bitmap(i), tmp, 0, 0, (i&7) * (int)ss->width(), int((i/8) * ss->height()), (int)ss->width(), (int)ss->height()); sprintf(buf, "%s%i.%s", spritename, i, extension); save_bitmap(buf, tmp, NULL); --- 147,153 ---- tw_error("save_spacesprite2 - error"); ! BITMAP *tmp = create_bitmap(int(ss->width(0) * 8), int(ss->height(0) * 8)); for (i = 0; i < ss->frames(); i += 1) { ! blit(ss->get_bitmap(i), tmp, 0, 0, (i&7) * (int)ss->width(i), int((i/8) * ss->height(i)), (int)ss->width(i), (int)ss->height(i)); sprintf(buf, "%s%i.%s", spritename, i, extension); save_bitmap(buf, tmp, NULL); *************** *** 195,200 **** set_config_string("Main", "Type", "SpaceSprite"); set_config_int("SpaceSprite", "Number", (int)ss->frames()); ! set_config_int("SpaceSprite", "Width", (int)ss->width()); ! set_config_int("SpaceSprite", "Height", (int)ss->height()); set_config_string("SpaceSprite", "SubType", "Normal"); set_config_string("SpaceSprite", "Extension", extension); --- 195,200 ---- set_config_string("Main", "Type", "SpaceSprite"); set_config_int("SpaceSprite", "Number", (int)ss->frames()); ! set_config_int("SpaceSprite", "Width", (int)ss->width(0)); ! set_config_int("SpaceSprite", "Height", (int)ss->height(0)); set_config_string("SpaceSprite", "SubType", "Normal"); set_config_string("SpaceSprite", "Extension", extension); Index: mcbodies.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mcbodies.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mcbodies.cpp 28 Aug 2005 20:31:32 -0000 1.19 --- mcbodies.cpp 27 Sep 2005 22:03:55 -0000 1.20 *************** *** 179,184 **** RNG_FS rng; rng.set_state64(s64); ! wx = sprite->width() * zoom; ! wy = sprite->height() * zoom; if (!wx || !wy) return; x = normalize ( x , mx); --- 179,184 ---- RNG_FS rng; rng.set_state64(s64); ! wx = sprite->width(index) * zoom; ! wy = sprite->height(index) * zoom; if (!wx || !wy) return; x = normalize ( x , mx); *************** *** 233,238 **** rng.set_state64(s64); int iwx, iwy; ! wx = sprite->width() * zoom; ! wy = sprite->height() * zoom; if (aa_mode) { iwx = iround_up(wx); --- 233,238 ---- rng.set_state64(s64); int iwx, iwy; ! wx = sprite->width(index) * zoom; ! wy = sprite->height(index) * zoom; if (aa_mode) { iwx = iround_up(wx); Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** mmain.cpp 3 Sep 2005 19:49:45 -0000 1.46 --- mmain.cpp 27 Sep 2005 22:03:55 -0000 1.47 *************** *** 990,994 **** continue; ! if (p->control->ship) { if (!p->control->ship->exists()) --- 990,994 ---- continue; ! /*if (p->control->ship) { if (!p->control->ship->exists()) *************** *** 997,1001 **** } } ! else { // if (player_panel[i]) player_panel[i]->window->hide(); // player_panel[i] = NULL; --- 997,1003 ---- } } ! else {*/ ! if (!p->control->ship) ! { // if (player_panel[i]) player_panel[i]->window->hide(); // player_panel[i] = NULL; Index: mitems.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mitems.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mitems.cpp 14 Aug 2005 16:14:32 -0000 1.10 --- mitems.cpp 27 Sep 2005 22:03:55 -0000 1.11 *************** *** 158,163 **** p -= space_view_size / 2; ! p.x -= sign(p.x) * s->width() / 4 * sqrt(space_zoom); ! p.y -= sign(p.y) * s->height() / 4 * sqrt(space_zoom); //shouldn't be sqrt ... maybe there's a bug somewhere --- 158,163 ---- p -= space_view_size / 2; ! p.x -= sign(p.x) * s->width(0) / 4 * sqrt(space_zoom); ! p.y -= sign(p.y) * s->height(0) / 4 * sqrt(space_zoom); //shouldn't be sqrt ... maybe there's a bug somewhere Index: msprite.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/msprite.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** msprite.cpp 15 Sep 2005 09:00:44 -0000 1.27 --- msprite.cpp 27 Sep 2005 22:03:55 -0000 1.28 *************** *** 311,316 **** int lw, lh; ! lw = iround(w * pow(0.5, level)); ! lh = iround(h * pow(0.5, level)); BITMAP *src = get_bitmap(i, 0);//b[0][i]; --- 311,316 ---- int lw, lh; ! lw = iround(width(index) * pow(0.5, level)); ! lh = iround(height(index) * pow(0.5, level)); BITMAP *src = get_bitmap(i, 0);//b[0][i]; *************** *** 351,356 **** { int lw, lh; ! lw = iround(w * pow(0.5, level)); ! lh = iround(h * pow(0.5, level)); if ((lw < 8) || (lh < 8)) --- 351,356 ---- { int lw, lh; ! lw = iround(width(0) * pow(0.5, level)); ! lh = iround(height(0) * pow(0.5, level)); if ((lw < 8) || (lh < 8)) *************** *** 379,383 **** if (sbitmap[l][i]) { ! BITMAP *tmp = create_bitmap_ex(newbpp, w, h); convert_bitmap(sbitmap[l][i], tmp, (general_attributes & MASKED) ? AA_MASKED : 0); --- 379,383 ---- if (sbitmap[l][i]) { ! BITMAP *tmp = create_bitmap_ex(newbpp, width(i), height(i)); convert_bitmap(sbitmap[l][i], tmp, (general_attributes & MASKED) ? AA_MASKED : 0); *************** *** 434,437 **** --- 434,459 ---- + int SpaceSprite::width(int i) + { + BITMAP *b; + b = get_bitmap(i); + return b->w; + } + + int SpaceSprite::height(int i) + { + BITMAP *b; + b = get_bitmap(i); + return b->h; + } + + void SpaceSprite::size(int *w, int *h, int i) + { + BITMAP *b; + b = get_bitmap(i); + *w = b->w; + *h = b->h; + } + PMASK *SpaceSprite::get_pmask(int index) *************** *** 452,456 **** STACKTRACE int i, j, obpp=0; ! BITMAP *bmp, *tmp = NULL; if (_attributes == -1) _attributes = string_to_sprite_attributes(NULL); --- 474,478 ---- STACKTRACE int i, j, obpp=0; ! BITMAP *bmp;//, *tmp = 0; if (_attributes == -1) _attributes = string_to_sprite_attributes(NULL); *************** *** 481,492 **** switch (originaltype) { case DAT_RLE_SPRITE: { ! w = ((RLE_SPRITE *)images[0].dat)->w; ! h = ((RLE_SPRITE *)images[0].dat)->h; obpp = ((RLE_SPRITE *)images[0].dat)->color_depth; } break; case DAT_BITMAP: { ! w = ((BITMAP *)images[0].dat)->w; ! h = ((BITMAP *)images[0].dat)->h; obpp = bitmap_color_depth((BITMAP *)images[0].dat); } --- 503,514 ---- switch (originaltype) { case DAT_RLE_SPRITE: { ! //bw = ((RLE_SPRITE *)images[0].dat)->w; ! //bh = ((RLE_SPRITE *)images[0].dat)->h; obpp = ((RLE_SPRITE *)images[0].dat)->color_depth; } break; case DAT_BITMAP: { ! //bw = ((BITMAP *)images[0].dat)->w; ! //bh = ((BITMAP *)images[0].dat)->h; obpp = bitmap_color_depth((BITMAP *)images[0].dat); } *************** *** 498,505 **** } ! if (bpp == 0) bpp = obpp; ! ! if (obpp != bpp) ! tmp = create_bitmap_ex(obpp, w, h); if (general_attributes & ALPHA) { --- 520,529 ---- } ! if (bpp == 0) ! bpp = obpp; ! ! // this is moved lower... ! // if (obpp != bpp) ! // tmp = create_bitmap_ex(obpp, bw, bh); if (general_attributes & ALPHA) { *************** *** 509,532 **** ! if (general_attributes & IRREGULAR) ! goto irregular; ! for(i = 1; i < sprite_count; i++) { ! if (images[i].type != originaltype) {tw_error ("SpaceSprite - bad data file");} switch (originaltype) { case DAT_RLE_SPRITE: { ! if ((w != ((RLE_SPRITE *)images[i].dat)->w) || ! (h != ((RLE_SPRITE *)images[i].dat)->h) ) {tw_error("SpaceSprite - size changed");} if (((RLE_SPRITE *)images[i].dat)->color_depth != obpp) {tw_error("SpaceSprite - changing source color depth not yet allowed");} } break; case DAT_BITMAP: { ! if ((w != ((BITMAP *)images[i].dat)->w) || ! (h != ((BITMAP *)images[i].dat)->h) ) {tw_error("SpaceSprite - size changed");} if (bitmap_color_depth((BITMAP *)images[i].dat) != obpp) {tw_error("SpaceSprite - changing source color depth not yet allowed");} } break; } ! } smask = new PMASK*[count]; --- 533,561 ---- ! // if (general_attributes & IRREGULAR) ! // goto irregular; ! for(i = 1; i < sprite_count; i++) ! { ! if (images[i].type != originaltype) ! {tw_error ("SpaceSprite - bad data file");} ! ! /* switch (originaltype) { case DAT_RLE_SPRITE: { ! //if ((w != ((RLE_SPRITE *)images[i].dat)->w) || ! // (h != ((RLE_SPRITE *)images[i].dat)->h) ) {tw_error("SpaceSprite - size changed");} if (((RLE_SPRITE *)images[i].dat)->color_depth != obpp) {tw_error("SpaceSprite - changing source color depth not yet allowed");} } break; case DAT_BITMAP: { ! //if ((w != ((BITMAP *)images[i].dat)->w) || ! // (h != ((BITMAP *)images[i].dat)->h) ) {tw_error("SpaceSprite - size changed");} if (bitmap_color_depth((BITMAP *)images[i].dat) != obpp) {tw_error("SpaceSprite - changing source color depth not yet allowed");} } break; } ! */ ! } smask = new PMASK*[count]; *************** *** 542,546 **** } ! bmp = create_bitmap_ex(bpp, w, h); --- 571,591 ---- } ! // determine the size of this bitmap ! int bw = 0, bh = 0; ! switch (originaltype) ! { ! case DAT_RLE_SPRITE: ! bw = ((RLE_SPRITE *)(images[i].dat))->w; ! bh = ((RLE_SPRITE *)(images[i].dat))->h; ! break; ! case DAT_BITMAP: ! bw = ((BITMAP *)(images[i].dat))->w; ! bh = ((BITMAP *)(images[i].dat))->h; ! break; ! } ! ! // allocate space for storage of a copy of the bitmap ! // use the new color depth ! bmp = create_bitmap_ex(bpp, bw, bh); *************** *** 548,563 **** clear_to_color(bmp, bitmap_mask_color(bmp)); ! if (!tmp) ! tmp = bmp; ! if (tmp != bmp) ! { ! int col = bitmap_mask_color(tmp); ! clear_to_color(tmp, col); ! } switch (originaltype) { case DAT_RLE_SPRITE: { draw_rle_sprite(tmp, (RLE_SPRITE *)(images[i].dat), 0, 0); --- 593,621 ---- clear_to_color(bmp, bitmap_mask_color(bmp)); ! // if (obpp != bpp) ! // { ! // if (!tmp) ! // tmp = create_bitmap_ex(obpp, bw, bh); ! // if (tmp->w != bmp->w ! // } ! // if (!tmp) ! // tmp = bmp; ! ! // if (tmp != bmp) ! // { ! // int col = bitmap_mask_color(tmp); ! // clear_to_color(tmp, col); ! // } switch (originaltype) { case DAT_RLE_SPRITE: { + // use the old color depth + BITMAP *tmp = create_bitmap_ex(obpp, bw, bh); + + int col = bitmap_mask_color(tmp); + clear_to_color(tmp, col); + draw_rle_sprite(tmp, (RLE_SPRITE *)(images[i].dat), 0, 0); *************** *** 565,590 **** handle_alpha_load(tmp); ! if (tmp != bmp) convert_bitmap(tmp, bmp, (general_attributes & MASKED) ? AA_MASKED : 0); } break; case DAT_BITMAP: { ! if (general_attributes & ALPHA) handle_alpha_load((BITMAP *)(images[i].dat)); ! if (obpp != bpp) { convert_bitmap((BITMAP *)(images[i].dat), bmp, (general_attributes & MASKED) ? AA_MASKED : 0); ! } ! else { if (general_attributes & MASKED) draw_sprite(bmp, (BITMAP*)images[i].dat, 0, 0); ! else ! blit((BITMAP*)images[i].dat, bmp, 0, 0, 0, 0, w, h); } } break; } ! color_correct_bitmap(bmp, general_attributes & MASKED); ! if (tmp == bmp) ! tmp = NULL; for (j = 1; j < rotations; j += 1) --- 623,657 ---- handle_alpha_load(tmp); ! if (obpp != bpp) convert_bitmap(tmp, bmp, (general_attributes & MASKED) ? AA_MASKED : 0); + + destroy_bitmap(tmp); } break; case DAT_BITMAP: { ! if (general_attributes & ALPHA) ! handle_alpha_load((BITMAP *)(images[i].dat)); ! ! if (obpp != bpp) ! { convert_bitmap((BITMAP *)(images[i].dat), bmp, (general_attributes & MASKED) ? AA_MASKED : 0); ! } else { if (general_attributes & MASKED) + { + int col = bitmap_mask_color(bmp); + clear_to_color(bmp, col); draw_sprite(bmp, (BITMAP*)images[i].dat, 0, 0); ! ! } else ! blit((BITMAP*)images[i].dat, bmp, 0, 0, 0, 0, bw, bh); } } break; } ! //xxx test ! //color_correct_bitmap(bmp, general_attributes & MASKED); ! // if (tmp == bmp) ! // tmp = NULL; for (j = 1; j < rotations; j += 1) *************** *** 610,618 **** } ! if (tmp) ! { ! destroy_bitmap(tmp); ! tmp = 0; ! } if (general_attributes & MIPMAPED) --- 677,685 ---- } ! // if (tmp) ! // { ! // destroy_bitmap(tmp); ! // tmp = 0; ! // } if (general_attributes & MIPMAPED) *************** *** 622,626 **** ! return;//end of normal/masked/autorotated --- 689,693 ---- ! /* THE MAIN ROUTINE IS GENERALIZED, BECAUSE A MIX OF 2 TYPES JUST CONFUSING, AND NOT NEEDED ANYMORE return;//end of normal/masked/autorotated *************** *** 683,687 **** return;//end of irregular/masked ! } --- 750,754 ---- return;//end of irregular/masked ! */ } *************** *** 694,699 **** highest_mip = old.highest_mip; originaltype = -1; ! w = old.w; ! h = old.h; smask = new PMASK*[count]; sbitmap[0] = new BITMAP* [count]; --- 761,766 ---- highest_mip = old.highest_mip; originaltype = -1; ! // w = old.w; ! // h = old.h; smask = new PMASK*[count]; sbitmap[0] = new BITMAP* [count]; *************** *** 814,819 **** int ix = iround(pos.x); int iy = iround(pos.y); ! int spr_w = iround(w * space_zoom * scale); ! int spr_h = iround(h * space_zoom * scale); if(spr_w < 1) spr_w = 1; if(spr_h < 1) spr_h = 1; --- 881,886 ---- int ix = iround(pos.x); int iy = iround(pos.y); ! int spr_w = iround(width(index) * space_zoom * scale); ! int spr_h = iround(height(index) * space_zoom * scale); if(spr_w < 1) spr_w = 1; if(spr_h < 1) spr_h = 1; *************** *** 882,886 **** if (index < 0) {tw_error("SpaceSprite::get_bitmap - index %d < 0 (count %d)", index, count); index = 0;} int ix, iy, iw, ih; ! int mip = find_mip_level(size.x / this->w, highest_mip); BITMAP *bmp = get_bitmap(index, mip);//b[mip][index]; aa_set_mode(find_aa_mode(general_attributes)); --- 949,953 ---- if (index < 0) {tw_error("SpaceSprite::get_bitmap - index %d < 0 (count %d)", index, count); index = 0;} int ix, iy, iw, ih; ! int mip = find_mip_level(size.x / this->width(index), highest_mip); BITMAP *bmp = get_bitmap(index, mip);//b[mip][index]; aa_set_mode(find_aa_mode(general_attributes)); *************** *** 920,924 **** //if (iy >= frame->frame->h) return; ! int mip = find_mip_level(size.x / this->w, highest_mip); BITMAP *bmp; --- 987,992 ---- //if (iy >= frame->frame->h) return; ! int mip = find_mip_level(size.x / this->width(index), highest_mip); ! BITMAP *bmp; *************** *** 942,947 **** if (tw_aa_mode & AA_NO_AA) { ! masked_stretch_blit(bmp, frame->surface, 0,0,bmp->w,bmp->h, ! ix, iy, iw, ih); } else { aa_stretch_blit(bmp, frame->surface, 0,0,bmp->w,bmp->h, --- 1010,1015 ---- if (tw_aa_mode & AA_NO_AA) { ! masked_stretch_blit(bmp, frame->surface, 0,0,bmp->w,bmp->h, ix, iy, iw, ih); ! } else { aa_stretch_blit(bmp, frame->surface, 0,0,bmp->w,bmp->h, *************** *** 988,996 **** {STACKTRACE draw_character(x, y, index, color, space->surface); ! space->add_box(x, y, w, h); } void SpaceSprite::draw_character(int x, int y, int w, int h, int index, int color, Frame *space) ! {STACKTRACE draw_character(x, y, w, h, index, color, space->surface); space->add_box(x, y, w, h); --- 1056,1065 ---- {STACKTRACE draw_character(x, y, index, color, space->surface); ! space->add_box(x, y, width(index), height(index)); } void SpaceSprite::draw_character(int x, int y, int w, int h, int index, int color, Frame *space) ! { ! STACKTRACE; draw_character(x, y, w, h, index, color, space->surface); space->add_box(x, y, w, h); *************** *** 1049,1053 **** int SpaceSprite::collide_ray(int lx1, int ly1, int *lx2, int *ly2, int sx, int sy, int sindex) ! {STACKTRACE line_collide = FALSE; rect_x = sx - (w / 2); --- 1118,1133 ---- int SpaceSprite::collide_ray(int lx1, int ly1, int *lx2, int *ly2, int sx, int sy, int sindex) ! { ! STACKTRACE; ! ! BITMAP *bmp; ! bmp = get_bitmap(sindex); ! if (!bmp) ! return (FALSE); ! ! int w, h; ! w = bmp->w; ! h = bmp->h; ! line_collide = FALSE; rect_x = sx - (w / 2); *************** *** 1185,1189 **** tw_error("Basic sprite shape doesn't exist, cannot rotate"); } ! BITMAP *tmp = create_bitmap_ex(bpp, w, h); clear_to_color(tmp, bitmap_mask_color(tmp)); rotate_sprite(tmp, bmp, 0, 0, irot * ((1<<24)/count_rotations)); --- 1265,1269 ---- tw_error("Basic sprite shape doesn't exist, cannot rotate"); } ! BITMAP *tmp = create_bitmap_ex(bpp, bmp->w, bmp->h); clear_to_color(tmp, bitmap_mask_color(tmp)); rotate_sprite(tmp, bmp, 0, 0, irot * ((1<<24)/count_rotations)); Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** mframe.cpp 23 Sep 2005 13:02:02 -0000 1.48 --- mframe.cpp 27 Sep 2005 22:03:55 -0000 1.49 *************** *** 980,984 **** : SpaceLocation(creator, opos, oangle), ! size(osprite->width(), osprite->height()), mass(0), sprite(osprite), --- 980,984 ---- : SpaceLocation(creator, opos, oangle), ! size(osprite->width(0), osprite->height(0)), mass(0), sprite(osprite), |
From: Rob <geo...@us...> - 2005-09-27 22:04:04
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362/source/util Modified Files: pmask.c Log Message: It appears that there's a possible overflow of the mask-array in case of an irregular sprite, because of use of a single default width; default width is therefore removed from the SpaceSprite, and the (artificial) separation between regular/irregular is removed. This has consequences throughout the game code. Index: pmask.c =================================================================== RCS file: /cvsroot/timewarp/source/util/pmask.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pmask.c 16 Aug 2005 18:17:30 -0000 1.9 --- pmask.c 27 Sep 2005 22:03:56 -0000 1.10 *************** *** 26,37 **** #define MAX_INTVAL(int_type) ((((unsigned int_type)(-1))-1)/2) ! int get_pmask_pixel(CONST struct PMASK *mask, int x, int y) { ! return 1 & (mask->mask[(mask->h * (x >> MASK_WORD_BITBITS)) + y] >> (x & (MASK_WORD_BITS-1))); } ! void set_pmask_pixel(struct PMASK *mask, int x, int y, int value) { if (value) { ! mask->mask[(mask->h * (x >> MASK_WORD_BITBITS)) + y] |= 1 << (x & (MASK_WORD_BITS-1)); } else { ! mask->mask[(mask->h * (x >> MASK_WORD_BITBITS)) + y] &=~(1 << (x & (MASK_WORD_BITS-1))); } } --- 26,58 ---- #define MAX_INTVAL(int_type) ((((unsigned int_type)(-1))-1)/2) ! ! int get_pmask_pixel(CONST struct PMASK *mask, int x, int y) ! { ! int k; ! ! #ifdef _DEBUG ! if (x < 0 || y < 0 || x > mask->w || y > mask->h) ! { ! *(int*) 0 = 0; // happens with collision with MortarFire = an irregular sprite... ! } ! #endif ! k = (mask->h * (x >> MASK_WORD_BITBITS)) + y; ! return 1 & (mask->mask[k] >> (x & (MASK_WORD_BITS-1))); } ! void set_pmask_pixel(struct PMASK *mask, int x, int y, int value) ! { ! int k; ! #ifdef _DEBUG ! if (x < 0 || y < 0 || x > mask->w || y > mask->h) ! { ! *(int*) 0 = 0; ! } ! #endif ! ! k = (mask->h * (x >> MASK_WORD_BITBITS)) + y; if (value) { ! mask->mask[k] |= 1 << (x & (MASK_WORD_BITS-1)); } else { ! mask->mask[k] &=~(1 << (x & (MASK_WORD_BITS-1))); } } *************** *** 61,64 **** --- 82,88 ---- total_words = words * h; + // so... the pmask is a series of bits, which indicate if there is a color or not. + // that's why there is the shift-right: there is less room needed. + #ifdef MASK_SINGLE_MEMORY_BLOCK |
From: Rob <geo...@us...> - 2005-09-27 22:04:04
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362/source/newships Modified Files: shpjurcu.cpp Log Message: It appears that there's a possible overflow of the mask-array in case of an irregular sprite, because of use of a single default width; default width is therefore removed from the SpaceSprite, and the (artificial) separation between regular/irregular is removed. This has consequences throughout the game code. Index: shpjurcu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpjurcu.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpjurcu.cpp 28 Aug 2005 20:34:08 -0000 1.9 --- shpjurcu.cpp 27 Sep 2005 22:03:55 -0000 1.10 *************** *** 116,120 **** // the animation needs to check if it inflicts damage on its own. for (a.begin(this, bit(LAYER_SHIPS) + bit(LAYER_SHOTS) + bit(LAYER_SPECIAL), ! sprite->width()/2, QUERY_OBJECT); a.current; a.next()) { if (!a.currento->sameTeam(this) && !(a.currento->isAsteroid() || a.currento->isPlanet() ) ) --- 116,120 ---- // the animation needs to check if it inflicts damage on its own. for (a.begin(this, bit(LAYER_SHIPS) + bit(LAYER_SHOTS) + bit(LAYER_SPECIAL), ! sprite->width(0)/2, QUERY_OBJECT); a.current; a.next()) { if (!a.currento->sameTeam(this) && !(a.currento->isAsteroid() || a.currento->isPlanet() ) ) |
From: Rob <geo...@us...> - 2005-09-27 22:04:03
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362/source/games Modified Files: gleague.cpp gplanets.cpp Log Message: It appears that there's a possible overflow of the mask-array in case of an irregular sprite, because of use of a single default width; default width is therefore removed from the SpaceSprite, and the (artificial) separation between regular/irregular is removed. This has consequences throughout the game code. Index: gleague.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gleague.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gleague.cpp 11 Jul 2005 00:25:11 -0000 1.12 --- gleague.cpp 27 Sep 2005 22:03:55 -0000 1.13 *************** *** 132,136 **** post = new FixedObject( NULL, Vector2(2 * size.x / 5 - meleedata.planetSprite->size().x / 2, 9 * size.y / 10), 0, meleedata.planetSprite ); add( post ); ! post = new FixedObject( NULL, Vector2(3 * size.x / 5 + meleedata.planetSprite->width() / 2, 9 * size.y / 10), 0, meleedata.planetSprite ); add( post ); --- 132,136 ---- post = new FixedObject( NULL, Vector2(2 * size.x / 5 - meleedata.planetSprite->size().x / 2, 9 * size.y / 10), 0, meleedata.planetSprite ); add( post ); ! post = new FixedObject( NULL, Vector2(3 * size.x / 5 + meleedata.planetSprite->width(0) / 2, 9 * size.y / 10), 0, meleedata.planetSprite ); add( post ); Index: gplanets.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gplanets.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gplanets.cpp 28 Aug 2005 20:31:01 -0000 1.16 --- gplanets.cpp 27 Sep 2005 22:03:55 -0000 1.17 *************** *** 882,890 **** for ( i = 0; i < NumMoons-1; ++i ) { ! int R1 = max(MoonPics[PlanetMoonPic[i]]->height(), ! MoonPics[PlanetMoonPic[i]]->width()); ! int R2 = max(MoonPics[PlanetMoonPic[i+1]]->height(), ! MoonPics[PlanetMoonPic[i+1]]->width()); if (PlanetMoonEllipsW[i+1]-PlanetMoonEllipsW[i] < R1+R2) --- 882,890 ---- for ( i = 0; i < NumMoons-1; ++i ) { ! int R1 = max(MoonPics[PlanetMoonPic[i]]->height(0), ! MoonPics[PlanetMoonPic[i]]->width(0)); ! int R2 = max(MoonPics[PlanetMoonPic[i+1]]->height(0), ! MoonPics[PlanetMoonPic[i+1]]->width(0)); if (PlanetMoonEllipsW[i+1]-PlanetMoonEllipsW[i] < R1+R2) *************** *** 1097,1102 **** 0, 0, tmpscreen->w, tmpscreen->h); ! x = xcenter - PlanetPics[iplanetpic]->width()/2; ! y = ycenter - PlanetPics[iplanetpic]->height()/2; Vector2 P, S; --- 1097,1102 ---- 0, 0, tmpscreen->w, tmpscreen->h); ! x = xcenter - PlanetPics[iplanetpic]->width(0)/2; ! y = ycenter - PlanetPics[iplanetpic]->height(0)/2; Vector2 P, S; *************** *** 1129,1134 **** { double R = PlanetMoonEllipsW[i] * 0.9*tmpscreen->h*dialog_scale * scalefactor / MapSize; ! x = xcenter + int(R * cos(orbitangle[i])) - MoonPics[PlanetMoonPic[i]]->width()/2; ! y = ycenter + int(R * sin(orbitangle[i])) - MoonPics[PlanetMoonPic[i]]->height()/2; Vector2 P, S; --- 1129,1134 ---- { double R = PlanetMoonEllipsW[i] * 0.9*tmpscreen->h*dialog_scale * scalefactor / MapSize; ! x = xcenter + int(R * cos(orbitangle[i])) - MoonPics[PlanetMoonPic[i]]->width(0)/2; ! y = ycenter + int(R * sin(orbitangle[i])) - MoonPics[PlanetMoonPic[i]]->height(0)/2; Vector2 P, S; |
From: Rob <geo...@us...> - 2005-09-27 22:04:03
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362/source/other Modified Files: planet3d.cpp Log Message: It appears that there's a possible overflow of the mask-array in case of an irregular sprite, because of use of a single default width; default width is therefore removed from the SpaceSprite, and the (artificial) separation between regular/irregular is removed. This has consequences throughout the game code. Index: planet3d.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/planet3d.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** planet3d.cpp 21 Aug 2005 13:55:29 -0000 1.23 --- planet3d.cpp 27 Sep 2005 22:03:55 -0000 1.24 *************** *** 46,53 **** attributes = new char [count]; ! w = image->w; ! h = image->h; ! bmp = create_bitmap_ex ( bpp, w, h); convert_bitmap(image, bmp, general_attributes & MASKED); --- 46,53 ---- attributes = new char [count]; ! //w = image->w; ! //h = image->h; ! bmp = create_bitmap_ex ( bpp, image->w, image->h); convert_bitmap(image, bmp, general_attributes & MASKED); |
From: Rob <geo...@us...> - 2005-09-27 22:04:03
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1362/source Modified Files: melee.h Log Message: It appears that there's a possible overflow of the mask-array in case of an irregular sprite, because of use of a single default width; default width is therefore removed from the SpaceSprite, and the (artificial) separation between regular/irregular is removed. This has consequences throughout the game code. Index: melee.h =================================================================== RCS file: /cvsroot/timewarp/source/melee.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** melee.h 3 Sep 2005 19:49:45 -0000 1.27 --- melee.h 27 Sep 2005 22:03:55 -0000 1.28 *************** *** 434,439 **** char highest_mip; int originaltype; ! int w; ! int h; struct PMASK **smask; Surface **sbitmap[MAX_MIP_LEVELS]; --- 434,439 ---- char highest_mip; int originaltype; ! // int w; ! // int h; struct PMASK **smask; Surface **sbitmap[MAX_MIP_LEVELS]; *************** *** 516,521 **** // changed Rob. Vector2 size(int i = 0);// const {return Vector2(b[0][i]->w, b[0][i]->h);} ! int width() const {return w;} ! int height() const {return h;} }; --- 516,522 ---- // changed Rob. Vector2 size(int i = 0);// const {return Vector2(b[0][i]->w, b[0][i]->h);} ! void size(int *w, int *h, int i); ! int width(int i); ! int height(int i); }; |
From: Rob <geo...@us...> - 2005-09-27 22:01:01
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32474/source/newships Modified Files: shpkabwe.cpp shpxxxas.cpp Log Message: fixing pointer mistake Index: shpkabwe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkabwe.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** shpkabwe.cpp 28 Aug 2005 20:34:08 -0000 1.20 --- shpkabwe.cpp 27 Sep 2005 22:00:49 -0000 1.21 *************** *** 610,615 **** //BITMAP *ship_bmp; ! int wship = ship_spr->width(); ! int hship = ship_spr->height(); BITMAP *ship_bmp = create_bitmap(wship, hship); --- 610,615 ---- //BITMAP *ship_bmp; ! int wship = ship_spr->width(0); ! int hship = ship_spr->height(0); BITMAP *ship_bmp = create_bitmap(wship, hship); Index: shpxxxas.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpxxxas.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpxxxas.cpp 14 Aug 2005 16:14:32 -0000 1.16 --- shpxxxas.cpp 27 Sep 2005 22:00:49 -0000 1.17 *************** *** 253,263 **** if (other->isShip()) { crew += 2; if (crew >= crew_max) crew = crew_max; ! if (other->ship->speed_max > speed_max) { ! speed_max = other->ship->speed_max; reload_panel(); play_sound(data->sampleExtra[0]); --- 253,265 ---- if (other->isShip()) { + Ship *s = (Ship*)other; + crew += 2; if (crew >= crew_max) crew = crew_max; ! if (s->speed_max > speed_max) { ! speed_max = s->speed_max; reload_panel(); play_sound(data->sampleExtra[0]); *************** *** 265,272 **** } ! if (other->ship->accel_rate > accel_rate) { ! accel_rate = other->ship->accel_rate; ! hotspot_rate = other->ship->hotspot_rate; reload_panel(); play_sound(data->sampleExtra[0]); --- 267,274 ---- } ! if (s->accel_rate > accel_rate) { ! accel_rate = s->accel_rate; ! hotspot_rate = s->hotspot_rate; reload_panel(); play_sound(data->sampleExtra[0]); |
From: Rob <geo...@us...> - 2005-09-23 13:20:10
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12981/ships Modified Files: shpglacr.dat Log Message: new ship graphics by shadow. Index: shpglacr.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpglacr.dat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsSLlyio and /tmp/cvsWYkDxF differ |
From: Rob <geo...@us...> - 2005-09-23 13:11:21
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10962/source/ais Modified Files: c_wussie.cpp Log Message: fixed an incorrect error message for cyborg control Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** c_wussie.cpp 28 Aug 2005 20:30:28 -0000 1.26 --- c_wussie.cpp 23 Sep 2005 13:11:12 -0000 1.27 *************** *** 270,274 **** } ! if (ship && ship->control != this) { tw_error("error in control reference..."); --- 270,274 ---- } ! if ((ship) && (ship->control != this) && (ship->control && ship->control->cyborg != this) ) { tw_error("error in control reference..."); |
From: Rob <geo...@us...> - 2005-09-23 13:02:10
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9086/source/melee Modified Files: mframe.cpp Log Message: fixed the cancollide function ... Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** mframe.cpp 23 Sep 2005 12:00:56 -0000 1.47 --- mframe.cpp 23 Sep 2005 13:02:02 -0000 1.48 *************** *** 756,759 **** --- 756,760 ---- } + /* // if you should not collide with objects from the same ship if ( (collide_flag_sameship & bit(other->layer) ) == 0) *************** *** 763,766 **** --- 764,768 ---- result = 0; // then set to zero, because they're brothers } + */ // if you are only allowed to collide with ships from other teams |
From: Rob <geo...@us...> - 2005-09-23 12:01:04
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28094/source/melee Modified Files: mframe.cpp Log Message: added extra comments Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** mframe.cpp 22 Sep 2005 07:24:29 -0000 1.46 --- mframe.cpp 23 Sep 2005 12:00:56 -0000 1.47 *************** *** 712,715 **** --- 712,737 ---- + /* + the original subroutine + int SpaceLocation::canCollide(SpaceLocation *other) { + if (!detectable()) return 0; + if (sameShip(other)) return ((1 << other->layer) & collide_flag_sameship); + else if (sameTeam(other)) return ((1 << other->layer) & collide_flag_sameteam); + return ((1 << other->layer) & collide_flag_anyone); + } + + the layer definitions (copied from source/melee.h) + #define LAYER_HOTSPOTS 0 + #define LAYER_CBODIES 1 + #define LAYER_LINES 2 + #define LAYER_SHOTS 3 + #define LAYER_SHIPS 4 + #define LAYER_SPECIAL 5 + #define LAYER_EXPLOSIONS 6 + #define LAYER_LOCATIONS 7 + #define ALL_LAYERS ( (1<<SPACE_LAYERS) - 1) + #define OBJECT_LAYERS ( (1<<SPACE_LAYERS) - 1 - (1<<LAYER_LINES) - (1<<LAYER_LOCATIONS) ) + #define LINE_LAYERS ( (1<<LAYER_LINES) ) + */ int SpaceLocation::canCollide(SpaceLocation *other) *************** *** 735,739 **** // if you should not collide with objects from the same ship - //if (collide_flag_sameship == 0) if ( (collide_flag_sameship & bit(other->layer) ) == 0) { --- 757,760 ---- *************** *** 744,748 **** // if you are only allowed to collide with ships from other teams - //if (collide_flag_sameteam == 0) if ( (collide_flag_sameteam & bit(other->layer) ) == 0) { --- 765,768 ---- *************** *** 752,757 **** } ! // if you are not allowed to collide with *anyone* ... ! //if (collide_flag_anyone == 0) if ( (collide_flag_anyone & bit(other->layer) ) == 0) { --- 772,776 ---- } ! // if you are not allowed to collide with *anyone* in the other layer if ( (collide_flag_anyone & bit(other->layer) ) == 0) { |
From: Rob <geo...@us...> - 2005-09-23 12:00:17
|
Update of /cvsroot/timewarp/ships/sc2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27833/ships/sc2 Modified Files: shpchmav.ini Log Message: improved Chmmr AI settings Index: shpchmav.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc2/shpchmav.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpchmav.ini 8 Jun 2003 17:55:39 -0000 1.3 --- shpchmav.ini 23 Sep 2005 12:00:07 -0000 1.4 *************** *** 44,47 **** --- 44,52 ---- [AI3_Default] + BattRecharge = 10 + Special_Range = 15 + Special = No_Proximity + ; this means that the special will be active at distances >15 + Special2 = Reserve_Battery [Names] |
From: Rob <geo...@us...> - 2005-09-23 11:47:31
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25530/source/sc2ships Modified Files: shpthrto.cpp Log Message: made the flames non-blocking shots Index: shpthrto.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpthrto.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpthrto.cpp 16 Aug 2005 23:21:02 -0000 1.15 --- shpthrto.cpp 23 Sep 2005 11:47:20 -0000 1.16 *************** *** 75,78 **** --- 75,80 ---- } debug_id = 1045; + + isblockingweapons = false; } |
From: Rob <geo...@us...> - 2005-09-23 11:23:24
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21000/source/newships Modified Files: shpquasi.cpp shpquawr.cpp Log Message: fixed cloaking in the quasi Index: shpquawr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquawr.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shpquawr.cpp 15 Sep 2005 09:01:37 -0000 1.19 --- shpquawr.cpp 23 Sep 2005 11:23:00 -0000 1.20 *************** *** 162,166 **** if((cloak_frame >= 300)) { ! if (!show_red_cloaker || (control && is_bot(control->channel)) || (control && !is_local(control->channel)) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[0], space); else --- 162,167 ---- if((cloak_frame >= 300)) { ! if (!show_red_cloaker || (control && is_bot(control->channel)) || ! (control && !is_local(control->channel)) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[0], space); else Index: shpquasi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquasi.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shpquasi.cpp 15 Sep 2005 09:01:37 -0000 1.18 --- shpquasi.cpp 23 Sep 2005 11:23:00 -0000 1.19 *************** *** 310,316 **** void Quai::animate(Frame *space) { ! if (!show_red_cloaker || isInvisible() || (control && !is_bot(control->channel)) || is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" ! sprite->animate_character( pos, sprite_index, pallete_color[4], space); ! else Ship::animate(space); } --- 310,321 ---- void Quai::animate(Frame *space) { ! if (isInvisible()) ! { ! if (!show_red_cloaker || (control && is_bot(control->channel)) || ! (control && !is_local(control->channel)) || (!game_networked && num_network>1)) // bots and remote players are "hidden" ! sprite->animate_character( pos, sprite_index, pallete_color[0], space); ! else ! sprite->animate_character( pos, sprite_index, pallete_color[4], space); ! } else Ship::animate(space); } |
From: Rob <geo...@us...> - 2005-09-22 07:25:20
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5365/ships Modified Files: shpquawr.dat Log Message: Index: shpquawr.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpquawr.dat,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsxjO2dY and /tmp/cvsFRvBes differ |
From: Rob <geo...@us...> - 2005-09-22 07:24:44
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5224/source/melee Modified Files: mframe.cpp mgame.cpp Log Message: Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** mgame.cpp 15 Sep 2005 09:00:44 -0000 1.57 --- mgame.cpp 22 Sep 2005 07:24:31 -0000 1.58 *************** *** 2440,2444 **** if (!music) music = (Music*) -1; } ! if (music) sound.play_music(music, TRUE); return; } --- 2440,2444 ---- if (!music) music = (Music*) -1; } ! if (music) sound.play_music(music, TRUE, false); return; } Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** mframe.cpp 15 Sep 2005 09:00:10 -0000 1.45 --- mframe.cpp 22 Sep 2005 07:24:29 -0000 1.46 *************** *** 1054,1057 **** --- 1054,1069 ---- } + #ifdef _DEBUG + SpaceObject *c1 = this; + SpaceObject *c2 = other; + if (fabs(c1->vel.x) > 1E6 || fabs(c1->vel.y) > 1E6 || fabs(c2->vel.x) > 1E6 || fabs(c2->vel.y) > 1E6 ) + { + int a1 = c1->canCollide(c2); + int a2 = c2->canCollide(c1); + bool b = ((c1->canCollide(c2) & c2->canCollide(c1)) == 0 ); + tw_error("velocity error in collision involving objects [%s] and [%s]", c1->get_identity(), c2->get_identity()); + } + #endif + Vector2 nd; nd = unit_vector(dp); |
From: Rob <geo...@us...> - 2005-09-22 07:24:44
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5224/source/util Modified Files: sounds.cpp sounds.h Log Message: Index: sounds.h =================================================================== RCS file: /cvsroot/timewarp/source/util/sounds.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sounds.h 15 Sep 2005 09:02:26 -0000 1.7 --- sounds.h 22 Sep 2005 07:24:31 -0000 1.8 *************** *** 44,48 **** void stop (int voice_id); ! void play_music (Music *mus, int loop = false); void stop_music (); int is_music_playing() const; --- 44,48 ---- void stop (int voice_id); ! void play_music (Music *mus, int loop = false, bool do_error_check = true); void stop_music (); int is_music_playing() const; Index: sounds.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/sounds.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sounds.cpp 15 Sep 2005 09:02:26 -0000 1.8 --- sounds.cpp 22 Sep 2005 07:24:31 -0000 1.9 *************** *** 199,206 **** } ! void SoundSystem::play_music (Music *music, int loop) { if ((state & (MOD_ENABLED | MUSIC_ON)) == (MOD_ENABLED | MUSIC_ON)) { ! check_music_duration(music, loop); ::play_mod(music, loop); } --- 199,208 ---- } ! void SoundSystem::play_music (Music *music, int loop, bool do_error_check) { if ((state & (MOD_ENABLED | MUSIC_ON)) == (MOD_ENABLED | MUSIC_ON)) { ! if (do_error_check) ! check_music_duration(music, loop); ! ::play_mod(music, loop); } |
From: Rob <geo...@us...> - 2005-09-15 09:03:18
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6539/source/util Modified Files: pmask.h Log Message: changes due to debugging code Index: pmask.h =================================================================== RCS file: /cvsroot/timewarp/source/util/pmask.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pmask.h 24 Mar 2004 23:51:45 -0000 1.5 --- pmask.h 15 Sep 2005 09:03:09 -0000 1.6 *************** *** 11,14 **** --- 11,15 ---- */ + #define PMASK_VERSION 4 *************** *** 133,138 **** //it returns a newly allocated PMASK structure, or NULL if an error occured - - typedef struct PMASKDATA { int x, y; --- 134,137 ---- |
From: Rob <geo...@us...> - 2005-09-15 09:02:35
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6372/source/util Modified Files: sounds.cpp sounds.h Log Message: adding sound debug info; also the ability to override error checking in case one knows absolutely sure what he's doing. Index: sounds.h =================================================================== RCS file: /cvsroot/timewarp/source/util/sounds.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sounds.h 24 Mar 2004 23:51:45 -0000 1.6 --- sounds.h 15 Sep 2005 09:02:26 -0000 1.7 *************** *** 40,44 **** void init() ; ! int play (Sound *spl, int vol = 256, int pan = 128, int freq = 1000, bool loop = false) ; void stop (Sound *spl); void stop (int voice_id); --- 40,44 ---- void init() ; ! int play (Sound *spl, int vol = 256, int pan = 128, int freq = 1000, bool loop = false, bool noerrorcheck = false) ; void stop (Sound *spl); void stop (int voice_id); Index: sounds.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/sounds.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sounds.cpp 3 Sep 2005 19:49:45 -0000 1.7 --- sounds.cpp 15 Sep 2005 09:02:26 -0000 1.8 *************** *** 149,158 **** } ! int SoundSystem::play (SAMPLE *spl, int vol, int pan, int freq, bool loop) { if ((state & (ENABLED | SOUND_ON)) == (ENABLED | SOUND_ON)) { //if (freq > 4535) freq = 4535; //I THINK that the 4536 bug is specific to my sound hardware, so that's commented out ! check_sample_duration(spl, freq, loop); return ::play_sample (spl, (vol * sound_volume) >> 8, pan, freq, loop); } else { --- 149,159 ---- } ! int SoundSystem::play (SAMPLE *spl, int vol, int pan, int freq, bool loop, bool noerrorcheck) { if ((state & (ENABLED | SOUND_ON)) == (ENABLED | SOUND_ON)) { //if (freq > 4535) freq = 4535; //I THINK that the 4536 bug is specific to my sound hardware, so that's commented out ! if (!noerrorcheck) ! check_sample_duration(spl, freq, loop); return ::play_sample (spl, (vol * sound_volume) >> 8, pan, freq, loop); } else { |