summaryrefslogtreecommitdiff
path: root/src/z-term.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-03-03 20:59:35 +0100
committerBardur Arantsson <bardur@scientician.net>2012-03-29 20:57:25 +0200
commitc033064404865fd1cccad23e36ce195fca92c64d (patch)
treeb65994d89f9cb022b6b437f85763718296b791d4 /src/z-term.c
parent1eaf454bd4f6c1f36391552cc1fc7188f9901f7e (diff)
Refactor: EGO_GRAPHICS compile-time flag always set
Diffstat (limited to 'src/z-term.c')
-rw-r--r--src/z-term.c168
1 files changed, 0 insertions, 168 deletions
diff --git a/src/z-term.c b/src/z-term.c
index 25a25f01..ef4dfeaa 100644
--- a/src/z-term.c
+++ b/src/z-term.c
@@ -310,8 +310,6 @@ static errr term_win_nuke(term_win *s, int w, int h)
C_KILL(s->vta, h * w, byte);
C_KILL(s->vtc, h * w, char);
-#ifdef USE_EGO_GRAPHICS
-
/* Free the ego graphics access arrays */
C_KILL(s->ea, h, byte*);
C_KILL(s->ec, h, char*);
@@ -320,8 +318,6 @@ static errr term_win_nuke(term_win *s, int w, int h)
C_KILL(s->vea, h * w, byte);
C_KILL(s->vec, h * w, char);
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* Success */
@@ -354,8 +350,6 @@ static errr term_win_init(term_win *s, int w, int h)
C_MAKE(s->vta, h * w, byte);
C_MAKE(s->vtc, h * w, char);
-#ifdef USE_EGO_GRAPHICS
-
/* Make the ego graphics access arrays */
C_MAKE(s->ea, h, byte*);
C_MAKE(s->ec, h, char*);
@@ -364,8 +358,6 @@ static errr term_win_init(term_win *s, int w, int h)
C_MAKE(s->vea, h * w, byte);
C_MAKE(s->vec, h * w, char);
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
@@ -380,13 +372,9 @@ static errr term_win_init(term_win *s, int w, int h)
s->ta[y] = s->vta + w * y;
s->tc[y] = s->vtc + w * y;
-#ifdef USE_EGO_GRAPHICS
-
s->ea[y] = s->vea + w * y;
s->ec[y] = s->vec + w * y;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
}
@@ -420,16 +408,12 @@ static errr term_win_copy(term_win *s, term_win *f, int w, int h)
byte *s_taa = s->ta[y];
char *s_tcc = s->tc[y];
-#ifdef USE_EGO_GRAPHICS
-
byte *f_eaa = f->ea[y];
char *f_ecc = f->ec[y];
byte *s_eaa = s->ea[y];
char *s_ecc = s->ec[y];
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
for (x = 0; x < w; x++)
@@ -441,10 +425,8 @@ static errr term_win_copy(term_win *s, term_win *f, int w, int h)
*s_taa++ = *f_taa++;
*s_tcc++ = *f_tcc++;
-#ifdef USE_EGO_GRAPHICS
*s_eaa++ = *f_eaa++;
*s_ecc++ = *f_ecc++;
-#endif /* USE_EGO_GRAPHICS */
#endif /* USE_TRANSPARENCY */
}
@@ -539,22 +521,14 @@ static errr Term_text_hack(int x, int y, int n, byte a, const char *cp)
* Hack -- fake hook for "Term_pict()" (see above)
*/
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
static errr Term_pict_hack(int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp, const byte *eap, const char *ecp)
-#else /* USE_EGO_GRAPHICS */
-static errr Term_pict_hack(int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp)
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
static errr Term_pict_hack(int x, int y, int n, const byte *ap, const char *cp)
#endif /* USE_TRANSPARENCY */
{
/* Compiler silliness */
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
if (x || y || n || ap || cp || tap || tcp || eap || ecp) return ( -2);
-#else /* USE_EGO_GRAPHICS */
-if (x || y || n || ap || cp || tap || tcp) return ( -2);
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
if (x || y || n || ap || cp) return ( -2);
#endif /* USE_TRANSPARENCY */
@@ -574,11 +548,7 @@ if (x || y || n || ap || cp || tap || tcp) return ( -2);
* Assumes given location and values are valid.
*/
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
void Term_queue_char(int x, int y, byte a, char c, byte ta, char tc, byte ea, char ec)
-#else /* USE_EGO_GRAPHICS */
-void Term_queue_char(int x, int y, byte a, char c, byte ta, char tc)
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
void Term_queue_char(int x, int y, byte a, char c)
#endif /* USE_TRANSPARENCY */
@@ -593,8 +563,6 @@ void Term_queue_char(int x, int y, byte a, char c)
byte *scr_taa = &scrn->ta[y][x];
char *scr_tcc = &scrn->tc[y][x];
-#ifdef USE_EGO_GRAPHICS
-
byte *scr_eaa = &scrn->ea[y][x];
char *scr_ecc = &scrn->ec[y][x];
@@ -603,14 +571,6 @@ void Term_queue_char(int x, int y, byte a, char c)
(*scr_taa == ta) && (*scr_tcc == tc) &&
(*scr_eaa == ea) && (*scr_ecc == ec)) return;
-#else /* USE_EGO_GRAPHICS */
-
- /* Hack -- Ignore non-changes */
- if ((*scr_aa == a) && (*scr_cc == c) &&
- (*scr_taa == ta) && (*scr_tcc == tc)) return;
-
-#endif /* USE_EGO_GRAPHICS */
-
#else /* USE_TRANSPARENCY */
/* Hack -- Ignore non-changes */
@@ -627,13 +587,9 @@ void Term_queue_char(int x, int y, byte a, char c)
*scr_taa = ta;
*scr_tcc = tc;
-#ifdef USE_EGO_GRAPHICS
-
*scr_eaa = ea;
*scr_ecc = ec;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* Check for new min/max row info */
@@ -655,11 +611,7 @@ void Term_queue_char(int x, int y, byte a, char c)
* It is used to update the map in the game.
*/
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
void Term_queue_line(int x, int y, int n, byte *a, char *c, byte *ta, char *tc, byte *ea, char *ec)
-#else /* USE_EGO_GRAPHICS */
-void Term_queue_line(int x, int y, int n, byte *a, char *c, byte *ta, char *tc)
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
void Term_queue_line(int x, int y, int n, byte *a, char *c)
#endif /* USE_TRANSPARENCY */
@@ -677,13 +629,9 @@ void Term_queue_line(int x, int y, int n, byte *a, char *c)
byte *scr_taa = &scrn->ta[y][x];
char *scr_tcc = &scrn->tc[y][x];
-#ifdef USE_EGO_GRAPHICS
-
byte *scr_eaa = &scrn->ea[y][x];
char *scr_ecc = &scrn->ec[y][x];
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
while (n--)
@@ -691,34 +639,24 @@ void Term_queue_line(int x, int y, int n, byte *a, char *c)
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
/* Hack -- Ignore non-changes */
if ((*scr_aa == *a) && (*scr_cc == *c) &&
(*scr_taa == *ta) && (*scr_tcc == *tc) &&
(*scr_eaa == *ea) && (*scr_ecc == *ec))
-#else /* USE_EGO_GRAPHICS */
- /* Hack -- Ignore non-changes */
- if ((*scr_aa == *a) && (*scr_cc == *c) &&
- (*scr_taa == *ta) && (*scr_tcc == *tc))
-#endif /* USE_EGO_GRAPHICS */
{
x++;
a++;
c++;
ta++;
tc++;
-#ifdef USE_EGO_GRAPHICS
ea++;
ec++;
-#endif /* USE_EGO_GRAPHICS */
scr_aa++;
scr_cc++;
scr_taa++;
scr_tcc++;
-#ifdef USE_EGO_GRAPHICS
scr_eaa++;
scr_ecc++;
-#endif /* USE_EGO_GRAPHICS */
continue;
}
@@ -726,11 +664,9 @@ void Term_queue_line(int x, int y, int n, byte *a, char *c)
*scr_taa++ = *ta++;
*scr_tcc++ = *tc++;
-#ifdef USE_EGO_GRAPHICS
/* Save the "literal" information */
*scr_eaa++ = *ea++;
*scr_ecc++ = *ec++;
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
@@ -795,12 +731,9 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s)
byte *scr_taa = Term->scr->ta[y];
char *scr_tcc = Term->scr->tc[y];
-#ifdef USE_EGO_GRAPHICS
-
byte *scr_eaa = Term->scr->ea[y];
char *scr_ecc = Term->scr->ec[y];
-#endif /* USE_EGO_GRAPHICS */
#endif /* USE_TRANSPARENCY */
/* Queue the attr/chars */
@@ -814,8 +747,6 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s)
int ota = scr_taa[x];
int otc = scr_tcc[x];
-#ifdef USE_EGO_GRAPHICS
-
int oea = scr_eaa[x];
int oec = scr_ecc[x];
@@ -824,13 +755,6 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s)
(ota == 0) && (otc == 0) &&
(oea == 0) && (oec == 0)) continue;
-#else /* USE_EGO_GRAPHICS */
-
- /* Hack -- Ignore non-changes */
- if ((oa == a) && (oc == *s) && (ota == 0) && (otc == 0)) continue;
-
-#endif /* USE_EGO_GRAPHICS */
-
#else /* USE_TRANSPARENCY */
/* Hack -- Ignore non-changes */
@@ -847,13 +771,9 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s)
scr_taa[x] = 0;
scr_tcc[x] = 0;
-#ifdef USE_EGO_GRAPHICS
-
scr_taa[x] = 0;
scr_tcc[x] = 0;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* Note the "range" of window updates */
@@ -908,8 +828,6 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
byte nta;
char ntc;
-#ifdef USE_EGO_GRAPHICS
-
byte *old_eaa = Term->old->ea[y];
char *old_ecc = Term->old->ec[y];
@@ -922,8 +840,6 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
byte nea;
char nec;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
@@ -958,8 +874,6 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
nta = scr_taa[x];
ntc = scr_tcc[x];
-#ifdef USE_EGO_GRAPHICS
-
oea = old_eaa[x];
oec = old_ecc[x];
@@ -971,13 +885,6 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
(nta == ota) && (ntc == otc) &&
(nea == oea) && (nec == oec))
-#else /* USE_EGO_GRAPHICS */
-
- /* Handle unchanged grids */
- if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc))
-
-#endif /* USE_EGO_GRAPHICS */
-
#else /* USE_TRANSPARENCY */
/* Handle unchanged grids */
@@ -990,15 +897,10 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
{
/* Draw pending attr/char pairs */
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
(void)((*Term->pict_hook)(fx, y, fn,
&scr_aa[fx], &scr_cc[fx],
&scr_taa[fx], &scr_tcc[fx],
&scr_eaa[fx], &scr_ecc[fx]));
-#else /* USE_EGO_GRAPHICS */
- (void)((*Term->pict_hook)(fx, y, fn,
- &scr_aa[fx], &scr_cc[fx], &scr_taa[fx], &scr_tcc[fx]));
-#endif
#else /* USE_TRANSPARENCY */
(void)((*Term->pict_hook)(fx, y, fn, &scr_aa[fx], &scr_cc[fx]));
#endif /* USE_TRANSPARENCY */
@@ -1018,11 +920,8 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
old_taa[x] = nta;
old_tcc[x] = ntc;
-#ifdef USE_EGO_GRAPHICS
old_eaa[x] = nea;
old_ecc[x] = nec;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* Restart and Advance */
@@ -1034,15 +933,10 @@ static void Term_fresh_row_pict(int y, int x1, int x2)
{
/* Draw pending attr/char pairs */
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
(void)((*Term->pict_hook)(fx, y, fn,
&scr_aa[fx], &scr_cc[fx],
&scr_taa[fx], &scr_tcc[fx],
&scr_eaa[fx], &scr_ecc[fx]));
-#else /* USE_EGO_GRAPHICS */
- (void)((*Term->pict_hook)(fx, y, fn,
- &scr_aa[fx], &scr_cc[fx], &scr_taa[fx], &scr_tcc[fx]));
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
(void)((*Term->pict_hook)(fx, y, fn, &scr_aa[fx], &scr_cc[fx]));
#endif /* USE_TRANSPARENCY */
@@ -1078,7 +972,6 @@ static void Term_fresh_row_both(int y, int x1, int x2)
byte nta;
char ntc;
-#ifdef USE_EGO_GRAPHICS
byte *old_eaa = Term->old->ea[y];
char *old_ecc = Term->old->ec[y];
byte *scr_eaa = Term->scr->ea[y];
@@ -1088,8 +981,6 @@ static void Term_fresh_row_both(int y, int x1, int x2)
char oec;
byte nea;
char nec;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* The "always_text" flag */
@@ -1129,7 +1020,6 @@ static void Term_fresh_row_both(int y, int x1, int x2)
nta = scr_taa[x];
ntc = scr_tcc[x];
-#ifdef USE_EGO_GRAPHICS
oea = old_eaa[x];
oec = old_ecc[x];
@@ -1141,13 +1031,6 @@ static void Term_fresh_row_both(int y, int x1, int x2)
(nta == ota) && (ntc == otc) &&
(nea == oea) && (nec == oec))
-#else /* USE_EGO_GRAPHICS */
-
-/* Handle unchanged grids */
- if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc))
-
-#endif /* USE_EGO_GRAPHICS */
-
#else /* USE_TRANSPARENCY */
/* Handle unchanged grids */
@@ -1186,13 +1069,9 @@ static void Term_fresh_row_both(int y, int x1, int x2)
old_taa[x] = nta;
old_tcc[x] = ntc;
-#ifdef USE_EGO_GRAPHICS
-
old_eaa[x] = nea;
old_ecc[x] = nec;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* 2nd byte of bigtile */
@@ -1220,18 +1099,9 @@ static void Term_fresh_row_both(int y, int x1, int x2)
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
-
/* Hack -- Draw the special attr/char pair */
(void)((*Term->pict_hook)(x, y, 1, &na, &nc, &nta, &ntc, &nea, &nec));
-#else /* USE_EGO_GRAPHICS */
-
-/* Hack -- Draw the special attr/char pair */
- (void)((*Term->pict_hook)(x, y, 1, &na, &nc, &nta, &ntc));
-
-#endif /* USE_EGO_GRAPHICS */
-
#else /* USE_TRANSPARENCY */
/* Hack -- Draw the special attr/char pair */
@@ -1596,13 +1466,9 @@ errr Term_fresh(void)
byte *taa = old->ta[y];
char *tcc = old->tc[y];
-#ifdef USE_EGO_GRAPHICS
-
byte *eaa = old->ea[y];
char *ecc = old->ec[y];
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
@@ -1618,13 +1484,9 @@ errr Term_fresh(void)
*taa++ = na;
*tcc++ = nc;
-#ifdef USE_EGO_GRAPHICS
-
*eaa++ = na;
*ecc++ = nc;
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
}
@@ -1669,27 +1531,19 @@ errr Term_fresh(void)
byte ota = old_taa[tx];
char otc = old_tcc[tx];
-#ifdef USE_EGO_GRAPHICS
-
byte *old_eaa = old->ea[ty];
char *old_ecc = old->ec[ty];
byte oea = old_eaa[tx];
char oec = old_ecc[tx];
-#endif /* USE_EGO_GRAPHICS */
-
#endif /* USE_TRANSPARENCY */
/* Hack -- use "Term_pict()" always */
if (Term->always_pict)
{
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
(void)((*Term->pict_hook)(tx, ty, 1, &oa, &oc, &ota, &otc, &oea, &oec));
-#else /* USE_EGO_GRAPHICS */
- (void)((*Term->pict_hook)(tx, ty, 1, &oa, &oc, &ota, &otc));
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
(void)((*Term->pict_hook)(tx, ty, 1, &oa, &oc));
#endif /* USE_TRANSPARENCY */
@@ -1699,11 +1553,7 @@ errr Term_fresh(void)
else if (Term->higher_pict && (oa & 0x80))
{
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
(void)((*Term->pict_hook)(tx, ty, 1, &oa, &oc, &ota, &otc, &oea, &oec));
-#else /* USE_EGO_GRAPHICS */
-(void)((*Term->pict_hook)(tx, ty, 1, &oa, &oc, &ota, &otc));
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
(void)((*Term->pict_hook)(tx, ty, 1, &oa, &oc));
#endif /* USE_TRANSPARENCY */
@@ -1933,11 +1783,7 @@ errr Term_draw(int x, int y, byte a, char c)
/* Queue it for later */
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
Term_queue_char(x, y, a, c, 0, 0, 0, 0);
-#else /* USE_EGO_GRAPHICS */
-Term_queue_char(x, y, a, c, 0, 0);
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
Term_queue_char(x, y, a, c);
#endif /* USE_TRANSPARENCY */
@@ -1975,11 +1821,7 @@ errr Term_addch(byte a, char c)
/* Queue the given character for display */
#ifdef USE_TRANSPARENCY
-#ifdef USE_EGO_GRAPHICS
Term_queue_char(Term->scr->cx, Term->scr->cy, a, c, 0, 0, 0, 0);
-#else /* USE_EGO_GRAPHICS */
- Term_queue_char(Term->scr->cx, Term->scr->cy, a, c, 0, 0);
-#endif /* USE_EGO_GRAPHICS */
#else /* USE_TRANSPARENCY */
Term_queue_char(Term->scr->cx, Term->scr->cy, a, c);
#endif /* USE_TRANSPARENCY */
@@ -2111,10 +1953,8 @@ errr Term_erase(int x, int y, int n)
byte *scr_taa;
char *scr_tcc;
-#ifdef USE_EGO_GRAPHICS
byte *scr_eaa;
char *scr_ecc;
-#endif /* USE_EGO_GRAPHICS */
#endif /* USE_TRANSPARENCY */
/* Place cursor */
@@ -2131,10 +1971,8 @@ errr Term_erase(int x, int y, int n)
scr_taa = Term->scr->ta[y];
scr_tcc = Term->scr->tc[y];
-#ifdef USE_EGO_GRAPHICS
scr_eaa = Term->scr->ea[y];
scr_ecc = Term->scr->ec[y];
-#endif
#endif /* USE_TRANSPARENCY */
if (n > 0 && (byte)scr_cc[x] == 255 && scr_aa[x] == 255)
@@ -2160,10 +1998,8 @@ errr Term_erase(int x, int y, int n)
scr_taa[x] = 0;
scr_tcc[x] = 0;
-#ifdef USE_EGO_GRAPHICS
scr_eaa[x] = 0;
scr_ecc[x] = 0;
-#endif /* USE_EGO_GRAPHICS */
#endif /* USE_TRANSPARENCY */
/* Track minimum changed column */
@@ -2221,10 +2057,8 @@ errr Term_clear(void)
byte *scr_taa = Term->scr->ta[y];
char *scr_tcc = Term->scr->tc[y];
-#ifdef USE_EGO_GRAPHICS
byte *scr_eaa = Term->scr->ea[y];
char *scr_ecc = Term->scr->ec[y];
-#endif /* USE_EGO_GRAPHICS */
#endif /* USE_TRANSPARENCY */
/* Wipe each column */
@@ -2237,10 +2071,8 @@ errr Term_clear(void)
scr_taa[x] = 0;
scr_tcc[x] = 0;
-#ifdef USE_EGO_GRAPHICS
scr_eaa[x] = 0;
scr_ecc[x] = 0;
-#endif /* USE_EGO_GRAPHICS */
#endif /* USE_TRANSPARENCY */
}