aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/helpbak.cpp
diff options
context:
space:
mode:
authoruruk2013-06-18 10:23:29 +0200
committeruruk2013-06-18 10:23:29 +0200
commit38bc20a0763f0f83ea3c0a94a68a1edea0d08514 (patch)
tree8d71d5d2dec96e83e2fcce7c5378e9f2da94130e /engines/avalanche/helpbak.cpp
parenta3025b8dad7abfe845c57aee3703451c223fc2e6 (diff)
downloadscummvm-rg350-38bc20a0763f0f83ea3c0a94a68a1edea0d08514.tar.gz
scummvm-rg350-38bc20a0763f0f83ea3c0a94a68a1edea0d08514.tar.bz2
scummvm-rg350-38bc20a0763f0f83ea3c0a94a68a1edea0d08514.zip
AVALANCHE: Use Artistic Style.
Diffstat (limited to 'engines/avalanche/helpbak.cpp')
-rw-r--r--engines/avalanche/helpbak.cpp273
1 files changed, 152 insertions, 121 deletions
diff --git a/engines/avalanche/helpbak.cpp b/engines/avalanche/helpbak.cpp
index b5513f3be6..3e60289a33 100644
--- a/engines/avalanche/helpbak.cpp
+++ b/engines/avalanche/helpbak.cpp
@@ -11,7 +11,7 @@
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
@@ -44,145 +44,176 @@
namespace Avalanche {
struct buttontype {
- char trigger;
- byte whither;
+ char trigger;
+ byte whither;
};
const integer buttonsize = 930;
-const integer toolbar = 0; const integer nim = 1; const integer kbd = 2; const integer credits = 3; const integer joystick = 4; const integer troubleshooting = 5; const integer story = 6;
-const integer mainscreen = 7; const integer registering = 8; const integer sound = 9; const integer mouse = 10; const integer filer = 11; const integer back2game = 12;
-const integer helponhelp = 13; const integer pgdn = 14; const integer pgup = 15;
-
-array<1,10,buttontype> buttons;
-
-void plot_button(integer y, byte which)
-{
- untyped_file f;
- pointer p;
-
- getmem(p,buttonsize);
- assign(f,"buttons.avd");
- reset(f,1);
- seek(f,which*buttonsize);
- blockread(f,p,buttonsize);
- putimage(470,y,p,0);
- close(f);
- freemem(p,buttonsize);
+const integer toolbar = 0;
+const integer nim = 1;
+const integer kbd = 2;
+const integer credits = 3;
+const integer joystick = 4;
+const integer troubleshooting = 5;
+const integer story = 6;
+const integer mainscreen = 7;
+const integer registering = 8;
+const integer sound = 9;
+const integer mouse = 10;
+const integer filer = 11;
+const integer back2game = 12;
+const integer helponhelp = 13;
+const integer pgdn = 14;
+const integer pgup = 15;
+
+array<1, 10, buttontype> buttons;
+
+void plot_button(integer y, byte which) {
+ untyped_file f;
+ pointer p;
+
+ getmem(p, buttonsize);
+ assign(f, "buttons.avd");
+ reset(f, 1);
+ seek(f, which * buttonsize);
+ blockread(f, p, buttonsize);
+ putimage(470, y, p, 0);
+ close(f);
+ freemem(p, buttonsize);
}
void getme(byte which);
-static void chalk(byte y, string z)
-{
- outtextxy(16,41+y*10,z);
+static void chalk(byte y, string z) {
+ outtextxy(16, 41 + y * 10, z);
}
-void getme(byte which) /* Help icons are 80x20 */
-{
- string x;
- text t;
- byte y,fv;
-
-
- str(which,x);
- assign(t,string('h')+x+".raw");
- y=0;
- reset(t);
-
- t >> x >> NL;
- setfillstyle(1,1); bar(0,0,640,200);
- setfillstyle(1,15); bar(8,40,450,200);
- settextjustify(1,1); setcolor(14);
- outtextxy(320,15,x);
- settextjustify(0,2);
- setcolor(3); settextstyle(0,0,2);
- outtextxy(550,0,"help!");
- /***/ setcolor(0); settextstyle(0,0,1);
-
- do {
- t >> x >> NL;
- if (x=='!') flush(); /* End of the help text is signalled with a !. */
- chalk(y,x);
- y += 1;
- } while (!false);
-
- /* We are now at the end of the text. Next we must read the icons. */
-
- y=0; settextjustify(1,1); setcolor(3);
- while (! eof(t))
- {
- y += 1;
- t >> x >> NL; /* Get the name of this button, and... */
- if (x!='-') /* (hyphen signals an empty button.) */
- {
- t >> buttons[y].trigger >> NL;
- t >> fv >> NL; plot_button(13+y*27,fv);
- t >> buttons[y].whither >> NL; /* this is the position to jump to */
-
- switch (buttons[y].trigger) {
- case 'þ' : outtextxy(580,25+y*27,"Esc"); break;
- case 'Ö' : outtextxy(580,25+y*27,"\30"); break;
- case 'Ø' : outtextxy(580,25+y*27,"\31"); break;
- default:
- outtextxy(580,25+y*27,buttons[y].trigger);
- }
-
- } else buttons[y].trigger='\0';
- }
-
- settextjustify(0,2);
- close(t);
+void getme(byte which) { /* Help icons are 80x20 */
+ string x;
+ text t;
+ byte y, fv;
+
+
+ str(which, x);
+ assign(t, string('h') + x + ".raw");
+ y = 0;
+ reset(t);
+
+ t >> x >> NL;
+ setfillstyle(1, 1);
+ bar(0, 0, 640, 200);
+ setfillstyle(1, 15);
+ bar(8, 40, 450, 200);
+ settextjustify(1, 1);
+ setcolor(14);
+ outtextxy(320, 15, x);
+ settextjustify(0, 2);
+ setcolor(3);
+ settextstyle(0, 0, 2);
+ outtextxy(550, 0, "help!");
+ /***/ setcolor(0);
+ settextstyle(0, 0, 1);
+
+ do {
+ t >> x >> NL;
+ if (x == '!') flush(); /* End of the help text is signalled with a !. */
+ chalk(y, x);
+ y += 1;
+ } while (!false);
+
+ /* We are now at the end of the text. Next we must read the icons. */
+
+ y = 0;
+ settextjustify(1, 1);
+ setcolor(3);
+ while (! eof(t)) {
+ y += 1;
+ t >> x >> NL; /* Get the name of this button, and... */
+ if (x != '-') { /* (hyphen signals an empty button.) */
+ t >> buttons[y].trigger >> NL;
+ t >> fv >> NL;
+ plot_button(13 + y * 27, fv);
+ t >> buttons[y].whither >> NL; /* this is the position to jump to */
+
+ switch (buttons[y].trigger) {
+ case 'þ' :
+ outtextxy(580, 25 + y * 27, "Esc");
+ break;
+ case 'Ö' :
+ outtextxy(580, 25 + y * 27, "\30");
+ break;
+ case 'Ø' :
+ outtextxy(580, 25 + y * 27, "\31");
+ break;
+ default:
+ outtextxy(580, 25 + y * 27, buttons[y].trigger);
+ }
+
+ } else buttons[y].trigger = '\0';
+ }
+
+ settextjustify(0, 2);
+ close(t);
}
-void continue_help()
-{
- char r;
- byte fv;
-
- do {
- r=upcase(readkey());
- switch (r) {
- case '\33' : return; break;
- case '\0' : switch (readkey()) {
- case '\110':case '\111': r='Ö'; break;
- case '\120':case '\121': r='Ø'; break;
- case '\73': r='H'; break; /* Help on help */
- }
- break;
- }
-
- for( fv=1; fv <= 10; fv ++)
- { buttontype& with = buttons[fv];
- if (with.trigger==r)
- {
- dusk;
- getme(with.whither);
- dawn;
- flush();
- }}
-
- } while (!false);
+void continue_help() {
+ char r;
+ byte fv;
+
+ do {
+ r = upcase(readkey());
+ switch (r) {
+ case '\33' :
+ return;
+ break;
+ case '\0' :
+ switch (readkey()) {
+ case '\110':
+ case '\111':
+ r = 'Ö';
+ break;
+ case '\120':
+ case '\121':
+ r = 'Ø';
+ break;
+ case '\73':
+ r = 'H';
+ break; /* Help on help */
+ }
+ break;
+ }
+
+ for (fv = 1; fv <= 10; fv ++) {
+ buttontype &with = buttons[fv];
+ if (with.trigger == r) {
+ dusk;
+ getme(with.whither);
+ dawn;
+ flush();
+ }
+ }
+
+ } while (!false);
}
-void boot_help()
-{
- setactivepage(2);
+void boot_help() {
+ setactivepage(2);
- getme(0);
+ getme(0);
- dusk;
- setvisualpage(2);
- dawn;
+ dusk;
+ setvisualpage(2);
+ dawn;
- continue_help();
+ continue_help();
- dusk;
- setvisualpage(cp);
- draw_also_lines;
- setactivepage(1-cp);
- dawn;
+ dusk;
+ setvisualpage(cp);
+ draw_also_lines;
+ setactivepage(1 - cp);
+ dawn;
}
} // End of namespace Avalanche. \ No newline at end of file