Make improvements utilizing G_ScreenText().

git-svn-id: https://svn.eduke32.com/eduke32@3838 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2013-06-01 06:56:28 +00:00
parent e483dbefcd
commit 899f19155d
3 changed files with 58 additions and 29 deletions

View file

@ -1140,6 +1140,41 @@ vec2_t G_ScreenText(const int32_t font,
return size; return size;
} }
vec2_t G_ScreenTextShadow(int32_t sx, int32_t sy,
const int32_t font,
int32_t x, int32_t y, const int32_t z, const int32_t blockangle, const int32_t charangle,
const char *str, const int32_t shade, int32_t pal, int32_t o, const int32_t alpha,
int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, const int32_t f,
const int32_t x1, const int32_t y1, const int32_t x2, const int32_t y2)
{
vec2_t size = { 0, 0, }; // eventually the return value
if (!(o & ROTATESPRITE_FULL16))
{
sx <<= 16;
sy <<= 16;
x <<= 16;
y <<= 16;
xspace <<= 16;
yline <<= 16;
xbetween <<= 16;
ybetween <<= 16;
}
G_ScreenText(font, x + scale(sx,z,65536), y + scale(sy,z,65536), z, blockangle, charangle, str, 127, 4, o|ROTATESPRITE_FULL16, alpha, xspace, yline, xbetween, ybetween, f, x1, y1, x2, y2);
size = G_ScreenText(font, x, y, z, blockangle, charangle, str, shade, pal, o|ROTATESPRITE_FULL16, alpha, xspace, yline, xbetween, ybetween, f, x1, y1, x2, y2);
// return values in the same manner we receive them
if (!(o & ROTATESPRITE_FULL16))
{
size.x >>= 16;
size.y >>= 16;
}
return size;
}
// flags // flags
// 4: small font, wrap strings? // 4: small font, wrap strings?
int32_t G_PrintGameText(int32_t hack, int32_t tile, int32_t x, int32_t y, const char *t, int32_t G_PrintGameText(int32_t hack, int32_t tile, int32_t x, int32_t y, const char *t,
@ -1176,7 +1211,7 @@ int32_t G_PrintGameText(int32_t hack, int32_t tile, int32_t x, int32_t y, cons
} }
// order is important, this bit comes after the rest // order is important, this bit comes after the rest
if (hack & 2) // squishtext if ((hack & 2) && !NAM) // squishtext
--xbetween; --xbetween;
if (x == (160<<16)) if (x == (160<<16))
@ -1254,6 +1289,15 @@ int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t
return x; return x;
} }
void creditsminitext(int32_t x,int32_t y,const char *t,int32_t p,int32_t sb)
{
int32_t f = TEXT_XCENTER;
if (!minitext_lowercase)
f |= TEXT_UPPERCASE;
G_ScreenTextShadow(1, 1, MINIFONT, x, y, 65536, 0, 0, t, 0, p, sb, 0, 4, 8, 1, 0, f, 0, 0, xdim-1, ydim-1);
}
void G_AddUserQuote(const char *daquote) void G_AddUserQuote(const char *daquote)
{ {

View file

@ -311,6 +311,7 @@ int32_t G_PrintGameText(int32_t hack,int32_t tile,int32_t x,int32_t y,const char
int32_t GetTime(void); int32_t GetTime(void);
int32_t kopen4loadfrommod(const char *filename,char searchfirst); int32_t kopen4loadfrommod(const char *filename,char searchfirst);
int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t sb); int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t sb);
void creditsminitext(int32_t x,int32_t y,const char *t,int32_t p,int32_t sb);
int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits); int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits);
int32_t startwin_run(void); int32_t startwin_run(void);
@ -369,6 +370,7 @@ extern int32_t G_GetStringTile(int32_t font, char *t, int32_t f);
extern vec2_t G_ScreenTextSize(const int32_t font, int32_t x, int32_t y, const int32_t z, const int32_t blockangle, const char *str, const int32_t o, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, const int32_t f, const int32_t x1, const int32_t y1, const int32_t x2, const int32_t y2); extern vec2_t G_ScreenTextSize(const int32_t font, int32_t x, int32_t y, const int32_t z, const int32_t blockangle, const char *str, const int32_t o, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, const int32_t f, const int32_t x1, const int32_t y1, const int32_t x2, const int32_t y2);
extern void G_AddCoordsFromRotation(vec2_t *coords, const vec2_t *unitDirection, const int32_t magnitude); extern void G_AddCoordsFromRotation(vec2_t *coords, const vec2_t *unitDirection, const int32_t magnitude);
extern vec2_t G_ScreenText(const int32_t font, int32_t x, int32_t y, const int32_t z, const int32_t blockangle, const int32_t charangle, const char *str, const int32_t shade, int32_t pal, int32_t o, const int32_t alpha, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, const int32_t f, int32_t x1, int32_t y1, int32_t x2, int32_t y2); extern vec2_t G_ScreenText(const int32_t font, int32_t x, int32_t y, const int32_t z, const int32_t blockangle, const int32_t charangle, const char *str, const int32_t shade, int32_t pal, int32_t o, const int32_t alpha, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, const int32_t f, int32_t x1, int32_t y1, int32_t x2, int32_t y2);
extern vec2_t G_ScreenTextShadow(int32_t sx, int32_t sy, const int32_t font, int32_t x, int32_t y, const int32_t z, const int32_t blockangle, const int32_t charangle, const char *str, const int32_t shade, int32_t pal, int32_t o, const int32_t alpha, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, const int32_t f, int32_t x1, int32_t y1, int32_t x2, int32_t y2);
int32_t app_main(int32_t argc,const char **argv); int32_t app_main(int32_t argc,const char **argv);
void fadepal(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step); void fadepal(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step);

