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

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

?? demo12_3.cpp

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

// move all the stars based on the motion of the player

for (index=0; index < MAX_STARS; index++)
    {
    // locally cache star position to speed up calculations
    star_x = stars[index].x;
    star_y = stars[index].y;

    // test which star field star is in so it is translated with correct
    // perspective

    switch(stars[index].plane)
          {
          case STAR_PLANE_0:
               {
               // move the star based on differntial motion of player
               // far plane is divided by 4

               star_x+=plane_0_dx;
               star_y+=plane_0_dy;

               } break;

          case STAR_PLANE_1:
               {
               // move the star based on differntial motion of player
               // middle plane is divided by 2

               star_x+=plane_1_dx;
               star_y+=plane_1_dy;

               } break;

          case STAR_PLANE_2:
               {
               // move the star based on differntial motion of player
               // near plane is divided by 1

               star_x+=plane_2_dx;
               star_y+=plane_2_dy;

               } break;

          } // end switch plane

    // test if a star has flown off an edge

    if (star_x >= SCREEN_WIDTH)
        star_x = star_x-SCREEN_WIDTH;
    else
    if (star_x < 0)
        star_x = SCREEN_WIDTH + star_x;

    if (star_y >= SCREEN_HEIGHT)
        star_y = star_y-SCREEN_HEIGHT;
    else
    if (star_y < 0)
        star_y = SCREEN_HEIGHT+star_y;

    // reset stars position in structure
    stars[index].x = star_x;
    stars[index].y = star_y;

    } // end for index

} // end Move_Stars

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

void Draw_Stars(void)
{
// this function draws all the stars

// lock back surface
DDraw_Lock_Back_Surface();

// draw all the stars
for (int index=0; index < MAX_STARS; index++)
    {
    // draw stars 
    Draw_Pixel(stars[index].x,stars[index].y, stars[index].color,back_buffer, back_lpitch);

    } // end for index

// unlock the secondary surface
DDraw_Unlock_Back_Surface();

} // end Draw_Stars

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

