mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
kilka drobnych poprawek dźwięku
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "CAmbarCendamo.h"
|
#include "CAmbarCendamo.h"
|
||||||
#include "CBuildingHandler.h"
|
#include "CBuildingHandler.h"
|
||||||
#include "CObjectHandler.h"
|
#include "CObjectHandler.h"
|
||||||
|
#include "CMusicHandler.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CGameInfo class
|
CGameInfo class
|
||||||
@@ -26,6 +27,7 @@ public:
|
|||||||
CAmbarCendamo * ac;
|
CAmbarCendamo * ac;
|
||||||
CBuildingHandler * buildh;
|
CBuildingHandler * buildh;
|
||||||
CObjectHandler * objh;
|
CObjectHandler * objh;
|
||||||
|
CMusicHandler * mush;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //CGAMEINFO_H
|
#endif //CGAMEINFO_H
|
3
CMT.cpp
3
CMT.cpp
@@ -233,8 +233,6 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
// well, there's no music, but most games don't break without music...
|
// 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*/);
|
screen = SDL_SetVideoMode(800,600,24,SDL_HWSURFACE|SDL_DOUBLEBUF/*|SDL_FULLSCREEN*/);
|
||||||
ekran = screen;
|
ekran = screen;
|
||||||
//FILE * zr = fopen("mal.txt","r");
|
//FILE * zr = fopen("mal.txt","r");
|
||||||
@@ -260,6 +258,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
THC timeHandler tmh;
|
THC timeHandler tmh;
|
||||||
CGameInfo * cgi = new CGameInfo;
|
CGameInfo * cgi = new CGameInfo;
|
||||||
CGameInfo::mainObj = cgi;
|
CGameInfo::mainObj = cgi;
|
||||||
|
cgi->mush = mush;
|
||||||
CArtHandler * arth = new CArtHandler;
|
CArtHandler * arth = new CArtHandler;
|
||||||
arth->loadArtifacts();
|
arth->loadArtifacts();
|
||||||
cgi->arth = arth;
|
cgi->arth = arth;
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
void CMusicHandler::initMusics()
|
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());
|
printf("Mix_OpenAudio: %s\n", Mix_GetError());
|
||||||
exit(2);
|
exit(2);
|
||||||
|
@@ -389,6 +389,8 @@ void CPreGame::scenHandleEv(SDL_Event& sEvent)
|
|||||||
{
|
{
|
||||||
if (isItIn(&btns[i]->pos,sEvent.motion.x,sEvent.motion.y))
|
if (isItIn(&btns[i]->pos,sEvent.motion.x,sEvent.motion.y))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
mush->playClick();
|
||||||
btns[i]->press(true);
|
btns[i]->press(true);
|
||||||
ourScenSel->pressed=btns[i];
|
ourScenSel->pressed=btns[i];
|
||||||
}
|
}
|
||||||
@@ -559,12 +561,12 @@ void CPreGame::runLoop()
|
|||||||
}
|
}
|
||||||
else if ((sEvent.type==SDL_MOUSEBUTTONDOWN) && (sEvent.button.button == SDL_BUTTON_LEFT))
|
else if ((sEvent.type==SDL_MOUSEBUTTONDOWN) && (sEvent.button.button == SDL_BUTTON_LEFT))
|
||||||
{
|
{
|
||||||
mush->playClick();
|
|
||||||
for (int i=0;i<btns.size(); i++)
|
for (int i=0;i<btns.size(); i++)
|
||||||
{
|
{
|
||||||
if (isItIn(&btns[i]->pos,sEvent.motion.x,sEvent.motion.y))
|
if (isItIn(&btns[i]->pos,sEvent.motion.x,sEvent.motion.y))
|
||||||
{
|
{
|
||||||
btns[i]->press(true);
|
btns[i]->press(true);
|
||||||
|
mush->playClick();
|
||||||
//SDL_BlitSurface((btns[i].imgs)->ourImages[1].bitmap,NULL,ekran,&btns[i].pos);
|
//SDL_BlitSurface((btns[i].imgs)->ourImages[1].bitmap,NULL,ekran,&btns[i].pos);
|
||||||
//updateRect(&btns[i].pos);
|
//updateRect(&btns[i].pos);
|
||||||
}
|
}
|
||||||
@@ -574,26 +576,31 @@ void CPreGame::runLoop()
|
|||||||
{
|
{
|
||||||
highlightButton(1,1);
|
highlightButton(1,1);
|
||||||
current->highlighted=1;
|
current->highlighted=1;
|
||||||
|
mush->playClick();
|
||||||
}
|
}
|
||||||
else if (isItIn(¤t->lLoadGame,sEvent.motion.x,sEvent.motion.y))
|
else if (isItIn(¤t->lLoadGame,sEvent.motion.x,sEvent.motion.y))
|
||||||
{
|
{
|
||||||
highlightButton(2,1);
|
highlightButton(2,1);
|
||||||
current->highlighted=2;
|
current->highlighted=2;
|
||||||
|
mush->playClick();
|
||||||
}
|
}
|
||||||
else if (isItIn(¤t->lHighScores,sEvent.motion.x,sEvent.motion.y))
|
else if (isItIn(¤t->lHighScores,sEvent.motion.x,sEvent.motion.y))
|
||||||
{
|
{
|
||||||
highlightButton(3,1);
|
highlightButton(3,1);
|
||||||
current->highlighted=3;
|
current->highlighted=3;
|
||||||
|
mush->playClick();
|
||||||
}
|
}
|
||||||
else if (isItIn(¤t->lCredits,sEvent.motion.x,sEvent.motion.y))
|
else if (isItIn(¤t->lCredits,sEvent.motion.x,sEvent.motion.y))
|
||||||
{
|
{
|
||||||
highlightButton(4,1);
|
highlightButton(4,1);
|
||||||
current->highlighted=4;
|
current->highlighted=4;
|
||||||
|
mush->playClick();
|
||||||
}
|
}
|
||||||
else if (isItIn(¤t->lQuit,sEvent.motion.x,sEvent.motion.y))
|
else if (isItIn(¤t->lQuit,sEvent.motion.x,sEvent.motion.y))
|
||||||
{
|
{
|
||||||
highlightButton(5,1);
|
highlightButton(5,1);
|
||||||
current->highlighted=5;
|
current->highlighted=5;
|
||||||
|
mush->playClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((sEvent.type==SDL_MOUSEBUTTONUP) && (sEvent.button.button == SDL_BUTTON_LEFT))
|
else if ((sEvent.type==SDL_MOUSEBUTTONUP) && (sEvent.button.button == SDL_BUTTON_LEFT))
|
||||||
|
Reference in New Issue
Block a user