亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? outpost.cpp

?? 一本外國人寫的關(guān)于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
      player_dy=0, 
	  player_xv=0, 
	  player_yv=0,
      vel = 0;

// these contain the virual cos, sin lookup tables for the 16 sector circle
float cos_look16[16],
      sin_look16[16];

// sound id's
int intro_music_id  = -1,
    main_music_id   = -1,
    ready_id        = -1,
    engines_id      = -1,
    scream_id       = -1,
    game_over_id    = -1,
    mine_powerup_id = -1,
    deactivate_id   = -1,
    main_menu_id    = -1,
    empty_id        = -1,
    beep0_id             = -1,
    beep1_id             = -1,
    station_blow_id      = -1,
    station_throb_id     = -1,
    ammopu_id            = -1,
    shldpu_id            = -1;

int expl_ids[MAX_EXPL_SOUNDS] = {-1,-1,-1,-1,-1,-1,-1,-1};
int fire_ids[MAX_FIRE_SOUNDS] = {-1,-1,-1,-1,-1,-1,-1,-1};
int game_state                = GAME_STATE_INIT;   // initial game state

// FUNCTIONS //////////////////////////////////////////////

LRESULT CALLBACK WindowProc(HWND hwnd, 
						    UINT msg, 
                            WPARAM wparam, 
                            LPARAM lparam)
{
// this is the main message handler of the system
PAINTSTRUCT	ps;		   // used in WM_PAINT
HDC			hdc;	   // handle to a device context

// what is the message 
switch(msg)
	{	
	case WM_CREATE: 
        {
		// do initialization stuff here


		return(0);
		} break;

    case WM_PAINT:
         {
         // start painting
         hdc = BeginPaint(hwnd,&ps);

         // end painting
         EndPaint(hwnd,&ps);
         return(0);
        } break;


	case WM_DESTROY: 
		{

		// kill the application			
		PostQuitMessage(0);
		return(0);
		} break;

	default:break;

    } // end switch

// process any messages that we didn't take care of 
return (DefWindowProc(hwnd, msg, wparam, lparam));

} // end WinProc

// WINMAIN ////////////////////////////////////////////////

