1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

kilka drobnych poprawek dźwięku

This commit is contained in:
mateuszb 2007-06-20 17:35:13 +00:00
parent 7db0e1157b
commit 1a01585af8
4 changed files with 12 additions and 4 deletions

View File

@ -9,6 +9,7 @@
#include "CAmbarCendamo.h"
#include "CBuildingHandler.h"
#include "CObjectHandler.h"
#include "CMusicHandler.h"
/*
CGameInfo class
@ -26,6 +27,7 @@ public:
CAmbarCendamo * ac;
CBuildingHandler * buildh;
CObjectHandler * objh;
CMusicHandler * mush;
};
#endif //CGAMEINFO_H

View File

@ -233,8 +233,6 @@ int _tmain(int argc, _TCHAR* argv[])
// well, there's no music, but most games don't break without music...
}
mush->playClick();
screen = SDL_SetVideoMode(800,600,24,SDL_HWSURFACE|SDL_DOUBLEBUF/*|SDL_FULLSCREEN*/);
ekran = screen;
//FILE * zr = fopen("mal.txt","r");
@ -260,6 +258,7 @@ int _tmain(int argc, _TCHAR* argv[])
THC timeHandler tmh;
CGameInfo * cgi = new CGameInfo;
CGameInfo::mainObj = cgi;
cgi->mush = mush;
CArtHandler * arth = new CArtHandler;
arth->loadArtifacts();
cgi->arth = arth;

View File

@ -2,7 +2,7 @@
void CMusicHandler::initMusics()
{
if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048)==-1)
if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096)==-1)
{
printf("Mix_OpenAudio: %s\n", Mix_GetError());
exit(2);

View File

@ -389,6 +389,8 @@ void CPreGame::scenHandleEv(SDL_Event& sEvent)
{
if (isItIn(&btns[i]->pos,sEvent.motion.x,sEvent.motion.y))
{
mush->playClick();
btns[i]->press(true);
ourScenSel->pressed=btns[i];
}
@ -559,12 +561,12 @@ void CPreGame::runLoop()
}
else if ((sEvent.type==SDL_MOUSEBUTTONDOWN) && (sEvent.button.button == SDL_BUTTON_LEFT))
{
mush->playClick();
for (int i=0;i<btns.size(); i++)
{
if (isItIn(&btns[i]->pos,sEvent.motion.x,sEvent.motion.y))
{
btns[i]->press(true);
mush->playClick();
//SDL_BlitSurface((btns[i].imgs)->ourImages[1].bitmap,NULL,ekran,&btns[i].pos);
//updateRect(&btns[i].pos);
}
@ -574,26 +576,31 @@ void CPreGame::runLoop()
{
highlightButton(1,1);
current->highlighted=1;
mush->playClick();
}
else if (isItIn(&current->lLoadGame,sEvent.motion.x,sEvent.motion.y))
{
highlightButton(2,1);
current->highlighted=2;
mush->playClick();
}
else if (isItIn(&current->lHighScores,sEvent.motion.x,sEvent.motion.y))
{
highlightButton(3,1);
current->highlighted=3;
mush->playClick();
}
else if (isItIn(&current->lCredits,sEvent.motion.x,sEvent.motion.y))
{
highlightButton(4,1);
current->highlighted=4;
mush->playClick();
}
else if (isItIn(&current->lQuit,sEvent.motion.x,sEvent.motion.y))
{
highlightButton(5,1);
current->highlighted=5;
mush->playClick();
}
}
else if ((sEvent.type==SDL_MOUSEBUTTONUP) && (sEvent.button.button == SDL_BUTTON_LEFT))