Commit ea5a14fd authored by anotherguest's avatar anotherguest

Updated Scene handling. Text is now visible per page. Still missing some...

Updated Scene handling. Text is now visible per page. Still missing some layout handling for all to be viewn properly.
parent a27afa6d
This diff is collapsed.
...@@ -25,19 +25,84 @@ ...@@ -25,19 +25,84 @@
#include <io/file.h> #include <io/file.h>
#include <sdl.h> #include <sdl.h>
enum EScriptFontTypes
{
EFONT2Type,
EFONTBIGType,
EFONTINYType,
EFONTMN1Type,
EFONTMN2Type
};
class ScriptFont
{
public:
// This maps to any of the available types (already loaded)
EScriptFontTypes fontType;
// Font id given this font
int fontId;
};
class ScriptText
{
public:
ScriptText()
{
x = -1;
y = -1;
}
char* text;
int alignment;
int fontId;
int x;
int y;
};
// Class // Class
class ScriptPage
{
public:
ScriptPage()
{
bgIndex = -1;
pageTime = 0;
noScriptTexts = 0;
}
int bgIndex;
// Length of the scene in seconds, or if zero = anim complete, or 256 = user interaction
int pageTime;
ScriptText scriptTexts[100];
int noScriptTexts;
};
class ImageInfo
{
public:
// SDL_Surface with the image
SDL_Surface *image;
// Palette associated with the image
SDL_Color palette[256];
// data index of the image (not the palette) to compare with scripts
int dataIndex;
};
class Scene { class Scene {
private: private:
SDL_Surface *sceneBGs[100]; ImageInfo imageInfo[100];
SDL_Color scenePalette[256];
unsigned short int scriptItems; unsigned short int scriptItems;
unsigned short int dataItems; unsigned short int dataItems;
signed long int* scriptStarts; signed long int* scriptStarts;
signed long int* dataOffsets; signed long int* dataOffsets;
int imageIndex; int imageIndex;
int bgIndex;
// Scripts all information needed to render script pages, text etc
ScriptPage* scriptPages;
ImageInfo* FindImage(int dataIndex);
// DataBlock
protected: protected:
void ParseScripts(File *f); void ParseScripts(File *f);
void ParseData(File *f); void ParseData(File *f);
...@@ -47,7 +112,12 @@ class Scene { ...@@ -47,7 +112,12 @@ class Scene {
~Scene (); ~Scene ();
int play (); int play ();
ScriptFont scriptFonts[5];
int noScriptFonts;
int textAlignment;
int textFont;
int textPosX;
int textPosY;
}; };
#endif #endif
......
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