Beispiel #1
0
void tex::package(int c)
	{
	scal	d;
	scal	h;
	ptr	p;

	d = box_max_depth;
	unsave();
	save_ptr -= 3;
	if (mode == -HMODE) {
		cur_box = hpack(link(head), saved(2), saved(1));
	} else {
		cur_box = vpackage(link(head), saved(2), saved(1), d);
		if (c == VTOP_CODE) {
			h = 0;
			p = list_ptr(cur_box);
			if (p != null && type(p) <= RULE_NODE)
				h = box_height(p);
			box_depth(cur_box) += box_height(cur_box) - h;
			box_height(cur_box) = h;
		}
	}
	pop_nest();
	box_end(saved(0));
}
Beispiel #2
0
void tex::scan_box(int box_context)
	{
	get_nbrx_token();
	if (cur_cmd == MAKE_BOX) {
		begin_box(box_context);
	} else if (box_context >= LEADER_FLAG
		&& (cur_cmd == HRULE || cur_cmd == VRULE)) {
		cur_box = scan_rule_spec();
		box_end(box_context);
	} else {
		print_err("A <box> was supposed to be here");
		help_box();
		back_error();
	}
}
Beispiel #3
0
int NewQuestFile(int template_slot)
{
    memset(filepath,0,255);
    memset(temppath,0,255);
#ifdef ALLEGRO_MACOSX
    sprintf(filepath, "../../../");
    sprintf(temppath, "../");
#endif
    first_save=false;
    box_start(1, "Initializing Quest", lfont, pfont, false);
    box_out("Please wait.");
    box_eol();
    box_out("This may take a few moments.");
    box_eol();
    
    init_quest(QuestTemplates[template_slot].path);
    saved=true;
    box_end(false);
    refresh(rALL);
    return D_O_K;
}
Beispiel #4
0
void tex::begin_box(int box_context)
	{
	int	k, m, n;
	ptr	p=0, q;

	switch (cur_chr)
	{
	case BOX_CODE:
		scan_eight_bit_int();
		cur_box = box(cur_val);
		box(cur_val) = null;
		break;
	
	case COPY_CODE:
		scan_eight_bit_int();
		cur_box = copy_node_list(box(cur_val));
		break;
	
	case LAST_BOX_CODE:
		cur_box = null;
		if (abs(mode) == MMODE) {
			you_cant();
			help_lastbox_m();
			error();
		} else if (mode == VMODE && head == tail) {
			you_cant();
			help_lastbox_v();
			error();
		} else if (type(tail) == HLIST_NODE
			|| type(tail) == VLIST_NODE) {
			for (q = head; q != tail; q = link(p)) {
				p = q;
				if (type(q) == DISC_NODE) {
					m = 1;
					while (m <= replace_count(q)) {
						p = link(p);
						incr(m);
					}
					if (p == tail) {
						break;
					}
				}
			}
			cur_box = tail;
			shift_amount(cur_box) = 0;
			tail = p;
			link(p) = null;
		}
		break;

	case VSPLIT_CODE:
		scan_eight_bit_int();
		n = cur_val;
		if (!scan_keyword("to")) {
			print_err("Missing `to' inserted");
			help_vsplit();
			error();
		}
		scan_normal_dimen();
		cur_box = vsplit(n, cur_val);
		break;
	
	default:
		k = cur_chr - VTOP_CODE;
		saved(0) = box_context;
		if (k == HMODE) {
			if (box_context < BOX_FLAG && abs(mode) == VMODE) {
				scan_spec(ADJUSTED_HBOX_GROUP, TRUE);
			} else {
				scan_spec(HBOX_GROUP, TRUE);
			}
		} else {
			if (k == VMODE) {
				scan_spec(VBOX_GROUP, TRUE);
			} else {
				scan_spec(VTOP_GROUP, TRUE);
				k = VMODE;
			}
			normal_paragraph();
		}
		push_nest();
		mode = -k;
		if (k == VMODE) {
			prev_depth = IGNORE_DEPTH;
			if (every_vbox != null)
				begin_token_list(every_vbox, EVERY_VBOX_TEXT);
		} else {
			space_factor = 1000;
			if (every_hbox != null) 
				begin_token_list(every_hbox, EVERY_HBOX_TEXT);
		}
		return;
	}
	box_end(box_context);
}