Browse Source

Calcualte SStringY instead of using a prebaked table

pull/380/head
Anders Jenbo 7 years ago
parent
commit
40cb1c01f0
  1. 2
      Source/help.cpp
  2. 4
      Source/items.cpp
  3. 4
      Source/quests.cpp
  4. 38
      Source/stores.cpp
  5. 1
      Source/stores.h

2
Source/help.cpp

@ -539,7 +539,7 @@ void DrawHelpLine(int always_0, int help_line_nr, char *text, char color)
BYTE c;
width = 0;
off = BUFFER_WIDTH * (SStringY[help_line_nr] + 204) + always_0 + 96;
off = BUFFER_WIDTH * (help_line_nr * 12 + 204) + always_0 + 96;
while (*text) {
c = gbFontTransTbl[(BYTE)*text];
text++;

4
Source/items.cpp

@ -2924,7 +2924,7 @@ void PrintUString(int x, int y, BOOL cjustflag, char *str, int col)
int len, width, off, i, k;
BYTE c;
off = x + BUFFER_WIDTH * (SStringY[y] + 204) + 96;
off = x + BUFFER_WIDTH * (y * 12 + 204) + 96;
len = strlen(str);
k = 0;
if (cjustflag) {
@ -2954,7 +2954,7 @@ void DrawULine(int y)
BYTE *src, *dst;
src = &gpBuffer[SCREENXY(26, 25)];
dst = &gpBuffer[BUFFER_WIDTH * (SStringY[y] + 198) + 26 + 64];
dst = &gpBuffer[BUFFER_WIDTH * (y * 12 + 198) + 26 + 64];
for (i = 0; i < 3; i++, src += BUFFER_WIDTH, dst += BUFFER_WIDTH)
memcpy(dst, src, 266);

4
Source/quests.cpp

@ -703,8 +703,8 @@ void PrintQLString(int x, int y, BOOL cjustflag, char *str, int col)
int len, width, off, i, k, s;
BYTE c;
s = SStringY[y];
off = x + BUFFER_WIDTH * (SStringY[y] + 204) + 96;
s = y * 12;
off = x + BUFFER_WIDTH * (y * 12 + 204) + 96;
len = strlen(str);
k = 0;
if (cjustflag) {

38
Source/stores.cpp

@ -36,32 +36,6 @@ int stextdown;
char stextscrlubtn;
char stextflag;
int SStringY[24] = {
0,
12,
24,
36,
48,
60,
72,
84,
96,
108,
120,
132,
144,
156,
168,
180,
192,
204,
216,
228,
240,
252,
264,
276
};
char *talkname[9] = {
"Griswold",
"Pepin",
@ -148,7 +122,7 @@ void PrintSString(int x, int y, BOOL cjustflag, char *str, char col, int val)
BYTE c;
char valstr[32];
s = SStringY[y] + stext[y]._syoff;
s = y * 12 + stext[y]._syoff;
if (stextsize)
xx = 96;
else
@ -199,7 +173,7 @@ void DrawSLine(int y)
{
int xy, yy, width, line, sy;
sy = SStringY[y];
sy = y * 12;
if (stextsize == 1) {
xy = SCREENXY(26, 25);
yy = BUFFER_WIDTH * (sy + 198) + 26 + 64;
@ -228,8 +202,8 @@ void DrawSArrows(int y1, int y2)
{
int yd1, yd2, yd3;
yd1 = SStringY[y1] + 204;
yd2 = SStringY[y2] + 204;
yd1 = y1 * 12 + 204;
yd2 = y2 * 12 + 204;
if (stextscrlubtn != -1)
CelDraw(665, yd1, pSTextSlidCels, 12, 12);
else
@ -247,10 +221,10 @@ void DrawSArrows(int y1, int y2)
else
yd3 = stextsel;
if (storenumh > 1)
yd3 = 1000 * (stextsval + ((yd3 - stextup) >> 2)) / (storenumh - 1) * (SStringY[y2] - SStringY[y1] - 24) / 1000;
yd3 = 1000 * (stextsval + ((yd3 - stextup) >> 2)) / (storenumh - 1) * (y2 * 12 - y1 * 12 - 24) / 1000;
else
yd3 = 0;
CelDraw(665, SStringY[y1 + 1] + 204 + yd3, pSTextSlidCels, 13, 12);
CelDraw(665, (y1 + 1) * 12 + 204 + yd3, pSTextSlidCels, 13, 12);
}
void DrawSTextHelp()

1
Source/stores.h

@ -134,7 +134,6 @@ void ReleaseStoreBtn();
/* rdata */
extern int SStringY[24];
extern char *talkname[9];
#endif /* __STORES_H__ */

Loading…
Cancel
Save