view TaskManager/Test/test_render/task/Load_Texture.cpp @ 360:716b87bce32a

add vacuum "-sg 16"
author aaa
date Fri, 17 Jul 2009 22:50:06 +0900
parents 3f5289873643
children eab18aa0c7f6
line wrap: on
line source

#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)
{
    /**
     * 現在 global_alloc() では new をサポートしてないので
     * コンストラクタ呼ぶために placement new してます。
     */
    void *hash_tmp
        = smanager->global_alloc(GLOBAL_TEXTURE_HASH, sizeof(TileHash));
    new(hash_tmp) TileHash;

    void *tileList_tmp
        = smanager->global_alloc(GLOBAL_TILE_LIST, sizeof(TileList));
    new(tileList_tmp) TileList;

    return 0;
}