コード例 #1
0
AnimatedSprite::AnimatedSprite(sf::Sprite initialFrame)
	:sf::Drawable(), sf::Transformable(),
	m_numFrames(0), m_frameLength(1.0f/24.0f), m_totalLength(0),
	m_loop(false), m_playing(false), m_resetOnPlay(false),
	m_timer(), m_pauseTimer(), m_totalTimePaused(), m_frameTimeOffset(),
	m_color(sf::Color::White), m_spriteBlendMode(sf::BlendMultiply)
{
	pushFrame(initialFrame);
	GotoFrame(0);
}
コード例 #2
0
void AnimatedSprite::Reset(void)
{
	
	m_timer.restart();
	m_pauseTimer.restart();
	m_resetOnPlay = false;
	m_playing = false;
	m_totalTimePaused = sf::seconds(0);
	m_frameTimeOffset = sf::seconds(0);
	GotoFrame(0);
}
コード例 #3
0
ファイル: lvrom.cpp プロジェクト: Domesday/BeebEm-AIV
void LVROM_Reset(void)
{
  FILE *lvcfg=NULL;
  int i, j;
  unsigned char hex_conv1, hex_conv2, hex_convR;

#ifdef USE_LVROM_LOG
  openLog(LVROM_LOG, LVROM_LOG_FN);
#endif

/***************** Sample LV.cfg file *****************************
communityS F:/laserDiscImages/communitySouth.ldi G:/commSthImg/ 55313D303636
communityN F:/laserDiscImages/communityNorth.ldi G:/commNthImg/ 55313D303637
nationalA  F:/laserDiscImages/nationalA.ldi      G:/natAImg/    55313D393836
nationalB  NotApplicable                         G:/natBImg/    55313D393837
 ******************************************************************/
  lvcfg = fopen("LV.cfg", "r");
  if (lvcfg != NULL)
  {
    for (i=0; i<LV_DISC_CNT; i++)
    {
      fscanf(lvcfg, " %s %s %s %s", lvDiscName[i], lvDiscLdiFile[i],
					lvDiscImgDir[i], lvDiscUsercode[i]);
    }
    
    currLvDisc=0;

    // Convert the Usercodes into the six byte string
    for (i=0; i<LV_DISC_CNT; i++)
    {
      for (j=0; j<6; j++)
      {
        hex_conv1 = lvDiscUsercode[i][j*2];
        hex_conv2 = lvDiscUsercode[i][j*2+1];

        if ((hex_conv1 >= '0') && (hex_conv1 <= '9'))
	{
	  hex_conv1 = hex_conv1 - '0';
	}
	else
	{
	  hex_conv1 = (hex_conv1 - 'A') + 10;
	}
        if ((hex_conv2 >= '0') && (hex_conv2 <= '9'))
	{
	  hex_conv2 = hex_conv2 - '0';
	}
	else
	{
	  hex_conv2 = (hex_conv2 - 'A') + 10;
	}
	hex_convR = (hex_conv1 << 4) + hex_conv2;
        lvDiscUsercode[i][j] = hex_convR;
      }
      lvDiscUsercode[i][6] = '\0';
      // MessageBox(GETHWND, lvDiscUsercode[i], "User code", MB_OK|MB_ICONERROR);
    }
  }
  else
  {
    MessageBox(GETHWND, "Could not load LV.cfg","BBC Emulator",
		MB_OK|MB_ICONERROR);
  }

  GotoFrame(1,0);
  MixMode=MIXMODE_LV;
//  MixMode=2;
//  MixMode=4;	// Start up with an even mix between Video and BBC

  StopReg=MAX_LV_FRAME_NUM;
  LVA=0;
  LVE=0;
//  CFrame=0;
//  VFrame=0;
}
コード例 #4
0
ファイル: lvrom.cpp プロジェクト: Domesday/BeebEm-AIV
void Do_FCode_Command(void)
{
  unsigned char FrameInstructionCode;
  int FIC_Ptr;
#ifdef USE_LVROM_LOG
  fprintf(LVROM_LOG,"%s\n",FCode_Buf);
  fflush(LVROM_LOG);
#endif

  /**************************
   * The FCodes listed in the documentation are: [DMS 02/12/2002]
   * !xy	- sound insert
   * #xy	- RC-5 command out via A/V Euroconnector
   * $0		- replay switch disable 
   * $1		- replay switch enable 
   * '		- Eject
   * )0		- Transmission delay off
   * )1		- Transmission delay on
   * *		- Halt (still mode)
   * *xxxxx+yy	- Repetitive halt and jump forward
   * *xxxxx-yy	- Repetitive halt and jump backward
   * +yy	- Instant jump forward yy tracks
   * ,0		- Standby (unload)
   * ,1		- On (load)
   * -yy	- Instant jump backward yy tracks
   * /		- Pause (halt + all muted)
   * :		- Reset to default values
   * ?F		- Picture number request
   * ?C		- Chapter number request
   * ?D		- Disc program status request
   * ?P		- Player status request
   * ?U		- User code request
   * ?=		- Revision level request
   * A0		- Audio 1-off
   * A1		- Audio 1-on
   * B0		- Audio 2-off
   * B1		- Audio 2-on
   * C0		- Chapter no display off
   * C1		- Chapter no display on
   * D0		- Picture no display off
   * D1		- Picture no display on
   * E0		- Video off
   * E1		- Video on
   * FxxxxxI	- Load picture number information register
   * FxxxxxS	- Load picture number stop register
   * FxxxxxR	- Load picture number then Still mode
   * FxxxxxN	- Load picture number then Normal play
   * FxxxxxQ	- Load picture number and continue previous play mode
   * H0		- Remote control not routed to computer
   * H1		- Remote control routed to computer
   * I0		- Local front-panel buttons disabled
   * I1		- Local front-panel buttons enabled
   * J0		- Remote control diabled
   * J1		- Remote control enabled
   * L		- Still forward
   * M		- Still reverse
   * N		- Normal play forward
   * Nxxxxx+yy	- Repetitive play forward and jump forward
   * Nxxxxx-yy	- Repetitive play forward and jump backward
   * O		- Play reverse
   * Oxxxxx+yy	- Play reverse and jump forward
   * Oxxxxx-yy	- Play reverse and jump forward jump backward
   * QxxR	- Goto chapter and halt
   * QxxN	- Goto chapter and play
   * QxxyyzzS	- Goto chapter and halt
   * SxxF	- Set fast speed value
   * SxxS	- Set slow speed value
   * TxxyyN	- Set fast speed value
   * TxxyyI	- Set slow speed value
   * U		- Slow motion forward
   * V		- Slow motion reverse
   * VPy	- Video overlay (VP1 is default)
   * VPX	- Request current VP mode
   * W		- Fast forward
   * X		- Clear
   * Z		- Fast reverse
   * [0		- Audio-1 from internal
   * [1		- Audio-1 from external
   * \0		- Video from internal
   * \1		- Video from external
   * ]0		- Audio-2 from internal
   * ]1		- Audio-2 from external
   * _0		- Teletext from disc off
   * _1		- Teletext from disc on
   ******************/

  FCode_Ptr=0;
  if (FCode_Buf[0]=='F')
  {
    // Frame code
    FIC_Ptr=FindFirstDigit(FCode_Buf);
    FrameInstructionCode=FCode_Buf[FIC_Ptr];
    FCode_Buf[FIC_Ptr]=0;
    if (FrameInstructionCode=='R')
    {
      FrameMode=V_STILL;
      GotoFrame(atoi(FCode_Buf+1),F_HALT);
      sprintf(FCode_Reply_Buf,"A0\r");
      LVAudioEnabled=0;
    }
    if (FrameInstructionCode=='S')
    {
      StopReg=atoi(FCode_Buf+1);
      sprintf(FCode_Reply_Buf,"\r");
    }
    if ((FrameInstructionCode=='I') || (FrameInstructionCode=='N') ||
    	(FrameInstructionCode=='Q'))
    {
//      MessageBox(GETHWND, FCode_Buf,"Unimplemented F-code",MB_OK|MB_ICONERROR);
    }
  }
  if ((FCode_Buf[0]=='N') && (FCode_Buf[1]<32))
  {
	  FrameMode=V_FORWARD1;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if ((FCode_Buf[0]=='A') || (FCode_Buf[0]=='B'))
  {
	  // Audio command - get state
	  LVA=FCode_Buf[1]-48;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if (FCode_Buf[0]=='E')
  {
	  // Video command - get state
	  LVE=FCode_Buf[1]-48;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if (strncmp(FCode_Buf,"?U",2)==0)
  {
    sprintf(FCode_Reply_Buf, "%s\r", lvDiscUsercode[currLvDisc]);
  }
  if (strncmp(FCode_Buf,"VP",2)==0)
  {
    unsigned char testchar;
    // Select Mix Modee
    testchar=FCode_Buf[2];
    if (testchar=='X')
    {
      // report it
      sprintf(FCode_Reply_Buf, "VP%c\n", 48+MixMode);
    }
    else
    {
      if ((testchar>='1') && (testchar<='5'))
      {
	MixMode=testchar-48;
	sprintf(FCode_Reply_Buf,"\r");
      }
    }
  }
  if (FCode_Buf[0]=='D')
  {
	  // Picture Number/Time Code Display Off/On
          lvPictureNumDisplay = FCode_Buf[1]-48;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if (strncmp(FCode_Buf,"?=",2)==0)
    sprintf(FCode_Reply_Buf,"=01718\r");

  if (FCode_Buf[0] == 'X')
  {
    StopReg=MAX_LV_FRAME_NUM;
    LVAudioEnabled=0;
    FrameMode=V_STILL;
  }
}
コード例 #5
0
ファイル: lwf_movieop.cpp プロジェクト: 435886030/lwf
Movie *Movie::GotoAndStop(int frameNo)
{
	GotoFrame(frameNo);
	Stop();
	return this;
}
コード例 #6
0
ファイル: lwf_movieop.cpp プロジェクト: 435886030/lwf
Movie *Movie::GotoAndStop(string label)
{
	GotoFrame(lwf->SearchFrame(this, lwf->GetStringId(label)));
	Stop();
	return this;
}
コード例 #7
0
ファイル: lwf_movieop.cpp プロジェクト: 435886030/lwf
Movie *Movie::GotoLabel(int stringId)
{
	GotoFrame(lwf->SearchFrame(this, stringId));
	return this;
}
コード例 #8
0
ファイル: lwf_movieop.cpp プロジェクト: 435886030/lwf
Movie *Movie::GotoAndPlay(int frameNo)
{
	GotoFrame(frameNo);
	Play();
	return this;
}