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:
@@ -1,4 +1,5 @@
|
|||||||
0.2:
|
0.2:
|
||||||
|
- Spheres of influence now move correctly in starmap, from l0ci@hotmail.com
|
||||||
- Linux OpenAL fixes (music plays now as stereo)
|
- Linux OpenAL fixes (music plays now as stereo)
|
||||||
- Fuel giveaway bug fixed, from steve@blckknght.org
|
- Fuel giveaway bug fixed, from steve@blckknght.org
|
||||||
- Starmap fuel range calculator and actual consumption matches now
|
- Starmap fuel range calculator and actual consumption matches now
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
#include "gfxintrn.h"
|
#include "gfxintrn.h"
|
||||||
|
|
||||||
|
#define min(a, b) ((a <= b) ? a : b)
|
||||||
|
#define max(a, b) ((a >= b) ? a : b)
|
||||||
|
|
||||||
INTERSECT_CODE
|
INTERSECT_CODE
|
||||||
BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter)
|
BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter)
|
||||||
{
|
{
|
||||||
@@ -100,6 +103,20 @@ void
|
|||||||
BoxUnion (PRECT pr1, PRECT pr2, PRECT punion)
|
BoxUnion (PRECT pr1, PRECT pr2, PRECT punion)
|
||||||
{
|
{
|
||||||
COORD x2, y2, w2, h2;
|
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 */
|
#if 1 /* alter based on 0 widths */
|
||||||
|
|
||||||
x2 =
|
x2 =
|
||||||
@@ -155,5 +172,7 @@ BoxUnion (PRECT pr1, PRECT pr2, PRECT punion)
|
|||||||
punion->corner.y = y2;
|
punion->corner.y = y2;
|
||||||
punion->extent.width = w2;
|
punion->extent.width = w2;
|
||||||
punion->extent.height = h2;
|
punion->extent.height = h2;
|
||||||
|
|
||||||
|
#endif // NEVER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,6 +226,8 @@ GetSphereRect (EXTENDED_SHIP_FRAGMENTPTR StarShipPtr, PRECT pRect, PRECT
|
|||||||
pRepairRect->corner.y = SIS_SCREEN_HEIGHT - pRepairRect->extent.height - 1;
|
pRepairRect->corner.y = SIS_SCREEN_HEIGHT - pRepairRect->extent.height - 1;
|
||||||
|
|
||||||
BoxUnion (pRepairRect, pRect, pRepairRect);
|
BoxUnion (pRepairRect, pRect, pRepairRect);
|
||||||
|
pRepairRect->extent.width++;
|
||||||
|
pRepairRect->extent.height++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user