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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? demo12_3.cpp

?? 游戲的聲音圖像演示程序
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
// DEMO12_3.CPP - vector tracking demo min game
// the vector tracking code can be found in Move_Mines()

// INCLUDES ///////////////////////////////////////////////

#define INITGUID

#define WIN32_LEAN_AND_MEAN  

#include <windows.h>   // include important windows stuff
#include <windowsx.h> 
#include <mmsystem.h>
#include <iostream.h> // include important C/C++ stuff
#include <conio.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h> 
#include <math.h>
#include <io.h>
#include <fcntl.h>

#include <ddraw.h>  // directX includes
#include <dsound.h>
#include <dmksctrl.h>
#include <dmusici.h>
#include <dmusicc.h>
#include <dmusicf.h>
#include <dinput.h>
#include "T3DLIB1.h" // game library includes
#include "T3DLIB2.h"
#include "T3DLIB3.h"


//#include "mono.h"

// DEFINES ////////////////////////////////////////////////

// mathematical defines
CONST float FRICTION = 0.1;

// defines for windows 
#define WINDOW_CLASS_NAME "WINCLASS"  // class name

#define WINDOW_WIDTH    640            // size of window viewport
#define WINDOW_HEIGHT   480

// size of universe
#define UNIVERSE_MIN_X   (-8000)
#define UNIVERSE_MAX_X   (8000)
#define UNIVERSE_MIN_Y   (-8000)
#define UNIVERSE_MAX_Y   (8000)

// weapons defines
#define MAX_PLASMA         32   // max number of plasma pulses
#define PLASMA_SPEED       16   // pixels/sec of plasma pulse
#define PLASMA_SPEED_SLOW  12   // slow version for gunships

#define PLASMA_STATE_OFF   0   // this plasma is dead or off
#define PLASMA_STATE_ON    1   // this one is alive and in flight
#define PLASMA_RANGE_1     30  // type 1 plasma disruptor

#define PLASMA_ANIM_PLAYER     0  // a plasma torpedeo from player
#define PLASMA_ANIM_ENEMY      1  // a plasma torpedeo from any enemy

// asteroid field defines
#define MAX_ROCKS             300
#define ROCK_STATE_OFF        0   // this rock is dead or off
#define ROCK_STATE_ON         1   // this one is alive and in flight

#define ROCK_LARGE            0   // sizes of rock
#define ROCK_MEDIUM           1
#define ROCK_SMALL            2

// explosion defines 
#define MAX_BURSTS            8
#define BURST_STATE_OFF       0   // this burst is dead or off
#define BURST_STATE_ON        1   // this one is alive

// defines for player states
#define PLAYER_STATE_DEAD           0
#define PLAYER_STATE_DYING          1
#define PLAYER_STATE_INVINCIBLE     2
#define PLAYER_STATE_ALIVE          3
#define PLAYER_REGEN_COUNT          100 // click before regenerating

#define WRAITH_INDEX_DIR            3 // index of direction var

#define MAX_PLAYER_SPEED            16

// sound id's
#define MAX_FIRE_SOUNDS       8
#define MAX_EXPL_SOUNDS       8


// defines for stations
#define MAX_STATIONS           20

// life state for stations
#define STATION_STATE_DEAD       0
#define STATION_STATE_ALIVE      1
#define STATION_STATE_DAMAGED    2  
#define STATION_STATE_DYING      3

#define STATION_SHIELDS_ANIM_ON  0  // animations for shields
#define STATION_SHIELDS_ANIM_OFF 1 

#define STATION_RANGE_RING       300

#define INDEX_STATION_DAMAGE     2  // tracks the current damage of station
#define MAX_STATION_DAMAGE      100

#define STATION_MIN_UPLINK_DISTANCE  150


// defines for mines
#define MAX_MINES                16

// life state for stations
#define MINE_STATE_DEAD       0
#define MINE_STATE_ALIVE      1
#define MINE_STATE_DAMAGED    2  
#define MINE_STATE_DYING      3

