if (gwin->get_mode() == Game_window::conversation) { gwin->set_mode(Game_window::normal); gwin->paint(); } delete this;
win->copy(sx, sy, w, h, dx, dy); gwin->set_painted(); gwin->show();  win->copy(dx, dy, w, h, sx, sy); if (++i < len) gwin->get_tqueue()->add(curtime + 100, this, udata); else delete this;
void Scheduled_usecode::handle_event	(	unsigned long curtime,		// Current time of day.	long udata			// ->usecode machine.	)	{	Usecode_machine *usecode = (Usecode_machine *) udata;	Game_window *gwin = usecode->gwin;	int delay = 200;			// Trying default delay.	int do_another = 1;			// Flag to keep going.	for ( ; i < cnt && do_another; i++)		{		do_another = 0;		Usecode_value& opval = arrval.get_elem(i);		int opcode = opval.get_int_value();		switch (opcode)			{		case 0x01:		// ??			break;		case 0x0b:		// ?? 2 parms, 1st one < 0.			i += 2;			break;		case 0x23:		// ??			break;		case 0x27:		// ?? 1 parm. Guessing:			{		//   delay before next instruction.			Usecode_value& delayval = arrval.get_elem(++i);					// ?? Guessing at time.			delay = 200*(delayval.get_int_value());			break;					}		case 0x2d:		// ?? Remove itemref?			usecode->remove_item(obj);			break;		case 0x46:		// ?? 1 parm. This IS a frame.			{		// Set frame?  Pretty sure.			Usecode_value& fval = arrval.get_elem(++i);			usecode->set_item_frame(objval, fval);			break;			}		case 0x50:		// ??			break;		case 0x52:		// Say string.			{			Usecode_value& strval = arrval.get_elem(++i);			usecode->item_say(objval, strval);			break;			}		case 0x55:		// Call?			{			Usecode_value& val = arrval.get_elem(++i);			usecode->call_usecode(val.get_int_value(), obj, 					Usecode_machine::internal_exec);			break;			}		case 0x58:		// ?? 1 parm, fairly large byte.			i++;		// Perhaps a soundfx or sprite??			break;		case 0x59:		// Parm. is dir. (0-7).  0=north?				// +++++++Walk in that dir.??			i++;			break;		default:					// ??Guessing these are frames:			if (opcode >= 0x60 && opcode <= 0x7f)				{	// Looks okay, so far.				Usecode_value v(opcode & 0xf);				usecode->set_item_frame(objval, v);				}			else				printf("Unhanded sched. opcode %02x\n",opcode);			break;			}		}	if (i < cnt)			// More to do?		{		gwin->get_tqueue()->add(curtime + delay, this, udata);		return;		}					// Don't get stuck in conv. mode.	if (gwin->get_mode() == Game_window::conversation)		{		gwin->set_mode(Game_window::normal);		gwin->paint();		}	delete this;			// Hope this is safe.	}