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

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

?? deb1d0~1.cpp

?? 游戲的聲音圖像演示程序
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
// DEMO12_7_16b.CPP - memory demo
// 16-bit version
// to compile make sure to include DDRAW.LIB, DSOUND.LIB,
// DINPUT.LIB, WINMM.LIB, and of course 
// T3DLIB1.CPP,T3DLIB2.CPP,T3DLIB3.CPP,

// 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"

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

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

// setup a 640x480 16-bit windowed mode example
#define WINDOW_TITLE      "16-Bit Memory Demo"
#define WINDOW_WIDTH      640   // size of window
#define WINDOW_HEIGHT     480

#define WINDOW_BPP        16    // bitdepth of window (8,16,24 etc.)
                                // note: if windowed and not
                                // fullscreen then bitdepth must
                                // be same as system bitdepth
                                // also if 8-bit the a pallete
                                // is created and attached

#define WINDOWED_APP      1     // 0 not windowed, 1 windowed

// defines for ants
#define NUM_ANTS         16 // just change this to whatever, but only 8 ants will be displayed
                            // on HUD
#define ANT_ANIM_UP      0
#define ANT_ANIM_RIGHT   1
#define ANT_ANIM_DOWN    2
#define ANT_ANIM_LEFT    3
#define ANT_ANIM_DEAD    4

// states of ant
#define ANT_WANDERING             0   // moving around randomly
#define ANT_EATING                1   // at a mnm eating it
#define ANT_RESTING               2   // sleeping :)
#define ANT_SEARCH_FOOD           3   // hungry and searching for food
       
// these are the substates that occur during a search for food
        #define ANT_SEARCH_FOOD_S1_SCAN         31  // substate 1
        #define ANT_SEARCH_FOOD_S2_WANDER       32  // substate 2
        #define ANT_SEARCH_FOOD_S3_VECTOR_2CELL 33  // substate 3
        #define ANT_SEARCH_FOOD_S4_VECTOR_2FOOD 34  // substate 4
        #define ANT_SEARCH_FOOD_S5              35  // substate 5
        #define ANT_SEARCH_FOOD_S6              36  // substate 6
        #define ANT_SEARCH_FOOD_S7              37  // substate 7

#define ANT_COMMUNICATING         4   // talking to another ant  
#define ANT_DEAD                  5   // this guy is dead, got too hungry

#define ANT_INDEX_HUNGER_LEVEL       0  // the current hunger level of ant
#define ANT_INDEX_HUNGER_TOLERANCE   1  // the death tolerance of hunger
#define ANT_INDEX_AI_STATE           2  // the artificial intelligence state
#define ANT_INDEX_AI_SUBSTATE        3  // generic substate
#define ANT_INDEX_DIRECTION          4  // direction of motion
#define ANT_INDEX_LAST_TALKED_WITH   5  // last ant talked to
#define ANT_INDEX_MNM_BEING_DEVOURED 6  // the index of mnm being eaten
#define ANT_INDEX_FOOD_TARGET_X      7  // x,y target position of cell or off actual food
#define ANT_INDEX_FOOD_TARGET_Y      8    
#define ANT_INDEX_FOOD_TARGET_ID     9  // the id of the actual piece of food

#define ANT_MEMORY_RESIDUAL_RATE     0.2 // inversely proportional to plasticity of ant memory

#define BITE_SIZE                    5 // bite size of one mouthful in energy units

// defines for food
#define NUM_MNMS         32

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

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

// ants stuff
void Move_Ants(void);
void Init_Ants(void);
void Draw_Ants(void);

void Draw_Food(void);

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

// this is the food
typedef struct MNM_TYP
{
int x,y;     // position of mnm
float energy;  // when this is 0, the mnm is dead

} MNM, *MNM_PTR;


typedef struct ANT_MEMORY_TYP
{

float cell[16][16];     // the actual memory
int   ilayer[16][16];   // used as an input layer to help display engine show
                        // areas during communication and forgetfulness

} ANT_MEMORY, *ANT_MEMORY_PTR;


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

#define RAND_RANGE(x,y) ( (x) + (rand()%((y)-(x)+1)))


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

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

BITMAP_IMAGE background_bmp;   // holds the background

BOB          ants[NUM_ANTS],   // the ants
             mnm;              // the little food mnm image

MNM food[NUM_MNMS];            // the array of mnms

ANT_MEMORY ants_mem[NUM_ANTS]; // each ant has a 256 cell memory, 16x16 structure

int niceday_sound_id = -1;     // the ambient wind


// 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

WNDCLASSEX winclass; // this will hold the class we create
HWND	   hwnd;	 // generic window handle
MSG		   msg;		 // generic message
HDC        hdc;      // graphics device context

