sgdk: tools.h Source File

sgdk

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

tools.h
Go to the documentation of this file.

    00001
    00010 #ifndef _TOOLS_H_
    00011 #define _TOOLS_H_
    00012
    00013 #include "bmp.h"
    00014 #include "vdp_tile.h"
    00015 #include "vdp_bg.h"
    00016 #include "map.h"
    00017
    00018
    00023 #define COMPRESSION_NONE        0
    00024
    00028 #define COMPRESSION_APLIB       1
    00029
    00033 #define COMPRESSION_LZ4W        2
    00034
    00035
    00046 typedef s16 _comparatorCallback(void* o1, void* o2);
    00047
    00048
    00053 void setRandomSeed(u16 seed);
    00058 u16 random();
    00059
    00064 u32 getFPS();
    00069 fix32 getFPS_f();
    00070
    00071
    00076 void KLog(char* text);
    00077 void KLog_U1(char* t1, u32 v1);
    00078 void KLog_U2(char* t1, u32 v1, char* t2, u32 v2);
    00079 void KLog_U3(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3);
    00080 void KLog_U4(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4);
    00081 void KLog_U1_(char* t1, u32 v1, char* t2);
    00082 void KLog_U2_(char* t1, u32 v1, char* t2, u32 v2, char* t3);
    00083 void KLog_U3_(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4);
    00084 void KLog_U4_(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4, char* t5);
    00085 void KLog_U1x(u16 minSize, char* t1, u32 v1);
    00086 void KLog_U2x(u16 minSize, char* t1, u32 v1, char* t2, u32 v2);
    00087 void KLog_U3x(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3);
    00088 void KLog_U4x(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4);
    00089 void KLog_U1x_(u16 minSize, char* t1, u32 v1, char* t2);
    00090 void KLog_U2x_(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3);
    00091 void KLog_U3x_(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4);
    00092 void KLog_U4x_(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4, char* t5);
    00093 void KLog_S1(char* t1, s32 v1);
    00094 void KLog_S2(char* t1, s32 v1, char* t2, s32 v2);
    00095 void KLog_S3(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3);
    00096 void KLog_S4(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4, s32 v4);
    00097 void KLog_S1_(char* t1, s32 v1, char* t2);
    00098 void KLog_S2_(char* t1, s32 v1, char* t2, s32 v2, char* t3);
    00099 void KLog_S3_(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4);
    00100 void KLog_S4_(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4, s32 v4, char* t5);
    00101 void KLog_S1x(u16 minSize, char* t1, s32 v1);
    00102 void KLog_S2x(u16 minSize, char* t1, s32 v1, char* t2, s32 v2);
    00103 void KLog_S3x(u16 minSize, char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3);
    00104 void KLog_S4x(u16 minSize, char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4, s32 v4);
    00105 void KLog_f1(char* t1, fix16 v1);
    00106 void KLog_f2(char* t1, fix16 v1, char* t2, fix16 v2);
    00107 void KLog_f3(char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3);
    00108 void KLog_f4(char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3, char* t4, fix16 v4);
    00109 void KLog_f1x(s16 numDec, char* t1, fix16 v1);
    00110 void KLog_f2x(s16 numDec, char* t1, fix16 v1, char* t2, fix16 v2);
    00111 void KLog_f3x(s16 numDec, char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3);
    00112 void KLog_f4x(s16 numDec, char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3, char* t4, fix16 v4);
    00113 void KLog_F1(char* t1, fix32 v1);
    00114 void KLog_F2(char* t1, fix32 v1, char* t2, fix32 v2);
    00115 void KLog_F3(char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3);
    00116 void KLog_F4(char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3, char* t4, fix32 v4);
    00117 void KLog_F1x(s16 numDec, char* t1, fix32 v1);
    00118 void KLog_F2x(s16 numDec, char* t1, fix32 v1, char* t2, fix32 v2);
    00119 void KLog_F3x(s16 numDec, char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3);
    00120 void KLog_F4x(s16 numDec, char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3, char* t4, fix32 v4);
    00121
    00122
    00135 Bitmap *allocateBitmap(const Bitmap *bitmap);
    00150 Bitmap *allocateBitmapEx(u16 width, u16 heigth);
    00162 TileSet *allocateTileSet(const TileSet *tileset);
    00174 TileSet *allocateTileSetEx(u16 numTile);
    00186 TileMap *allocateTileMap(const TileMap *tilemap);
    00200 TileMap *allocateTileMapEx(u16 width, u16 heigth);
    00213 Image *allocateImage(const Image *image);
    00225 Map *allocateMap(const MapDefinition *mapDef);
    00226
    00241 Bitmap *unpackBitmap(const Bitmap *src, Bitmap *dest);
    00256 TileSet *unpackTileSet(const TileSet *src, TileSet *dest);
    00271 TileMap *unpackTileMap(const TileMap *src, TileMap *dest);
    00286 Image *unpackImage(const Image *src, Image *dest);
    00287
    00304 u32 unpack(u16 compression, u8 *src, u8 *dest);
    00305
    00317 u32 aplib_unpack(u8 *src, u8 *dest);
    00330 u32 lz4w_unpack(const u8 *src, u8 *dest);
    00331
    00332
    00344 void qsort_u8(u8 *data, u16 left, u16 right);
    00356 void qsort_s8(s8 *data, u16 left, u16 right);
    00368 void qsort_u16(u16 *data, u16 left, u16 right);
    00380 void qsort_s16(s16 *data, u16 left, u16 right);
    00392 void qsort_u32(u32 *data, u16 left, u16 right);
    00404 void qsort_s32(s32 *data, u16 left, u16 right);
    00405
    00417 void qsort(void** data, u16 len, _comparatorCallback* cb);
    00418
    00419
    00420
    00421 #endif // _TOOLS_H_

All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines