summaryrefslogtreecommitdiff
path: root/src/decblupi.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decblupi.cxx')
-rw-r--r--src/decblupi.cxx44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/decblupi.cxx b/src/decblupi.cxx
index e236eba..e29513a 100644
--- a/src/decblupi.cxx
+++ b/src/decblupi.cxx
@@ -1,7 +1,7 @@
/*
* This file is part of the planetblupi source code
* Copyright (C) 1997, Daniel Roux & EPSITEC SA
- * Copyright (C) 2017, Mathieu Schroeter
+ * Copyright (C) 2017-2018, Mathieu Schroeter
* http://epsitec.ch; http://www.blupi.org; http://github.com/blupi-games
*
* This program is free software: you can redistribute it and/or modify
@@ -200,6 +200,7 @@ void
CDecor::BlupiDelete (Sint32 rank)
{
m_blupi[rank].bExist = false;
+ this->m_pSound->StopSound(true, rank);
if (
!m_bBuild && // phase de jeu ?
@@ -236,6 +237,7 @@ CDecor::BlupiKill (Sint32 exRank, Point cel, Sint32 type)
if (type == 0) // explosion ?
{
m_blupi[rank].bExist = false; // mort instantannée
+ this->m_pSound->StopSound(true, rank);
}
if (type == 1) // électro ?
@@ -467,9 +469,9 @@ CDecor::BlupiSound (Sint32 rank, Sounds sound, Point pos, bool bStop)
}
if (bStop)
- m_pSound->PlayImage (sound, pos, rank);
+ m_pSound->PlayImage (sound, pos, rank, bStop);
else
- m_pSound->PlayImage (sound, pos);
+ m_pSound->PlayImage (sound, pos, rank);
}
// Sons associés à des actions.
@@ -2184,7 +2186,9 @@ CDecor::GoalStop (Sint32 rank, bool bError, bool bSound)
};
static Sounds table_sound_boing[] = {
- SOUND_BOING1, SOUND_BOING2, SOUND_BOING3,
+ SOUND_BOING1,
+ SOUND_BOING2,
+ SOUND_BOING3,
};
if (bError && bSound)
@@ -2220,8 +2224,8 @@ CDecor::GoalStop (Sint32 rank, bool bError, bool bSound)
{
if (bError)
{
- pos.x = LXIMAGE / 2;
- pos.y = LYIMAGE / 2;
+ pos.x = LXIMAGE () / 2;
+ pos.y = LYIMAGE () / 2;
BlupiSound (
rank, table_sound_boing[Random (0, countof (table_sound_boing) - 1)],
pos, true);
@@ -3463,12 +3467,16 @@ CDecor::BlupiHiliUp (Point pos)
static Sounds table_sound_okf[] = // si fatigué
{
- SOUND_OK1f, SOUND_OK2f, SOUND_OK3f,
+ SOUND_OK1f,
+ SOUND_OK2f,
+ SOUND_OK3f,
};
static Sounds table_sound_oke[] = // si énervé
{
- SOUND_OK1e, SOUND_OK2e, SOUND_OK3e,
+ SOUND_OK1e,
+ SOUND_OK2e,
+ SOUND_OK3e,
};
if (m_bHiliRect) // rectangle de sélection existe ?
@@ -3757,6 +3765,8 @@ CDecor::GetDefButton (Point cel)
if (icon == 61)
button = BUTTON_CULTIVE; // cabane
+ if (icon == 81 || icon == 83 || icon == 94)
+ button = BUTTON_FLOWER;
if (icon == 122)
button = BUTTON_EXTRAIT; // extrait
@@ -4102,11 +4112,15 @@ CDecor::BlupiGoal (Point cel, Buttons button)
};
static Sounds table_sound_gom[] = {
- SOUND_GO4, SOUND_GO5, SOUND_GO6,
+ SOUND_GO4,
+ SOUND_GO5,
+ SOUND_GO6,
};
static Sounds table_sound_boing[] = {
- SOUND_BOING1, SOUND_BOING2, SOUND_BOING3,
+ SOUND_BOING1,
+ SOUND_BOING2,
+ SOUND_BOING3,
};
if (button == -1)
@@ -4145,9 +4159,9 @@ CDecor::BlupiGoal (Point cel, Buttons button)
}
if (avg.x < 0)
avg.x = 0;
- if (avg.x > LXIMAGE)
- avg.x = LXIMAGE;
- avg.y = LYIMAGE / 2;
+ if (avg.x > LXIMAGE ())
+ avg.x = LXIMAGE ();
+ avg.y = LYIMAGE () / 2;
if (nb == 0 && nbHili > 0)
{
@@ -4588,8 +4602,8 @@ CDecor::IsTerminated ()
Sint32 nb, count, out;
Point pos;
- pos.x = LXIMAGE / 2;
- pos.y = LYIMAGE / 2;
+ pos.x = LXIMAGE () / 2;
+ pos.y = LYIMAGE () / 2;
count = m_winCount;
m_winCount = 50;