void Draw_Scanner(void)
{
// this function draws all the stars

int index,sx,sy; // looping and position

// lock back surface
DDraw_Lock_Back_Surface();

// draw all the rocks
for (index=0; index < MAX_ROCKS; index++)
    {
    // draw rock blips
	if (rocks[index].state==ROCK_STATE_ON)
		{
		sx = ((rocks[index].varsI[INDEX_WORLD_X] - UNIVERSE_MIN_X) >> 7) + (SCREEN_WIDTH/2) - ((UNIVERSE_MAX_X - UNIVERSE_MIN_X) >> 8);
		sy = ((rocks[index].varsI[INDEX_WORLD_Y] - UNIVERSE_MIN_Y) >> 7) + 32;
	    
		Draw_Pixel(sx,sy,8,back_buffer, back_lpitch);
		} // end if

    } // end for index

// draw all the mines
for (index=0; index < MAX_MINES; index++)
    {
    // draw gunship blips
	if (mines[index].state==MINE_STATE_ALIVE)
		{
		sx = ((mines[index].varsI[INDEX_WORLD_X] - UNIVERSE_MIN_X) >> 7) + (SCREEN_WIDTH/2) - ((UNIVERSE_MAX_X - UNIVERSE_MIN_X) >> 8);
		sy = ((mines[index].varsI[INDEX_WORLD_Y] - UNIVERSE_MIN_Y) >> 7) + 32;
	    
		Draw_Pixel(sx,sy,12,back_buffer, back_lpitch);
		Draw_Pixel(sx,sy+1,12,back_buffer, back_lpitch);

		} // end if

    } // end for index

// unlock the secondary surface
DDraw_Unlock_Back_Surface();

// draw all the stations
for (index=0; index < MAX_STATIONS; index++)
    {
    // draw station blips
	if (stations[index].state==STATION_STATE_ALIVE)
		{
		sx = ((stations[index].varsI[INDEX_WORLD_X] - UNIVERSE_MIN_X) >> 7) + (SCREEN_WIDTH/2) - ((UNIVERSE_MAX_X - UNIVERSE_MIN_X) >> 8);
		sy = ((stations[index].varsI[INDEX_WORLD_Y] - UNIVERSE_MIN_Y) >> 7) + 32;
	    
        // test for state
		if (stations[index].anim_state == STATION_SHIELDS_ANIM_ON)
			{
            stationsmall.curr_frame = 0;
            stationsmall.x = sx - 3;
            stationsmall.y = sy - 3; 
            Draw_BOB(&stationsmall,lpddsback);            


			} // end if
		else
			{

            stationsmall.curr_frame = 1;
            stationsmall.x = sx - 3;
            stationsmall.y = sy - 3; 
            Draw_BOB(&stationsmall,lpddsback);  


			} // end if

		} // end if

    } // end for index


// unlock the secondary surface
DDraw_Lock_Back_Surface();

// draw player as white blip
sx = ((int(player_x) - UNIVERSE_MIN_X) >> 7) + (SCREEN_WIDTH/2) - ((UNIVERSE_MAX_X - UNIVERSE_MIN_X) >> 8);
sy = ((int(player_y) - UNIVERSE_MIN_Y) >> 7) + 32;

int col = rand()%256;

Draw_Pixel(sx,sy,col,back_buffer, back_lpitch);
Draw_Pixel(sx+1,sy,col,back_buffer, back_lpitch);
Draw_Pixel(sx,sy+1,col,back_buffer, back_lpitch);
Draw_Pixel(sx+1,sy+1,col,back_buffer, back_lpitch);

// unlock the secondary surface
DDraw_Unlock_Back_Surface();

// now draw the art around the edges

hud.x          = 320-64;
hud.y          = 32-4;
hud.curr_frame = 0;
Draw_BOB(&hud,lpddsback);

hud.x          = 320+64-16;
hud.y          = 32-4;
hud.curr_frame = 1;
Draw_BOB(&hud,lpddsback);

hud.x          = 320-64;
hud.y          = 32+128-20;
hud.curr_frame = 2;
Draw_BOB(&hud,lpddsback);


hud.x          = 320+64-16;
hud.y          = 32+128-20;
hud.curr_frame = 3;
Draw_BOB(&hud,lpddsback);


} // end Draw_Scanner


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