#define MINE_STATE_AI_ACTIVATED   1
#define MINE_STATE_AI_SLEEP       0

#define INDEX_MINE_AI_STATE       1  // state of ai system
#define INDEX_MINE_DAMAGE         2  // tracks the current damage of MINE
#define INDEX_MINE_CONTACT_COUNT  3  // tracks how long mine has been in contact with player

#define MAX_MINE_DAMAGE            50 
#define MAX_MINE_CONTACT_COUNT     20

#define MAX_MINE_VELOCITY        16  
#define MIN_MINE_TRACKING_DIST   1000
#define MIN_MINE_ACTIVATION_DIST 250 

// defines for the star field

#define MAX_STARS                256   // number of stars in universe

#define STAR_PLANE_0             0    // far plane
#define STAR_PLANE_1             1    // near plane
#define STAR_PLANE_2             2

#define STAR_COLOR_0             8    // color of farthest star plane
#define STAR_COLOR_1             7
#define STAR_COLOR_2             15   // color of nearest star plane


// defines for particle system
#define PARTICLE_STATE_DEAD               0
#define PARTICLE_STATE_ALIVE              1

// types of particles
#define PARTICLE_TYPE_FLICKER             0
#define PARTICLE_TYPE_FADE                1 

// color of particle
#define PARTICLE_COLOR_RED                0
#define PARTICLE_COLOR_GREEN              1
#define PARTICLE_COLOR_BLUE               2
#define PARTICLE_COLOR_WHITE              3

#define MAX_PARTICLES                     128

// color ranges
#define COLOR_RED_START                   32
#define COLOR_RED_END                     47

#define COLOR_GREEN_START                 96
#define COLOR_GREEN_END                   111

#define COLOR_BLUE_START                  144
#define COLOR_BLUE_END                    159

#define COLOR_WHITE_START                 16
#define COLOR_WHITE_END                   31

// indices used to access data arrays in BOBs 
#define INDEX_WORLD_X                     8
#define INDEX_WORLD_Y                     9

// defines for the states of the main loop
#define GAME_STATE_INIT                  0
#define GAME_STATE_MENU                  1
#define GAME_STATE_RESTART               2
#define GAME_STATE_RUNNING               3
#define GAME_STATE_UPLINK                4
#define GAME_STATE_EXIT                  5
#define GAME_STATE_WAITING_FOR_EXIT      6
#define GAME_STATE_PAUSED                7

// the menu defines
#define MENU_STATE_MAIN                  0   // main menu state 
#define MENU_STATE_INST                  1   // instructions state
#define MENU_SEL_NEW_GAME                0
#define MENU_SEL_INSTRUCTIONS            1
#define MENU_SEL_EXIT                    2
#define MAX_INSTRUCTION_PAGES            6  

// defines for font
#define FONT_NUM_CHARS         96  // entire character set
#define FONT_WIDTH             12
#define FONT_HEIGHT            12
#define FONT_WIDTH_NEXT_NUM    8
#define FONT_WIDTH_NEXT_LOWER  7
#define FONT_WIDTH_NEXT_UPPER  8

// number of starting objects
#define NUM_ACTIVE_MINES             16
#define NUM_ACTIVE_STATIONS          8


// PROTOTYPES /////////////////////////////////////////////

// game console
int  Game_Init(void *parms=NULL);
int  Game_Shutdown(void *parms=NULL);
int  Game_Main(void *parms=NULL);
void Game_Reset(void);

// helper functions for game logic
void Draw_Info(void);
void Start_Burst(int x, int y, int width, int height, int xv,int yv);
void Draw_Bursts(void);
void Move_Bursts(void);
void Delete_Bursts(void);
void Init_Bursts(void);
void Reset_Bursts(void);

void Draw_Rocks(void);
void Start_Rock(int x, int y, int size,int xv, int yv);
void Move_Rocks(void);
void Delete_Rocks(void);
void Init_Rocks(void);
void Reset_Rocks(void);


