guiDefaultControlRender.cc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #include "graphics/dgl.h"
  23. #include "gui/guiDefaultControlRender.h"
  24. #include "gui/guiTypes.h"
  25. #include "graphics/color.h"
  26. #include "math/mRect.h"
  27. void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state )
  28. {
  29. //Get the border profiles
  30. GuiBorderProfile *leftProfile = (profile->mBorderLeft) ? profile->mBorderLeft : profile->mBorderDefault;
  31. GuiBorderProfile *rightProfile = (profile->mBorderRight) ? profile->mBorderRight : profile->mBorderDefault;
  32. GuiBorderProfile *topProfile = (profile->mBorderTop) ? profile->mBorderTop : profile->mBorderDefault;
  33. GuiBorderProfile *bottomProfile = (profile->mBorderBottom) ? profile->mBorderBottom : profile->mBorderDefault;
  34. //Get the colors
  35. ColorI fillColor = profile->getFillColor(state);
  36. ColorI leftColor = (leftProfile) ? leftProfile->getBorderColor(state) : ColorI();
  37. ColorI rightColor = (rightProfile) ? rightProfile->getBorderColor(state) : ColorI();
  38. ColorI topColor = (topProfile) ? topProfile->getBorderColor(state) : ColorI();
  39. ColorI bottomColor = (bottomProfile) ? bottomProfile->getBorderColor(state) : ColorI();
  40. S32 leftSize = (leftProfile) ? leftProfile->getBorder(state) : 0;
  41. S32 rightSize = (rightProfile) ? rightProfile->getBorder(state) : 0;
  42. S32 topSize = (topProfile) ? topProfile->getBorder(state) : 0;
  43. S32 bottomSize = (bottomProfile) ? bottomProfile->getBorder(state) : 0;
  44. //Get the inner rect
  45. RectI innerRect = RectI(bounds.point.x + leftSize, bounds.point.y + topSize, (bounds.extent.x - leftSize) - rightSize, (bounds.extent.y - topSize) - bottomSize);
  46. //Draw the fill
  47. if(profile->mOpaque)
  48. {
  49. S32 fillWidth = innerRect.extent.x + ((leftProfile && leftProfile->mUnderfill) ? leftSize : 0) + ((rightProfile && rightProfile->mUnderfill) ? rightSize : 0);
  50. S32 fillHeight = innerRect.extent.y + ((topProfile && topProfile->mUnderfill) ? topSize : 0) + ((bottomProfile && bottomProfile->mUnderfill) ? bottomSize : 0);
  51. RectI fillRect = RectI((leftProfile && leftProfile->mUnderfill) ? bounds.point.x : innerRect.point.x,
  52. (topProfile && topProfile->mUnderfill) ? bounds.point.y : innerRect.point.y, fillWidth, fillHeight);
  53. dglDrawRectFill(fillRect, fillColor);
  54. }
  55. //Draw the borders
  56. //Points for outer bounds starting top left and traveling counter-clockwise
  57. Point2I p1 = Point2I(bounds.point);
  58. Point2I p2 = Point2I(bounds.point.x, bounds.point.y + bounds.extent.y);
  59. Point2I p3 = Point2I(bounds.point.x + bounds.extent.x, bounds.point.y + bounds.extent.y);
  60. Point2I p4 = Point2I(bounds.point.x + bounds.extent.x, bounds.point.y);
  61. //Points for inner bounds starting top left and traveling counter-clockwise
  62. Point2I p5 = Point2I(innerRect.point);
  63. Point2I p6 = Point2I(innerRect.point.x, innerRect.point.y + innerRect.extent.y);
  64. Point2I p7 = Point2I(innerRect.point.x + innerRect.extent.x, innerRect.point.y + innerRect.extent.y);
  65. Point2I p8 = Point2I(innerRect.point.x + innerRect.extent.x, innerRect.point.y);
  66. if (leftSize > 0)
  67. {
  68. dglDrawQuadFill(p1, p2, p6, p5, leftColor);
  69. }
  70. if (rightSize > 0)
  71. {
  72. dglDrawQuadFill(p8, p7, p3, p4, rightColor);
  73. }
  74. if (topSize > 0)
  75. {
  76. dglDrawQuadFill(p1, p5, p8, p4, topColor);
  77. }
  78. if (bottomSize > 0)
  79. {
  80. dglDrawQuadFill(p6, p2, p3, p7, bottomColor);
  81. }
  82. }
  83. // DAW: Render out the sizable bitmap borders based on a multiplier into the bitmap array
  84. // Based on the 'Skinnable GUI Controls in TGE' resource by Justin DuJardin
  85. void renderSizableBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
  86. {
  87. // DAW: Indices into the bitmap array
  88. S32 NumBitmaps = 9;
  89. S32 BorderTopLeft = NumBitmaps * baseMultiplier - NumBitmaps;
  90. S32 BorderTop = 1 + BorderTopLeft;
  91. S32 BorderTopRight = 2 + BorderTopLeft;
  92. S32 BorderLeft = 3 + BorderTopLeft;
  93. S32 Fill = 4 + BorderTopLeft;
  94. S32 BorderRight = 5 + BorderTopLeft;
  95. S32 BorderBottomLeft = 6 + BorderTopLeft;
  96. S32 BorderBottom = 7 + BorderTopLeft;
  97. S32 BorderBottomRight = 8 + BorderTopLeft;
  98. dglClearBitmapModulation();
  99. if(profile->mBitmapArrayRects.size() >= (NumBitmaps * baseMultiplier))
  100. {
  101. RectI destRect;
  102. RectI stretchRect;
  103. RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
  104. // Draw all corners first.
  105. //top left border
  106. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y),mBitmapBounds[BorderTopLeft]);
  107. //top right border
  108. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderTopRight].extent.x,bounds.point.y),mBitmapBounds[BorderTopRight]);
  109. //bottom left border
  110. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottomLeft].extent.y),mBitmapBounds[BorderBottomLeft]);
  111. //bottom right border
  112. dglDrawBitmapSR(profile->mTextureHandle,Point2I(
  113. bounds.point.x + bounds.extent.x - mBitmapBounds[BorderBottomRight].extent.x,
  114. bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottomRight].extent.y),
  115. mBitmapBounds[BorderBottomRight]);
  116. // End drawing corners
  117. // Begin drawing sides and top stretched borders
  118. //start with top line stretch
  119. destRect.point.x = bounds.point.x + mBitmapBounds[BorderTopRight].extent.x;
  120. destRect.extent.x = bounds.extent.x - mBitmapBounds[BorderTopRight].extent.x - mBitmapBounds[BorderTopLeft].extent.x;
  121. destRect.extent.y = mBitmapBounds[BorderTop].extent.y;
  122. destRect.point.y = bounds.point.y;
  123. //stretch it
  124. stretchRect = mBitmapBounds[BorderTop];
  125. stretchRect.inset(1,0);
  126. //draw it
  127. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  128. //bottom line stretch
  129. destRect.point.x = bounds.point.x + mBitmapBounds[BorderBottomRight].extent.x;
  130. destRect.extent.x = bounds.extent.x - mBitmapBounds[BorderBottomRight].extent.x - mBitmapBounds[BorderBottomLeft].extent.x;
  131. destRect.extent.y = mBitmapBounds[BorderBottom].extent.y;
  132. destRect.point.y = bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottom].extent.y;
  133. //stretch it
  134. stretchRect = mBitmapBounds[BorderBottom];
  135. stretchRect.inset(1,0);
  136. //draw it
  137. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  138. //left line stretch
  139. destRect.point.x = bounds.point.x;
  140. destRect.extent.x = mBitmapBounds[BorderLeft].extent.x;
  141. destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTopLeft].extent.y - mBitmapBounds[BorderBottomLeft].extent.y;
  142. destRect.point.y = bounds.point.y + mBitmapBounds[BorderTopLeft].extent.y;
  143. //stretch it
  144. stretchRect = mBitmapBounds[BorderLeft];
  145. stretchRect.inset(0,1);
  146. //draw it
  147. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  148. //left line stretch
  149. destRect.point.x = bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x;
  150. destRect.extent.x = mBitmapBounds[BorderRight].extent.x;
  151. destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTopRight].extent.y - mBitmapBounds[BorderBottomRight].extent.y;
  152. destRect.point.y = bounds.point.y + mBitmapBounds[BorderTopRight].extent.y;
  153. //stretch it
  154. stretchRect = mBitmapBounds[BorderRight];
  155. stretchRect.inset(0,1);
  156. //draw it
  157. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  158. //fill stretch
  159. destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
  160. destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
  161. destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTop].extent.y - mBitmapBounds[BorderBottom].extent.y;
  162. destRect.point.y = bounds.point.y + mBitmapBounds[BorderTop].extent.y;
  163. //stretch it
  164. stretchRect = mBitmapBounds[Fill];
  165. stretchRect.inset(1,1);
  166. //draw it
  167. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  168. // End drawing sides and top stretched borders
  169. }
  170. }
  171. // DAW: Render out the sizable bitmap borders based on a multiplier into the bitmap array
  172. // Based on the 'Skinnable GUI Controls in TGE' resource by Justin DuJardin
  173. void renderSizableBitmapBordersFilledIndex(RectI &bounds, S32 startIndex, GuiControlProfile *profile)
  174. {
  175. // DAW: Indices into the bitmap array
  176. S32 NumBitmaps = 9;
  177. S32 BorderTopLeft = startIndex;
  178. S32 BorderTop = 1 + BorderTopLeft;
  179. S32 BorderTopRight = 2 + BorderTopLeft;
  180. S32 BorderLeft = 3 + BorderTopLeft;
  181. S32 Fill = 4 + BorderTopLeft;
  182. S32 BorderRight = 5 + BorderTopLeft;
  183. S32 BorderBottomLeft = 6 + BorderTopLeft;
  184. S32 BorderBottom = 7 + BorderTopLeft;
  185. S32 BorderBottomRight = 8 + BorderTopLeft;
  186. dglClearBitmapModulation();
  187. if(profile->mBitmapArrayRects.size() >= (startIndex + NumBitmaps))
  188. {
  189. RectI destRect;
  190. RectI stretchRect;
  191. RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
  192. // Draw all corners first.
  193. //top left border
  194. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y),mBitmapBounds[BorderTopLeft]);
  195. //top right border
  196. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderTopRight].extent.x,bounds.point.y),mBitmapBounds[BorderTopRight]);
  197. //bottom left border
  198. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottomLeft].extent.y),mBitmapBounds[BorderBottomLeft]);
  199. //bottom right border
  200. dglDrawBitmapSR(profile->mTextureHandle,Point2I(
  201. bounds.point.x + bounds.extent.x - mBitmapBounds[BorderBottomRight].extent.x,
  202. bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottomRight].extent.y),
  203. mBitmapBounds[BorderBottomRight]);
  204. // End drawing corners
  205. // Begin drawing sides and top stretched borders
  206. //start with top line stretch
  207. destRect.point.x = bounds.point.x + mBitmapBounds[BorderTopLeft].extent.x;
  208. destRect.extent.x = bounds.extent.x - mBitmapBounds[BorderTopRight].extent.x - mBitmapBounds[BorderTopLeft].extent.x;
  209. destRect.extent.y = mBitmapBounds[BorderTop].extent.y;
  210. destRect.point.y = bounds.point.y;
  211. //stretch it
  212. stretchRect = mBitmapBounds[BorderTop];
  213. stretchRect.inset(1,0);
  214. //draw it
  215. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  216. //bottom line stretch
  217. destRect.point.x = bounds.point.x + mBitmapBounds[BorderBottomLeft].extent.x;
  218. destRect.extent.x = bounds.extent.x - mBitmapBounds[BorderBottomRight].extent.x - mBitmapBounds[BorderBottomLeft].extent.x;
  219. destRect.extent.y = mBitmapBounds[BorderBottom].extent.y;
  220. destRect.point.y = bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottom].extent.y;
  221. //stretch it
  222. stretchRect = mBitmapBounds[BorderBottom];
  223. stretchRect.inset(1,0);
  224. //draw it
  225. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  226. //left line stretch
  227. destRect.point.x = bounds.point.x;
  228. destRect.extent.x = mBitmapBounds[BorderLeft].extent.x;
  229. destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTopLeft].extent.y - mBitmapBounds[BorderBottomLeft].extent.y;
  230. destRect.point.y = bounds.point.y + mBitmapBounds[BorderTopLeft].extent.y;
  231. //stretch it
  232. stretchRect = mBitmapBounds[BorderLeft];
  233. stretchRect.inset(0,1);
  234. //draw it
  235. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  236. //left line stretch
  237. destRect.point.x = bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x;
  238. destRect.extent.x = mBitmapBounds[BorderRight].extent.x;
  239. destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTopRight].extent.y - mBitmapBounds[BorderBottomRight].extent.y;
  240. destRect.point.y = bounds.point.y + mBitmapBounds[BorderTopRight].extent.y;
  241. //stretch it
  242. stretchRect = mBitmapBounds[BorderRight];
  243. stretchRect.inset(0,1);
  244. //draw it
  245. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  246. //fill stretch
  247. destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
  248. destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
  249. destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTop].extent.y - mBitmapBounds[BorderBottom].extent.y;
  250. destRect.point.y = bounds.point.y + mBitmapBounds[BorderTop].extent.y;
  251. //stretch it
  252. stretchRect = mBitmapBounds[Fill];
  253. stretchRect.inset(1,1);
  254. //draw it
  255. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  256. // End drawing sides and top stretched borders
  257. }
  258. }
  259. // DAW: Render out the fixed bitmap borders based on a multiplier into the bitmap array
  260. // It renders left and right caps, with a sizable fill area in the middle to reach
  261. // the x extent. It does not stretch in the y direction.
  262. void renderFixedBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
  263. {
  264. // DAW: Indices into the bitmap array
  265. S32 NumBitmaps = 3;
  266. S32 BorderLeft = NumBitmaps * baseMultiplier - NumBitmaps;
  267. S32 Fill = 1 + BorderLeft;
  268. S32 BorderRight = 2 + BorderLeft;
  269. dglClearBitmapModulation();
  270. if(profile->mBitmapArrayRects.size() >= (NumBitmaps * baseMultiplier))
  271. {
  272. RectI destRect;
  273. RectI stretchRect;
  274. RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
  275. // Draw all corners first.
  276. //left border
  277. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y),mBitmapBounds[BorderLeft]);
  278. //right border
  279. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x,bounds.point.y),mBitmapBounds[BorderRight]);
  280. // End drawing corners
  281. // Begin drawing fill
  282. //fill stretch
  283. destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
  284. destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
  285. destRect.extent.y = mBitmapBounds[Fill].extent.y;
  286. destRect.point.y = bounds.point.y;
  287. //stretch it
  288. stretchRect = mBitmapBounds[Fill];
  289. stretchRect.inset(1,0);
  290. //draw it
  291. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  292. // End drawing fill
  293. }
  294. }
  295. // DAW: Render out the fixed bitmap borders based on a multiplier into the bitmap array
  296. // It renders left and right caps, with a sizable fill area in the middle to reach
  297. // the x extent. It does not stretch in the y direction.
  298. void renderFixedBitmapBordersFilledIndex(RectI &bounds, S32 startIndex, GuiControlProfile *profile)
  299. {
  300. // DAW: Indices into the bitmap array
  301. S32 NumBitmaps = 3;
  302. S32 BorderLeft = startIndex;
  303. S32 Fill = 1 + startIndex;
  304. S32 BorderRight = 2 + startIndex;
  305. dglClearBitmapModulation();
  306. if(profile->mBitmapArrayRects.size() >= (startIndex + NumBitmaps))
  307. {
  308. RectI destRect;
  309. RectI stretchRect;
  310. RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
  311. // Draw all corners first.
  312. //left border
  313. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y),mBitmapBounds[BorderLeft]);
  314. //right border
  315. dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x,bounds.point.y),mBitmapBounds[BorderRight]);
  316. // End drawing corners
  317. // Begin drawing fill
  318. //fill stretch
  319. destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
  320. destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
  321. destRect.extent.y = mBitmapBounds[Fill].extent.y;
  322. destRect.point.y = bounds.point.y;
  323. //stretch it
  324. stretchRect = mBitmapBounds[Fill];
  325. stretchRect.inset(1,0);
  326. //draw it
  327. dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
  328. // End drawing fill
  329. }
  330. }
  331. // DAW: Render out the fixed bitmap borders based on a multiplier into the bitmap array
  332. // It renders left and right caps, with a sizable fill area in the middle to reach
  333. // the x extent. It does not stretch in the y direction.
  334. void renderFixedBitmapBordersStretchYFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
  335. {
  336. // DAW: Indices into the bitmap array
  337. S32 NumBitmaps = 3;
  338. S32 BorderLeft = NumBitmaps * baseMultiplier - NumBitmaps;
  339. S32 Fill = 1 + BorderLeft;
  340. S32 BorderRight = 2 + BorderLeft;
  341. dglClearBitmapModulation();
  342. if(profile->mBitmapArrayRects.size() >= (NumBitmaps * baseMultiplier))
  343. {
  344. RectI destRect;
  345. RectI stretchRect;
  346. RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
  347. // Draw all corners first.
  348. //left border
  349. dglDrawBitmapStretchSR(profile->mTextureHandle, RectI( bounds.point.x, bounds.point.y, mBitmapBounds[BorderLeft].extent.x, bounds.extent.y ), mBitmapBounds[BorderLeft] );
  350. //right border
  351. dglDrawBitmapStretchSR(profile->mTextureHandle, RectI(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x, bounds.point.y, mBitmapBounds[BorderRight].extent.x, bounds.extent.y ), mBitmapBounds[BorderRight] );
  352. // End drawing corners
  353. // Begin drawing fill
  354. //fill stretch
  355. destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
  356. destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
  357. destRect.extent.y = bounds.extent.y;
  358. destRect.point.y = bounds.point.y;
  359. //stretch it
  360. stretchRect = mBitmapBounds[Fill];
  361. stretchRect.inset(1,0);
  362. //draw it
  363. dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
  364. // End drawing fill
  365. }
  366. }