ManaPlus
Functions | Variables
graphics_drawImageRect.hpp File Reference

(a946678)

Go to the source code of this file.

Functions

 BLOCK_START ("Graphics::drawImageRect") const Image *restrict const *restrict const grid
 
 if (center &&drawMain)
 
 if (top &&left &&bottom &&right)
 
 if (drawMain)
 

Variables

const Image *restrict const topLeft = grid[0]
 
const Image *restrict const topRight = grid[2]
 
const Image *restrict const bottomLeft = grid[6]
 
const Image *restrict const bottomRight = grid[8]
 
const Image *restrict const top = grid[1]
 
const Image *restrict const right = grid[5]
 
const Image *restrict const bottom = grid[7]
 
const Image *restrict const left = grid[3]
 
const Image *restrict const center = grid[4]
 
const bool drawMain
 

Function Documentation

◆ BLOCK_START()

BLOCK_START ( "Graphics::drawImageRect"  ) const

◆ if() [1/3]

if ( center &&  drawMain)

Definition at line 45 of file graphics_drawImageRect.hpp.

References bottomLeft, center, drawPatternInline(), Image::getHeight(), Image::getWidth(), topLeft, topRight, x, and y.

46 {
47  const int tlw = topLeft->getWidth();
48  const int tlh = topLeft->getHeight();
49  drawPatternInline(center, tlw + x, tlh + y,
50  w - tlw - topRight->getWidth(),
51  h - tlh - bottomLeft->getHeight());
52 }
const Image *restrict const topRight
const Image *restrict const bottomLeft
void drawPatternInline(const Image *restrict const image, const int x, const int y, const int w, const int h) restrict2 A_INLINE
const Image *restrict const center
const Image *restrict const topLeft
int getWidth() const A_INLINE
Definition: image.h:116
int getHeight() const A_INLINE
Definition: image.h:122

◆ if() [2/3]

if ( top &&left &&bottom &&  right)

Definition at line 55 of file graphics_drawImageRect.hpp.

References bottom, drawPatternInline(), Image::getHeight(), Image::getWidth(), left, right, top, x, and y.

56 {
57  const int lw = left->getWidth();
58  const int rw = right->getWidth();
59  const int th = top->getHeight();
60  const int bh = bottom->getHeight();
61  drawPatternInline(top, x + lw, y, w - lw - rw, th);
62  drawPatternInline(bottom, x + lw, h - bh + y, w - lw - rw, bh);
63  drawPatternInline(left, x, y + th, lw, h - th - bh);
64  if (w > rw)
65  drawPatternInline(right, x + w - rw, th + y, rw, h - th - bh);
66 }
void drawPatternInline(const Image *restrict const image, const int x, const int y, const int w, const int h) restrict2 A_INLINE
const Image *restrict const left
const Image *restrict const bottom
const Image *restrict const top
const Image *restrict const right
int getWidth() const A_INLINE
Definition: image.h:116
int getHeight() const A_INLINE
Definition: image.h:122

◆ if() [3/3]

if ( drawMain  )

Definition at line 68 of file graphics_drawImageRect.hpp.

References BLOCK_END, bottomLeft, bottomRight, drawImageInline(), Image::getHeight(), Image::getWidth(), topLeft, topRight, x, and y.

69 {
71  const int trw = topRight->getWidth();
72  if (w > trw)
73  drawImageInline(topRight, x + w - trw, y);
75  const int brw = bottomRight->getWidth();
76  if (w > brw)
77  {
79  x + w - brw,
80  y + h - bottomRight->getHeight());
81  }
82 }
const Image *restrict const topRight
const Image *restrict const bottomRight
const Image *restrict const bottomLeft
void void drawImageInline(const Image *restrict const image, int dstX, int dstY) restrict2 A_INLINE
const Image *restrict const topLeft
int getWidth() const A_INLINE
Definition: image.h:116
int getHeight() const A_INLINE
Definition: image.h:122

Variable Documentation

◆ bottom

const Image* restrict const bottom = grid[7]

Definition at line 37 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ bottomLeft

const Image* restrict const bottomLeft = grid[6]

Definition at line 33 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ bottomRight

const Image* restrict const bottomRight = grid[8]

Definition at line 34 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ center

const Image* restrict const center = grid[4]

Definition at line 39 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ drawMain

const bool drawMain
Initial value:
const Image *restrict const topRight
const Image *restrict const bottomRight
const Image *restrict const bottomLeft
const Image *restrict const center
const Image *restrict const topLeft

Definition at line 41 of file graphics_drawImageRect.hpp.

◆ left

const Image* restrict const left = grid[3]

Definition at line 38 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ right

const Image* restrict const right = grid[5]

Definition at line 36 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ top

const Image* restrict const top = grid[1]

Definition at line 35 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ topLeft

const Image* restrict const topLeft = grid[0]

Definition at line 31 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ topRight

const Image* restrict const topRight = grid[2]

Definition at line 32 of file graphics_drawImageRect.hpp.

Referenced by if().