void Fire_Plasma(int x,int y, int xv, int yv, int source);
void Draw_Plasma(void);
void Move_Plasma(void);
void Delete_Plasma(void);
void Init_Plasma(void);
void Reset_Plasma(void);

void Move_Stars(void);
void Draw_Stars(void);
void Init_Stars(void);
void Reset_Stars(void);


void Init_Reset_Particles(void);
void Draw_Particles(void);
void Move_Particles(void);
void Start_Particle(int type, int color, int count, int x, int y, int xv, int yv);
void Start_Particle_Explosion(int type, int color, int count, 
                              int x, int y, int xv, int yv, int num_particles);

void Reset_Particles(void);


void Init_Stations(void);
void Move_Stations(void);
void Draw_Stations(void);
void Start_Station(int override, int x, int y);
void Reset_Stations(void);


void Init_Mines(void);
void Move_Mines(void);
void Draw_Mines(void);
void Start_Mine(int override, int x, int y, int ai_state);
void Reset_Mines(void);


void Create_Tables(void);
float Fast_Distance_2D(float x, float y);
void Seed_Rocks(void);
int Load_Player(void);
void Draw_Scanner(void);
int Pad_Name(char *filename, char *extension, char *padstring, int num);

int Copy_Screen(UCHAR *source_bitmap,UCHAR *dest_buffer, int lpitch, int transparent);

void Load_Buttons(void);
void Load_HUD(void);


inline void Copy_Palette(LPPALETTEENTRY dest, LPPALETTEENTRY source)
{ memcpy(dest, source, 256*sizeof(PALETTEENTRY)); }


// TYPES //////////////////////////////////////////////////

// used to contain a single star
typedef struct STAR_TYP
        {
        int x,y;                   // position of star
        UCHAR color;               // color of star
        int plane;                 // plane that star is in

        } STAR, *STAR_PTR;


// a single particle
typedef struct PARTICLE_TYP
        {
        int state;           // state of the particle
        int type;            // type of particle effect
        int x,y;             // world position of particle
        int xv,yv;           // velocity of particle
        int curr_color;      // the current rendering color of particle
        int start_color;     // the start color or range effect
        int end_color;       // the ending color of range effect
        int counter;         // general state transition timer
        int max_count;       // max value for counter

        } PARTICLE, *PARTICLE_PTR;

// MACROS ////////////////////////////////////////////////

// used to compute the min and max of two expresions
#define MIN(a, b)  (((a) < (b)) ? (a) : (b)) 
#define MAX(a, b)  (((a) > (b)) ? (b) : (a)) 

// returns a rand in a range
#define RAND_RANGE(a,b) ((a)+(rand()%((b)-(a)+1)))

// GLOBALS ////////////////////////////////////////////////

HWND main_window_handle = NULL; // save the window handle
HINSTANCE main_instance = NULL; // save the instance
char buffer[80];                // used to print text

BITMAP_IMAGE background_bmp, menu_bmp; // used to hold backgrounds
BITMAP_IMAGE menu_sel_bmps[3];   // holds the menu selections
BITMAP_IMAGE andre;

BOB wraith;                   // the player 
BOB plasma[MAX_PLASMA];       // plasma pulses
BOB rocks[MAX_ROCKS];         // the asteroids
BOB rock_s, rock_m, rock_l;   // the master templates for surface info
BOB bursts[MAX_BURSTS];       // the explosion bursts
BOB stations[MAX_STATIONS];   // the starbase stations
BOB mines[MAX_MINES];         // the predator mines
BOB hud;                      // the art for the scanner hud
BOB stationsmall;             // small station bob

int rock_sizes[3] = {96,56,32}; // X,Y dims for scaler

STAR stars[MAX_STARS];          // the star field

PARTICLE particles[MAX_PARTICLES]; // the particles for the particle engine

