void resume() override { static bool flag = true; if (flag){ insertToParent(new game::CSceneStage("scene_stage")); flag = false; } }
void resume() override { insertToParent(new Stage("Stage")); effect::Create(0, 0, effect::EFFECTTYPE::CURTAIN_OPEN); gplib::bgm::DShow_Play("pinchi_bgm"); kill(); }
node *insertToLeafSplit(node *root, node *leaf, int index, int *key) { node *newLeaf, **tempChild, *parent; int *newKey, **tempKey; int i, split; tempKey = malloc(childSize * sizeof(int *)); tempChild = malloc(childSize * sizeof(node *)); for (i = 0; i < childSize; i++){ if (i == index){ tempKey[i] = malloc(sizeof(int)); // printf("index=%d\n",index); tempKey[i] = key; tempChild[i] = NULL; } else if (i < index){ tempKey[i] = leaf->keys[i]; tempChild[i] = leaf->children[i]; } else{ tempKey[i] = leaf->keys[i-1]; tempChild[i] = leaf->children[i-1]; } } split = childSize / 2; leaf->numChild = split; for (i = 0; i < split; i++){ leaf->keys[i] = tempKey[i]; leaf->children[i] = tempChild[i]; } newLeaf = SetNewLeaf(); newLeaf->numChild = childSize - split; for (i = split; i < childSize; i++){ newLeaf->keys[i - split] = tempKey[i]; newLeaf->children[i - split] = tempChild[i]; } newLeaf->parent = leaf->parent; newLeaf->children[childSize-1] = leaf->children[childSize-1]; leaf->children[childSize-1] = newLeaf; free(tempKey); free(tempChild); newKey = newLeaf->keys[0]; printf("found leaf: %d\n", *leaf->keys[0]); parent = leaf->parent; if (parent) printf("found leaf's parent: %d\n", *parent->keys[0]); return insertToParent(root, leaf, newLeaf, newKey); }
void update() override { //追加 auto btnobj = ci_ext::weak_to_shared<Button>(p_btns); btnobj->ButtonClick("start", 640, 300, btnflag); if (btnflag==true) { insertToParent(new game::Menu("scene_stage")); //ここにイベントを記述 kill(); } // if (gplib::input::CheckPush(gplib::input::KEY_BTN0)) { //effect::Create(0, 0, effect::EFFECTTYPE::FADEOUTWHITE); sleep(5); } }
void update() override { //追加 auto btnobj = ci_ext::weak_to_shared<Button>(p_playbtns); btnobj->ButtonClick("menu_play", 640, 300, playflag); auto btnobj2 = ci_ext::weak_to_shared<Button>(p_otherbtns); btnobj2->ButtonClick("menu_other", 640, 400, otherflag); auto btnobj3 = ci_ext::weak_to_shared<Button>(p_optionbtns); btnobj3->ButtonClick("menu_option", 640, 500, optionflag); if (playflag==true) { insertToParent(new game::CSceneStage("scene_stage")); //ここにイベントを記述 kill(); } // if (gplib::input::CheckPush(gplib::input::KEY_BTN0)) { //effect::Create(0, 0, effect::EFFECTTYPE::FADEOUTWHITE); sleep(5); } }
node *insertToNodeSplit(node *root, node *nd, node *r, int index, int *key) { int i, split; node **tempChild, *newNode, *child; int **tempKey, *newKey; tempChild = malloc((childSize) * sizeof(node *)); tempKey = malloc(childSize * sizeof(int *)); for (i = 0; i < childSize; i++){ if (i == index + 1) tempChild[i] = r; else if (i < index+1) tempChild[i] = nd->children[i]; else tempChild[i] = nd->children[i-1]; } for (i = 0; i < childSize; i++){ if (i == index){ tempKey[i] = malloc(sizeof(int)); tempKey[i] = key; } else if (i < index) tempKey[i] = nd->keys[i]; else tempKey[i] = nd->keys[i-1]; } // printf("i'm in inserttonode\n"); split = childSize % 2 ? childSize / 2 + 1 : childSize / 2; nd->numChild = split - 1; for (i = 0; i < split - 1; i++){ nd->children[i] = tempChild[i]; nd->keys[i] = tempKey[i]; } nd->children[i] = tempChild[i]; newKey = tempKey[i]; newNode = SetNewNode(); newNode->numChild = childSize - split - 1; for (++i; i < childSize; i++){ newNode->children[i - split] = tempChild[i]; newNode->keys[i - split] = tempKey[i]; } newNode->children[i - split] = tempChild[i]; newNode->parent = nd->parent; for (i = 0; i <= newNode->numChild; i++){ child = (node *)(newNode->children[i]); child->parent = newNode; } newNode->next = nd->next; nd->next = newNode; free(tempChild); free(tempKey); // printf("updated: %d\n", *key); return insertToParent(root, nd, newNode, newKey); }