ManaPlus
Functions | Variables
graphics_drawImageRect.hpp File Reference

(986a3bf)

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 46 of file graphics_drawImageRect.hpp.

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

References bottomLeft, center, drawPatternInline(), topLeft, topRight, x, and y.

◆ if() [2/3]

if ( drawMain  )

Definition at line 69 of file graphics_drawImageRect.hpp.

70 {
72  const int trw = topRight->getWidth();
73  if (w > trw)
74  drawImageInline(topRight, x + w - trw, y);
75  drawImageInline(bottomLeft, x, h - bottomLeft->getHeight() + y);
76  const int brw = bottomRight->getWidth();
77  if (w > brw)
78  {
80  x + w - brw,
81  y + h - bottomRight->getHeight());
82  }
83 }
const Image *restrict const bottomRight
void void drawImageInline(const Image *restrict const image, int dstX, int dstY) restrict2 A_INLINE

References bottomLeft, bottomRight, drawImageInline(), topLeft, topRight, x, and y.

◆ if() [3/3]

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

Definition at line 56 of file graphics_drawImageRect.hpp.

57 {
58  const int lw = left->getWidth();
59  const int rw = right->getWidth();
60  const int th = top->getHeight();
61  const int bh = bottom->getHeight();
62  drawPatternInline(top, x + lw, y, w - lw - rw, th);
63  drawPatternInline(bottom, x + lw, h - bh + y, w - lw - rw, bh);
64  drawPatternInline(left, x, y + th, lw, h - th - bh);
65  if (w > rw)
66  drawPatternInline(right, x + w - rw, th + y, rw, h - th - bh);
67 }
const Image *restrict const left
const Image *restrict const bottom
const Image *restrict const top
const Image *restrict const right

References bottom, drawPatternInline(), left, right, top, x, and y.

Variable Documentation

◆ bottom

const Image* restrict const bottom = grid[7]

Definition at line 38 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ bottomLeft

const Image* restrict const bottomLeft = grid[6]

Definition at line 34 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ bottomRight

const Image* restrict const bottomRight = grid[8]

Definition at line 35 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ center

const Image* restrict const center = grid[4]

Definition at line 40 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ drawMain

const bool drawMain
Initial value:

Definition at line 42 of file graphics_drawImageRect.hpp.

◆ left

const Image* restrict const left = grid[3]

Definition at line 39 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ right

const Image* restrict const right = grid[5]

Definition at line 37 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ top

const Image* restrict const top = grid[1]

Definition at line 36 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ topLeft

const Image* restrict const topLeft = grid[0]

Definition at line 32 of file graphics_drawImageRect.hpp.

Referenced by if().

◆ topRight

const Image* restrict const topRight = grid[2]

Definition at line 33 of file graphics_drawImageRect.hpp.

Referenced by if().