l0ci's fixes (spheres of influence now move correctly)

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@309 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-04 02:28:29 +00:00
parent 61cfe75f82
commit 518e9b9f1f
3 changed files with 22 additions and 0 deletions
+1
View File
@@ -1,4 +1,5 @@
0.2:
- Spheres of influence now move correctly in starmap, from l0ci@hotmail.com
- Linux OpenAL fixes (music plays now as stereo)
- Fuel giveaway bug fixed, from steve@blckknght.org
- Starmap fuel range calculator and actual consumption matches now
+19
View File
@@ -18,6 +18,9 @@
#include "gfxintrn.h"
#define min(a, b) ((a <= b) ? a : b)
#define max(a, b) ((a >= b) ? a : b)
INTERSECT_CODE
BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter)
{
@@ -100,6 +103,20 @@ void
BoxUnion (PRECT pr1, PRECT pr2, PRECT punion)
{
COORD x2, y2, w2, h2;
// Union is A AND B, put together, correct? Returns a bigger box that
// encompasses the two.
punion->corner.x = min(pr1->corner.x, pr2->corner.x);
punion->corner.y = min(pr1->corner.y, pr2->corner.y);
punion->extent.width = max(pr1->corner.x + pr1->extent.width,
pr2->corner.x + pr2->extent.width) - punion->corner.x;
punion->extent.height = max(pr1->corner.y + pr1->extent.height,
pr2->corner.y + pr2->extent.height) - punion->corner.y;
#if NEVER // FIXME - I think this is broken, but keeping it around for reference
// FIXME - just in case.
#if 1 /* alter based on 0 widths */
x2 =
@@ -155,5 +172,7 @@ BoxUnion (PRECT pr1, PRECT pr2, PRECT punion)
punion->corner.y = y2;
punion->extent.width = w2;
punion->extent.height = h2;
#endif // NEVER
}
+2
View File
@@ -226,6 +226,8 @@ GetSphereRect (EXTENDED_SHIP_FRAGMENTPTR StarShipPtr, PRECT pRect, PRECT
pRepairRect->corner.y = SIS_SCREEN_HEIGHT - pRepairRect->extent.height - 1;
BoxUnion (pRepairRect, pRect, pRepairRect);
pRepairRect->extent.width++;
pRepairRect->extent.height++;
}
}