ScummVM API documentation
bibble_window.h
1
2/* ScummVM - Graphic Adventure Engine
3 *
4 * ScummVM is the legal property of its developers, whose names
5 * are too numerous to list here. Please refer to the COPYRIGHT
6 * file distributed with this source distribution.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef BAGEL_SPACEBAR_BIBBLE_WINDOW_H
24#define BAGEL_SPACEBAR_BIBBLE_WINDOW_H
25
26#include "bagel/spacebar/baglib/storage_dev_win.h"
27#include "bagel/spacebar/boflib/gui/text_box.h"
28#include "bagel/spacebar/boflib/gui/button.h"
29#include "bagel/spacebar/boflib/gfx/sprite.h"
30#include "bagel/boflib/sound.h"
31
32namespace Bagel {
33namespace SpaceBar {
34
35#define BIBBLE_NUM_BUTTONS 12
36#define BIBBLE_NUM_BIBBLES 3
37#define BIBBLE_NUM_SHOUTS 4
38#define BIBBLE_NUM_PAYOFFS 16
39#define BIBBLE_NUM_BET_AREAS 24
40
41struct ST_PAYOFFS {
42 int _nPay1;
43 int _nPay2;
44};
45
47 int _nBet;
48 int _left;
49 int _top;
50 int _right;
51 int _bottom;
52 int _nPayOff1;
53 int _nPayOff2;
54 const char *_cAudioFile;
55 const char *_cPayFile;
56};
57
58class CBetArea : public CBofObject {
59public:
60 CBetArea() {}
61 CBetArea(const CBetAreaDef &def);
62
63 // Data members
64 CBofRect _cRect;
65 int _nBet = 0;
66 int _nPayOff1 = 0;
67 int _nPayOff2 = 0;
68 bool _bWon = false;
69 CBofString _cAudioFile;
70 CBofString _cPayFile;
71};
72
73extern CBetAreaDef BET_AREAS[BIBBLE_NUM_BET_AREAS];
74extern const ST_PAYOFFS PAY_OFFS[BIBBLE_NUM_PAYOFFS];
75
76
78public:
80
81 virtual ErrorCode attach();
82 virtual ErrorCode detach();
83
84 virtual void onBofButton(CBofObject *pButton, int nState);
85 virtual void onClose();
86
87protected:
88 ErrorCode playGame();
89 ErrorCode bonkBibble(int nBibble, int nShout);
90
91 void calcOutcome();
92 ErrorCode displayCredits();
93
94 ErrorCode highlight(CBetArea *pArea, byte nColor);
95 ErrorCode unHighlight(CBetArea *pArea);
96
97 virtual void onLButtonDown(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
98 virtual void onLButtonUp(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
99 virtual void onLButtonDblClk(uint32 nFlags, CBofPoint *pPoint);
100 virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
101
102 virtual void onPaint(CBofRect *pRect);
103 virtual void onMainLoop();
104 virtual void onTimer(uint32 /*nTimerID*/) {
105 // Do nothing
106 }
107
108 // Data
109 CBofSound *_pBkgSnd;
110 CBofBmpButton *_pButtons[BIBBLE_NUM_BUTTONS];
111 CBofText *_pCreditsText;
112 CBofSprite *_pMasterBibble;
113 CBofSprite *_pBibble[BIBBLE_NUM_BIBBLES];
114 CBofSprite *_pBall;
115 CBofSprite *_pArch1;
116 CBofSprite *_pArch2;
117 CBofSprite *_pArch3;
118 CBofSound *_pShouts[BIBBLE_NUM_SHOUTS];
119 uint32 _nNumCredits;
120
121 int _nBall1; // Which Bibble hit by ball 1
122 int _nBall2; // Which Bibble hit by ball 2
123 int _nBall3; // Which Bibble hit by ball 3
124
125 int _nBall1Said;
126 int _nBall2Said;
127 int _nBall3Said;
128
129 int _nNumShout1;
130 int _nNumShout2;
131 int _nNumShout3;
132 int _nNumShout4;
133
134 int _nNumTopBonks;
135 int _nNumMidBonks;
136 int _nNumBotBonks;
137 CBetArea *_pSelected;
138};
139
140} // namespace SpaceBar
141} // namespace Bagel
142
143#endif
Definition: object.h:28
Definition: point.h:32
Definition: rect.h:35
Definition: sound.h:77
Definition: string.h:38
Definition: storage_dev_win.h:410
Definition: bibble_window.h:58
Definition: bibble_window.h:77
Definition: button.h:110
Definition: sprite.h:39
Definition: text.h:125
Definition: bibble_window.h:46
Definition: bibble_window.h:41