commit 24a6ea5f
Now there is sound when counting down
git-svn-id: https://blockattack.svn.sourceforge.net/svnroot/blockattack/trunk@51 9d7177f8-192b-0410-8f35-a16a89829b06
Changed files
diff --git a/Game/sound/counter.ogg b/Game/sound/counter.ogg
new file mode 100644
index 0000000..0eb3b4d
Binary files /dev/null and b/Game/sound/counter.ogg differ
diff --git a/Game/sound/counterFinal.ogg b/Game/sound/counterFinal.ogg
new file mode 100644
index 0000000..f76ba7c
Binary files /dev/null and b/Game/sound/counterFinal.ogg differ
diff --git a/source/AUTH b/source/AUTH
index a96643a..0fb9546 100644
--- a/source/AUTH
+++ b/source/AUTH
@@ -1,4 +1,6 @@
-To ensure that all authers for each medie file. Only files that cannot include authers in the source are mentioned.
+To ensure that all authers is known for each medie file. Only files that cannot include authers in the source are mentioned.
+
+Most graphics are by Iwan Gabovitch aka qubodup.
/gfx/
14P_Arial_Angle_Red.png Karl Bartel - http://user.cs.tu-berlin.de/~karlb/sfont/fonts.html
@@ -130,7 +132,8 @@ ballYellow.png qubodup
pop.ogg openarena-svn887:/sound/weapons/rocket/rockf1a.wav
cameraclick.ogg openarean-svn887:/sound/misc/w_pkup.wav
typing.ogg openarena-svn887:/sound/world/clack.wav
-
+counter.ogg openarena-svn900:/sound/feedback/hitlo.wav
+counterFinal.ogg openarena-svn900:/sound/feedback/hit.wav
diff --git a/source/assets/gfx/buttons/buttons.svg b/source/assets/gfx/buttons/buttons.svg
index a2984e8..92fb425 100644
--- a/source/assets/gfx/buttons/buttons.svg
+++ b/source/assets/gfx/buttons/buttons.svg
@@ -6392,7 +6392,10 @@
id="tspan4434"
sodipodi:role="line">Configure</tspan></text>
<g
- id="g3535">
+ id="g3535"
+ inkscape:export-filename="/home/poul/programmering/svn/blockattack/blockattack/trunk/Game/gfx/bVsGameConfig.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
<g
id="g3523"
transform="translate(125,45)"
@@ -6405,7 +6408,7 @@
height="40"
width="120"
id="rect3525"
- style="opacity:1;fill:#40cafc;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:162;stroke-opacity:1" />
+ style="opacity:1;fill:#50cefc;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:162;stroke-opacity:1" />
<path
id="path3527"
d="M 0,0 L 120,0 C 120,0 120,40 120,40 L 115,35 L 115,5 L 5,5 L 0,0 z"
@@ -6432,7 +6435,10 @@
</g>
<g
id="g3543"
- transform="translate(0,44.5)">
+ transform="translate(0,44.5)"
+ inkscape:export-filename="/home/poul/programmering/svn/blockattack/blockattack/trunk/Game/gfx/bTheme.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
<g
inkscape:export-ydpi="89.996552"
inkscape:export-xdpi="89.996552"
@@ -6440,7 +6446,7 @@
transform="translate(125,45)"
id="g3545">
<rect
- style="opacity:1;fill:#40cafc;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:162;stroke-opacity:1"
+ style="opacity:1;fill:#60dafc;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:162;stroke-opacity:1"
id="rect3547"
width="120"
height="40"
diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp
index 2e6ce45..964431a 100644
--- a/source/code/BlockGame.hpp
+++ b/source/code/BlockGame.hpp
@@ -1972,6 +1972,8 @@ public:
}
}
+
+ int lastCounter;
//Draws everything
void DoPaintJob() {
@@ -2031,7 +2033,12 @@ public:
#endif
if (!bGameOver)DrawIMG(cursor[(SDL_GetTicks()/600)%2],sBoard,cursorx*50-4,550-cursory*50-pixels-4);
if (SDL_GetTicks()<gameStartedAt)
- switch (abs((int)SDL_GetTicks()-(int)gameStartedAt)/1000) {
+ {
+ int currentCounter = abs((int)SDL_GetTicks()-(int)gameStartedAt)/1000;
+ if( (currentCounter!=lastCounter) && (SoundEnabled)&&(!NoSound))
+ Mix_PlayChannel(1,counterChunk,0);
+ lastCounter = currentCounter;
+ switch (currentCounter) {
case 2:
DrawIMG(counter[2], sBoard, 100, 250);
break;
@@ -2044,6 +2051,13 @@ public:
default:
break;
}
+ }
+ else
+ {
+ if( (0==lastCounter) && (SoundEnabled)&&(!NoSound))
+ Mix_PlayChannel(1,counterFinalChunk,0);
+ lastCounter = -1;
+ }
if ((bGameOver)&&(!editorMode))
if (hasWonTheGame)DrawIMG(iWinner, sBoard, 0, 250);
else if (bDraw) DrawIMG(iDraw, sBoard, 0, 250);
diff --git a/source/code/main.cpp b/source/code/main.cpp
index b2d493e..eb97c64 100644
--- a/source/code/main.cpp
+++ b/source/code/main.cpp
@@ -700,6 +700,7 @@ int InitImages()
heartBeat = Mix_LoadWAV2((char*)"sound/heartbeat3.ogg");
typingChunk = Mix_LoadWAV2((char*)"sound/typing.ogg");
counterChunk = Mix_LoadWAV2((char*)"sound/counter.ogg");
+ counterFinalChunk = Mix_LoadWAV2((char*)"sound/counterFinal.ogg");
} //All sound has been loaded or not
return 0;
} //InitImages()
@@ -720,6 +721,7 @@ void UnloadImages()
Mix_FreeChunk(photoClick);
Mix_FreeChunk(heartBeat);
Mix_FreeChunk(counterChunk);
+ Mix_FreeChunk(counterFinalChunk);
Mix_FreeChunk(typingChunk);
}
//Free surfaces:
diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp
index 5fb3329..f5d71fb 100644
--- a/source/code/mainVars.hpp
+++ b/source/code/mainVars.hpp
@@ -183,6 +183,7 @@ Mix_Chunk *photoClick; //clickSound
Mix_Chunk *heartBeat; //heart beat
Mix_Chunk *typingChunk; //When writing
Mix_Chunk *counterChunk; //When counting down
+Mix_Chunk *counterFinalChunk;
Highscore theTopScoresEndless; //Stores highscores for endless
Highscore theTopScoresTimeTrial; //Stores highscores for timetrial