// player state variables
int player_state       = PLAYER_STATE_ALIVE;
int player_score       = 0;   // the score
int player_ships       = 3;   // ships left
int player_regen_counter = 0; // used to track when to regen
int player_damage      = 0;   // damage of player
int player_counter     = 0;   // used for state transition tracking
int player_regen_count = 0;   // used to regenerate player
int player_shield_count = 0;  // used to display shields
int ready_counter = 0,        // used to draw a little "get ready"
    ready_state   = 0;

float mine_tracking_rate = 2; // rate that mines track player

int win_counter = 0,          // tracks if player won
    player_won = 0;   

int station_id = -1,          // uplink station id
    num_stations_destroyed = 0;

int intro_done = 0;           // flags if intro has played already

int game_paused      = 0,
    pause_debounce   = 0,
    huds_on          = 1,
    scanner_on       = 1,
    huds_debounce    = 0,
    scanner_debounce = 0;

// color palettes, so we don't have to reload all the time
PALETTEENTRY         game_palette[256]; // holds the main game palette
PALETTEENTRY         menu_palette[256]; // gee what do you think
PALETTEENTRY         andre_palette[256]; // for me

// positional and state info for player
float player_x=0,
      player_y=0,
	  player_dx=0, 
      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,
    beep0_id             = -1,
    beep1_id             = -1,
    station_blow_id      = -1,
    station_throb_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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品伦理在线| 正在播放亚洲一区| 国产69精品久久99不卡| 蜜桃av一区二区三区| 日本一不卡视频| 久久成人羞羞网站| 激情六月婷婷久久| 国产在线精品一区二区不卡了| 日韩精品电影一区亚洲| 青椒成人免费视频| 久久99国内精品| 国产麻豆成人精品| 岛国一区二区在线观看| 成人av动漫在线| 欧美体内she精高潮| 欧美欧美午夜aⅴ在线观看| 欧美日韩在线播放三区| 欧美一级在线视频| 国产欧美日韩久久| 亚洲免费在线观看| 男人的天堂久久精品| 精品欧美久久久| 亚洲一级二级在线| 热久久免费视频| 国产精品一级黄| 一本一本大道香蕉久在线精品| 在线观看视频一区| 日韩视频免费观看高清完整版在线观看 | 午夜精品福利一区二区蜜股av| 日韩和的一区二区| 国产乱妇无码大片在线观看| 91网上在线视频| 日韩精品一区二区三区三区免费| 中文字幕不卡在线观看| 亚洲国产成人av网| 国内精品国产三级国产a久久| 95精品视频在线| 日韩免费看网站| 亚洲精品综合在线| 国产一区二区三区香蕉| 91黄色在线观看| 久久伊人中文字幕| 亚洲一区在线观看免费| 国产成人鲁色资源国产91色综| 欧美视频一区在线| 国产精品久久久久永久免费观看 | 国产91丝袜在线18| 欧美在线观看视频一区二区三区| 日韩精品专区在线| 亚洲美女视频在线观看| 国产精品99久| 欧美一区二区三区在线观看| 日韩美女精品在线| 丁香六月久久综合狠狠色| 欧美一区二区免费视频| 亚洲另类春色校园小说| 国产成人精品在线看| 日韩欧美色综合网站| 一区二区三区中文字幕精品精品 | 日韩精品视频网站| 国产欧美日韩在线看| 天天综合色天天综合色h| 91在线视频在线| 国产精品久久久久久久蜜臀 | 中文字幕欧美日本乱码一线二线| 日本中文字幕不卡| 91精品国产综合久久久久久 | 国产91精品一区二区| 欧美zozozo| 精品一区二区三区蜜桃| 555www色欧美视频| 亚洲v日本v欧美v久久精品| 91麻豆精品一区二区三区| 国产精品日韩精品欧美在线| 国产成人午夜精品影院观看视频| 精品成人免费观看| 国内精品久久久久影院色| 欧美成人精品二区三区99精品| 日本一道高清亚洲日美韩| 欧美一区二区精美| 精品一二三四区| 久久久久久久久久电影| 懂色中文一区二区在线播放| 国产欧美日韩另类一区| 99久久精品免费看国产| 亚洲激情图片qvod| 678五月天丁香亚洲综合网| 日本系列欧美系列| 久久蜜桃一区二区| 不卡在线观看av| 亚洲一区二区三区自拍| 91麻豆精品国产自产在线观看一区| 欧美日韩一区二区在线观看 | 日本va欧美va精品| 日韩欧美专区在线| 国产精品影视天天线| 国产精品三级久久久久三级| 91麻豆高清视频| 亚洲成人激情社区| 国产日韩精品一区| 91精品办公室少妇高潮对白| 视频一区二区中文字幕| 久久久久久久久久久久久女国产乱| 成人黄色777网| 亚洲一区在线观看免费 | 国产在线播放一区| 亚洲日穴在线视频| 日韩欧美久久一区| 99久久99久久综合| 午夜欧美电影在线观看| 欧美r级在线观看| 日本精品一区二区三区高清| 美女被吸乳得到大胸91| 中文字幕综合网| 精品伦理精品一区| 欧美天堂一区二区三区| 国产69精品一区二区亚洲孕妇| 亚洲成a人v欧美综合天堂下载 | 国产欧美中文在线| 欧美疯狂性受xxxxx喷水图片| 国产一区二区91| 亚洲mv在线观看| 自拍偷拍亚洲激情| 久久综合色鬼综合色| 欧美电影影音先锋| 97久久超碰国产精品电影| 精品亚洲国内自在自线福利| 一区二区三区四区不卡在线 | 国产超碰在线一区| 五月婷婷综合在线| 伊人色综合久久天天人手人婷| 精品国产一区二区精华 | 六月丁香综合在线视频| 一区二区三区加勒比av| 国产精品久久毛片av大全日韩| 欧美日韩精品欧美日韩精品一 | 丁香六月久久综合狠狠色| aaa欧美日韩| 国产精品免费看片| 亚洲黄色小说网站| 亚洲免费av网站| 99久久99久久精品免费观看| 波多野结衣亚洲| 色系网站成人免费| 一本一道综合狠狠老| www.av亚洲| 日韩激情中文字幕| 亚洲一区二区三区四区在线观看 | 一区二区三区在线影院| 中文字幕日韩av资源站| 国产精品69毛片高清亚洲| 亚洲线精品一区二区三区八戒| 久久精品亚洲麻豆av一区二区 | 91精品久久久久久久99蜜桃| 色94色欧美sute亚洲线路一久| 青青草伊人久久| 五月天婷婷综合| 亚洲女同一区二区| 一区二区三区四区中文字幕| 久久久99免费| 欧美精品久久99| 国产成人av影院| 乱中年女人伦av一区二区| 亚洲chinese男男1069| 国产精品视频一二三区| 亚洲成人av一区| 国产精品一区二区黑丝| 国产美女视频91| 国产在线麻豆精品观看| 美女视频一区二区三区| 久久国产综合精品| 国产中文字幕一区| 国产在线一区观看| 成人黄色国产精品网站大全在线免费观看 | 国产河南妇女毛片精品久久久| 成人免费视频视频在线观看免费| 国产成人av影院| 色婷婷久久99综合精品jk白丝| 色94色欧美sute亚洲13| 91超碰这里只有精品国产| 国产欧美日韩精品一区| 夜夜嗨av一区二区三区网页| 国产精品一区二区免费不卡| 国产成人精品综合在线观看| 99在线精品一区二区三区| 91在线小视频| 99精品久久只有精品| 不卡高清视频专区| 国产99精品视频| 国产成人a级片| 国产蜜臀av在线一区二区三区| 国产一区在线观看视频| 欧美一级xxx| 久久精品男人的天堂| 亚洲靠逼com| 韩国女主播成人在线| 91成人看片片| 久久精品在线免费观看| 午夜影院久久久| 成人黄色av电影|