View file

@ -1912,37 +1912,30 @@ cheat_for_port_credits:
if (g_scriptVersion != 14) l = (-2); if (g_scriptVersion != 14) l = (-2);
mgametext(160,38-l,"Programming and Project Management",0,2+8+16); mgametext(160,38-l,"Programming and Project Management",0,2+8+16);
p = "Richard \"TerminX\" Gobeille"; p = "Richard \"TerminX\" Gobeille";
minitextshade(161-(Bstrlen(p)<<1), 39+10-l, p, 127, 4, 10+16+128); creditsminitext(160, 38+10-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 38+10-l, p, 8, 10+16+128);
mgametext(160,58-l,"Polymer Rendering System",0,2+8+16); mgametext(160,58-l,"Polymer Rendering System",0,2+8+16);
p = "Pierre-Loup \"Plagman\" Griffais"; p = "Pierre-Loup \"Plagman\" Griffais";
minitextshade(161-(Bstrlen(p)<<1), 59+10-l, p, 127, 4, 10+16+128); creditsminitext(160, 58+10-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 58+10-l, p, 8, 10+16+128);
mgametext(160,78-l,"Additional Engine and Game Programming",0,2+8+16); mgametext(160,78-l,"Additional Engine and Game Programming",0,2+8+16);
p = "Philipp \"Helixhorned\" Kutin"; p = "Philipp \"Helixhorned\" Kutin";
minitextshade(161-(Bstrlen(p)<<1), 79+10-l, p, 127, 4, 10+16+128); creditsminitext(160, 78+10-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 78+10-l, p, 8, 10+16+128);
mgametext(160,98-l,"\"JFDuke3D\" and \"JFBuild\" code",0,2+8+16); mgametext(160,98-l,"\"JFDuke3D\" and \"JFBuild\" code",0,2+8+16);
p = "Jonathon \"JonoF\" Fowler"; p = "Jonathon \"JonoF\" Fowler";
minitextshade(161-(Bstrlen(p)<<1), 99+10-l, p, 127, 4, 10+16+128); creditsminitext(160, 98+10-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 98+10-l, p, 8, 10+16+128);
mgametext(160,118-l,"Legacy \"NAM\", \"WWII GI\", and \"EDuke\" Code",0,2+8+16); mgametext(160,118-l,"Legacy \"NAM\", \"WWII GI\", and \"EDuke\" Code",0,2+8+16);
p = "Matt \"Matteus\" Saettler"; p = "Matt \"Matteus\" Saettler";
minitextshade(161-(Bstrlen(p)<<1), 119+10-l, p, 127, 4, 10+16+128); creditsminitext(160, 118+10-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 118+10-l, p, 8, 10+16+128);
mgametext(160,138-l,"Core BUILD Engine functionality",0,2+8+16); mgametext(160,138-l,"Core BUILD Engine functionality",0,2+8+16);
p = "Ken \"Awesoken\" Silverman"; p = "Ken \"Awesoken\" Silverman";
minitextshade(161-(Bstrlen(p)<<1), 139+10-l, p, 127, 4, 10+16+128); creditsminitext(160, 138+10-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 138+10-l, p, 8, 10+16+128);
p = "Visit www.eduke32.com for news and updates"; p = "Visit www.eduke32.com for news and updates";
minitextshade(161-(Bstrlen(p)<<1), 139+10+10+10+10+4-l, p, 127, 4, 10+16+128); creditsminitext(160, 138+10+10+10+10+4-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 138+10+10+10+10+4-l, p, 8, 10+16+128);
break; break;
case MENU_CREDITS5: case MENU_CREDITS5:
@ -2007,29 +2000,19 @@ cheat_for_port_credits2:
i = 0; i = 0;
for (m=0; m<header_numlines; m++) for (m=0; m<header_numlines; m++)
{ creditsminitext(160, 17+10+10+8+4+(m*7)-l, header[m], 8, 10+16+128);
minitextshade(161-(Bstrlen(header[m])<<1), 18+10+10+8+4+(m*7)-l, header[m], 127, 4, 10+16+128);
minitext(160-(Bstrlen(header[m])<<1), 17+10+10+8+4+(m*7)-l, header[m], 8, 10+16+128);
}
i += m; i += m;
#define CCOLUMNS 3 #define CCOLUMNS 3
#define CCOLXBUF 20 #define CCOLXBUF 20
for (m=0; m<body_numlines; m++) for (m=0; m<body_numlines; m++)
{ creditsminitext(CCOLXBUF+((320-CCOLXBUF*2)/(CCOLUMNS*2)) +((320-CCOLXBUF*2)/CCOLUMNS)*(m/(body_numlines/CCOLUMNS)), 17+10+10+8+4+((m%(body_numlines/CCOLUMNS))*7)+(i*7)-l, body[m], 8, 10+16+128);
minitextshade(CCOLXBUF+((320-CCOLXBUF*2)/(CCOLUMNS*2))+1+((320-CCOLXBUF*2)/CCOLUMNS)*(m/(body_numlines/CCOLUMNS))-(Bstrlen(body[m])<<1), 18+10+10+8+4+((m%(body_numlines/CCOLUMNS))*7)+(i*7)-l, body[m], 127, 4, 10+16+128);
minitext(CCOLXBUF+((320-CCOLXBUF*2)/(CCOLUMNS*2)) +((320-CCOLXBUF*2)/CCOLUMNS)*(m/(body_numlines/CCOLUMNS))-(Bstrlen(body[m])<<1), 17+10+10+8+4+((m%(body_numlines/CCOLUMNS))*7)+(i*7)-l, body[m], 8, 10+16+128);
}
i += m/CCOLUMNS; i += m/CCOLUMNS;
for (m=0; m<footer_numlines; m++) for (m=0; m<footer_numlines; m++)
{ creditsminitext(160, 17+10+10+8+4+(m*7)+(i*7)-l, footer[m], 8, 10+16+128);
minitextshade(161-(Bstrlen(footer[m])<<1), 18+10+10+8+4+(m*7)+(i*7)-l, footer[m], 127, 4, 10+16+128);
minitext(160-(Bstrlen(footer[m])<<1), 17+10+10+8+4+(m*7)+(i*7)-l, footer[m], 8, 10+16+128);
}
} }
p = "Visit www.eduke32.com for news and updates"; p = "Visit www.eduke32.com for news and updates";
minitextshade(161-(Bstrlen(p)<<1), 139+10+10+10+10+4-l, p, 127, 4, 10+16+128); creditsminitext(160, 138+10+10+10+10+4-l, p, 8, 10+16+128);
minitext(160-(Bstrlen(p)<<1), 138+10+10+10+10+4-l, p, 8, 10+16+128);
break; break;
} }