view TaskManager/Test/test_render/spe/Load_Texture.cpp @ 371:f88744ee9350

change DrawSpan, #define USE_MEMLIST use MemList(LRU)
author aaa
date Wed, 29 Jul 2009 16:34:26 +0900
parents b89ba1d96fff
children b4b8345b5366
line wrap: on
line source

// #define DEBUG
#include "error.h"

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

SchedDefineTask(LoadTexture);

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

#ifdef USE_MEMLIST
    void *tileList_tmp
        = smanager->global_alloc(GLOBAL_TILE_LIST, sizeof(MemList));
    new(tileList_tmp) MemList;
#else
    void *tileList_tmp
        = smanager->global_alloc(GLOBAL_TILE_LIST, sizeof(TileList));
    new(tileList_tmp) TileList;
#endif
    return 0;
}