~ares-developers/ares/gd03

« back to all changes in this revision

Viewing changes to Utilities/Constructs.h

  • Committer: Renegade
  • Date: 2010-05-29 08:12:17 UTC
  • Revision ID: git-v1:0a1bb6321f04d723afe64d1b843dc87b4da783ec
Creating /trunk/src.

git-svn-id: svn://svn.renegadeprojects.com/ares/trunk@622 859b54a9-7a54-0410-aeb3-f8d2f1fa40fd

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef CONSTRUCTS_H_
2
 
#define CONSTRUCTS_H_
3
 
 
4
 
// custom paletted cameos
5
 
// TODO: add a static vector to buffer instances of the same Palette file?
6
 
#include <ConvertClass.h>
7
 
#include <CCINIClass.h>
8
 
#include <GeneralStructures.h>
9
 
 
10
 
#include "Ares.h"
11
 
 
12
 
class CustomPalette {
13
 
public:
14
 
        ConvertClass *Convert;
15
 
        BytePalette *Palette;
16
 
 
17
 
        CustomPalette() :
18
 
                Convert(NULL),
19
 
                Palette(NULL)
20
 
        {};
21
 
 
22
 
        ~CustomPalette() {
23
 
                GAME_DEALLOC(this->Convert);
24
 
                GAME_DEALLOC(this->Palette);
25
 
        }
26
 
 
27
 
        bool LoadFromINI(CCINIClass *pINI, const char *pSection, const char *pKey) {
28
 
                if(pINI->ReadString(pSection, pKey, "", Ares::readBuffer, Ares::readLength)) {
29
 
                        GAME_DEALLOC(this->Palette);
30
 
                        GAME_DEALLOC(this->Convert);
31
 
                        ConvertClass::CreateFromFile(Ares::readBuffer, &this->Palette, &this->Convert);
32
 
                        return true;
33
 
                }
34
 
                return false;
35
 
        };
36
 
};
37
 
 
38
 
#endif