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