Mercurial > hg > Game > Cerium
view TaskManager/Test/test_render/spe/ChainInit.cc @ 467:839e34d0cc3c draft
fix all examples. test_render is not working now.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 01 Oct 2009 19:25:25 +0900 |
parents | 60f44d3ea452 |
children | f979728101e7 |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include "ChainInit.h" #include "Func.h" /* これは必須 */ SchedDefineTask(ChainInit); /* spe の global 領域に MemList を生成する */ typedef struct { double x, y, next_x, next_y; double vx, vy, next_vx, next_vy; int can_move; uint32 parent; } CHAIN_VARS; static int run(SchedTask *s,void *rbuf, void *wbuf) { CHAIN_VARS* idata = (CHAIN_VARS*)s->get_input(rbuf, 0); uint32 chain_len = s->get_param(0); // property は spe 上で allocate している(global) CHAIN_VARS *property = (CHAIN_VARS*)global_alloc(DATA_ID, sizeof(CHAIN_VARS)*chain_len); memcpy(property, idata, sizeof(CHAIN_VARS)*chain_len); return 0; }