Harmonic Flow Framework (libhffwk)
Cross platform C++ 2D Game Engine Framework
BatchInfo.cpp
1 /*
2  Harmonic Flow Framework
3  Copyright (C) 2011-2018 Andreas Widen <andreas@harmonicflow.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "BatchInfo.h"
22 
23 using namespace HFCore;
24 
25 #include "debug/CrtDbgNew.h"
26 
28 {
29  // default init:
30  mImage = NULL;
32  mSrcRect = Rect::ZERO();
34  mFirstCharInStr = false;
35  mLastCharInStr = false;
37  mScalew = 1.0f;
38  mScaleh = 1.0f;
39  mRotDeg = 0.0f;
43 }
44 
46 {
47 }
48 
50 {
51  if (mImage == NULL || mDestRect == Rect::ZERO())
52  {
53  return false;
54  }
55  return true;
56 }
57 
59 {
60  if (mImage == NULL || mDestRect == Rect::ZERO() ||
62  {
63  return false;
64  }
65  return true;
66 }
67 
bool isMandatoryDataSetImage()
Determines whether mandatory fields are set for Image drawing.
Definition: BatchInfo.cpp:49
BatchInfo()
Constructor.
Definition: BatchInfo.cpp:27
bool mFirstCharInStr
Boolean to indicate if this is first character of string.
Definition: BatchInfo.h:105
static Rect ZERO()
Initialize Rect with 0 for all members.
Definition: Rect.h:141
fp32_hf mScaleh
Holds scale for y / height (1.0f is original size).
Definition: BatchInfo.h:125
Image * mImage
Holds Image to use for drawing operations.
Definition: BatchInfo.h:84
fp32_hf mScalew
Holds scale for x / width (1.0f is original size).
Definition: BatchInfo.h:120
Returns the weighted average of the texture elements that are closest to the specified texture coordi...
Definition: Graphics.h:184
bool mLastCharInStr
Boolean to indicate if this is last character of string.
Definition: BatchInfo.h:110
Graphics::MagFilter mMagFilter
Holds Graphics::MagFilter to use for drawing operations.
Definition: BatchInfo.h:141
fp32_hf mRotDeg
Holds angle of rotation (around z-axis), in degrees for subsequent drawing operations.
Definition: BatchInfo.h:131
Returns the weighted average of the texture elements that are closest to the specified texture coordi...
Definition: Graphics.h:161
Color mColor
Holds Color to use for Alpha blending.
Definition: BatchInfo.h:115
#define NULL
Convenient define for 0.
Definition: HFDataTypes.h:42
Graphics::MinFilter mMinFilter
Holds Graphics::MinFilter to use for drawing operations.
Definition: BatchInfo.h:146
Rect mFontCharRect
Holds Rect for a specific Font character.
Definition: BatchInfo.h:99
Definition: Actor.h:34
bool isMandatoryDataSetFont()
Determines whether mandatory fields are set for Font drawing.
Definition: BatchInfo.cpp:58
Draw mode default / normal.
Definition: Graphics.h:143
Rect mDestRect
Holds Rect for destination position.
Definition: BatchInfo.h:89
static Color getColorWhite()
Get opaque White Color.
Definition: Color.cpp:331
virtual ~BatchInfo()
Destructor.
Definition: BatchInfo.cpp:45
Interface useful when drawing batches.
Graphics::DrawMode mDrawMode
Holds Graphics::DrawMode to use for drawing operations.
Definition: BatchInfo.h:136
Rect mSrcRect
Holds Rect for portion of Image to draw.
Definition: BatchInfo.h:94