// first fill in the window class stucture
winclass.cbSize         = sizeof(WNDCLASSEX);
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;
winclass.hIconSm        = LoadIcon(NULL, IDI_APPLICATION);

// save hinstance in global
main_instance = hinstance;

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

// create the window
if (!(hwnd = CreateWindowEx(NULL,                  // extended style
                            WINDOW_CLASS_NAME,     // class
						    WINDOW_TITLE, // title
						    (WINDOWED_APP ? (WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION) : (WS_POPUP | WS_VISIBLE)), 
					 	    0,0,	  // initial x,y
						    WINDOW_WIDTH,WINDOW_HEIGHT,  // initial width, height
						    NULL,	  // handle to parent 
						    NULL,	  // handle to menu
						    hinstance,// instance of this application
						    NULL)))	// extra creation parms
return(0);

// save main window handle
main_window_handle = hwnd;

if (WINDOWED_APP)
{
// now resize the window, so the client area is the actual size requested
// since there may be borders and controls if this is going to be a windowed app
// if the app is not windowed then it won't matter
RECT window_rect = {0,0,WINDOW_WIDTH-1,WINDOW_HEIGHT-1};

// make the call to adjust window_rect
AdjustWindowRectEx(&window_rect,
     GetWindowStyle(main_window_handle),
     GetMenu(main_window_handle) != NULL,
     GetWindowExStyle(main_window_handle));

// save the global client offsets, they are needed in DDraw_Flip()
window_client_x0 = -window_rect.left;
window_client_y0 = -window_rect.top;

// now resize the window with a call to MoveWindow()
MoveWindow(main_window_handle,
           0, // x position
           0, // y position
           window_rect.right - window_rect.left, // width
           window_rect.bottom - window_rect.top, // height
           TRUE);

// show the window, so there's no garbage on first render
ShowWindow(main_window_handle, SW_SHOW);
} // end if windowed

// 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

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

// T3D GAME PROGRAMMING CONSOLE FUNCTIONS ////////////////

