Commit 0b47d4f3 authored by anotherguest's avatar anotherguest

Updated to show more of intro. Delay using timing values

parent ea5a14fd
......@@ -645,6 +645,7 @@ int Scene::play () {
unsigned int sceneIndex = 0;
ImageInfo* imageInfo = NULL;
unsigned int pageTime = scriptPages[sceneIndex].pageTime;
unsigned int lastTicks = globalTicks;
if(scriptPages[sceneIndex].bgIndex != -1)
{
imageInfo = FindImage(scriptPages[sceneIndex].bgIndex);
......@@ -653,7 +654,6 @@ int Scene::play () {
if(imageInfo != NULL)
usePalette(imageInfo[0].palette);
while (true) {
if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT;
if (controls.release(C_ESCAPE)) {
......@@ -662,18 +662,22 @@ int Scene::play () {
}
if(controls.release(C_ENTER)) {
if(controls.release(C_ENTER) || ((globalTicks-lastTicks)>=pageTime*1000 && pageTime != 256 && pageTime != 0)) {
sceneIndex++;
if(sceneIndex == scriptItems) {
return E_NONE;
}
lastTicks = globalTicks;
// Get bg for this page
if(scriptPages[sceneIndex].bgIndex != -1) {
imageInfo = FindImage(scriptPages[sceneIndex].bgIndex);
if(imageInfo != NULL) {
usePalette(imageInfo[0].palette);
}
else
{
restorePalette(screen);
}
}
pageTime = scriptPages[sceneIndex].pageTime;
......@@ -684,6 +688,10 @@ int Scene::play () {
dst.y = (screenH - 200) >> 1;
if(imageInfo != NULL) {
SDL_BlitSurface(imageInfo->image, NULL, screen, &dst);
}
else {
clearScreen(BLACK);
}
int x = 0;
int y = 0;
for(int text = 0;text<scriptPages[sceneIndex].noScriptTexts;text++) {
......@@ -736,10 +744,7 @@ int Scene::play () {
}
y+=font->fontHeight()/2;
}
}
else {
//clearScreen(BLACK);
}
SDL_Delay(T_FRAME);
}
......
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