I don't want to keep this cool info away from you, even if most editors might have no use for it.
The Pal2Pac.dll is included with O2. The rest of the info is inside the header.
Big THX to SUMA! ***![]()
Here you are:Originally Posted by (Dschulle @ Jan. 28 2004,17:18)
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#ifndef _PAL2PAC_HPP
#define _PAL2PAC_HPP
#define MYDLL _ _ declspec ( dllexport ) _ _ stdcall
//the spaces should not be there,
// but iconboard does not like it without them
// dynamic linking types etc...
extern "C"
{
// Objektiv Interface
int MYDLL AddTexture( const char *libPath, const char *textPath, int size );
int MYDLL UpdateTexture( const char *dest, const char *src, int size );
int MYDLL CombineTexture
(
const char *D, const char *S1, const char *S2, const char *S3, const char *S4,
int size, const char *bank, const char *water
);
// Visitor Interface
void MYDLL TextureMix
(
const char *t,
const char *s1, const char *s2, const char *s3, const char *s4,
const char *bankDirectory, const char *bankTexture
);
struct TextureDataStruct
{
int _w,_h; // data dimensions
DWORD *_data; // pointer to ARGB 8888 data
};
void MYDLL CreateTextureData( TextureDataStruct &data, const char *name );
void MYDLL DestroyTextureData( TextureDataStruct &data );
COLORREF MYDLL TextureColor( const char *s );
DWORD MYDLL TextureColorARGB( const char *s );
typedef int stdcall UpdateTextureT( const char *dest, const char *src, int size );
typedef void stdcall DestroyTextureDataT( TextureDataStruct &data );
};
extern UpdateTextureT *UpdateTextureF;
extern CreateTextureDataT *CreateTextureDataF;
extern DestroyTextureDataT *DestroyTextureDataF;
void InitPal2Pac();
// class encapsulation of TextureDataStruct
class TextureData
{
struct TextureDataStruct _data;
public:
TextureData( const char *name=NULL )
{
if (!CreateTextureDataF) return;
CreateTextureDataF(_data,name);
}
~TextureData()
{
if (!DestroyTextureDataF) return;
DestroyTextureDataF(_data);
}
void Load( const char *name )
{
if (!CreateTextureDataF) return;
if (!DestroyTextureDataF) return;
DestroyTextureDataF(_data);
CreateTextureDataF(_data,name);
}
int W() const {return _data._w;}
int H() const {return _data._h;}
const DWORD *Data() const {return _data._data;}
DWORD GetPixel( int x, int y ) const {return _data._data[y*_data._w+x];}
private:
TextureData( const TextureData &src );
void operator =( const TextureData &src );
};
#endif
[/QUOTE]
If you think anyone else can use this for the benefit of OPF community, feel free to share it. You can create and load pal/pac files with this interface. It is far from flexible, but it may help you.
HOME
Reply With Quote


