Commit 3de8e5e3 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Improved scaling for terminator scroll text. It now merges better into

the intro bitmap of the game
parent cd6300c7
......@@ -15,18 +15,11 @@
#include "graphics/GsGraphics.h"
#include "graphics/effects/CPixelate.h"
//#include "menu/MainMenu.h"
#include "sdl/audio/music/CMusic.h"
#include "engine/core/VGamepads/vgamepadsimple.h"
#include "engine/core/menu/MainMenu.h"
SDL_Surface *commanderSfc;
SDL_Surface *keenSfc;
// 10 Seconds are for 1200 logic cycles
const int INTRO_TIME = 1200;
//const int STARWARS_TIME = 1200;
......@@ -122,7 +115,7 @@ mSkipSection(false)
bool CPassiveGalaxy::init()
{
auto blit = gVideoDriver.getBlitSurface();
SDL_FillRect( blit, NULL, SDL_MapRGB(blit->format,0,0,0));
SDL_FillRect( blit, nullptr, SDL_MapRGB(blit->format,0,0,0));
gInput.flushAll();
#ifdef VIRTUALPAD
......@@ -263,8 +256,8 @@ void CPassiveGalaxy::processIntro()
void CPassiveGalaxy::processIntroZoom()
{
const int leftEdge = 8;
const int topEdge = 8;
const int maxWidth = (19*gVideoDriver.getGameResolution().w)/20;
const int topEdge = 3;
const int maxWidth = (37*gVideoDriver.getGameResolution().w)/40;
if(mZoomSfcPos.x < leftEdge)
{
......@@ -296,7 +289,9 @@ void CPassiveGalaxy::processIntroZoom()
mZoomSfcPos.y = topEdge;
}
if(mZoomSfcZoom.y > mScaleFactor*32)
const auto maxYScaleFactor = mScaleFactor*26;
if(mZoomSfcZoom.y > maxYScaleFactor)
{
mZoomSfcZoom.y -= mScaleFactor*4;
}
......@@ -306,9 +301,14 @@ void CPassiveGalaxy::processIntroZoom()
if( (mZoomSfcPos.x >= leftEdge &&
mZoomSfcPos.y <= topEdge &&
mZoomSfcZoom.x <= maxWidth &&
mZoomSfcZoom.y <= mScaleFactor*32 ) ||
mZoomSfcZoom.y <= maxYScaleFactor ) ||
mSkipSection)
{
mZoomSfcPos.x = leftEdge;
mZoomSfcPos.y = topEdge;
mZoomSfcZoom.x = maxWidth;
mZoomSfcZoom.y = maxYScaleFactor;
gInput.flushAll();
processPonderMode = &CPassiveGalaxy::processTitle;
processRenderMode = &CPassiveGalaxy::renderTitle;
......
......@@ -1676,7 +1676,7 @@ bool CEGAGraphicsGalaxy::readMiscStuff()
// Those are monochrom...
for(size_t miscIdx = 0 ; miscIdx < EpisodeInfo[episode-4].NumMisc; miscIdx++)
{
const int index = indexMisc + miscIdx;
const auto index = indexMisc + miscIdx;
const auto &dataChunk = m_egagraph.at(index);
......@@ -1689,16 +1689,6 @@ bool CEGAGraphicsGalaxy::readMiscStuff()
return false;
}
// Memcpy is here required for correct alignment on devices with different architectures
// and compiles which do not like pointer from 8-bit to 16-bit
//Uint16 *dataEndPtr = nullptr;
// This might copy beyond the boundaries. We need to fix that.
//memcpy( &dataEndPtr, &(dataChunk.data) + dataSize, sizeof(Uint16 *) );
Uint16 *dataPtr = nullptr;
memcpy( &dataPtr, &(dataChunk.data), sizeof(Uint16 *) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment