Beispiel #1
0
/*
===============
ParseScript
===============
*/
void ParseScript (void)
{
	while (1)
	{
		do
		{	// look for a line starting with a $ command
			GetToken (true);
			if (endofscript)
				return;
			if (token[0] == '$')
				break;				
			while (TokenAvailable())
				GetToken (false);
		} while (1);
	
		//
		// model commands
		//
		if (!strcmp (token, "$modelname"))
			Cmd_Modelname ();
		else if (!strcmp (token, "$base"))
			Cmd_Base ();
		else if (!strcmp (token, "$cd"))
			Cmd_Cd ();
		else if (!strcmp (token, "$origin"))
			Cmd_Origin ();
		else if (!strcmp (token, "$scale"))
			Cmd_ScaleUp ();
		else if (!strcmp (token, "$frame"))
			Cmd_Frame ();
		else if (!strcmp (token, "$skin"))
			Cmd_Skin ();
		else if (!strcmp (token, "$skinsize"))
			Cmd_Skinsize ();
		//
		// sprite commands
		//
		else if (!strcmp (token, "$spritename"))
			Cmd_SpriteName ();
		else if (!strcmp (token, "$load"))
			Cmd_Load ();
		else if (!strcmp (token, "$spriteframe"))
			Cmd_SpriteFrame ();
		//
		// image commands
		//
		else if (!strcmp (token, "$grab"))
			Cmd_Grab ();
		else if (!strcmp (token, "$raw"))
			Cmd_Raw ();
		else if (!strcmp (token, "$colormap"))
			Cmd_Colormap ();
		else if (!strcmp (token, "$mippal"))
			Cmd_Mippal ();
		else if (!strcmp (token, "$mipdir"))
			Cmd_Mipdir ();
		else if (!strcmp (token, "$mip"))
			Cmd_Mip ();
		else if (!strcmp (token, "$environment"))
			Cmd_Environment ();
		//
		// video
		//
		else if (!strcmp (token, "$video"))
			Cmd_Video ();
		//
		// misc
		//
		else if (!strcmp (token, "$file"))
			Cmd_File ();
		else if (!strcmp (token, "$dir"))
			Cmd_Dir ();
		else if (!strcmp (token, "$maps"))
			Cmd_Maps ();
		else if (!strcmp (token, "$alphalight"))
			Cmd_Alphalight ();
		else if (!strcmp (token, "$inverse16table" ))
			Cmd_Inverse16Table();
		else
			Error ("bad command %s\n", token);
	}
}
Beispiel #2
0
/*
===============
ParseScript
===============
*/
void ParseScript (void)
{
	while (1)
	{
		do
		{	// look for a line starting with a $ command
			GetScriptToken (true);
			if (endofscript)
				return;
			if (token[0] == '$')
				break;				
			while (ScriptTokenAvailable())
				GetScriptToken (false);
		} while (1);
		
		//
		// model commands
		//
		if (!strcmp (token, "$modelname"))
			MODELCMD_Modelname (MODEL_MD2);
		else if (!strcmp (token, "$cd"))
			MODELCMD_Cd (MODEL_MD2);
		else if (!strcmp (token, "$origin"))
			MODELCMD_Origin (MODEL_MD2);
		else if (!strcmp (token, "$cluster"))
			MODELCMD_Cluster (MODEL_MD2);
		else if (!strcmp (token, "$base"))
			MODELCMD_Base (MODEL_MD2);
		else if (!strcmp (token, "$scale"))
			MODELCMD_ScaleUp (MODEL_MD2);
		else if (!strcmp (token, "$frame"))
			MODELCMD_Frame (MODEL_MD2);
		else if (!strcmp (token, "$skin"))
			MODELCMD_Skin (MODEL_MD2);
		else if (!strcmp (token, "$skinsize"))
			MODELCMD_Skinsize (MODEL_MD2);
		//
		// flexible model commands
		//
		else if (!strcmp (token, "$fm_modelname"))
			MODELCMD_Modelname (MODEL_FM);
		else if (!strcmp (token, "$fm_base"))
			MODELCMD_Base (MODEL_FM);
		else if (!strcmp (token, "$fm_basest"))
			MODELCMD_BaseST (MODEL_FM);
		else if (!strcmp (token, "$fm_cd"))
			MODELCMD_Cd (MODEL_FM);
		else if (!strcmp (token, "$fm_origin"))
			MODELCMD_Origin (MODEL_FM);
		else if (!strcmp (token, "$fm_cluster"))
			MODELCMD_Cluster (MODEL_FM);
		else if (!strcmp (token, "$fm_skeleton"))
			MODELCMD_Skeleton (MODEL_FM);
		else if (!strcmp (token, "$fm_scale"))
			MODELCMD_ScaleUp (MODEL_FM);
		else if (!strcmp (token, "$fm_frame"))
			MODELCMD_Frame (MODEL_FM);
		else if (!strcmp (token, "$fm_skeletal_frame"))	// left in for compadibility with qdt already using fm_skeletal_frame
			MODELCMD_Frame (MODEL_FM);
		else if (!strcmp (token, "$fm_skin"))
			MODELCMD_Skin (MODEL_FM);
		else if (!strcmp (token, "$fm_skinsize"))
			MODELCMD_Skinsize (MODEL_FM);
		else if (!strcmp (token, "$fm_begin_group"))
			MODELCMD_BeginGroup(MODEL_FM);
		else if (!strcmp (token, "$fm_end_group"))
			MODELCMD_EndGroup(MODEL_FM);
		else if (!strcmp (token, "$fm_referenced"))
			MODELCMD_Referenced(MODEL_FM);
		else if (!strcmp (token, "$fm_node_order"))
			MODELCMD_NodeOrder(MODEL_FM);
		
		//
		// sprite commands
		//
		else if (!strcmp (token, "$spritename"))
			Cmd_SpriteName ();
		else if (!strcmp (token, "$sprdir"))
			Cmd_Sprdir ();
		else if (!strcmp (token, "$load"))
			Cmd_Load ();
		else if (!strcmp (token, "$spriteframe"))
			Cmd_SpriteFrame ();
		//
		// image commands
		//
		else if (!strcmpi (token, "$grab"))
			Cmd_Grab ();
		else if (!strcmpi (token, "$raw"))
			Cmd_Raw ();
		else if (!strcmpi (token, "$colormap"))
			Cmd_Colormap ();
		else if (!strcmpi (token, "$mippal"))
			Cmd_Mippal ();
		else if (!strcmpi (token, "$mipdir"))
			Cmd_Mipdir ();
		else if (!strcmpi (token, "$mip"))
			Cmd_Mip ();
		else if (!strcmp (token, "$environment"))
			Cmd_Environment ();
		//
		// pics
		//
		else if (!strcmp (token, "$picdir"))
			Cmd_Picdir ();
		else if (!strcmp (token, "$pic"))
			Cmd_Pic ();
		//
		// book
		//
		else if (!strcmp (token, "$bookdir"))
			Cmd_Bookdir ();
		else if (!strcmp (token, "$book"))
			Cmd_Book ();
		//
		// tmix
		//
		else if (!strcmp (token, "$texturemix"))
			Cmd_TextureMix ();
		//
		// video
		//
		else if (!strcmp (token, "$video"))
			Cmd_Video ();
		//
		// misc
		//
		else if (!strcmp (token, "$file"))
			Cmd_File ();
		else if (!strcmp (token, "$dir"))
			Cmd_Dir ();
		else if (!strcmp (token, "$maps"))
			Cmd_Maps ();
		else if (!strcmp (token, "$alphalight"))
			Cmd_Alphalight ();
		else if (!strcmp (token, "$inverse16table" ))
			Cmd_Inverse16Table();
		else
			Error ("bad command %s\n", token);
	}
}