int WINAPI WinMain(	HINSTANCE hinstance,
					HINSTANCE hprevinstance,
					LPSTR lpcmdline,
					int ncmdshow)
{
// this is the winmain function

WNDCLASS winclass;	// this will hold the class we create
HWND	 hwnd;		// generic window handle
MSG		 msg;		// generic message
HDC      hdc;       // generic dc
PAINTSTRUCT ps;     // generic paintstruct

// first fill in the window class stucture
winclass.style			= CS_DBLCLKS | CS_OWNDC | 
                          CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc	= WindowProc;
winclass.cbClsExtra		= 0;
winclass.cbWndExtra		= 0;
winclass.hInstance		= hinstance;
winclass.hIcon			= LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor		= LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground	= (HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName	= NULL; 
winclass.lpszClassName	= WINDOW_CLASS_NAME;

// register the window class
if (!RegisterClass(&winclass))
	return(0);

// create the window, note the use of WS_POPUP
if (!(hwnd = CreateWindow(WINDOW_CLASS_NAME, // class
						  "Vector tracking demo",	 // title
						  WS_POPUP | WS_VISIBLE,
					 	  0,0,	   // x,y
						  WINDOW_WIDTH,  // width
                          WINDOW_HEIGHT, // height
						  NULL,	   // handle to parent 
						  NULL,	   // handle to menu
						  hinstance,// instance
						  NULL)))	// creation parms
return(0);

// save the window handle and instance in a global
main_window_handle = hwnd;
main_instance      = hinstance;

// perform all game console specific initialization
Game_Init();

// enter main event loop
while(1)
	{
	if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
		{ 
		// test if this is a quit
        if (msg.message == WM_QUIT)
           break;
	
		// translate any accelerator keys
		TranslateMessage(&msg);

		// send the message to the window proc
		DispatchMessage(&msg);
		} // end if
    
    // main game processing goes here
    Game_Main();

	} // end while


// shutdown game and release all resources
Game_Shutdown();

// return to Windows like this
return(msg.wParam);

} // end WinMain

////////////////////////////////////////////////////////////////////////////

void Load_Andre(void)
{
// this function loads all the buttons for the interface

// load image
Load_Bitmap_File(&bitmap8bit, "OUTART/ENEMYAI.DAT");

// save the palette
Copy_Palette(andre_palette, bitmap8bit.palette);

Create_Bitmap(&andre,320-216/2,240-166/2,216,166);
Load_Image_Bitmap(&andre,&bitmap8bit,0,0,BITMAP_EXTRACT_MODE_ABS);

// unload object bitmap
Unload_Bitmap_File(&bitmap8bit);

} // end Load_Andre

/////////////////////////////////////////////////////////////////

void Init_Reset_Particles(void)
{
// this function serves as both an init and reset for the particles

// loop thru and reset all the particles to dead
for (int index=0; index<MAX_PARTICLES; index++)
    {
    particles[index].state = PARTICLE_STATE_DEAD;
    particles[index].type  = PARTICLE_TYPE_FADE;
    particles[index].x     = 0;
    particles[index].y     = 0;
    particles[index].xv    = 0;
    particles[index].yv    = 0;
    particles[index].start_color = 0;
    particles[index].end_color   = 0;
    particles[index].curr_color  = 0;
    particles[index].counter     = 0;
    particles[index].max_count   = 0;
    } // end if

} // end Init_Reset_Particles

/////////////////////////////////////////////////////////////////////////

void Start_Particle(int type, int color, int count, int x, int y, int xv, int yv)
{
// this function starts a single particle

int pindex = -1; // index of particle

// first find open particle
for (int index=0; index < MAX_PARTICLES; index++)
    if (particles[index].state == PARTICLE_STATE_DEAD)
       {
       // set index
       pindex = index; 
       break;
       } // end if    

// did we find one
if (pindex==-1)
   return;

// set general state info
particles[pindex].state = PARTICLE_STATE_ALIVE;
particles[pindex].type  = type;
particles[pindex].x     = x;
particles[pindex].y     = y;
particles[pindex].xv    = xv;
particles[pindex].yv    = yv;
particles[pindex].counter     = 0;
particles[pindex].max_count   = count;     

// set color ranges, always the same
   switch(color)
         {
         case PARTICLE_COLOR_RED:
              {
              particles[pindex].start_color = COLOR_RED_START;
              particles[pindex].end_color   = COLOR_RED_END;
              } break;

         case PARTICLE_COLOR_GREEN:
              {
              particles[pindex].start_color = COLOR_GREEN_START;
              particles[pindex].end_color   = COLOR_GREEN_END;
              } break;

         case PARTICLE_COLOR_BLUE:
              {
              particles[pindex].start_color = COLOR_BLUE_START;
              particles[pindex].end_color   = COLOR_BLUE_END;
              } break;

         case PARTICLE_COLOR_WHITE:
              {
              particles[pindex].start_color = COLOR_WHITE_START;
              particles[pindex].end_color   = COLOR_WHITE_END;
              } break;

         break;

         } // end switch

// what type of particle is being requested
if (type == PARTICLE_TYPE_FLICKER)
   {
    // set current color
    particles[index].curr_color  = RAND_RANGE(particles[index].start_color, particles[index].end_color);

   } // end if
else
   {
   // particle is fade type
   // set current color
   particles[index].curr_color  = particles[index].start_color;
   } // end if

} // end Start_Particle

////////////////////////////////////////////////////////////////////////////////

void Start_Particle_Explosion(int type, int color, int count, 
                              int x, int y, int xv, int yv, int num_particles)
{
// this function starts a particle explosion at the given position and velocity

while(--num_particles >=0)
    {
    // compute random trajectory angle
    int ang = rand()%16;

    // compute random trajectory velocity
    float vel = 2+rand()%4;

    Start_Particle(type,color,count,
                   x+RAND_RANGE(-4,4),y+RAND_RANGE(-4,4), 
                   xv+cos_look16[ang]*vel, yv+sin_look16[ang]*16);        

    } // end while

} // end Start_Particle_Explosion

////////////////////////////////////////////////////////////////////////////////

void Draw_Particles(void)
{
// this function draws all the particles

// lock back surface
DDraw_Lock_Back_Surface();

for (int index=0; index<MAX_PARTICLES; index++)
    {
    // test if particle is alive
    if (particles[index].state==PARTICLE_STATE_ALIVE)
       {
       // render the particle, perform world to screen transform
       int x = particles[index].x - player_x + (SCREEN_WIDTH/2);
       int y = particles[index].y - player_y + (SCREEN_HEIGHT/2);

       // test for clip
       if (x >= SCREEN_WIDTH || x < 0 || y >= SCREEN_HEIGHT || y < 0)
          continue;

       // draw the pixel
       Draw_Pixel(x,y,particles[index].curr_color, back_buffer, back_lpitch);
    
      } // end if

    } // end for index

// unlock the secondary surface
DDraw_Unlock_Back_Surface(); 

} // end Draw_Particles

////////////////////////////////////////////////////////////////////

void Move_Particles(void)
{
// this function moves and animates all particles

for (int index=0; index<MAX_PARTICLES; index++)
    {
    // test if this particle is alive
    if (particles[index].state == PARTICLE_STATE_ALIVE)
       {
       // translate particle
       particles[index].x+=particles[index].xv;
       particles[index].y+=particles[index].yv;

       // now based on type of particle perform proper animation
       if (particles[index].type==PARTICLE_TYPE_FLICKER)
          {
          // simply choose a color in the color range and assign it to the current color
          particles[index].curr_color = RAND_RANGE(particles[index].start_color, particles[index].end_color);

          // now update counter
          if (++particles[index].counter >= particles[index].max_count)
             {
             // kill the particle
             particles[index].state = PARTICLE_STATE_DEAD;             

             } // end if

          } // end if
      else
          {
          // must be a fade, be careful!
          // test if it's time to update color
          if (++particles[index].counter >= particles[index].max_count)
             {
              // reset counter
              particles[index].counter = 0;

             // update color
             if (++particles[index].curr_color>particles[index].end_color)
                {
                // transition is complete, terminate particle
                particles[index].state = PARTICLE_STATE_DEAD;  
 
                } // end if

             } // end if

          } // end else
             
       } // end if 

    } // end for index

} // end Move_Particles

////////////////////////////////////////////////////////////////////////////////////

void Init_Stars(void)
{
// this function initializes all the stars in the star field

int index; // looping variable

for (index=0; index < MAX_STARS; index++)
    {

    // select plane that star will be in

    switch(rand()%3)
          {
          case STAR_PLANE_0:
               {
               stars[index].color = STAR_COLOR_0;
               stars[index].plane = STAR_PLANE_0;
               } break;

          case STAR_PLANE_1:
               {
               stars[index].color = STAR_COLOR_1;
               stars[index].plane = STAR_PLANE_1;
               } break;

          case STAR_PLANE_2:
               {
               stars[index].color = STAR_COLOR_2;
               stars[index].plane = STAR_PLANE_2;
               } break;

          default:break;

          } // end switch

     // set fields that aren't plane specific
     stars[index].x = rand()%SCREEN_WIDTH;   // change this latter to reflect clipping
     stars[index].y = rand()%SCREEN_HEIGHT;  // region

    } // end for index

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产91亚洲一区二区三区婷婷| 91视频国产资源| 日韩欧美电影一区| 经典一区二区三区| 久久日一线二线三线suv| 国产伦精品一区二区三区免费| 久久先锋影音av| 成人精品视频一区二区三区| 日本一区二区三区国色天香 | 国产精品一区二区三区网站| 久久九九全国免费| av一区二区三区在线| 亚洲成人在线免费| 久久综合999| 91在线视频免费观看| 亚洲在线观看免费视频| 精品国产亚洲在线| 波多野结衣中文字幕一区二区三区| 亚洲男人的天堂网| 91丝袜美腿高跟国产极品老师| 91精品国产色综合久久| 欧洲av一区二区嗯嗯嗯啊| 欧美电影一区二区三区| 久久久久久久综合狠狠综合| 亚洲日本一区二区三区| 三级欧美韩日大片在线看| 丝袜国产日韩另类美女| 一区二区三区中文在线观看| 美女视频网站久久| 欧美卡1卡2卡| 亚洲手机成人高清视频| 精品一区二区三区久久| 欧美乱熟臀69xxxxxx| 日韩精品一区二区三区视频| 欧美一区二区三区日韩| 日韩欧美国产综合| 日韩一区二区三区视频| 欧美不卡激情三级在线观看| 亚洲欧美国产高清| 在线视频观看一区| 精品亚洲国产成人av制服丝袜| 粗大黑人巨茎大战欧美成人| 日韩精品一区二区三区四区 | 中文字幕精品综合| 亚洲综合色视频| thepron国产精品| 26uuu精品一区二区在线观看| 亚洲国产精品一区二区久久恐怖片| 国产精品一区免费视频| 538在线一区二区精品国产| 日本一二三四高清不卡| 久久成人久久爱| 欧美精品日韩一区| 亚洲成精国产精品女| 三级成人在线视频| 欧美精品乱码久久久久久按摩| 亚洲小说欧美激情另类| 欧美日韩国产电影| 精品一区二区免费视频| 中文字幕精品综合| 91精品国产综合久久久蜜臀图片 | 亚洲欧美日韩中文字幕一区二区三区| 亚洲精品一区二区三区香蕉| 亚洲午夜一二三区视频| 在线观看日韩电影| 国产精品亚洲一区二区三区妖精| 久久99国内精品| 精品美女在线播放| 激情综合色综合久久综合| 亚洲欧美日韩系列| 久久亚区不卡日本| 欧美美女网站色| 91在线小视频| 成人免费毛片片v| 九色综合狠狠综合久久| 亚洲一区在线观看视频| 欧美精品一区二区三区四区 | 成人激情动漫在线观看| 免费在线看成人av| 亚洲成人免费av| 337p日本欧洲亚洲大胆色噜噜| 欧美性xxxxxxxx| av一区二区久久| 成人亚洲一区二区一| 九九**精品视频免费播放| 日本不卡一区二区三区 | 亚洲精品视频在线看| 国产精品动漫网站| 中文av字幕一区| 中文av一区特黄| 国产精品五月天| 中文字幕免费观看一区| 中文字幕av资源一区| 国产精品私人影院| 日本一区二区三区dvd视频在线| 久久蜜臀精品av| 国产亚洲一本大道中文在线| 久久亚洲捆绑美女| 国产三级精品三级| 国产午夜精品一区二区| 久久久久国产一区二区三区四区| 久久亚区不卡日本| 国产精品网站在线播放| 1024亚洲合集| 亚洲男人电影天堂| 亚洲视频在线观看一区| 中文字幕亚洲欧美在线不卡| 久久久精品tv| 国产精品美日韩| 欧美激情一区二区三区| 一区免费观看视频| 亚洲欧美二区三区| 亚洲午夜久久久| 青青草国产精品亚洲专区无| 国产综合成人久久大片91| 国产麻豆视频一区| 91免费看`日韩一区二区| 日本道精品一区二区三区| 欧美日韩大陆在线| 精品国产髙清在线看国产毛片 | 丁香婷婷综合色啪| 免费观看在线综合| 激情综合色综合久久综合| 成人免费高清在线观看| 欧美性大战久久久久久久| 欧美大度的电影原声| 国产精品蜜臀在线观看| 亚洲电影一级黄| 国产精品影音先锋| 色狠狠一区二区| 日韩欧美亚洲另类制服综合在线 | 色视频一区二区| 日韩一区二区三区免费观看| 欧美国产精品v| 亚洲一二三区视频在线观看| 精品在线免费观看| 色婷婷av一区二区三区软件| 欧美mv日韩mv| 中文字幕一区二区三区av| 喷白浆一区二区| 91亚洲精华国产精华精华液| 欧美蜜桃一区二区三区| 国产精品免费久久| 六月婷婷色综合| 在线视频一区二区三区| 久久午夜色播影院免费高清| 一区二区三区国产精品| 韩国精品久久久| 欧美艳星brazzers| 国产精品久久久久久久久免费桃花| 日日夜夜免费精品| 97超碰欧美中文字幕| 精品福利在线导航| 亚洲国产一区视频| 99久久精品国产网站| 久久综合狠狠综合| 丝袜美腿亚洲一区| 色成人在线视频| 中文字幕一区二区三区色视频| 极品尤物av久久免费看| 欧美日韩精品免费| 18涩涩午夜精品.www| 成人综合婷婷国产精品久久| 欧美日韩大陆一区二区| 亚洲黄色av一区| 成人高清免费观看| 国产女人18毛片水真多成人如厕 | 精品99一区二区| 一区二区三区在线视频免费| 久久草av在线| 91精品久久久久久蜜臀| 一区二区三区日韩在线观看| 国产传媒欧美日韩成人| 日韩一区二区三区观看| 午夜久久久久久电影| 色狠狠av一区二区三区| 亚洲视频一区在线| 色综合一个色综合亚洲| 亚洲天天做日日做天天谢日日欢| 国产精品一二一区| 欧美日韩黄色影视| 亚洲自拍欧美精品| 在线日韩av片| 亚洲成国产人片在线观看| 欧美在线观看一区二区| 亚洲一卡二卡三卡四卡| 欧美午夜片在线观看| 亚洲一区二区av在线| 欧美视频一二三区| 丝袜亚洲另类丝袜在线| 91精品国产麻豆| 精品一区二区三区视频在线观看 | 成人av电影在线观看| 亚洲一区二区3| 欧美精品一区二区三区视频 | 7777精品伊人久久久大香线蕉完整版| 久久成人免费日本黄色| 亚洲图片你懂的| 日韩一区二区在线观看视频 | 午夜精品爽啪视频|