view Renderer/Engine/TextureHash.h @ 1161:cc1a50cac83d draft

use MemorySegment API for pp load. do not check execution of the cell side. to be continued..
author Yutaka_Kinjyo
date Thu, 05 May 2011 00:15:43 +0900
parents 80c1d74f2c7f
children b8adf4e95e96
line wrap: on
line source

#ifndef INCLUDED_TEXTURE_HASH
#define INCLUDED_TEXTURE_HASH

const int TABLE_SIZE = 9192; //8192 + 1000

struct hashtable{
    int tx_id;
    char* key;
};

class TextureHash {
public:
	int id_count;
    hashtable *table;

    TextureHash(void);
    ~TextureHash(void);
    int hash_function(const char* image_name);
    int hash_regist(const char* image_name, int &tx_id);
    int sg_hash_regist(const char* image_name, int &tx_id);
    int get_sgid(const char* key);
    void remove(int id) {  table[id].tx_id = -1; }
};

#endif