32 #ifndef TBX_SCALEFACTORS_H_ 33 #define TBX_SCALEFACTORS_H_ 65 ScaleFactors(
int xm,
int ym,
int xd,
int yd) {_xmult = xm; _ymult = ym; _xdiv = xd; _ydiv = yd;}
72 ScaleFactors(
int mult,
int div = 1) {_xmult = _ymult = mult; _xdiv = _ydiv = div;}
77 bool is_unit()
const {
return (_xmult == _xdiv && _ymult == _ydiv);};
82 int xmult()
const {
return _xmult;}
94 int ymult()
const {
return _ymult;}
105 int xdiv()
const {
return _xdiv;}
116 int ydiv()
const {
return _ydiv;}
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
int ymult() const
Return the y direction multiplier.
Definition: scalefactors.h:94
ScaleFactors & xmult(int x)
Set the x direction multiplier.
Definition: scalefactors.h:90
ScaleFactors & ymult(int y)
Set the y direction multiplier.
Definition: scalefactors.h:101
ScaleFactors(int mult, int div=1)
Constructor for common multiplier/divider in x and y directions.
Definition: scalefactors.h:72
int xmult() const
Return the x direction multiplier.
Definition: scalefactors.h:82
int xdiv() const
Return the x direction divider.
Definition: scalefactors.h:105
int ydiv() const
Return the y direction divider.
Definition: scalefactors.h:116
bool is_unit() const
Returns true if scale factors do not change a value.
Definition: scalefactors.h:77
ScaleFactors & ydiv(int y)
Set the y direction divider.
Definition: scalefactors.h:123
ScaleFactors & xdiv(int x)
Set the x direction divider.
Definition: scalefactors.h:112
ScaleFactors(int xm, int ym, int xd, int yd)
Constructor allowing the multipliers and dividers to be specified.
Definition: scalefactors.h:65
Class for sprite ScaleFactors.
Definition: scalefactors.h:45
ScaleFactors()
Constructor that creates the unit scale factors.
Definition: scalefactors.h:56
const int * as_array() const
Return 4 integer array of scale factors.
Definition: scalefactors.h:132
int * as_array()
Return 4 integer array of scale factors.
Definition: scalefactors.h:128