bool Main::Initialize() { hbit[0] = (HBITMAP)LoadImage(NULL, L"./Bitmap/main.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[1] = (HBITMAP)LoadImage(NULL, L"./Bitmap/m_int.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[2] = (HBITMAP)LoadImage(NULL, L"./Bitmap/m_out.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[3] = (HBITMAP)LoadImage(NULL, L"./Bitmap/m_info.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[4] = (HBITMAP)LoadImage(NULL, L"./Bitmap/m_information.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[5] = (HBITMAP)LoadImage(NULL, L"./Bitmap/deathcollect.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); for (size_t i = 0; i < 6; i++) IMAGE_CHECK(hbit[i]); SetRect(&Button[0], 200, 430, 500, 500); // 게임 시작 SetRect(&Button[1], 200, 530, 500, 600); // 게임 종료 SetRect(&Button[2], 1150, 50, 1150 + 85, 50 + 85); // Maker Info Button SetRect(&Button[3], 1280, 0, 1280 + 1280, 720); // Maker Information SetRect(&Button[4], 210, 610, 462, 690); // Collection /* Sound */ SoundManager()->Pause(CommonPtr()->GetDeadBGM()); Sound1 = SoundManager()->OpenMp3(L"./Sound/InfoSound.mp3"); SoundManager()->PlayRepeat(CommonPtr()->GetMainBGM()); return true; }
void Main::InfoUpdate() { if (Button[3].left <= 0 && InfoState == InfoMoveLeft) { InfoState = InfoStoped; return; } if (InfoState == InfoMoveLeft) { SoundManager()->Play(Sound1); OffsetRect(&Button[3], -14, 0); if (Button[3].left<=0) OffsetRect(&Button[3], -Button[3].left, 0); } else if (InfoState == InfoMoveRight) { if (Button[3].left >= 1280) { SoundManager()->MoveStartPosition(Sound1);// 처음으로 옮김 InfoState = InfoActionLess; return; } OffsetRect(&Button[3], 14, 0); } }
Common::Common() { hbit = new HBITMAP[4]; SetRect(&A, 100, 400, 400, 670); SetRect(&B, 490, 400, 790, 670); SetRect(&C, 880, 400, 1180, 670); SetRect(&Return, 900, 530, 1200, 600); // 처음으로 SetRect(&Main, 900, 630, 1200, 700); // 메인으로 SetRect(&Exit, 0, 630, 300, 700); // 게임 종료 SetRect(&Enter, 0, 600, 250, 700); // Enter hbit[0] = (HBITMAP)LoadImage(NULL, L"./Bitmap/enter.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[1] = (HBITMAP)LoadImage(NULL, L"./Bitmap/return.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[2] = (HBITMAP)LoadImage(NULL, L"./Bitmap/m_out.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); hbit[3] = (HBITMAP)LoadImage(NULL, L"./Bitmap/mainButton.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); for (size_t i = 0; i < 4; i++) IMAGE_CHECK(hbit[i]); NarrMoveNum = 1; MainBGM = SoundManager()->OpenMp3(L"./Sound/MainBGM.mp3"); DeadBGM = SoundManager()->OpenMp3(L"./Sound/DeadBGM.mp3"); }
void Common::ResetCommon() { PressEnter = false; SetRect(&Narration, 250, -150, 1050, 0); SetRect(&Enter, -250, 600, 0, 700); StartTime = GetTickCount(); SoundManager()->Pause(DeadBGM); SoundManager()->MoveStartPosition(MainBGM); SoundManager()->MoveStartPosition(DeadBGM); NarrMoveNum = 1; }
void Main::UnInitialize() { delete[]hbit; delete[]Button; SoundManager()->Close(Sound1); }
void Main::Process() { ButtonUpdate(); InfoUpdate(); if ((StartState == ButtonClicked) && (Button[0].top >= SCREEN_Y)) { SoundManager()->Pause(CommonPtr()->GetMainBGM()); SceneManager()->ChangeScene(new Intro); } }
// // Sound.cpp for Sound.cpp in /home/bechad_p/rendu/cpp_bomberman/project/sound // // Made by Pierre Bechade // Login <*****@*****.**> // // Started on Wed Jun 3 14:27:07 2015 Pierre Bechade // Last update Sun Jun 14 16:32:44 2015 Pierre Bechade // #include "bomberman.hpp" #include <fmod.hpp> SoundManager SoundManager::m_instance=SoundManager(); SoundManager::SoundManager() { this->_system = NULL; this->_result = FMOD::System_Create(&this->_system); this->_system->setOutput(FMOD_OUTPUTTYPE_DSOUND ); this->_system->init(1024, FMOD_INIT_NORMAL, 0); this->_soundChannel = NULL; this->_musicChannel = NULL; this->_volumeSound = 1; this->_volumeMusic = 1; } SoundManager::~SoundManager() { if (!this->_noise.empty()) {
Common::~Common() { delete[]hbit; SoundManager()->Close(MainBGM); SoundManager()->Close(DeadBGM); }
void Common::PlayDeadBGM() { SoundManager()->Play(DeadBGM); }