Menu::~Menu() { DeleteGraph (h_twi); DeleteGraph (h_cursor); DeleteSoundMem(hs_choice); DeleteSoundMem(hs_move); }
LREnemy8::~LREnemy8() { for (int i = 0; i < 4; i++){ DeleteGraph(HandleN[i]); } for (h = 0; h < 10; h++){ DeleteGraph(ExpHandle[h]); } }
Image::~Image(){ DeleteGraph(mBaseHandle); DeleteGraph(mBuffHandle); for(int i=0;i<mDivNum;i++){ DeleteGraph(mDivHandle[i]); } if (mDivFlag) { delete mDivHandle; mDivHandle = 0; } }
Pshot::~Pshot() { for (auto &shot : Ashot) delete shot; for (auto &shot : Bshot) delete shot; for (auto &shot : Cshot) delete shot; for (int &Gr_Handle : hg) DeleteGraph(Gr_Handle); for (int &Gr_Handle : hg2) DeleteGraph(Gr_Handle); DeleteGraph(hg_fire); DeleteSoundMem(hs_shot); DeleteSoundMem(hs_hit); }
// データ破棄 void GameRoad::DataDel(void) { for(int i=0; i<_RO_SP_END; i++) { DeleteGraph( sp_num[i] ) ; } for(int i=0; i<8; i++) { for(int j=0; j<5; j++) { DeleteGraph( ichi_num[i][j] ); } } for(int i=0; i<_RO_SE_END; i++) { DeleteSoundMem( se_num[i] ); } }
void GraphicManager::DrawLayer() { if (GlobalValue::state==Transitioning) { switch (GlobalValue::FadeType) { case FadeCross: CrossFade(fade_frame_left,fade_frame); break; case FadeMove: MoveFade(fade_frame_left,fade_frame); break; case FadeCurtain: CurtainFade(fade_frame_left,fade_frame); break; } fade_frame_left--; if (this->fade_frame_left==0) { for (int i=0;i<GlobalValue::LayerMax;i++) { if ((layer[i].enable)&&(layer[i].handle!=layer_back[i].handle)) { DeleteGraph(layer[i].handle); } layer[i]=layer_back[i]; layer_back[i].enable=false; } GlobalValue::state=Nothing; } }else{ for (int i=0;i<GlobalValue::LayerMax;i++) { if (layer[i].enable) { DrawGraph(layer[i].x,layer[i].y,layer[i].handle,TRUE); } } } SetDrawBlendMode(DX_BLENDMODE_NOBLEND,0); }
Explosion::~Explosion() { for (int i = 0; i < COUNTER_NUM; ++i) delete c_play[i]; delete[] c_play; for (int i = 0; i < sizeof(gh_explo) / sizeof(gh_explo[0]); i++) DeleteGraph(gh_explo[i]); }
bool MapTask::Exit() { for (int i = 0; i < 400; i++) DeleteGraph(GraphHandle[i]); return true; }
void Window::DrawStringInWindow(int Input_x,int Input_y,int Input_Pos,string Input_String,int FontData,int Color) { vector<string> Strs = split(Input_String,"<>"); int Height; GetFontStateToHandle(NULL,&Height,NULL,FontData); Height *= 1.4; int Length = Strs.size(); int Draw_y = Input_y-Height; for(int i=0;i<Length;i++) { int Graph; int Draw_x = Input_x; Draw_y += Height; int DrawWidth = GetDrawStringWidthToHandle(Strs[i].c_str(),Strs[i].size(),FontData); int Size; float Ext = 1.0f; if(Input_Pos == DrawString_Center)Draw_x -= DrawWidth/2; else if(Input_Pos == DrawString_Right)Draw_x -= DrawWidth; GetFontStateToHandle(0,&Size,0,FontData); Graph = MakeScreen(DrawWidth,Size*2,true); SetDrawScreen(Graph); DrawStringToHandle(0,0,Strs[i].c_str(),Color,FontData); if(DrawWidth + Draw_x >= Width) { Ext = (float)Width / (float)(DrawWidth + Draw_x) - 0.01f; } SetDrawScreen(Screen); DrawRotaGraph2(Draw_x,Draw_y,0,0,Ext,0.f,Graph,true); DeleteGraph(Graph); } SetDrawScreen(DX_SCREEN_BACK); }
void GraphicManager::CopyForeToBack() { for (int i=0;i<GlobalValue::LayerMax;i++) { if ((layer_back[i].enable)&&(layer[i].handle!=layer_back[i].handle)) { DeleteGraph(layer_back[i].handle); } layer_back[i]=layer[i]; } }
// キャラクター共通情報の後始末 void CharaCommon_Terminate( void ) { // モデルの削除 MV1DeleteModel( chcmn.BaseModelHandle ) ; // 影用画像の削除 DeleteGraph( chcmn.ShadowHandle ) ; }
int LoadMemoryGraphScreen(int x, int y, const void *data, unsigned int size, int trans) { int gh = LoadMemoryGraph(data, size); if ( gh == -1 ) return -1; int res = DrawGraph(x, y, gh, trans); DeleteGraph(gh); return res; }
//---------------------------------------------------------- /// 壁データのロード /// @param n: 壁番号(000〜999) /// @return ロード成功(true), 失敗(false) /// @author Harui //---------------------------------------------------------- bool CWall::LoadWall(int n){ string wallname, buf; // 今あるデータは除去 _vertex.clear(); _coins.clear(); // z初期化 z = INIT_Z; // 読み込むファイル名生成 wallname = "Data/wall/wall"; wallname += (char)('0'+n/100); n = n%100; wallname += (char)('0'+n/10); n = n%10; wallname += (char)('0'+n); // wallname += ".txt"; // ファイル読み込み FILE *fp = fopen((wallname+".txt").c_str(), "r"); if( !fp ) return false; // 壁の穴の座標 int nv; fscanf(fp, "%d", &nv); // txtファイルの文字コードがShift_JISでないとエラー起きる注意 while(nv--){ double x, y; fscanf(fp, "%lf, %lf", &x, &y); _vertex.push_back( make_pair<double,double>(x, y) ); } // コインの座標 int nc; fscanf(fp, "%d", &nc); while(nc--){ double x, y; fscanf(fp, "%lf,%lf", &x, &y); _coins.push_back( make_pair<double,double>(x, y) ); } fclose(fp); // 壁の点の順番ソート SortWallPoints(); // 三角形分割 SplitTriangles(); // 壁名と同じpngファイルがある時、それを壁にする if( imgWall!=-1 ) DeleteGraph(imgWall); imgWall = LoadGraph((wallname+".png").c_str()); return true; }
Enemy::~Enemy() { delete shot; delete shot2; delete shot3; // 画像アンロード switch (type) { case 0: DeleteGraph(gh_ene00); break; case 1: break; case 2: for (int i = 0; i < sizeof(gh_ene02) / sizeof(gh_ene02[0]); i++) DeleteGraph(gh_ene02[i]); break; case 3: break; case 4: for (int i = 0; i < sizeof(gh_ene04) / sizeof(gh_ene04[0]); i++) DeleteGraph(gh_ene04[i]); break; case 5: break; case 6: break; case 7: break; default: printfDx("ERROR:Enemy.cpp"); break; } if (gh_shot00 != NULL) DeleteGraph(gh_shot00); if (sh_voice != NULL) DeleteSoundMem(sh_voice); }
Title::~Title() { DeleteGraph(titleImage[0]); DeleteGraph(titleImage[1]); DeleteGraph(titleImage[2]); DeleteGraph(titleImage[3]); DeleteGraph(titleImage[4]); DeleteGraph(titleImage[5]); DeleteGraph(_selectHandle); DeleteSoundMem(titleBGM); DeleteSoundMem(selectBGM); }
// 終了処理をする void Shader_Finalize(Shader *self) { if (self->active_pass != -1) { fprintf(stderr, "warning: unfinished pass (#%d)\n", self->active_pass); } DeleteGraph(self->depthmap_screen); DeleteShader(self->depthmap_vs); DeleteShader(self->depthmap_ps); DeleteShader(self->phong_vs); DeleteShader(self->phong_ps); delete self; }
/// <summary> 画像を 3D で扱えるように修正します </summary> Texture &use3D(bool alpha = true) { uint32 width = getSize().width, height = getSize().height; uint32 size = std::max(width, height); // そのままでもいい場合 if (width == height && size >= 8 && (size - 1 & size)) { return *this; } int count = 3; while (true) { uint32 _ = static_cast<uint32>(std::pow(2, count++)); if (_ >= size) { size = _ < 8 ? 8 : _; break; } } dxlib_handle screen = MakeScreen(size, size, alpha); SetDrawScreen(screen); DrawExtendGraph(0, 0, size, size, handle, alpha); DeleteGraph(handle); return *this = Texture(screen); }
void TextureResourceManager::DeleteResourceManager() { DEBUG_PRINT("/_/_/TextureResourceManager 削除/_/_/\n"); //! メモリ解放 for(uint32_t i = 0; i < m_vRecource2D.size(); ++i){ for(uint32_t j = 0; j < NUMBEROF(m_vRecource2D.at(i).m_texHandle); ++j){ if(m_vRecource2D.at(i).m_texHandle[j] == INVALID_VALUE){ break; } DeleteGraph(m_vRecource2D.at(i).m_texHandle[j]); } } SAFE_DELETE( s_pInstance ); DEBUG_PRINT("/_/_/TextureResourceManager 削除完了/_/_/\n"); }
void resize(const uint32 width, const uint32 height) { dxlib_handle screen = MakeScreen(width, height, true); auto _ = GetDrawScreen(); SetDrawScreen(screen); DrawExtendGraph(0, 0, width, height, handle, true); SetDrawScreen(_); DeleteGraph(handle); handle = screen; }
void Stage::StageSet(eStage estage) { // まず素材用のメモリを開放します for (int &Gr_Handle : hg) { if(Gr_Handle != NULL) DeleteGraph(Gr_Handle); } if (hs_bgm != NULL) DeleteSoundMem(hs_bgm); // ステージ用素材ロード switch (estage) { case eStage::stage1 : hs_bgm = LoadSoundMem("SOUND/s0.mp3"); hg.at(eBG_back) = LoadGraph("GRAPH/GAME/BACKGROUND/RasterOnly/rbg00.png"); hg.at(eBG_middle) = LoadGraph("GRAPH/GAME/BACKGROUND/sumple_middle.png"); hg.at(eBG_front) = LoadGraph("GRAPH/GAME/BACKGROUND/RasterOnly/rbg01.png"); break; case eStage::stage2 : break; case eStage::stage3 : break; case eStage::stage4 : break; case eStage::stage5 : break; case eStage::stage6 : break; case eStage::stage0 : break; } // 敵データを読み込む Game::LoadEnemy(estage); Game::StageCall(); PlaySoundMem(hs_bgm, DX_PLAYTYPE_LOOP); }
/* ================================================ */ void TextureResourceManager::DeleteTextureInfo( const char *jsonFile ) { //DEBUG_PRINT("/_/_/リソース解放 : %s/_/_/\n", jsonFile); std::vector<RESOURCE_TEX>::iterator it = m_vRecource2D.begin(); for( uint32_t i = 0; i < m_vRecource2D.size(); ++i ){ if(m_vRecource2D.at(i).m_jsonFile.compare(jsonFile) == 0){ //! 発見!!! --m_vRecource2D.at(i).m_readCounter; if( m_vRecource2D.at(i).m_readCounter <= 0 ){ //! メモリ解放 for( uint32_t j = 0; j < NUMBEROF(it->m_texHandle); ++j ){ if( it->m_texHandle[j] == INVALID_VALUE ){ break; } // 読み込み画像を削除 DeleteGraph(it->m_texHandle[j]); // 描画予約をしていたかもしれないので削除 Draw2DManager::GetInstance()->DeleteDrawInfo( jsonFile ); } //DEBUG_PRINT("/_/_/リソース解放完了 : 【%s】/_/_/\n", m_vRecource2D.at(i).m_jsonFile.c_str() ); m_vRecource2D.erase(it); } else{ //DEBUG_PRINT("/_/_/リソース読み込みカウンタ残り %d/_/_/\n", m_vRecource2D.at(i).m_readCounter ); } return; } ++it; } DEBUG_PRINT("/_/_/リソースが見つからなかった.../_/_/\n"); DEBUG_ASSERT( 0, "jsonFile is Nothing"); }
IrreEnemy5::~IrreEnemy5() { for (h = 0; h < 4; h++){ DeleteGraph(HandleN[h]); } }
Player::~Player(){ for (int i = 0; i < 7; i++){ DeleteGraph(handle[i]); } }
EShot03::~EShot03() { for (int i = 0; i < sizeof(gh) / sizeof(gh[0]); i++) DeleteGraph(gh[i]); }
Player::~Player() { for (int h : hg) DeleteGraph(h); DeleteSoundMem(hs_shiftUp); DeleteSoundMem(hs_shiftDown); DeleteSoundMem(hs_dead); }
Creticle::~Creticle(void) { DeleteGraph(this->graph); }
menu::~menu() { if(!Picture_Handle.empty())DeleteGraph(Picture_Handle[0]); }
EnemyShytarn::~EnemyShytarn(){ DeleteGraph(m_image); }
Piece::~Piece() { for (int i = 0; i < PIECE_ALL_NUM; i++) delete c_play[i]; delete[] c_play; switch (type) { case ePiece_SmallGray: for (int i = 0; i < sizeof(gh_small1) / sizeof(gh_small1[0]); i++) DeleteGraph(gh_small1[i]); break; case ePiece_SmallCoin: for (int i = 0; i < sizeof(gh_small6) / sizeof(gh_small6[0]); i++) DeleteGraph(gh_small6[i]); break; case ePiece_SmallSquare: for (int i = 0; i < sizeof(gh_small5) / sizeof(gh_small5[0]); i++) DeleteGraph(gh_small5[i]); break; case ePiece_Smalls: for (int i = 0; i < sizeof(gh_smalls) / sizeof(gh_smalls[0]); i++) DeleteGraph(gh_smalls[i]); break; case ePiece_BigNut: for (int i = 0; i < sizeof(gh_big1) / sizeof(gh_big1[0]); i++) DeleteGraph(gh_big1[i]); break; case ePiece_BigPlate: for (int i = 0; i < sizeof(gh_big2) / sizeof(gh_big2[0]); i++) DeleteGraph(gh_big2[i]); break; case ePiece_BigSquare: for (int i = 0; i < sizeof(gh_big3) / sizeof(gh_big3[0]); i++) DeleteGraph(gh_big3[i]); break; case ePiece_BigPlate3: for (int i = 0; i < sizeof(gh_big5) / sizeof(gh_big5[0]); i++) DeleteGraph(gh_big5[i]); break; case ePiece_Bigs: for (int i = 0; i < sizeof(gh_bigs) / sizeof(gh_bigs[0]); i++) DeleteGraph(gh_bigs[i]); break; case ePiece_Special: DeleteGraph(gh_burger); DeleteGraph(gh_kit); break; } }
void Clear_Finalize() { DeleteGraph(clear_image); }