view TaskManager/Test/test_render/task/Load_Texture.cpp @ 167:c8b868871dce

DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
author gongo@localhost.localdomain
date Tue, 09 Dec 2008 15:07:31 +0900
parents 8e22fd25befb
children 56be4a6e5513
line wrap: on
line source

#include <stdlib.h>
#include <string.h>
#include "Load_Texture.h"
#include "texture.h"
#include "TileHash.h"
#include "Func.h"

SchedDefineTask(LoadTexture);

/**
 * 「Load」といいながら、結局 DrawSpan で使う
 * Hash の準備だけなので、名前変えないとなー
 */
int 
LoadTexture::run(void *rbuf , void *wbuf) 
{
    /**
     * 現在 global_alloc() では new をサポートしてないので
     * コンストラクタ呼ぶために placement new してます。
     */
    void *hash_tmp = smanager->global_alloc(GLOBAL_TEXTURE_HASH,
					    sizeof(TileHash));
    TileHashPtr hashtable = new(hash_tmp) TileHash;

    TileListPtr tileList
	= (TileListPtr)smanager->global_alloc(GLOBAL_TILE_LIST,
					      sizeof(TileList));
    tileList->init();

    return 0;
}