Skip to content

Commit 42e111d

Browse files
committed
center intro on higher resolutions.
1 parent a20829e commit 42e111d

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/Engine/Flc.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void SS2()
197197
Uint16 Lines, Count;
198198

199199
pSrc=flc.pChunk+6;
200-
pDst=(Uint8*)flc.mainscreen->pixels;
200+
pDst=(Uint8*)flc.mainscreen->pixels + flc.offset;
201201
ReadU16(&Lines, pSrc);
202202
pSrc+=2;
203203
while(Lines--) {
@@ -257,7 +257,7 @@ void DECODE_BRUN()
257257

258258
HeightCount=flc.HeaderHeight;
259259
pSrc=flc.pChunk+6;
260-
pDst=(Uint8*)flc.mainscreen->pixels;
260+
pDst=(Uint8*)flc.mainscreen->pixels + flc.offset;
261261
while(HeightCount--) {
262262
pTmpDst=pDst;
263263
PacketsCount=*(pSrc++);
@@ -291,7 +291,7 @@ void DECODE_LC()
291291
int PacketsCount;
292292

293293
pSrc=flc.pChunk+6;
294-
pDst=(Uint8*)flc.mainscreen->pixels;
294+
pDst=(Uint8*)flc.mainscreen->pixels + flc.offset;
295295

296296
ReadU16(&tmp, pSrc);
297297
pSrc+=2;
@@ -355,7 +355,7 @@ void DECODE_COPY()
355355
{ Uint8 *pSrc, *pDst;
356356
int Lines = flc.screen_h;
357357
pSrc=flc.pChunk+6;
358-
pDst=(Uint8*)flc.mainscreen->pixels;
358+
pDst=(Uint8*)flc.mainscreen->pixels + flc.offset;
359359
while(Lines-- > 0) {
360360
memcpy(pDst, pSrc, flc.screen_w);
361361
pSrc+=flc.screen_w;
@@ -366,7 +366,7 @@ void DECODE_COPY()
366366
void BLACK()
367367
{ Uint8 *pDst;
368368
int Lines = flc.screen_h;
369-
pDst=(Uint8*)flc.mainscreen->pixels;
369+
pDst=(Uint8*)flc.mainscreen->pixels + flc.offset;
370370
while(Lines-- > 0) {
371371
memset(pDst, 0, flc.screen_w);
372372
pDst+=flc.mainscreen->pitch;
@@ -489,6 +489,7 @@ void FlcMain(void (*frameCallBack)())
489489
{ flc.quit=false;
490490
SDL_Event event;
491491
FlcInitFirstFrame();
492+
flc.offset = flc.dy*flc.mainscreen->pitch + flc.mainscreen->format->BytesPerPixel*flc.dx;
492493
while(!flc.quit) {
493494
if (frameCallBack) (*frameCallBack)();
494495
flc.FrameCount++;

src/Engine/Flc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ struct Flc_t {
6767
int screen_h;
6868
int screen_depth;
6969
int loop;
70+
int dx, dy;
71+
int offset;
7072
bool quit;
7173
};
7274

src/Menu/StartState.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ void StartState::think()
451451
audioSequence = new AudioSequence(_game->getResourcePack());
452452
Flc::flc.realscreen = _game->getScreen();
453453
Flc::FlcInit(introFile.c_str());
454+
Flc::flc.dx = (Options::getInt("baseXResolution") - 320) / 2;
455+
Flc::flc.dy = (Options::getInt("baseYResolution") - 200) / 2;
454456
Flc::flc.loop = 0; // just the one time, please
455457
Flc::FlcMain(&audioHandler);
456458
Flc::FlcDeInit();

0 commit comments

Comments
 (0)