ScummVM API documentation
slot_wnd.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_SLOT_WND_H
24 #define BAGEL_SPACEBAR_SLOT_WND_H
25 
26 #include "bagel/baglib/storage_dev_win.h"
27 #include "bagel/boflib/gui/text_box.h"
28 #include "bagel/boflib/gui/button.h"
29 #include "bagel/boflib/sound.h"
30 
31 namespace Bagel {
32 namespace SpaceBar {
33 
34 #define NUM_SLOTBUTT 17
35 
36 // ID's and INDEX of buttons
37 #define ONE 0
38 #define FOUR 1
39 #define SEVEN 2
40 #define TEN 3
41 #define FORTY 4
42 #define SEVENTY 5
43 #define OHNDRD 6
44 #define RHNDRD 7
45 #define SHNDRD 8
46 #define OTHSND 9
47 #define RTHSND 10
48 #define STHSND 11
49 #define CLRBET 12
50 #define BETALL 13
51 #define GO 14
52 #define SLOTHELP 15
53 #define SLOTQUIT 16
54 
55 #define SLOT_NUM 4
56 #define SLOT_BMP_NUM 9
57 
58 
59 #define SHOWGO 100
60 
61 
62 
63 class SBarSlot {
64 public:
65  int _nIdx;
66  CBofRect _cSlotRect;
67  CBofBitmap *_pSlotBmp[SLOT_BMP_NUM];
68 };
69 
71 private:
72  CBofRect Slot0Rect = CBofRect(220, 46, 464, 98);
73  CBofRect Slot1Rect = CBofRect(469, 14, 522, 187);
74  CBofRect Slot2Rect = CBofRect(378, 192, 623, 243);
75  CBofRect Slot3Rect = CBofRect(321, 102, 374, 274);
76 
77  CBofRect CreditRect = CBofRect(24, 334, 135, 360);
78  CBofRect BetRect = CBofRect(15, 410, 131, 432);
79  CBofRect OddRect = CBofRect(401, 125, 443, 166);
80  CBofRect FixRect = CBofRect(150, 306, 150 + 109 - 1, 306 + 64 - 1);
81 
82 protected:
83  SBarSlot _cSlots[SLOT_NUM];
84  CBofBmpButton *_pSlotButs[NUM_SLOTBUTT];
85  int _nBet;
86  int _nCredit;
87  int _nPayOff1;
88  int _nPayOff2;
89  CBofText *_pCredText;
90  CBofText *_pBetText;
91  CBofText *_pOddsText;
92  bool _bFixBet;
93  bool _bAutoDecrement;
94  CBofBitmap *_bFixBmp;
95  CBofBitmap *_pLoseBmp;
96  CBofSound *_pBkgSnd; // Casino background sounds
97  CBofSound *_pSlotSound;
98  CBofSound *_pWinSound; // Allow all ambient noise to continue playing
99  bool _bLose;
100 
101 public:
102  SBarSlotWnd();
103 
104  virtual void onBofButton(CBofObject *pButton, int nState);
105  virtual void onMainLoop();
106 
107  virtual ErrorCode attach(); // This function attaches the background and necessary bitmaps
108  virtual ErrorCode detach(); // This function detaches the background and necessary bitmaps
109 
110  void addBet(int nBetVal);
111  void betAll();
112  void clrBet();
113  void fixBet();
114  void go();
115 
116  void updateText();
117  void calcOutcome();
118 
119  void quadPays(int nSlotIdx);
120  void tripPays(int nSlotIdx);
121  void pairPays(int nSlotIdx);
122 
123  void setPayOff(int nPay1, int nPay2);
124 
125  void slideSlots();
126 
127  void onPaint(CBofRect *pRect);
128  void onTimer(uint32 nTimerId);
129  void onLButtonDown(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
130  void onLButtonUp(uint32 /*nFlags*/, CBofPoint * /*pPoint*/, void * = nullptr) { }
131 
132 };
133 
134 } // namespace SpaceBar
135 } // namespace Bagel
136 
137 #endif
Definition: storage_dev_win.h:406
Definition: slot_wnd.h:63
Definition: object.h:28
Definition: bitmap.h:55
Definition: rect.h:36
Definition: sound.h:73
Definition: button.h:109
Definition: bagel.h:31
Definition: point.h:34
Definition: text.h:122
Definition: slot_wnd.h:70