Mercurial > hg > Game > Cerium
view TaskManager/Test/test_render/task/Load_Texture.cpp @ 120:13b43de5ef5d draft
fix Load Texture
author | gongo@gendarme.local |
---|---|
date | Tue, 25 Nov 2008 00:18:49 +0900 |
parents | 028ffc9c0375 |
children | 40978d4b608a |
line wrap: on
line source
#include <stdlib.h> #include <string.h> #include "Load_Texture.h" #include "texture.h" #include "Func.h" /** * 決めうちじゃなくて、 * create_task の時に param で渡せばおk */ #define height 128 #define width 128 // byteperpixel = 3 width = 128 dma_height= 32 #define LOAD_SIZE 3*128*32 #define MAX_LOAD_SIZE 16384 #define USE_ARRAY 3 SchedDefineTask(LoadTexture); int LoadTexture::run(void *rbuf , void *wbuf) { int addr = smanager->get_param(0); int addrNum = smanager->get_param(1); void **addrList = (void**)smanager->get_input(0); void **list = (void**)global_alloc(TEXTURE2_ID, addrNum*sizeof(void*)); memcpy(list, addrList, addrNum*sizeof(void*)); #if 0 //タスクからタスクを生成 TaskPtr task = create_task(TASK_SET_TEXTURE); // 16kbyte づつ送ってる task->add_inData(addr, MAX_LOAD_SIZE); task->add_inData(addr + MAX_LOAD_SIZE, MAX_LOAD_SIZE); task->add_inData(addr + MAX_LOAD_SIZE*2, MAX_LOAD_SIZE); task->add_inData(addr + MAX_LOAD_SIZE*3, MAX_LOAD_SIZE); wait_task(task); #endif return 0; }