int Game_Init(void *parms)
{
// this function is where you do all the initialization 
// for your game

int index; // looping variable

// seed the random number generator
srand(Get_Clock());

// initialize directdraw, very important that in the call
// to setcooperativelevel that the flag DDSCL_MULTITHREADED is used
// which increases the response of directX graphics to
// take the global critical section more frequently
DDraw_Init(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_BPP, WINDOWED_APP);

// load background image
Load_Bitmap_File(&bitmap16bit, "SIDEWALK224.BMP");
Create_Bitmap(&background_bmp,0,0,640,480,16);
Load_Image_Bitmap16(&background_bmp, &bitmap16bit,0,0,BITMAP_EXTRACT_MODE_ABS);
Unload_Bitmap_File(&bitmap16bit);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费观看日韩av| 香蕉成人啪国产精品视频综合网 | 国产精品久久久久久亚洲毛片 | √…a在线天堂一区| 91丨九色丨蝌蚪丨老版| 怡红院av一区二区三区| 欧美日韩中文另类| 麻豆91精品91久久久的内涵| 国产亚洲欧美中文| 91亚洲资源网| 日韩av中文字幕一区二区三区| 欧美成人一区二区三区片免费| 久久99精品国产.久久久久| 欧美激情在线看| 在线国产电影不卡| 国内成+人亚洲+欧美+综合在线| 中文一区一区三区高中清不卡| 91浏览器在线视频| 午夜视频一区二区三区| 精品精品欲导航| av在线播放一区二区三区| 亚洲电影欧美电影有声小说| 精品欧美乱码久久久久久1区2区| 成人国产一区二区三区精品| 爽好多水快深点欧美视频| 2023国产精品| 欧美午夜在线一二页| 国产乱码字幕精品高清av| 亚洲女爱视频在线| 精品国产一二三区| 91免费版在线看| 精品一区二区在线免费观看| 一区二区三区四区视频精品免费| 91精品国产综合久久蜜臀| 成人高清视频免费观看| 免费在线观看成人| 亚洲一区二区三区四区在线免费观看| 日韩欧美一级二级三级久久久| 91婷婷韩国欧美一区二区| 激情综合色丁香一区二区| 亚洲精品久久7777| 国产日韩精品视频一区| 91精品国产福利| 在线视频你懂得一区| 国产91精品一区二区麻豆亚洲| 奇米影视在线99精品| 亚洲综合视频网| 亚洲欧美一区二区在线观看| 久久免费看少妇高潮| 欧美久久久影院| 色哟哟欧美精品| 国产成人午夜电影网| 久久成人av少妇免费| 婷婷久久综合九色国产成人| 一区二区三区四区视频精品免费 | 日韩一区精品字幕| 亚洲免费成人av| 自拍偷拍亚洲激情| 国产欧美一区二区精品性色超碰| 91精品国产91久久综合桃花| 欧美丝袜丝交足nylons| 色综合久久66| 99精品视频中文字幕| 成人手机电影网| 高清在线不卡av| 国产高清一区日本| 国产精品一区二区免费不卡| 久久99精品国产麻豆不卡| 麻豆91精品视频| 久久www免费人成看片高清| 日韩精品视频网| 日本欧美加勒比视频| 日韩av一区二区在线影视| 丝袜亚洲精品中文字幕一区| 日日噜噜夜夜狠狠视频欧美人 | 日韩精品一区二区三区视频| 91精品国产综合久久久久久漫画| 欧美日韩国产一区二区三区地区| 91色|porny| 在线免费av一区| 欧美日韩极品在线观看一区| 欧美巨大另类极品videosbest| 欧美日韩亚洲不卡| 欧美日本一道本| 欧美一区中文字幕| 2023国产一二三区日本精品2022| 精品动漫一区二区三区在线观看| 久久午夜电影网| 中文字幕精品一区| 亚洲精品国产精华液| 一区二区三区中文免费| 午夜精品一区在线观看| 日日摸夜夜添夜夜添精品视频| 日韩国产欧美三级| 国产一区二区三区香蕉| av网站免费线看精品| 日本丶国产丶欧美色综合| 欧美日韩精品一区视频| 欧美大胆人体bbbb| 欧美国产精品中文字幕| 亚洲欧美日韩国产成人精品影院| 一区二区欧美视频| 久久精品国产精品亚洲精品| 国产99精品视频| 欧美三级一区二区| 精品国内片67194| 一区免费观看视频| 日韩成人免费在线| 成人污视频在线观看| 欧美日韩免费电影| 中文欧美字幕免费| 亚洲一区二区三区四区的| 精品一区二区三区免费毛片爱| 成人av中文字幕| 欧美一区二区三区视频| 欧美国产综合色视频| 午夜精品福利在线| 成人h精品动漫一区二区三区| 欧美日韩另类一区| 欧美激情一区二区三区| 舔着乳尖日韩一区| 成人精品亚洲人成在线| 欧美一级久久久久久久大片| 国产精品女人毛片| 日本亚洲三级在线| 色先锋资源久久综合| 2017欧美狠狠色| 亚洲一区二区精品视频| 高清不卡在线观看| 日韩一级免费一区| 亚洲综合成人在线视频| 风间由美性色一区二区三区| 日韩视频免费观看高清完整版 | 亚洲国产综合色| 成人毛片视频在线观看| 欧美xxxxxxxx| 午夜视黄欧洲亚洲| 色噜噜狠狠色综合中国| 久久精品夜色噜噜亚洲a∨| 亚洲第一成年网| 91免费观看国产| 国产精品日韩精品欧美在线| 精品一区二区三区香蕉蜜桃 | 麻豆精品一区二区| 欧美中文字幕一二三区视频| 国产精品高潮久久久久无| 黑人精品欧美一区二区蜜桃| 欧美日韩国产综合视频在线观看| 亚洲视频 欧洲视频| 成年人网站91| 中文字幕免费不卡| 国产91高潮流白浆在线麻豆 | 欧美一卡二卡在线| 亚洲大片一区二区三区| 色婷婷综合在线| 亚洲天堂久久久久久久| 成人小视频在线观看| 国产欧美日韩一区二区三区在线观看| 久久99精品一区二区三区| 日韩精品中文字幕一区二区三区| 日本欧美一区二区三区乱码| 欧美美女直播网站| 亚洲国产色一区| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲一区二区三区四区在线免费观看 | 国产日韩亚洲欧美综合| 黑人巨大精品欧美黑白配亚洲| 欧美电影免费观看高清完整版| 久久精品久久久精品美女| 日韩欧美亚洲国产另类| 久久成人麻豆午夜电影| 精品免费国产二区三区| 国产精品 欧美精品| 国产农村妇女毛片精品久久麻豆| 国产成人精品免费视频网站| 国产精品网站在线| 99免费精品视频| 夜夜精品浪潮av一区二区三区| 在线观看日韩毛片| 视频一区中文字幕国产| 欧美tickling网站挠脚心| 国产一区二区久久| 日韩伦理电影网| 欧美日韩精品一区视频| 久久成人羞羞网站| 国产精品看片你懂得 | 欧美在线制服丝袜| 午夜精品久久久久久久99水蜜桃| 日韩欧美在线观看一区二区三区| 久久99热狠狠色一区二区| 欧美经典一区二区| 91视视频在线观看入口直接观看www | 免费日韩伦理电影| 久久这里只有精品视频网| aa级大片欧美| 日韩国产欧美在线播放| 国产人成亚洲第一网站在线播放| 91啦中文在线观看| 免费成人美女在线观看.| 中文字幕乱码久久午夜不卡|