Show oil wells burning in the radar instead of pulsing.

master
Cyp 2010-07-22 12:27:32 +02:00
parent a31beaec05
commit a16c5f7df9
5 changed files with 45 additions and 19 deletions

View File

@ -518,3 +518,10 @@
5,32,192,32,32,-15,-15,"IMAGE CURSOR BRIDGE"
5,64,192,32,32,-15,-15,"IMAGE CURSOR BOMB"
5,20,86,179,18,0,0,"IMAGE SLIDER AI"
1,39,98,3,3,-1,-1,"IMAGE RAD BURNRESREAD"
1,79,133,6,9,-3,-6,"IMAGE RAD BURNRES1"
1,86,133,6,9,-3,-6,"IMAGE RAD BURNRES2"
1,94,134,5,8,-2,-5,"IMAGE RAD BURNRES3"
1,101,133,5,9,-2,-6,"IMAGE RAD BURNRES4"
1,108,132,5,10,-2,-7,"IMAGE RAD BURNRES5"
1,114,131,6,11,-3,-8,"IMAGE RAD BURNRES6"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,6 @@
1,37,102,6,9,-3,-6,"IMAGE RAD BURNRES1"
1,44,102,7,10,-3,-6,"IMAGE RAD BURNRES2"
1,52,103,9,10,-4,-5,"IMAGE RAD BURNRES3"
1,62,102,5,9,-2,-6,"IMAGE RAD BURNRES4"
1,68,101,7,11,-3,-7,"IMAGE RAD BURNRES5"
1,76,100,9,13,-4,-8,"IMAGE RAD BURNRES6"

View File

@ -92,9 +92,6 @@
#define FORM_OPEN_ANIM_DURATION (GAME_TICKS_PER_SEC/6) // Time duration for form open/close anims.
//number of pulses in the blip for the radar
#define NUM_PULSES 3
//the loop default value
#define DEFAULT_LOOP 1
@ -3062,6 +3059,11 @@ void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV)
UDWORD i;
SDWORD width, height;
int x = 0, y = 0;
static const uint16_t imagesEnemy[] = {IMAGE_RAD_ENMREAD, IMAGE_RAD_ENM1, IMAGE_RAD_ENM2, IMAGE_RAD_ENM3};
static const uint16_t imagesResource[] = {IMAGE_RAD_RESREAD, IMAGE_RAD_RES1, IMAGE_RAD_RES2, IMAGE_RAD_RES3};
static const uint16_t imagesArtifact[] = {IMAGE_RAD_ARTREAD, IMAGE_RAD_ART1, IMAGE_RAD_ART2, IMAGE_RAD_ART3};
static const uint16_t imagesBurningResource[] = {IMAGE_RAD_BURNRESREAD, IMAGE_RAD_BURNRES1, IMAGE_RAD_BURNRES2, IMAGE_RAD_BURNRES3, IMAGE_RAD_BURNRES4, IMAGE_RAD_BURNRES5, IMAGE_RAD_BURNRES6};
static const uint16_t *const imagesProxTypes[] = {imagesEnemy, imagesResource, imagesArtifact};
// store the width & height of the radar/mini-map
width = scrollMaxX - scrollMinX;
@ -3097,7 +3099,8 @@ void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV)
/* Go through all the proximity Displays */
for (psProxDisp = apsProxDisp[selectedPlayer]; psProxDisp != NULL; psProxDisp = psProxDisp->psNext)
{
PROX_TYPE proxType;
unsigned animationLength = ARRAY_SIZE(imagesEnemy) - 1; // Same size as imagesResource and imagesArtifact.
const uint16_t *images;
if (psProxDisp->psMessage->player != selectedPlayer)
{
@ -3106,7 +3109,8 @@ void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV)
if (psProxDisp->type == POS_PROXDATA)
{
proxType = ((VIEW_PROXIMITY*)((VIEWDATA *)psProxDisp->psMessage->pViewData)->pData)->proxType;
PROX_TYPE proxType = ((VIEW_PROXIMITY*)((VIEWDATA *)psProxDisp->psMessage->pViewData)->pData)->proxType;
images = imagesProxTypes[proxType];
}
else
{
@ -3115,32 +3119,33 @@ void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV)
ASSERT(psFeature && psFeature->psStats, "Bad feature message");
if (psFeature && psFeature->psStats && psFeature->psStats->subType == FEAT_OIL_RESOURCE)
{
proxType = PROX_RESOURCE;
images = imagesResource;
if (fireOnLocation(psFeature->pos.x, psFeature->pos.y))
{
images = imagesBurningResource;
animationLength = ARRAY_SIZE(imagesBurningResource) - 1; // Longer animation for burning oil wells.
}
}
else
{
proxType = PROX_ARTEFACT;
images = imagesArtifact;
}
}
// Draw the 'blips' on the radar - use same timings as radar blips if the message is read - don't animate
if (psProxDisp->psMessage->read)
{
imageID = IMAGE_RAD_ENM3 + (proxType * (NUM_PULSES + 1));
imageID = images[0];
}
else
{
// Draw animated
if ((gameTime2 - psProxDisp->timeLastDrawn) > delay)
if (realTime - psProxDisp->timeLastDrawn > delay)
{
psProxDisp->strobe++;
if (psProxDisp->strobe > (NUM_PULSES-1))
{
psProxDisp->strobe = 0;
}
psProxDisp->timeLastDrawn = gameTime2;
psProxDisp->strobe = (psProxDisp->strobe + 1) % animationLength;
psProxDisp->timeLastDrawn = realTime;
}
imageID = (UWORD)(IMAGE_RAD_ENM1 + psProxDisp->strobe + (proxType * (NUM_PULSES + 1)));
imageID = images[1 + psProxDisp->strobe];
}
if (psProxDisp->type == POS_PROXDATA)
@ -3173,10 +3178,11 @@ void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV)
}
if (audio_GetPreviousQueueTrackRadarBlipPos(&x, &y))
{
int strobe = (gameTime2/delay)%NUM_PULSES;
unsigned animationLength = ARRAY_SIZE(imagesEnemy) - 1;
int strobe = (realTime/delay) % animationLength;
x = (x / TILE_UNITS - scrollMinX) * pixSizeH;
y = (y / TILE_UNITS - scrollMinY) * pixSizeV;
imageID = (UWORD)(IMAGE_RAD_ENM1 + strobe + (PROX_ENEMY * (NUM_PULSES + 1)));
imageID = imagesEnemy[strobe];
// NOTE: On certain missions (limbo & expand), there is still valid data that is stored outside the
// normal radar/mini-map view. We must now calculate the radar/mini-map's bounding box, and clip

View File

@ -549,7 +549,14 @@ enum {
IMAGE_CURSOR_ATTACH,
IMAGE_CURSOR_BRIDGE,
IMAGE_CURSOR_BOMB,
IMAGE_SLIDER_AI
IMAGE_SLIDER_AI,
IMAGE_RAD_BURNRESREAD,
IMAGE_RAD_BURNRES1,
IMAGE_RAD_BURNRES2,
IMAGE_RAD_BURNRES3,
IMAGE_RAD_BURNRES4,
IMAGE_RAD_BURNRES5,
IMAGE_RAD_BURNRES6
};
#ifdef __cplusplus