Commit c0129c90 authored by anotherguest's avatar anotherguest

Better palette, image parsing, Fade in for screens.

Missing font colours, spacing is not correct all of the time. ANimations not working.
parent 0b47d4f3
This diff is collapsed.
...@@ -48,57 +48,66 @@ public: ...@@ -48,57 +48,66 @@ public:
class ScriptText class ScriptText
{ {
public: public:
ScriptText() ScriptText();
{ ~ScriptText();
x = -1;
y = -1;
}
char* text; char* text;
int alignment; int alignment;
int fontId; int fontId;
int x; int x;
int y; int y;
SDL_Rect textRect;
int extraLineHeight;
}; };
// Class // Class
class ScriptPage class ScriptPage
{ {
public: public:
ScriptPage() ScriptPage();
{ ~ScriptPage();
bgIndex = -1; int backgrounds;
pageTime = 0; int bgIndex[30];
noScriptTexts = 0; unsigned int bgPos[30];
}
int bgIndex;
// Length of the scene in seconds, or if zero = anim complete, or 256 = user interaction // Length of the scene in seconds, or if zero = anim complete, or 256 = user interaction
int pageTime; int pageTime;
ScriptText scriptTexts[100]; ScriptText scriptTexts[100];
int noScriptTexts; int noScriptTexts;
char* musicfile;
int paletteIndex;
}; };
class ImageInfo class ImageInfo
{ {
public: public:
ImageInfo();
~ImageInfo();
// SDL_Surface with the image // SDL_Surface with the image
SDL_Surface *image; SDL_Surface *image;
// data index of the image (not the palette) to compare with scripts
int dataIndex;
};
class PaletteInfo
{
public:
// Palette associated with the image // Palette associated with the image
SDL_Color palette[256]; SDL_Color palette[256];
// data index of the image (not the palette) to compare with scripts // data index of the image (not the palette) to compare with scripts
int dataIndex; int dataIndex;
}; };
class Scene { class Scene {
private: private:
ImageInfo imageInfo[100]; ImageInfo imageInfos[100];
PaletteInfo paletteInfos[100];
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; int paletteIndex;
// Scripts all information needed to render script pages, text etc // Scripts all information needed to render script pages, text etc
ScriptPage* scriptPages; ScriptPage* scriptPages;
ImageInfo* FindImage(int dataIndex); ImageInfo* FindImage(int dataIndex);
...@@ -106,18 +115,14 @@ class Scene { ...@@ -106,18 +115,14 @@ class Scene {
protected: protected:
void ParseScripts(File *f); void ParseScripts(File *f);
void ParseData(File *f); void ParseData(File *f);
void ParseAni(File* f); void ParseAni(File* f, int dataIndex);
public: public:
Scene (char * fileName); Scene (char * fileName);
~Scene (); ~Scene ();
int play (); int play ();
ScriptFont scriptFonts[5]; ScriptFont scriptFonts[5];
int noScriptFonts; 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