Advertisement
Guest User

rsfont

a guest
Sep 25th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.03 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. public class RSFont extends DrawingArea {
  4.  
  5. public int baseCharacterHeight = 0;
  6. public int anInt4142;
  7. public int anInt4144;
  8. public int[] characterDrawYOffsets;
  9. public int[] characterHeights;
  10. public int[] characterDrawXOffsets;
  11. public int[] characterWidths;
  12. public int[] iconWidths;
  13. public byte[] aByteArray4151;
  14. public byte[][] fontPixels;
  15. public int[] characterScreenWidths;
  16. public Sprite[] chatImages;
  17. public static String aRSString_4135;
  18. public static String startTransparency;
  19. public static String startDefaultShadow;
  20. public static String endShadow = "/shad";
  21. public static String endEffect;
  22. public static String aRSString_4143;
  23. public static String endStrikethrough = "/str";
  24. public static String aRSString_4147;
  25. public static String startColor;
  26. public static String lineBreak;
  27. public static String startStrikethrough;
  28. public static String endColor;
  29. public static String startImage;
  30. public static String endUnderline;
  31. public static String defaultStrikethrough;
  32. public static String startShadow;
  33. public static String startEffect;
  34. public static String aRSString_4162;
  35. public static String aRSString_4163;
  36. public static String endTransparency;
  37. public static String aRSString_4165;
  38. public static String startUnderline;
  39. public static String startDefaultUnderline;
  40. public static String aRSString_4169;
  41. public static String[] splitTextStrings;
  42. public static int defaultColor;
  43. public static int textShadowColor;
  44. public static int strikethroughColor;
  45. public static int defaultTransparency;
  46. public static int anInt4175;
  47. public static int underlineColor;
  48. public static int defaultShadow;
  49. public static int anInt4178;
  50. public static int transparency;
  51. public static int textColor;
  52.  
  53. public RSFont(boolean TypeFont, String s, StreamLoader archive) {
  54. fontPixels = new byte[256][];
  55. characterWidths = new int[256];
  56. characterHeights = new int[256];
  57. characterDrawXOffsets = new int[256];
  58. characterDrawYOffsets = new int[256];
  59. characterScreenWidths = new int[256];
  60. Stream stream = new Stream(archive.getDataForName(s + ".dat"));
  61. Stream stream_1 = new Stream(archive.getDataForName("index.dat"));
  62. stream_1.currentOffset = stream.readUnsignedWord() + 4;
  63. int k = stream_1.readUnsignedByte();
  64. if (k > 0) {
  65. stream_1.currentOffset += 3 * (k - 1);
  66. }
  67. for (int l = 0; l < 256; l++) {
  68. characterDrawXOffsets[l] = stream_1.readUnsignedByte();
  69. characterDrawYOffsets[l] = stream_1.readUnsignedByte();
  70. int i1 = characterWidths[l] = stream_1.readUnsignedWord();
  71. int j1 = characterHeights[l] = stream_1.readUnsignedWord();
  72. int k1 = stream_1.readUnsignedByte();
  73. int l1 = i1 * j1;
  74. fontPixels[l] = new byte[l1];
  75. if (k1 == 0) {
  76. for (int i2 = 0; i2 < l1; i2++) {
  77. fontPixels[l][i2] = stream.readSignedByte();
  78. }
  79.  
  80. } else if (k1 == 1) {
  81. for (int j2 = 0; j2 < i1; j2++) {
  82. for (int l2 = 0; l2 < j1; l2++) {
  83. fontPixels[l][j2 + l2 * i1] = stream.readSignedByte();
  84. }
  85.  
  86. }
  87.  
  88. }
  89. if (j1 > baseCharacterHeight && l < 128) {
  90. baseCharacterHeight = j1;
  91. }
  92. characterDrawXOffsets[l] = 1;
  93. characterScreenWidths[l] = i1 + 2;
  94. int k2 = 0;
  95. for (int i3 = j1 / 7; i3 < j1; i3++) {
  96. k2 += fontPixels[l][i3 * i1];
  97. }
  98.  
  99. if (k2 <= j1 / 7) {
  100. characterScreenWidths[l]--;
  101. characterDrawXOffsets[l] = 0;
  102. }
  103. k2 = 0;
  104. for (int j3 = j1 / 7; j3 < j1; j3++) {
  105. k2 += fontPixels[l][(i1 - 1) + j3 * i1];
  106. }
  107.  
  108. if (k2 <= j1 / 7) {
  109. characterScreenWidths[l]--;
  110. }
  111. }
  112.  
  113. if (TypeFont) {
  114. characterScreenWidths[32] = characterScreenWidths[73];
  115. } else {
  116. characterScreenWidths[32] = characterScreenWidths[105];
  117. }
  118. }
  119.  
  120. public void drawStringMoveY(String string, int drawX, int drawY, int color,
  121. int shadow, int randomMod, int randomMod2) {
  122. if (string != null) {
  123. setColorAndShadow(color, shadow);
  124. double d = 7.0 - (double) randomMod2 / 8.0;
  125. if (d < 0.0) {
  126. d = 0.0;
  127. }
  128. int[] yOffset = new int[string.length()];
  129. for (int index = 0; index < string.length(); index++) {
  130. yOffset[index] = (int) (Math.sin((double) index / 1.5 + (double) randomMod) * d);
  131. }
  132. drawBaseStringMoveXY(string, drawX - getTextWidth(string) / 2, drawY, null, yOffset);
  133. }
  134. }
  135.  
  136. public int getCharacterWidth(int i) {
  137. return characterScreenWidths[i & 0xff];
  138. }
  139.  
  140. public void setDefaultTextEffectValues(int color, int shadow, int trans) {
  141. strikethroughColor = -1;
  142. underlineColor = -1;
  143. textShadowColor = defaultShadow = shadow;
  144. textColor = defaultColor = color;
  145. transparency = defaultTransparency = trans;
  146. anInt4178 = 0;
  147. anInt4175 = 0;
  148. }
  149.  
  150. public static void drawHorizontalLine(int drawX, int drawY, int lineWidth, int i_62_) {
  151. if (drawY >= topY && drawY < bottomY) {
  152. if (drawX < topX) {
  153. lineWidth -= topX - drawX;
  154. drawX = topX;
  155. }
  156. if (drawX + lineWidth > bottomX) {
  157. lineWidth = bottomX - drawX;
  158. }
  159. int i_63_ = drawX + drawY * width;
  160. for (int i_64_ = 0; i_64_ < lineWidth; i_64_++) {
  161. pixels[i_63_ + i_64_] = i_62_;
  162. }
  163. }
  164. }
  165.  
  166. public static int method1014(byte[][] is, byte[][] is_27_, int[] is_28_,
  167. int[] is_29_, int[] is_30_, int i,
  168. int i_31_) {
  169. int i_32_ = is_28_[i];
  170. int i_33_ = i_32_ + is_30_[i];
  171. int i_34_ = is_28_[i_31_];
  172. int i_35_ = i_34_ + is_30_[i_31_];
  173. int i_36_ = i_32_;
  174. if (i_34_ > i_32_) {
  175. i_36_ = i_34_;
  176. }
  177. int i_37_ = i_33_;
  178. if (i_35_ < i_33_) {
  179. i_37_ = i_35_;
  180. }
  181. int i_38_ = is_29_[i];
  182. if (is_29_[i_31_] < i_38_) {
  183. i_38_ = is_29_[i_31_];
  184. }
  185. byte[] is_39_ = is_27_[i];
  186. byte[] is_40_ = is[i_31_];
  187. int i_41_ = i_36_ - i_32_;
  188. int i_42_ = i_36_ - i_34_;
  189. for (int i_43_ = i_36_; i_43_ < i_37_; i_43_++) {
  190. int i_44_ = is_39_[i_41_++] + is_40_[i_42_++];
  191. if (i_44_ < i_38_) {
  192. i_38_ = i_44_;
  193. }
  194. }
  195. return -i_38_;
  196. }
  197.  
  198. public void drawCenteredStringMoveXY(String string, int drawX, int drawY, int color,
  199. int shadow, int randomMod) {
  200. if (string != null) {
  201. setColorAndShadow(color, shadow);
  202. int[] xMods = new int[string.length()];
  203. int[] yMods = new int[string.length()];
  204. for (int index = 0; index < string.length(); index++) {
  205. xMods[index] = (int) (Math.sin((double) index / 5.0 + (double) randomMod / 5.0) * 5.0);
  206. yMods[index] = (int) (Math.sin((double) index / 3.0 + (double) randomMod / 5.0) * 5.0);
  207. }
  208. drawBaseStringMoveXY(string, drawX - getTextWidth(string) / 2, drawY, xMods,
  209. yMods);
  210. }
  211. }
  212.  
  213. public void drawCenteredStringMoveY(String class100, int drawX, int drawY, int color,
  214. int shadow, int i_54_) {
  215. if (class100 != null) {
  216. setColorAndShadow(color, shadow);
  217. int[] yOffset = new int[class100.length()];
  218. for (int index = 0; index < class100.length(); index++) {
  219. yOffset[index] = (int) (Math.sin((double) index / 2.0 + (double) i_54_ / 5.0) * 5.0);
  220. }
  221. drawBaseStringMoveXY(class100, drawX - getTextWidth(class100) / 2, drawY, null,
  222. yOffset);
  223. }
  224. }
  225.  
  226. public void unpackChatImages(Sprite[] icons) {
  227. chatImages = icons;
  228. }
  229.  
  230. public void drawBasicString(String string, int drawX, int drawY) {
  231. drawY -= baseCharacterHeight;
  232. int startIndex = -1;
  233. int i_70_ = -1;
  234. for (int currentCharacter = 0; currentCharacter < string.length(); currentCharacter++) {
  235. int character = string.charAt(currentCharacter);
  236. if (character > 255) {
  237. character = 32;
  238. }
  239. if (character == 60) {
  240. startIndex = currentCharacter;
  241. } else {
  242. if (character == 62 && startIndex != -1) {
  243. String effectString = string.substring(startIndex + 1, currentCharacter);
  244. startIndex = -1;
  245. if (effectString.equals(startEffect)) {
  246. character = 60;
  247. } else if (effectString.equals(endEffect)) {
  248. character = 62;
  249. } else if (effectString.equals(aRSString_4135)) {
  250. character = 160;
  251. } else if (effectString.equals(aRSString_4162)) {
  252. character = 173;
  253. } else if (effectString.equals(aRSString_4165)) {
  254. character = 215;
  255. } else if (effectString.equals(aRSString_4147)) {
  256. character = 128;
  257. } else if (effectString.equals(aRSString_4163)) {
  258. character = 169;
  259. } else if (effectString.equals(aRSString_4169)) {
  260. character = 174;
  261. } else {
  262. if (effectString.startsWith(startImage)) {
  263. try {
  264. int imageId = Integer.valueOf(effectString.substring(4));
  265. Sprite icon = chatImages[imageId];
  266. int iconModY = icon.maxHeight;
  267. if (transparency == 256) {
  268. icon.drawSprite(drawX, (drawY + baseCharacterHeight - iconModY));
  269. } else {
  270. icon.drawTransparentSprite(drawX,
  271. (drawY + baseCharacterHeight - iconModY),
  272. transparency);
  273. }
  274. drawX += icon.maxWidth;
  275. i_70_ = -1;
  276. } catch (Exception exception) {
  277. /* empty */
  278. }
  279. } else {
  280. setTextEffects(effectString);
  281. }
  282. continue;
  283. }
  284. }
  285. if (startIndex == -1) {
  286. int width = characterWidths[character];
  287. int height = characterHeights[character];
  288. if (character != 32) {
  289. if (transparency == 256) {
  290. if (textShadowColor != -1) {
  291. drawCharacter(character,
  292. drawX + characterDrawXOffsets[character] + 1,
  293. drawY + characterDrawYOffsets[character] + 1,
  294. width, height, textShadowColor, true);
  295. }
  296. drawCharacter(character, drawX + characterDrawXOffsets[character],
  297. drawY + characterDrawYOffsets[character], width,
  298. height, textColor, false);
  299. } else {
  300. if (textShadowColor != -1) {
  301. drawTransparentCharacter(character,
  302. drawX + characterDrawXOffsets[character] + 1,
  303. drawY + characterDrawYOffsets[character] + 1,
  304. width, height, textShadowColor, transparency,
  305. true);
  306. }
  307. drawTransparentCharacter(character, drawX + characterDrawXOffsets[character],
  308. drawY + characterDrawYOffsets[character], width,
  309. height, textColor, transparency, false);
  310. }
  311. } else if (anInt4178 > 0) {
  312. anInt4175 += anInt4178;
  313. drawX += anInt4175 >> 8;
  314. anInt4175 &= 0xff;
  315. }
  316. int lineWidth = characterScreenWidths[character];
  317. if (strikethroughColor != -1) {
  318. drawHorizontalLine(drawX,drawY + (int) ((double) baseCharacterHeight * 0.69999999999999996D), lineWidth,strikethroughColor);
  319. }
  320. if (underlineColor != -1) {
  321. drawHorizontalLine(drawX,drawY + baseCharacterHeight, lineWidth,underlineColor);
  322. }
  323. drawX += lineWidth;
  324. i_70_ = character;
  325. }
  326. }
  327. }
  328. }
  329.  
  330. public void drawRAString(String string, int drawX, int drawY, int color,
  331. int shadow) {
  332. if (string != null) {
  333. setColorAndShadow(color, shadow);
  334. drawBasicString(string, drawX - getTextWidth(string), drawY);
  335. }
  336. }
  337.  
  338. public void drawBaseStringMoveXY(String string, int drawX, int drawY, int[] xModifier,
  339. int[] yModifier) {
  340. drawY -= baseCharacterHeight;
  341. int startIndex = -1;
  342. int i_96_ = -1;
  343. int modifierOffset = 0;
  344. for (int currentCharacter = 0; currentCharacter < string.length(); currentCharacter++) {
  345. int character = string.charAt(currentCharacter);
  346. if (character == 60) {
  347. startIndex = currentCharacter;
  348. } else {
  349. if (character == 62 && startIndex != -1) {
  350. String effectString = string.substring(startIndex + 1, currentCharacter);
  351. startIndex = -1;
  352. if (effectString.equals(startEffect)) {
  353. character = 60;
  354. } else if (effectString.equals(endEffect)) {
  355. character = 62;
  356. } else if (effectString.equals(aRSString_4135)) {
  357. character = 160;
  358. } else if (effectString.equals(aRSString_4162)) {
  359. character = 173;
  360. } else if (effectString.equals(aRSString_4165)) {
  361. character = 215;
  362. } else if (effectString.equals(aRSString_4147)) {
  363. character = 128;
  364. } else if (effectString.equals(aRSString_4163)) {
  365. character = 169;
  366. } else if (effectString.equals(aRSString_4169)) {
  367. character = 174;
  368. } else {
  369. if (effectString.startsWith(startImage)) {
  370. try {
  371. int xModI;
  372. if (xModifier != null) {
  373. xModI = xModifier[modifierOffset];
  374. } else {
  375. xModI = 0;
  376. }
  377. int yMod;
  378. if (yModifier != null) {
  379. yMod = yModifier[modifierOffset];
  380. } else {
  381. yMod = 0;
  382. }
  383. modifierOffset++;
  384. int iconId = Integer.valueOf(effectString.substring(4));
  385. Sprite class92 = chatImages[iconId];
  386. int iconOffsetY = class92.maxHeight;
  387. if (transparency == 256) {
  388. class92.drawSprite(drawX + xModI,
  389. (drawY + baseCharacterHeight - iconOffsetY + yMod));
  390. } else {
  391. class92.drawTransparentSprite(drawX + xModI,
  392. (drawY + baseCharacterHeight - iconOffsetY + yMod),
  393. transparency);
  394. }
  395. drawX += class92.maxWidth;
  396. i_96_ = -1;
  397. } catch (Exception exception) {
  398. /* empty */
  399. }
  400. } else {
  401. setTextEffects(effectString);
  402. }
  403. continue;
  404. }
  405. }
  406. if (startIndex == -1) {
  407. int width = characterWidths[character];
  408. int height = characterHeights[character];
  409. int xOff;
  410. if (xModifier != null) {
  411. xOff = xModifier[modifierOffset];
  412. } else {
  413. xOff = 0;
  414. }
  415. int yOff;
  416. if (yModifier != null) {
  417. yOff = yModifier[modifierOffset];
  418. } else {
  419. yOff = 0;
  420. }
  421. modifierOffset++;
  422. if (character != 32) {
  423. if (transparency == 256) {
  424. if (textShadowColor != -1) {
  425. drawCharacter(character,
  426. (drawX + characterDrawXOffsets[character] + 1 + xOff),
  427. (drawY + characterDrawYOffsets[character] + 1 + yOff),
  428. width, height, textShadowColor, true);
  429. }
  430. drawCharacter(character,
  431. drawX + characterDrawXOffsets[character] + xOff,
  432. drawY + characterDrawYOffsets[character] + yOff,
  433. width, height, textColor, false);
  434. } else {
  435. if (textShadowColor != -1) {
  436. drawTransparentCharacter(character,
  437. (drawX + characterDrawXOffsets[character] + 1 + xOff),
  438. (drawY + characterDrawYOffsets[character] + 1 + yOff),
  439. width, height, textShadowColor,
  440. transparency, true);
  441. }
  442. drawTransparentCharacter(character,
  443. drawX + characterDrawXOffsets[character] + xOff,
  444. drawY + characterDrawYOffsets[character] + yOff,
  445. width, height, textColor, transparency,
  446. false);
  447. }
  448. } else if (anInt4178 > 0) {
  449. anInt4175 += anInt4178;
  450. drawX += anInt4175 >> 8;
  451. anInt4175 &= 0xff;
  452. }
  453. int i_109_ = characterScreenWidths[character];
  454. if (strikethroughColor != -1) {
  455. drawHorizontalLine(drawX,
  456. drawY + (int) ((double) baseCharacterHeight * 0.7),
  457. i_109_, strikethroughColor);
  458. }
  459. if (underlineColor != -1) {
  460. drawHorizontalLine(drawX, drawY + baseCharacterHeight, i_109_,
  461. underlineColor);
  462. }
  463. drawX += i_109_;
  464. i_96_ = character;
  465. }
  466. }
  467. }
  468. }
  469.  
  470. public void setTextEffects(String string) {
  471. do {
  472. try {
  473. if (string.startsWith(startColor)) {
  474. textColor = Integer.valueOf(string.substring(4));
  475. } else if (string.equals(endColor)) {
  476. textColor = defaultColor;
  477. } else if (string.startsWith(startTransparency)) {
  478. transparency = Integer.valueOf(string.substring(6));
  479. } else if (string.equals(endTransparency)) {
  480. transparency = defaultTransparency;
  481. } else if (string.startsWith(startStrikethrough)) {
  482. strikethroughColor = Integer.valueOf(string.substring(4));
  483. } else if (string.equals(defaultStrikethrough)) {
  484. strikethroughColor = 8388608;
  485. } else if (string.equals(endStrikethrough)) {
  486. strikethroughColor = -1;
  487. } else if (string.startsWith(startUnderline)) {
  488. underlineColor = Integer.valueOf(string.substring(2));
  489. } else if (string.equals(startDefaultUnderline)) {
  490. underlineColor = 0;
  491. } else if (string.equals(endUnderline)) {
  492. underlineColor = -1;
  493. } else if (string.startsWith(startShadow)) {
  494. textShadowColor = Integer.valueOf(string.substring(5));
  495. } else if (string.equals(startDefaultShadow)) {
  496. textShadowColor = 0;
  497. } else if (string.equals(endShadow)) {
  498. textShadowColor = defaultShadow;
  499. } else {
  500. if (!string.equals(lineBreak)) {
  501. break;
  502. }
  503. setDefaultTextEffectValues(defaultColor, defaultShadow, defaultTransparency);
  504. }
  505. } catch (Exception exception) {
  506. break;
  507. }
  508. break;
  509. } while (false);
  510. }
  511.  
  512. public void setColorAndShadow(int color, int shadow) {
  513. strikethroughColor = -1;
  514. underlineColor = -1;
  515. textShadowColor = defaultShadow = shadow;
  516. textColor = defaultColor = color;
  517. transparency = defaultTransparency = 256;
  518. anInt4178 = 0;
  519. anInt4175 = 0;
  520. }
  521.  
  522. public int getTextWidth(String string) {
  523. if (string == null) {
  524. return 0;
  525. }
  526. int startIndex = -1;
  527. int i_126_ = -1;
  528. int finalWidth = 0;
  529. for (int currentCharacter = 0; currentCharacter < string.length(); currentCharacter++) {
  530. int character = string.charAt(currentCharacter);
  531. if (character > 255) {
  532. character = 32;
  533. }
  534. if (character == 60) {
  535. startIndex = currentCharacter;
  536. } else {
  537. if (character == 62 && startIndex != -1) {
  538. String effectString = string.substring(startIndex + 1, currentCharacter);
  539. startIndex = -1;
  540. if (effectString.equals(startEffect)) {
  541. character = 60;
  542. } else if (effectString.equals(endEffect)) {
  543. character = 62;
  544. } else if (effectString.equals(aRSString_4135)) {
  545. character = 160;
  546. } else if (effectString.equals(aRSString_4162)) {
  547. character = 173;
  548. } else if (effectString.equals(aRSString_4165)) {
  549. character = 215;
  550. } else if (effectString.equals(aRSString_4147)) {
  551. character = 128;
  552. } else if (effectString.equals(aRSString_4163)) {
  553. character = 169;
  554. } else if (effectString.equals(aRSString_4169)) {
  555. character = 174;
  556. } else {
  557. if (effectString.startsWith(startImage)) {
  558. try {//<img=
  559. int iconId = Integer.valueOf(effectString.substring(4));
  560. finalWidth += chatImages[iconId].maxWidth;
  561. i_126_ = -1;
  562. } catch (Exception exception) {
  563. /* empty */
  564. }
  565. }
  566. continue;
  567. }
  568. }
  569. if (startIndex == -1) {
  570. finalWidth += characterScreenWidths[character];
  571. i_126_ = character;
  572. }
  573. }
  574. }
  575. return finalWidth;
  576. }
  577.  
  578. public void drawBasicString(String string, int drawX, int drawY, int color,
  579. int shadow) {
  580. if (string != null) {
  581. setColorAndShadow(color, shadow);
  582. drawBasicString(string, drawX, drawY);
  583. }
  584. }
  585.  
  586. public void drawCenteredString(String string, int drawX, int drawY, int color,
  587. int shadow) {
  588. if (string != null) {
  589. setColorAndShadow(color, shadow);
  590. drawBasicString(string, drawX - getTextWidth(string) / 2, drawY);
  591. }
  592. }
  593.  
  594. public static void nullLoader() {
  595. startEffect = null;
  596. endEffect = null;
  597. aRSString_4135 = null;
  598. aRSString_4162 = null;
  599. aRSString_4165 = null;
  600. aRSString_4147 = null;
  601. aRSString_4163 = null;
  602. aRSString_4169 = null;
  603. startImage = null;
  604. lineBreak = null;
  605. startColor = null;
  606. endColor = null;
  607. startTransparency = null;
  608. endTransparency = null;
  609. startUnderline = null;
  610. startDefaultUnderline = null;
  611. endUnderline = null;
  612. startShadow = null;
  613. startDefaultShadow = null;
  614. endShadow = null;
  615. startStrikethrough = null;
  616. defaultStrikethrough = null;
  617. endStrikethrough = null;
  618. aRSString_4143 = null;
  619. splitTextStrings = null;
  620. }
  621.  
  622. public static void createTransparentCharacterPixels(int[] is, byte[] is_0_, int i, int i_1_,
  623. int i_2_, int i_3_, int i_4_, int i_5_,
  624. int i_6_, int i_7_) {
  625. i = ((i & 0xff00ff) * i_7_ & ~0xff00ff) + ((i & 0xff00) * i_7_ & 0xff0000) >> 8;
  626. i_7_ = 256 - i_7_;
  627. for (int i_8_ = -i_4_; i_8_ < 0; i_8_++) {
  628. for (int i_9_ = -i_3_; i_9_ < 0; i_9_++) {
  629. if (is_0_[i_1_++] != 0) {
  630. int i_10_ = is[i_2_];
  631. is[i_2_++] = ((((i_10_ & 0xff00ff) * i_7_ & ~0xff00ff) + ((i_10_ & 0xff00) * i_7_ & 0xff0000)) >> 8) + i;
  632. } else {
  633. i_2_++;
  634. }
  635. }
  636. i_2_ += i_5_;
  637. i_1_ += i_6_;
  638. }
  639. }
  640.  
  641. public void drawTransparentCharacter(int i, int i_11_, int i_12_, int i_13_, int i_14_,
  642. int i_15_, int i_16_, boolean bool) {
  643. int i_17_ = i_11_ + i_12_ * DrawingArea.width;
  644. int i_18_ = DrawingArea.width - i_13_;
  645. int i_19_ = 0;
  646. int i_20_ = 0;
  647. if (i_12_ < DrawingArea.topY) {
  648. int i_21_ = DrawingArea.topY - i_12_;
  649. i_14_ -= i_21_;
  650. i_12_ = DrawingArea.topY;
  651. i_20_ += i_21_ * i_13_;
  652. i_17_ += i_21_ * DrawingArea.width;
  653. }
  654. if (i_12_ + i_14_ > DrawingArea.bottomY) {
  655. i_14_ -= i_12_ + i_14_ - DrawingArea.bottomY;
  656. }
  657. if (i_11_ < DrawingArea.topX) {
  658. int i_22_ = DrawingArea.topX - i_11_;
  659. i_13_ -= i_22_;
  660. i_11_ = DrawingArea.topX;
  661. i_20_ += i_22_;
  662. i_17_ += i_22_;
  663. i_19_ += i_22_;
  664. i_18_ += i_22_;
  665. }
  666. if (i_11_ + i_13_ > DrawingArea.bottomX) {
  667. int i_23_ = i_11_ + i_13_ - DrawingArea.bottomX;
  668. i_13_ -= i_23_;
  669. i_19_ += i_23_;
  670. i_18_ += i_23_;
  671. }
  672. if (i_13_ > 0 && i_14_ > 0) {
  673. createTransparentCharacterPixels(DrawingArea.pixels, fontPixels[i], i_15_,
  674. i_20_, i_17_, i_13_, i_14_, i_18_, i_19_, i_16_);
  675. }
  676. }
  677.  
  678. public static void createCharacterPixels(int[] is, byte[] is_24_, int i, int i_25_,
  679. int i_26_, int i_27_, int i_28_, int i_29_,
  680. int i_30_) {
  681. int i_31_ = -(i_27_ >> 2);
  682. i_27_ = -(i_27_ & 0x3);
  683. for (int i_32_ = -i_28_; i_32_ < 0; i_32_++) {
  684. for (int i_33_ = i_31_; i_33_ < 0; i_33_++) {
  685. if (is_24_[i_25_++] != 0) {
  686. is[i_26_++] = i;
  687. } else {
  688. i_26_++;
  689. }
  690. if (is_24_[i_25_++] != 0) {
  691. is[i_26_++] = i;
  692. } else {
  693. i_26_++;
  694. }
  695. if (is_24_[i_25_++] != 0) {
  696. is[i_26_++] = i;
  697. } else {
  698. i_26_++;
  699. }
  700. if (is_24_[i_25_++] != 0) {
  701. is[i_26_++] = i;
  702. } else {
  703. i_26_++;
  704. }
  705. }
  706. for (int i_34_ = i_27_; i_34_ < 0; i_34_++) {
  707. if (is_24_[i_25_++] != 0) {
  708. is[i_26_++] = i;
  709. } else {
  710. i_26_++;
  711. }
  712. }
  713. i_26_ += i_29_;
  714. i_25_ += i_30_;
  715. }
  716. }
  717.  
  718. public void drawCharacter(int character, int i_35_, int i_36_, int i_37_, int i_38_,
  719. int i_39_, boolean bool) {
  720. int i_40_ = i_35_ + i_36_ * DrawingArea.width;
  721. int i_41_ = DrawingArea.width - i_37_;
  722. int i_42_ = 0;
  723. int i_43_ = 0;
  724. if (i_36_ < DrawingArea.topY) {
  725. int i_44_ = DrawingArea.topY - i_36_;
  726. i_38_ -= i_44_;
  727. i_36_ = DrawingArea.topY;
  728. i_43_ += i_44_ * i_37_;
  729. i_40_ += i_44_ * DrawingArea.width;
  730. }
  731. if (i_36_ + i_38_ > DrawingArea.bottomY) {
  732. i_38_ -= i_36_ + i_38_ - DrawingArea.bottomY;
  733. }
  734. if (i_35_ < DrawingArea.topX) {
  735. int i_45_ = DrawingArea.topX - i_35_;
  736. i_37_ -= i_45_;
  737. i_35_ = DrawingArea.topX;
  738. i_43_ += i_45_;
  739. i_40_ += i_45_;
  740. i_42_ += i_45_;
  741. i_41_ += i_45_;
  742. }
  743. if (i_35_ + i_37_ > DrawingArea.bottomX) {
  744. int i_46_ = i_35_ + i_37_ - DrawingArea.bottomX;
  745. i_37_ -= i_46_;
  746. i_42_ += i_46_;
  747. i_41_ += i_46_;
  748. }
  749. if (i_37_ > 0 && i_38_ > 0) {
  750. createCharacterPixels(DrawingArea.pixels, fontPixels[character],
  751. i_39_, i_43_, i_40_, i_37_, i_38_, i_41_, i_42_);
  752.  
  753. }
  754. }
  755.  
  756. static {
  757. startTransparency = "trans=";
  758. startStrikethrough = "str=";
  759. startDefaultShadow = "shad";
  760. startColor = "col=";
  761. lineBreak = "br";
  762. defaultStrikethrough = "str";
  763. endUnderline = "/u";
  764. startImage = "img=";
  765. startShadow = "shad=";
  766. startUnderline = "u=";
  767. endColor = "/col";
  768. startDefaultUnderline = "u";
  769. endTransparency = "/trans";
  770.  
  771. aRSString_4143 = Integer.toString(100);
  772. aRSString_4135 = "nbsp";
  773. aRSString_4169 = "reg";
  774. aRSString_4165 = "times";
  775. aRSString_4162 = "shy";
  776. aRSString_4163 = "copy";
  777. endEffect = "gt";
  778. aRSString_4147 = "euro";
  779. startEffect = "lt";
  780. defaultTransparency = 256;
  781. defaultShadow = -1;
  782. anInt4175 = 0;
  783. textShadowColor = -1;
  784. textColor = 0;
  785. defaultColor = 0;
  786. strikethroughColor = -1;
  787. splitTextStrings = new String[100];
  788. underlineColor = -1;
  789. anInt4178 = 0;
  790. transparency = 256;
  791. }
  792. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement