void BemGame::AddSpaceTiles() { // This functions adds the background bitmaps. (Pictures // of Space.) The Space picture is a tile that is rotated // for variaton. KrResource* resource = engine->Vault()->GetResource( KYRATAG_TILE, BEM_SPACE ); GLASSERT( resource ); KrTileResource* spaceTileRes = resource->ToTileResource(); GLASSERT( spaceTileRes ); int i, j; KrRect bounds = engine->FullScreenBounds(); for( i=0; i<(bounds.Width() / spaceTileRes->Size() + 1); i++ ) { for( j=0; j<(bounds.Height() / spaceTileRes->Size() + 1); j++ ) { KrTile* spaceTile = new KrTile( spaceTileRes ); GLASSERT( spaceTile ); spaceTile->SetPos( i * spaceTile->Size(), j * spaceTile->Size() ); spaceTile->SetRotation( (i+j) & 7 ); engine->Tree()->AddNode( backgroundTree, spaceTile ); } } }
PyObject * _wrap_tile_set_rotation (PyObject *self, PyObject *args) { PyObject *py_r; int angle; if (!PyArg_ParseTuple (args, "Oi:set_rotation", &py_r, &angle)) return NULL; KrTile *t = AS_PTR (KrTile, py_r); GLASSERT (t); t->SetRotation(angle); RETURN_NONE; }
KrImNode* KrTile::Clone() { KrTile* tile = new KrTile( resource ); tile->SetRotation( rotation ); return tile; }