本文整理汇总了C++中cpSpaceFree函数的典型用法代码示例。如果您正苦于以下问题:C++ cpSpaceFree函数的具体用法?C++ cpSpaceFree怎么用?C++ cpSpaceFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpSpaceFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: l_physics_gc
static int l_physics_gc(lua_State* state)
{
l_physics_PhysicsData* physics = (l_physics_PhysicsData*)lua_touserdata(state, 1);
cpSpaceFree(physics->physics->space);
return 0;
}
示例2: destroy
static void
destroy(void)
{
cpBodyFree(staticBody);
cpSpaceFreeChildren(space);
cpSpaceFree(space);
}
示例3: cpSpaceRemoveShape
Space::~Space() {
for (auto& shape : shapes) {
cpSpaceRemoveShape(space, *shape);
}
shapes.clear();
cpSpaceFree(space);
}
示例4: destroy
static void
destroy(void)
{
cpBodyFree(rogueBoxBody);
ChipmunkDemoFreeSpaceChildren(space);
cpSpaceFree(space);
}
示例5: destroy
static void
destroy(void)
{
cpBodyFree(tankControlBody);
cpSpaceFreeChildren(space);
cpSpaceFree(space);
}
示例6: destroy
static void
destroy(cpSpace *space)
{
ChipmunkDemoFreeSpaceChildren(space);
cpBodyFree(planetBody);
cpSpaceFree(space);
}
示例7: eol_level_clear_layer_space
void eol_level_clear_layer_space(eolLevelLayer *layer)
{
if (!layer)
{
return;
}
if (layer->space != NULL)
{
cpSpaceFree(layer->space);
}
layer->space = cpSpaceNew();
if (layer->space == NULL)
{
eol_logger_message(
EOL_LOG_ERROR,
"Unable to create a physics space for new layer!");
eol_level_delete_layer(layer);
return;
}
layer->space->iterations = _eol_level_clip_iterations;
layer->space->sleepTimeThreshold = 999999;
cpSpaceSetEnableContactGraph(layer->space,eolTrue);
cpSpaceSetCollisionSlop(layer->space, _eol_level_slop);
cpSpaceSetCollisionBias(layer->space, _eol_level_bias);
}
示例8: eol_level_delete_layer
void eol_level_delete_layer(eolLevelLayer * level)
{
eolBackground *b = NULL;
GList *s,*e;
eolSpawn *spawn;
if (!level)return;
eol_tile_map_free(&level->tileMap);
for (s = level->spawnList; s != NULL; s = s->next)
{
if (!s->data)continue;
spawn = (eolSpawn *)s->data;
eol_spawn_free(&spawn);
}
s = NULL;
g_list_free(level->spawnList);
for (s = level->backgrounds; s != NULL; s = s->next)
{
if (s->data == NULL)continue;
b = (eolBackground *)s->data;
eol_model_free(&b->model);
free(b);
}
s = NULL;
g_list_free(level->backgrounds);
for (e = level->entities;e != NULL;e = e->next)
{
eol_entity_remove_from_space(e->data);
}
g_list_free(level->entities);/*just free our pointers to em, they can delete themselves*/
if (level->space != NULL)cpSpaceFree(level->space);
}
示例9: physics_thread
static void physics_thread()
{
/* Now initialize the physics engine. */
cpInitChipmunk();
space = cpSpaceNew();
do
{
/* But here we do care about the elapsed time. */
synchronize(&oldtime /*,&server_elapsed*/);
simple_lock(&physics_lock);
physics(world, space);
cpSpaceHashEach(space->activeShapes, &draw_player, NULL);
//cpSpaceHashEach(space->staticShapes, &draw_static, NULL);
simple_unlock(&physics_lock);
if(to_remove_array.length > 0)
lDestroy(&to_remove_array, remove_unused);
}
while(!physics_exit_time);
lFree(&to_remove_array);
cpSpaceFreeChildren(space);
cpSpaceFree(space);
}
示例10: destroy
static void
destroy(void)
{
cpSpaceFreeChildren(space);
cpSpaceFree(space);
cpArrayFree(platformInstance.passThruList);
}
示例11: lc_space_gc
int lc_space_gc(lua_State *vm){
lc_space *space = lc_GetSpace(1, vm);
cpSpaceFree(space->space);
luaL_unref(vm, LUA_REGISTRYINDEX, space->bodies);
luaL_unref(vm, LUA_REGISTRYINDEX, space->shapes);
free(space);
printf("Delete space: %p\n", lua_touserdata(vm, 1));
}
示例12: main
/*
* main
*/
int main(int argc, char** argv) {
espace=init();
SDL_Event event;
int continuer=1;
SDL_Init(SDL_INIT_VIDEO);
ecran=SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
//char* fichier_dico = "dico.txt";
//algo_1(fichier_dico, "asdfarbre");
if (ecran == NULL)
{
fprintf(stderr, "Erreur d'initialisation de la SDL");
exit(EXIT_FAILURE);
}
SDL_WM_SetCaption("Letter Boule Game !", NULL);
SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format,0,0,0));
initPolice();
initLesBoules(espace);
boolean refresh=TRUE;
while (continuer) {
SDL_WaitEvent(&event);
switch(event.type) {
case SDL_QUIT: continuer = 0;
}
if(refresh)
{
affichage();
refresh=FALSE;
}
if(nbBoules==0)
{
SDL_Color white={255,255,255};
SDL_Surface *game=TTF_RenderText_Solid(police,"GAME OVER" , white);
SDL_Rect position_game;
position_game.y=320;
position_game.x=240;
SDL_BlitSurface(game, NULL, ecran, &position_game);
}
SDL_Flip(ecran);
refresh=tracerLigne();
SDL_Flip(ecran);
}
cpSpaceFree(espace);
TTF_CloseFont(police);
TTF_Quit();
SDL_Quit();
return (EXIT_SUCCESS);
}
示例13: destroyCPBody
void TestColliderDetector::onExit()
{
destroyCPBody(armature2->getCPBody());
destroyCPBody(bullet->getCPBody());
cpSpaceFree(space);
CCLayer::onExit();
}
示例14: destroy
static void
destroy(void)
{
cpBodyFree(staticBody);
cpSpaceFreeChildren(space);
cpSpaceFree(space);
cpArrayFree(playerInstance.groundShapes);
}
示例15: world_destroy
void world_destroy(World_t *aWorld)
{
llist_apply(aWorld->entities, (LinkedListApplier_t)&_removeEntityFromWorld, aWorld);
aWorld->staticEntity->cpBody = NULL;
world_removeEntity(aWorld, aWorld->staticEntity);
cpSpaceFree(aWorld->cpSpace), aWorld->cpSpace = NULL;
obj_release(aWorld->entities), aWorld->entities = NULL;
obj_release(aWorld->staticEntity), aWorld->staticEntity = NULL;
}