当前位置: 首页>>代码示例>>C++>>正文


C++ Animation::PutRegular18bit方法代码示例

本文整理汇总了C++中Animation::PutRegular18bit方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::PutRegular18bit方法的具体用法?C++ Animation::PutRegular18bit怎么用?C++ Animation::PutRegular18bit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Animation的用法示例。


在下文中一共展示了Animation::PutRegular18bit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main (int argc, char * argv[]) {

	int x = 0, y = 0, xinc = 1, yinc = 1;
   int rf = LOWLIMIT, gf= LOWLIMIT, bf = LOWLIMIT, rfinc = 1, gfinc= 1, bfinc =1,
		rs = .5, gs = .5, bs = .5, rsinc = .1, gsinc = .1, bsinc = .1;

	if ( argc < 1 ) {
		cout << "Not Enough Arguments\n";
		return 1;
	}

	TheKeyBoard->Install (); //install the keyboard driver

	//clip is set by default to 0,0 - 319, 199
	//ScreenClip->Set (50,50, 319-50,199-50);

	TheScreen->SetMode13h(); //set mode13h (don't forget)
	ScreenPal->Load("vbmview.vpl", "vbmview.pal");
	ScreenPal->PutToScreen();
	VirtualBuffer * MyBuffer = new VirtualBuffer;


	//Bitmap * MyBitmap = new Bitmap; //make a new bitmap
	//int retval = MyBitmap->Load(argv[1]); //load a sample bitmap
	char * myfiles [] = {
		"back.vbm",
		"ball.vbm",
		"ball3.vbm",
		"nowman1.vbm",
		"nba1.vbm"
	};

	int mydurs [] = {
		15,35,15,50,15
	};

	Animation * MyAnim = new Animation;
	MyAnim->AddAll(5, myfiles, mydurs);
	AnimationRef * Anim1 = new AnimationRef;
	Anim1->AssignAnimation(MyAnim);
	AnimationRef * Anim2 = new AnimationRef;
	Anim2->AssignAnimation(MyAnim);



	//if ( retval == 0) //do we NOT have an error?
	//{
		ScreenPal->PrepareFadeIn();

		MyBuffer->Clear();
		//MyBitmap->PutRegularFaded (x, y, MyBuffer->Memory, rf, gf, bf);
		MyAnim->PutRegular18bit (x, y, MyBuffer->Memory);

		MyBuffer->CopyToScreen();

		ScreenPal->FadeIn(1500);


		do {
			x +=xinc;
			y+=yinc;

			rf += rfinc;
			gf += gfinc;
			bf += bfinc;
			rs += rsinc;
			gs += gsinc;
			bs += bsinc;

			if (rs < 0)
				 rs = 0; rsinc = -rsinc;
			if (rs > 1)
				 rs = 1; rsinc = -rsinc;

			if (gs < 0)
				 gs = 0; gsinc = -gsinc;
			if (gs > 1)
				 gs = 1; gsinc = -gsinc;


			if (bs < 0)
				 bs = 0; bsinc = -bsinc;
			if (bs > 1)
				 bs = 1; bsinc = -bsinc;



			if ( rf < LOWLIMIT) {
				rf =LOWLIMIT; rfinc = -rfinc;
			}
			if ( gf < LOWLIMIT) {
				gf = LOWLIMIT; gfinc = -gfinc;
			}
			if ( bf < LOWLIMIT) {
				bf = LOWLIMIT; bfinc = -bfinc;
			}

			if ( rf >UPLIMIT) {
				rf = UPLIMIT; rfinc = -rfinc;
			}
//.........这里部分代码省略.........
开发者ID:lucian303,项目名称:GameKit,代码行数:101,代码来源:vbmtest.cpp


注:本文中的Animation::PutRegular18bit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。