< index < 14. BSP toolkit < 14.2 Splitting a BSP tree |
===================================== | > 14.4 Reading information from the tree |
C++ : void TCODBsp::resize(int x,int y, int w, int h) C : void TCOD_bsp_resize(TCOD_bsp_t *node, int x,int y, int w, int h) Py : bsp_resize(node, x,y, w, h)
Parameter | Description |
---|---|
node | In the C version, the root node created with TCOD_bsp_new_with_size, or a node obtained by splitting. |
x,y,w,h | New position and size of the node. The original rectangular area covered by the node should be included in the new one to ensure that every splitting edge stay inside its node. |
C++ : TCODBsp *myBSP = new TCODBsp(0,0,50,50); myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); // ... do something with the tree here myBSP->resize(0,0,50,50); C : TCOD_bsp_t *my_bsp=TCOD_bsp_new_with_size(0,0,50,50); TCOD_bsp_split_recursive(my_bsp,NULL,4,5,5,1.5f,1.5f); /* ... do something with the tree here */ TCOD_bsp_resize(my_bsp,0,0,50,50); Py : my_bsp=libtcod.bsp_new_with_size(0,0,50,50) libtcod.bsp_split_recursive(my_bsp,0,4,5,5,1.5,1.5) # ... do something with the tree here libtcod.bsp_resize(my_bsp,0,0,50,50)