Skip to content
Snippets Groups Projects
Commit aee5eabc authored by deuce's avatar deuce
Browse files

Use ANSIs from the game rather than PIX files for source generation.

Provides a number of advantages:
1) They're smaller.
2) They go into the scrollback buffer.
3) They are guaranteed to match the 1.20 menus
parent 7ee417bf
No related branches found
No related tags found
No related merge requests found
...@@ -149,78 +149,63 @@ static char armors[13][20]= ...@@ -149,78 +149,63 @@ static char armors[13][20]=
static void readInPix(char codeCh) { static void readInPix(char codeCh) {
int promptY;
int fptr; int fptr;
cterm_clearscreen(0);
cterm.xpos=1;
cterm.ypos=1;
switch ((char)codeCh) { switch ((char)codeCh) {
// complex pictures // complex pictures
case 'A': case 'A':
fptr=0; fptr=0; /* Main = 0 */
promptY=19;
break; break;
case 'B': case 'B':
fptr=1; fptr=1; /* Barracks = 1 */
promptY=22;
break; break;
case 'C': case 'C':
fptr=2; fptr=3; /* Head-quarters = 3 */
promptY=20;
break; break;
case 'D': case 'D':
fptr=3; fptr=2; /* Communications = 2 */
promptY=19;
break; break;
case 'E': case 'E':
fptr=4; fptr=4; /* Wastelands = 4 */
promptY=19;
break; break;
// base pictures // base pictures
case 'F': case 'F':
fptr=0; fptr=0; /* Main menu = 0 */
promptY=21;
break; break;
case 'G': case 'G':
fptr=1; fptr=1; /* Barracks = 1 */
promptY=21;
break; break;
case 'H': case 'H':
fptr=2; fptr=3; /* Storage = 3 */
promptY=18;
break; break;
case 'I': case 'I':
fptr=3; fptr=5; /* Tech Centre = 5 */
promptY=21;
break; break;
case 'J': case 'J':
fptr=4; fptr=2; /* Control Room = 2 */
promptY=18;
break; break;
case 'K': case 'K':
fptr=5; fptr=4; /* Radio Room = 4 */
promptY=20;
break; break;
// logon pictures // logon pictures
case '0': case '0':
fptr=xp_random(10); fptr=xp_random(10);
promptY=22;
break; break;
} }
cterm_clearscreen(0); if (codeCh>='A' && codeCh<='E')
if (codeCh>='A' && codeCh<='E') { cterm_write(ooii_cmenus[fptr], strlen(ooii_cmenus[fptr])-1, NULL, 0, NULL);
puttext(1, 1, 80, 24, (unsigned char *)ooii_cmenus+(fptr*4000)); else if (codeCh>='F' && codeCh<='K')
} cterm_write(ooii_bmenus[fptr], strlen(ooii_bmenus[fptr])-1, NULL, 0, NULL);
else if (codeCh>='F' && codeCh<='K') { else if (codeCh=='0')
puttext(1, 1, 80, 24, (unsigned char *)ooii_bmenus+(fptr*4000)); cterm_write(ooii_logon[fptr], strlen(ooii_logon[fptr])-1, NULL, 0, NULL);
}
else if (codeCh=='0') {
puttext(1, 1, 80, 24, (unsigned char *)ooii_logons+(fptr*4000));
}
cterm.xpos=1;
cterm.ypos=promptY+1;
/* We don't overwrite the status line, so we don't need to redraw it */ /* We don't overwrite the status line, so we don't need to redraw it */
/* statusLine(); */ /* statusLine(); */
......
This diff is collapsed.
#ifndef _BMENUS_H_ #ifndef _BMENUS_H_
#define _BMENUS_H_ #define _BMENUS_H_
extern const unsigned char ooii_bmenus[24000]; extern const unsigned char *ooii_bmenus[6];
#endif #endif
This diff is collapsed.
#ifndef _CMENUS_H_ #ifndef _CMENUS_H_
#define _CMENUS_H_ #define _CMENUS_H_
extern const unsigned char ooii_cmenus[20000]; extern const unsigned char *ooii_cmenus[5];
#endif #endif
This diff is collapsed.
#ifndef _LOGONS_H_ #ifndef _LOGON_H_
#define _LOGONS_H_ #define _LOGON_H_
extern const unsigned char ooii_logons[40000]; extern const unsigned char *ooii_logon[10];
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment