Exemplo n.º 1
0
int main (int argc,char ** argv)
{ SWF swf;
  RGBA rgb;
  SRECT r;
  SHAPE* s;
  MATRIX m;
  ActionTAG*a1,*a2,*a3;
  S32 width = 826, height = 1169;
  
  int f,i,ls1,fs1;
  int count;
  int t;

  memset(&swf,0x00,sizeof(SWF));        // set global movie parameters

  swf.fileVersion    = 4;               // make flash 4 compatible swf
  swf.frameRate      = 0x1900;          // about 0x19 frames per second
  
  swf.movieSize.xmax = 20*width;        // flash units: 1 pixel = 20 units
  swf.movieSize.ymax = 20*height;

  swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
  tag = swf.firstTag;
  rgb.r = 0xff;
  rgb.g = 0xff;
  rgb.b = 0xff;
  swf_SetRGB(tag,&rgb);

  tag = swf_InsertTag(tag,ST_DEFINESPRITE);
  swf_SetU16(tag, 1); //id
  swf_SetU16(tag, 0); //frames
  tag = swf_InsertTag(tag,ST_END);
  tag = swf_InsertTag(tag,ST_PLACEOBJECT2);
  swf_ObjectPlace(tag, 1, 1, 0, 0, "loader");
  
  tag = swf_InsertTag(tag,ST_SHOWFRAME);

    a1 = action_PushFloat(0, 12.0);
    a1 = action_PushString(a1, "");
    a1 = action_GetProperty(a1);
    a1 = action_PushFloat(a1, 2.0);
    a1 = action_Less(a1);
    a1 = action_If(a1, 2);
    a1 = action_GotoFrame(a1, 1);
    a1 = action_End(a1);

    a2 = action_Stop(0);
    a2 = action_End(a2);

  tag = swf_InsertTag(tag,ST_DOACTION);
  swf_ActionSet(tag, a1);
  
  tag = swf_InsertTag(tag,ST_SHOWFRAME);
  
  tag = swf_InsertTag(tag,ST_DOACTION);
  swf_ActionSet(tag, a2);
  
  tag = swf_InsertTag(tag,ST_REMOVEOBJECT2);
  swf_SetU16(tag, 1);

  tag = swf_InsertTag(tag,ST_DEFINESPRITE);
  swf_SetU16(tag, 2); //id
  swf_SetU16(tag, 0); //frames
  tag = swf_InsertTag(tag,ST_END);
  tag = swf_InsertTag(tag,ST_PLACEOBJECT2);
  swf_ObjectPlace(tag, 2, 2, 0, 0, "movie");
  
  tag = swf_InsertTag(tag,ST_SHOWFRAME);
  
  tag = swf_InsertTag(tag,ST_END);

  f = open("PreLoaderTemplate.swf",O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644);
  if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
  close(f);

  swf_FreeTags(&swf);                       // cleanup

  swf_ActionFree(a1);
  swf_ActionFree(a2);

  return 0;
}
Exemplo n.º 2
0
/**
 * \brief ESTE ES EL VERDADERO COMPUTE
 */
void SpecificWorker::actionExecution()
{
	QMutexLocker locker(mutex);
	qDebug() << "---------------------------------------------------";
	qDebug() <<__FUNCTION__ <<"Checking ACTION: " << QString::fromStdString(action);

	static std::string previousAction = "";
	bool newAction = (previousAction != action);

	if (newAction)
	{
		printf("prev:%s  new:%s\n", previousAction.c_str(), action.c_str());
		rDebug2(("action %s") % action.c_str() );
	}

	if (action == "changeroom")
	{
		action_ChangeRoom(newAction);
	}
	else if (action == "findobjectvisuallyintable")
	{
		action_FindObjectVisuallyInTable(newAction);
	}
	else if (boost::starts_with(action, "setobjectreach") or boost::starts_with(action, "graspobject"))
	{
		action_SetObjectReach(newAction);
	}
	else if (action == "detectperson")
	{
		action_DetectPerson(newAction);
	}
	else if (action == "handobject")
	{
//		action_HandObject(newAction);
	}
	else if (action == "setstop")
	{
		action_Stop();
	}
	else if (action == "reachpose")
	{
		action_ReachPose();
	}
	else if (action == "noAction")
	{

	}
	else if (action == "handobject_offer")
	{
		action_HandObject_Offer();
	}
	else if (action == "handobject_leave")
	{
		action_HandObject_leave();
	}
	if (newAction)
	{
		previousAction = action;
		printf("New action: %s\n", action.c_str());
	}
	// manageReachedPose();
// 	printf("actionExecution>>\n");
}