only update portion of screen that has changed on entering orbit.
This is about the smoothest I know how to make it. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@868 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Changes towards version 0.3:
|
||||
- Decelerate when entering orbit to give a smoother effect -PhracturedBlue
|
||||
- fix subtitle text overlap issues (bug 232)
|
||||
- 'Esc' now leaves planet surface (bug233) -PhracturedBlue
|
||||
- Fix race on exiting starbase (bug 230) -PracturedBlue
|
||||
|
||||
@@ -54,7 +54,6 @@ PlanetZoomOrbit (int x, COUNT zoom_amt, UBYTE zoom_from)
|
||||
{
|
||||
FRAME pFrame[2];
|
||||
COUNT i, num_frames;
|
||||
COUNT scale_amt;
|
||||
|
||||
num_frames = (pSolarSysState->ShieldFrame == 0) ? 1 : 2;
|
||||
pFrame[0] = SetAbsFrameIndex (pSolarSysState->PlanetFrameArray, (COUNT)(x + 1));
|
||||
@@ -84,13 +83,13 @@ PlanetZoomOrbit (int x, COUNT zoom_amt, UBYTE zoom_from)
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
RotatePlanet (int x, int dx, int dy, COUNT scale_amt, UBYTE zoom_from)
|
||||
PRECT
|
||||
RotatePlanet (int x, int dx, int dy, COUNT scale_amt, UBYTE zoom_from, PRECT zoomr)
|
||||
{
|
||||
STAMP s;
|
||||
FRAME pFrame[2];
|
||||
COUNT i, num_frames;
|
||||
RECT r, *rp = NULL;
|
||||
RECT *rp = NULL;
|
||||
CONTEXT OldContext;
|
||||
|
||||
num_frames = (pSolarSysState->ShieldFrame == 0) ? 1 : 2;
|
||||
@@ -99,11 +98,8 @@ RotatePlanet (int x, int dx, int dy, COUNT scale_amt, UBYTE zoom_from)
|
||||
pFrame[1] = pSolarSysState->ShieldFrame;
|
||||
if (scale_amt)
|
||||
{
|
||||
r.corner.x = 0;
|
||||
r.corner.y = 0;
|
||||
r.extent.width = SIS_SCREEN_WIDTH;
|
||||
r.extent.height = SIS_SCREEN_HEIGHT - MAP_HEIGHT;
|
||||
rp = &r;
|
||||
if(zoomr->extent.width)
|
||||
rp = zoomr;
|
||||
// we're zooming in, take care of scaling the frames
|
||||
for (i=0; i < num_frames; i++)
|
||||
pFrame[i] = pSolarSysState->ScaleFrame[i];
|
||||
@@ -140,8 +136,13 @@ RotatePlanet (int x, int dx, int dy, COUNT scale_amt, UBYTE zoom_from)
|
||||
}
|
||||
//ClearSemaphore (GraphicsSem);
|
||||
if (scale_amt && scale_amt != MAP_HEIGHT)
|
||||
return 1;
|
||||
return 0;
|
||||
{
|
||||
GetFrameRect (pFrame[num_frames - 1], zoomr);
|
||||
zoomr->corner.x += dx;
|
||||
zoomr->corner.y += dy;
|
||||
return zoomr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -40,7 +40,7 @@ void SetPlanetTilt (int da);
|
||||
|
||||
void RepairBackRect (PRECT pRect);
|
||||
|
||||
int RotatePlanet (int x, int dx, int dy, COUNT scale_amt, UBYTE zoom_from);
|
||||
PRECT RotatePlanet (int x, int dx, int dy, COUNT scale_amt, UBYTE zoom_from, PRECT r);
|
||||
|
||||
DWORD frame_mapRGBA (FRAME FramePtr,UBYTE r, UBYTE g, UBYTE b, UBYTE a);
|
||||
|
||||
@@ -1368,7 +1368,8 @@ rotate_planet_task (void *data)
|
||||
COORD init_x;
|
||||
DWORD TimeIn;
|
||||
PSOLARSYS_STATE pSS;
|
||||
BOOLEAN repair, zooming;
|
||||
BOOLEAN zooming;
|
||||
RECT r, *repair = &r;
|
||||
UBYTE zoom_from;
|
||||
COUNT zoom_arr[50];
|
||||
COUNT zoom_amt, frame_num = 0, zoom_frames;
|
||||
@@ -1376,7 +1377,7 @@ rotate_planet_task (void *data)
|
||||
|
||||
Task task = (Task) data;
|
||||
|
||||
repair = FALSE;
|
||||
r.extent.width = 0;
|
||||
zooming = TRUE;
|
||||
|
||||
pSS = pSolarSysState;
|
||||
@@ -1425,7 +1426,7 @@ rotate_planet_task (void *data)
|
||||
pSS->PauseRotate = 1;
|
||||
|
||||
repair = RotatePlanet (x, SIS_SCREEN_WIDTH >> 1,
|
||||
(148 - SIS_ORG_Y) >> 1, zoom_amt, zoom_from
|
||||
(148 - SIS_ORG_Y) >> 1, zoom_amt, zoom_from, repair
|
||||
);
|
||||
|
||||
if (!repair && zooming)
|
||||
|
||||
Reference in New Issue
Block a user