void Init_Stations(void)
{
// this function loads and initializes the stations to a known state
	
static int shields_on_anim[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
           shields_off_anim[1] = {16};

int frame;  // looping va

// create the first bob
Create_BOB(&stations[0],0,0,192,144,17,
            BOB_ATTR_VISIBLE | BOB_ATTR_MULTI_ANIM,
            DDSCAPS_SYSTEMMEMORY);

// load animation frames 
for (frame=0; frame <= 16; frame++)
	{
	// load the rocks imagery 
    Pad_Name("OUTART/STATION", "BMP", buffer, frame);
	Load_Bitmap_File(&bitmap8bit, buffer);		

    // load the actual .BMP
    Load_Frame_BOB(&stations[0],&bitmap8bit,frame,0,0,BITMAP_EXTRACT_MODE_ABS);  

    // unload data infile
    Unload_Bitmap_File(&bitmap8bit);

	} // end if

// set state to off
stations[0].state  = STATION_STATE_ALIVE;

// set anim state
stations[0].anim_state = STATION_SHIELDS_ANIM_ON;

// set damage to 0
stations[0].varsI[INDEX_STATION_DAMAGE] = 0;

// set animation rate
Set_Anim_Speed_BOB(&stations[0],15);

// load in the shield on/off animations
Load_Animation_BOB(&stations[0], STATION_SHIELDS_ANIM_ON, 16, shields_on_anim);
Load_Animation_BOB(&stations[0], STATION_SHIELDS_ANIM_OFF, 1, shields_off_anim);

// set animation to on
Set_Animation_BOB(&stations[0], STATION_SHIELDS_ANIM_ON);

// make copies
for (int ship=1; ship < MAX_STATIONS; ship++)
    {
    memcpy(&stations[ship], &stations[0], sizeof(BOB));
    } // end for pulse


    // load the miniature station
    Create_BOB(&stationsmall,0,0,8,8,2,
               BOB_ATTR_VISIBLE | BOB_ATTR_MULTI_FRAME,
               DDSCAPS_SYSTEMMEMORY);

    Load_Bitmap_File(&bitmap8bit, "OUTART/STATIONSMALL8.BMP");		

    // load the actual .BMP
    Load_Frame_BOB(&stationsmall,&bitmap8bit,0,0,0,BITMAP_EXTRACT_MODE_CELL);  
    Load_Frame_BOB(&stationsmall,&bitmap8bit,1,1,0,BITMAP_EXTRACT_MODE_CELL);  

    // unload data infile
    Unload_Bitmap_File(&bitmap8bit);


} // end Init_Stations

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

void Reset_Stations(void)
{
// this function resets all the stations in preparation for another run

for (int index=0; index < MAX_STATIONS; index++)
	{
    // set state to off
    stations[index].state  = STATION_STATE_DEAD;

    // set anim state
    stations[index].anim_state = STATION_SHIELDS_ANIM_ON;

    // set damage to 0
    stations[index].varsI[INDEX_STATION_DAMAGE] = 0;

    } // end for

} // end Reset_Stations

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

void Start_Station(int override=0, int x=0, int y=0)
{
// this functions starts a station, note that if override = 1
// then the function uses the sent data otherwise it's random

// first find an available stations
for (int index=0; index < MAX_STATIONS; index++)
	{
	// is this one dead
	if (stations[index].state  == STATION_STATE_DEAD)
		{
		// position the station

		int xpos = RAND_RANGE((UNIVERSE_MIN_X+256),(UNIVERSE_MAX_X-256));
		int ypos = RAND_RANGE((UNIVERSE_MIN_Y+256),(UNIVERSE_MAX_Y-256));

        // set position
		stations[index].varsI[INDEX_WORLD_X] = xpos;
		stations[index].varsI[INDEX_WORLD_Y] = ypos;

        // start a mine up in the vicinity
        int ang = rand()%16;
		float mine_x = xpos + STATION_RANGE_RING*cos_look16[ang];
		float mine_y = ypos + STATION_RANGE_RING*sin_look16[ang];

        // start a deactivated mine
        Start_Mine(1, mine_x, mine_y, MINE_STATE_AI_SLEEP);    

  	    // set velocity
		stations[index].xv = 0;
		stations[index].yv = 0;

		// set remaining state variables
		stations[index].state  = STATION_STATE_ALIVE;

		// set animation to on
        Set_Animation_BOB(&stations[index], STATION_SHIELDS_ANIM_ON);

		// set anim state
        stations[index].anim_state = STATION_SHIELDS_ANIM_ON;

        // set damage to 0
        stations[index].varsI[INDEX_STATION_DAMAGE] = 0;

		// done so exit
		return;

		} // end if
	
	} // end for index

} // end Start_Station

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

void Move_Stations(void)
{
// this function moves/animates all the stations

for (int index=0; index < MAX_STATIONS; index++)
    {
    // test if station is alive
    if (stations[index].state == STATION_STATE_ALIVE)
        {
        // move the stations
        stations[index].varsI[INDEX_WORLD_X]+=stations[index].xv;
        stations[index].varsI[INDEX_WORLD_Y]+=stations[index].yv;
          
        // test for boundaries
        if (stations[index].varsI[INDEX_WORLD_X] > UNIVERSE_MAX_X)
           {
  		   stations[index].varsI[INDEX_WORLD_X] = UNIVERSE_MIN_X;
           } // end if
		else
		if (stations[index].varsI[INDEX_WORLD_X] < UNIVERSE_MIN_X )
           {
  		   stations[index].varsI[INDEX_WORLD_X] = UNIVERSE_MAX_X;
           } // end if	    

		if (stations[index].varsI[INDEX_WORLD_Y] > UNIVERSE_MAX_Y)
           {
		   stations[index].varsI[INDEX_WORLD_Y] = UNIVERSE_MIN_Y;
           } // end if
		else
		if (stations[index].varsI[INDEX_WORLD_Y] < UNIVERSE_MIN_Y ) 
           {
		   stations[index].varsI[INDEX_WORLD_Y] = UNIVERSE_MAX_Y;
           } // end if

        // test for damage level
        if (stations[index].varsI[INDEX_STATION_DAMAGE] > (MAX_STATION_DAMAGE/4) &&
            (rand()%(20 - (stations[index].varsI[INDEX_STATION_DAMAGE] >> 3))) == 1)
            {
            int width = 20+rand()%60;

             // start a burst
             Start_Burst(stations[index].varsI[INDEX_WORLD_X] - (stations[index].width*.5)+RAND_RANGE(0,stations[index].width),
                         stations[index].varsI[INDEX_WORLD_Y] - (stations[index].height*.5)+RAND_RANGE(0,stations[index].height), 
                         width,(width >> 2) + (width >> 1),
                         int(stations[index].xv)*.5, int(stations[index].yv)*.5);   

            // add some particles

            } // end if

		} // end if alive

	} // end for index

} // end Move_Stations

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

void Draw_Stations(void)
{
// this function draws all the stations

for (int index=0; index < MAX_STATIONS; index++)
    {
    // test if station is alive

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美区一区二区三区| 91麻豆精品国产无毒不卡在线观看| 亚洲黄色av一区| 日韩女优电影在线观看| 91在线观看下载| 紧缚捆绑精品一区二区| 亚洲制服丝袜av| 久久精品一区八戒影视| 在线成人免费视频| 色屁屁一区二区| 国产成人综合自拍| 蜜桃精品视频在线观看| 亚洲一级在线观看| 日韩毛片精品高清免费| 日韩欧美国产小视频| 欧美三日本三级三级在线播放| 国产精品1区2区3区| 日本特黄久久久高潮| 亚洲一区二区三区激情| 免播放器亚洲一区| 亚洲国产cao| 亚洲欧美韩国综合色| 国产欧美日韩精品在线| 日韩亚洲电影在线| 欧美高清视频不卡网| 91福利视频在线| 91毛片在线观看| 99视频一区二区三区| 国产伦精品一区二区三区免费| 日本欧美一区二区三区| 亚洲午夜电影在线观看| 亚洲精品你懂的| 亚洲黄色在线视频| 亚洲另类中文字| 亚洲精品成人精品456| 亚洲人成伊人成综合网小说| 一区视频在线播放| 国产精品久久久久久妇女6080| 国产亚洲一区二区三区在线观看 | 亚洲成av人影院| 亚洲中国最大av网站| 亚洲最大的成人av| 亚洲成av人综合在线观看| 亚洲777理论| 日韩av一区二区三区| 日韩高清一区二区| 奇米在线7777在线精品| 日本午夜精品视频在线观看| 强制捆绑调教一区二区| 久久99精品久久久久久动态图| 美女网站视频久久| 激情成人综合网| 国产精品夜夜爽| 成人av在线一区二区三区| 99精品在线观看视频| 99久久精品国产麻豆演员表| 色妞www精品视频| 精品视频一区 二区 三区| 欧美午夜一区二区| 日韩一区二区三区在线视频| 亚洲精品一区二区三区蜜桃下载| 国产亚洲婷婷免费| 中文字幕一区二区在线观看 | 国产一区高清在线| 成人黄色小视频| 色哟哟国产精品免费观看| 欧美日韩国产另类不卡| 欧美一区二区福利在线| 调教+趴+乳夹+国产+精品| 蜜桃久久av一区| 国产电影一区二区三区| 色老综合老女人久久久| 日韩丝袜美女视频| 国产精品女主播av| 亚洲电影欧美电影有声小说| 狠狠v欧美v日韩v亚洲ⅴ| 99久久99久久精品免费观看| 欧美日本韩国一区| 久久蜜桃av一区二区天堂| 一区二区三区在线免费视频| 青椒成人免费视频| 国产suv精品一区二区三区| 色综合天天天天做夜夜夜夜做| 欧美日韩不卡一区| 国产亚洲欧美日韩俺去了| 夜夜嗨av一区二区三区网页 | 成人一区在线看| 欧美中文字幕一二三区视频| 精品国产成人系列| 亚洲欧美国产77777| 狂野欧美性猛交blacked| av不卡在线播放| 精品精品国产高清a毛片牛牛| 亚洲人午夜精品天堂一二香蕉| 免费观看成人鲁鲁鲁鲁鲁视频| 福利一区在线观看| 91麻豆精品国产91久久久更新时间 | 国产精品美女久久久久久| 污片在线观看一区二区| 99精品久久久久久| 久久久精品综合| 日本欧美一区二区三区| www.久久精品| 精品福利一二区| 午夜不卡在线视频| 色妹子一区二区| 国产精品白丝在线| 国产一区二区在线视频| 717成人午夜免费福利电影| 亚洲乱码国产乱码精品精的特点| 国产精品一区二区在线看| 欧美一级理论片| 97久久精品人人做人人爽| 久久久一区二区| 蜜臀av国产精品久久久久 | 欧美日韩国产天堂| 亚洲人xxxx| 99在线精品视频| 国产女主播一区| 国产一区二区三区在线看麻豆| 91 com成人网| 日韩av一二三| 欧美精品vⅰdeose4hd| 亚洲精品网站在线观看| gogo大胆日本视频一区| 中文字幕电影一区| 国产精品亚洲人在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 欧美岛国在线观看| 日韩**一区毛片| 欧美老肥妇做.爰bbww视频| 一区二区三区在线免费视频| 91农村精品一区二区在线| 国产清纯美女被跳蛋高潮一区二区久久w| 美女在线视频一区| 精品久久久久香蕉网| 久久99精品久久久久久久久久久久| 欧美一区二区在线不卡| 久久国内精品视频| 精品国产麻豆免费人成网站| 黄色日韩网站视频| 久久蜜桃av一区二区天堂| 国产mv日韩mv欧美| 国产精品美女久久久久高潮| 99久久久免费精品国产一区二区| 亚洲视频一区在线| 欧美在线观看你懂的| 午夜成人免费电影| 精品美女一区二区三区| 国产精品91一区二区| 成人免费在线观看入口| 一本久道中文字幕精品亚洲嫩| 亚洲高清在线精品| 日韩精品一区二区三区四区| 国产精品18久久久久久久久| 欧美国产在线观看| 91成人免费在线| 免费成人在线网站| 中国av一区二区三区| 欧美性欧美巨大黑白大战| 丝袜亚洲另类欧美综合| 精品区一区二区| www.亚洲色图| 亚洲亚洲人成综合网络| 日韩欧美一区中文| 成人高清视频在线观看| 亚洲一区精品在线| 欧美成人官网二区| 成人a免费在线看| 天天综合网天天综合色| 久久精品夜色噜噜亚洲a∨| 一本色道久久加勒比精品| 天天综合网天天综合色| 国产色综合一区| 在线观看视频一区| 国产乱人伦偷精品视频不卡| 亚洲色图视频网站| 制服.丝袜.亚洲.另类.中文| 国产丶欧美丶日本不卡视频| 亚洲福利视频三区| 久久久www成人免费毛片麻豆| 欧美视频一区在线观看| 加勒比av一区二区| 亚洲一区二区美女| 久久久久久久综合狠狠综合| 欧美亚洲高清一区| 国产一区二区精品久久99| 一区二区三区四区国产精品| 欧美成人伊人久久综合网| 色婷婷一区二区| 国产精品一区免费视频| 偷窥国产亚洲免费视频| 中文字幕av资源一区| 91精品久久久久久久91蜜桃| 成人免费av在线| 久久99久久精品欧美| 亚洲综合自拍偷拍| 国产精品视频一二三区| 精品区一区二区| 欧美区视频在线观看|