HoverRace  2.0
Sprite.h
Go to the documentation of this file.
1 
2 // Sprite.h
3 //
4 // Copyright (c) 1995-1998 - Richard Langlois and Grokksoft Inc.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 //
22 
23 #pragma once
24 
25 #include "Viewport2D.h"
26 #include "../Util/DllObjectFactory.h"
27 
28 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
29 # ifdef MR_ENGINE
30 # define MR_DllDeclare __declspec( dllexport )
31 # else
32 # define MR_DllDeclare __declspec( dllimport )
33 # endif
34 #else
35 # define MR_DllDeclare
36 #endif
37 
38 namespace HoverRace {
39  namespace Parcel {
40  class ObjStream;
41  }
42 }
43 
44 namespace HoverRace {
45 namespace VideoServices {
46 
48 {
49 public:
51  {
52  eLeft = 0,
53  eTop = 0,
54  eRight = 1,
55  eBottom = 1,
56  eCenter = 2
57  };
58 
59 protected:
60  int mNbItem;
63  int mWidth;
65 
66 public:
67  Sprite();
68  ~Sprite();
69 
70  void Blt(int pX, int pY, Viewport2D *pDest,
71  eAlignment pHAlign = eLeft, eAlignment pVAlign = eTop,
72  int pItem = 0, int pScaling = 1) const;
73 
74  void StrBlt(int pX, int pY, const char *pStr, Viewport2D *pDest,
75  eAlignment pHAlign = eLeft, eAlignment pVAlign = eTop,
76  int pScaling = 1) const;
77 
78  int GetNbItem() const;
79  int GetItemHeight() const;
80  int GetItemWidth() const;
81 
82  void Serialize(Parcel::ObjStream &pArchive);
83 };
84 
85 // Helper class and functions
86 MR_DllDeclare const char *Ascii2Simple(const char *pSrc);
87 MR_DllDeclare char Ascii2Simple(char pSrc);
88 
89 } // namespace VideoServices
90 } // namespace HoverRace
91 
92 #undef MR_DllDeclare
int mTotalHeight
Definition: Sprite.h:62
int mNbItem
Definition: Sprite.h:60
Definition: Sprite.h:47
const char * Ascii2Simple(const char *pSrc)
Definition: Sprite.cpp:228
Definition: Viewport2D.h:42
int mWidth
Definition: Sprite.h:63
MR_UInt8 * mData
Definition: Sprite.h:64
eAlignment
Definition: Sprite.h:50
int mItemHeight
Definition: Sprite.h:61
Base class for parcel serializers.
Definition: ObjStream.h:58
#define MR_DllDeclare
Definition: Sprite.h:35
Definition: Announcement.h:24
uint8_t MR_UInt8
Definition: MR_Types.h:40