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

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

?? frame.cpp

?? RPG小游戲
?? CPP
?? 第 1 頁 / 共 5 頁
字號:

 

#define WIN32_LEAN_AND_MEAN  

#define INITGUID

#include <windows.h>   
#include <windowsx.h> 
#include <mmsystem.h>
#include <iostream> 
#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 <fstream>

using namespace std;

#include <ddraw.h> // include directdraw
#include "resource.h"
// DEFINES ////////////////////////////////////////////////

// defines for windows 
#define WINDOW_CLASS_NAME "WINCLASS1"

// default screen size
#define SCREEN_WIDTH    1024// size of screen
#define SCREEN_HEIGHT   768
#define SCREEN_BPP      8    // bits per pixel

#define BITMAP_ID            0x4D42 // universal id for a bitmap
#define MAX_COLORS_PALETTE   256

#define START_PICTURE  10001
#define GAMEMAP_1	   10002
#define GAMEMAP_2	   10003	
#define GAMEMAP_3	   10004

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

// basic unsigned types
typedef unsigned short USHORT;
typedef unsigned short WORD;
typedef unsigned char  UCHAR;
typedef unsigned char  BYTE;



// container structure for bitmaps .BMP file
typedef struct BITMAP_FILE_TAG
        {
        BITMAPFILEHEADER bitmapfileheader;  // this contains the bitmapfile header
        BITMAPINFOHEADER bitmapinfoheader;  // this is all the info including the palette
        PALETTEENTRY     palette[256];      // we will store the palette here
        UCHAR            *buffer;           // this is a pointer to the data

        } BITMAP_FILE, *BITMAP_FILE_PTR;

// this will hold our little alien

 
 





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

int Flip_Bitmap(UCHAR *image, int bytes_per_line, int height);

int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char *filename);

int Unload_Bitmap_File(BITMAP_FILE_PTR bitmap);

int DDraw_Fill_Surface(LPDIRECTDRAWSURFACE7 lpdds,int color);

int Scan_Image_Bitmap(BITMAP_FILE_PTR bitmap, LPDIRECTDRAWSURFACE7 lpdds, int cx,int cy);

LPDIRECTDRAWSURFACE7 DDraw_Create_Surface(int width, int height, int mem_flags, int color_key);

int DDraw_Draw_Surface(LPDIRECTDRAWSURFACE7 source, int x, int y, 
                      int width, int height, LPDIRECTDRAWSURFACE7 dest, 
                      int transparent);    

LPDIRECTDRAWCLIPPER DDraw_Attach_Clipper(LPDIRECTDRAWSURFACE7 lpdds,
                                         int num_rects,
                                         LPRECT clip_list);

int Draw_Text_GDI(char *text, int x,int y,COLORREF color, LPDIRECTDRAWSURFACE7 lpdds);

bool bump(int x,int y,int**Rec);
int talk(LPDIRECTDRAWSURFACE7 background,LPDIRECTDRAWSURFACE7 people1,LPDIRECTDRAWSURFACE7 people2,char **word,int n);
int toux[5]={48,104,101,101,96};
int touy[5]={64,105,100,130,96};

int tou=0;
// MACROS /////////////////////////////////////////////////

// tests if a key is up or down
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code)   ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)

// initializes a direct draw struct
#define DDRAW_INIT_STRUCT(ddstruct) { memset(&ddstruct,0,sizeof(ddstruct)); ddstruct.dwSize=sizeof(ddstruct); }

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

HWND      main_window_handle = NULL; // globally track main window
int       window_closed      = 0;    // tracks if window is closed
HINSTANCE hinstance_app      = NULL; // globally track hinstance


const int map_number=5;
const int otherpeople_number=4;
int cx=480,cy=-150,mark=0,mark_1,count=0;




// directdraw stuff

LPDIRECTDRAW7         lpdd         = NULL;   // dd4 object
LPDIRECTDRAWSURFACE7  lpddsprimary = NULL;   // dd primary surface
LPDIRECTDRAWSURFACE7  lpddsback    = NULL;   // dd back surface
LPDIRECTDRAWPALETTE   lpddpal      = NULL;   // a pointer to the created dd palette
LPDIRECTDRAWCLIPPER   lpddclipper  = NULL;   // dd clipper
PALETTEENTRY          palette[256];          // color palette
PALETTEENTRY          save_palette[256];     // used to save palettes
DDSURFACEDESC2        ddsd;                  // a direct draw surface description struct
DDBLTFX               ddbltfx;               // used to fill
DDSCAPS2              ddscaps;               // a direct draw surface capabilities struct
HRESULT               ddrval;                
DWORD                 start_clock_count = 0; 

BITMAP_FILE           bitmap[map_number];                
BITMAP_FILE			  start_pic;

LPDIRECTDRAWSURFACE7  lpddsbackground [map_number];
LPDIRECTDRAWSURFACE7  lpddsotherpeople[otherpeople_number];
LPDIRECTDRAWSURFACE7   fight_effect[1];
LPDIRECTDRAWSURFACE7  houyitou;
LPDIRECTDRAWSURFACE7  yuditou,start_picture ;
LPDIRECTDRAWSURFACE7 talkbar;

#include "PeopleClass.h"






                 houyi HouYi(20,1,20,15,0,480,550,10);
enchanter changer (100,1,5,3,0,500,500,5,1000);


char buffer[80];                             

int gwidth  = -1;
int gheight = -1;
int GameState =0;



int fight(LPDIRECTDRAWSURFACE7 background,LPDIRECTDRAWSURFACE7 guai,LPDIRECTDRAWSURFACE7 houyi,
		  people& guaiwu);

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

int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char *filename)
{
// this function opens a bitmap file and loads the data into bitmap

int file_handle,  // the file handle
    index;        // looping index

UCHAR   *temp_buffer = NULL; // used to convert 24 bit images to 16 bit
OFSTRUCT file_data;          // the file data information

// open the file if it exists
if ((file_handle = OpenFile(filename,&file_data,OF_READ))==-1)
   return(0);

// now load the bitmap file header
_lread(file_handle, &bitmap->bitmapfileheader,sizeof(BITMAPFILEHEADER));

// test if this is a bitmap file
if (bitmap->bitmapfileheader.bfType!=BITMAP_ID)
   {
   // close the file
   _lclose(file_handle);

   // return error
   return(0);
   } // end if

// now we know this is a bitmap, so read in all the sections

// first the bitmap infoheader

// now load the bitmap file header
_lread(file_handle, &bitmap->bitmapinfoheader,sizeof(BITMAPINFOHEADER));

// now load the color palette if there is one
if (bitmap->bitmapinfoheader.biBitCount == 8)
   {
   _lread(file_handle, &bitmap->palette,MAX_COLORS_PALETTE*sizeof(PALETTEENTRY));

   // now set all the flags in the palette correctly and fix the reversed 
   // BGR RGBQUAD data format
   for (index=0; index < MAX_COLORS_PALETTE; index++)
       {
       // reverse the red and green fields
       int temp_color                = bitmap->palette[index].peRed;
       bitmap->palette[index].peRed  = bitmap->palette[index].peBlue;
       bitmap->palette[index].peBlue = temp_color;
       
       // always set the flags word to this
       bitmap->palette[index].peFlags = PC_NOCOLLAPSE;
       } // end for index

    } // end if

// finally the image data itself
_lseek(file_handle,-(int)(bitmap->bitmapinfoheader.biSizeImage),SEEK_END);

// now read in the image, if the image is 8 or 16 bit then simply read it
// but if its 24 bit then read it into a temporary area and then convert
// it to a 16 bit image

if (bitmap->bitmapinfoheader.biBitCount==8 || bitmap->bitmapinfoheader.biBitCount==16 || 
    bitmap->bitmapinfoheader.biBitCount==24)
   {
   // delete the last image if there was one
   if (bitmap->buffer)
       free(bitmap->buffer);

   // allocate the memory for the image
   if (!(bitmap->buffer = (UCHAR *)malloc(bitmap->bitmapinfoheader.biSizeImage)))
      {
      // close the file
      _lclose(file_handle);

      // return error
      return(0);
      } // end if

   // now read it in
   _lread(file_handle,bitmap->buffer,bitmap->bitmapinfoheader.biSizeImage);

   } // end if
else
   {
   // serious problem
   return(0);

   } // end else

#if 0
// write the file info out 
printf("\nfilename:%s \nsize=%d \nwidth=%d \nheight=%d \nbitsperpixel=%d \ncolors=%d \nimpcolors=%d",
        filename,
        bitmap->bitmapinfoheader.biSizeImage,
        bitmap->bitmapinfoheader.biWidth,
        bitmap->bitmapinfoheader.biHeight,
		bitmap->bitmapinfoheader.biBitCount,
        bitmap->bitmapinfoheader.biClrUsed,
        bitmap->bitmapinfoheader.biClrImportant);
#endif

// close the file
_lclose(file_handle);

// flip the bitmap
Flip_Bitmap(bitmap->buffer, 
            bitmap->bitmapinfoheader.biWidth*(bitmap->bitmapinfoheader.biBitCount/8), 
            bitmap->bitmapinfoheader.biHeight);

// return success
return(1);

} // end Load_Bitmap_File

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

int Unload_Bitmap_File(BITMAP_FILE_PTR bitmap)
{
// this function releases all memory associated with "bitmap"
if (bitmap->buffer)
   {
   // release memory
   free(bitmap->buffer);

   // reset pointer
   bitmap->buffer = NULL;

   } // end if

// return success
return(1);

} // end Unload_Bitmap_File

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

int Flip_Bitmap(UCHAR *image, int bytes_per_line, int height)
{
// this function is used to flip bottom-up .BMP images

UCHAR *buffer; // used to perform the image processing
int index;     // looping index

// allocate the temporary buffer
if (!(buffer = (UCHAR *)malloc(bytes_per_line*height)))
   return(0);

// copy image to work area
memcpy(buffer,image,bytes_per_line*height);

// flip vertically
for (index=0; index < height; index++)
    memcpy(&image[((height-1) - index)*bytes_per_line],
           &buffer[index*bytes_per_line], bytes_per_line);

// release the memory
free(buffer);

// return success
return(1);

} // end Flip_Bitmap

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

LPDIRECTDRAWCLIPPER DDraw_Attach_Clipper(LPDIRECTDRAWSURFACE7 lpdds,
                                         int num_rects,
                                         LPRECT clip_list)

{


int index;                         // looping var
LPDIRECTDRAWCLIPPER lpddclipper;   // pointer to the newly created dd clipper
LPRGNDATA region_data;             // pointer to the region data that contains
                                   // the header and clip list

// first create the direct draw clipper
if (FAILED(lpdd->CreateClipper(0,&lpddclipper,NULL)))
   return(NULL);

// now create the clip list from the sent data

// first allocate memory for region data
region_data = (LPRGNDATA)malloc(sizeof(RGNDATAHEADER)+num_rects*sizeof(RECT));

// now copy the rects into region data
memcpy(region_data->Buffer, clip_list, sizeof(RECT)*num_rects);

// set up fields of header
region_data->rdh.dwSize          = sizeof(RGNDATAHEADER);
region_data->rdh.iType           = RDH_RECTANGLES;
region_data->rdh.nCount          = num_rects;
region_data->rdh.nRgnSize        = num_rects*sizeof(RECT);

region_data->rdh.rcBound.left    =  64000;
region_data->rdh.rcBound.top     =  64000;
region_data->rdh.rcBound.right   = -64000;
region_data->rdh.rcBound.bottom  = -64000;

// find bounds of all clipping regions
for (index=0; index<num_rects; index++)
    {
    // test if the next rectangle unioned with the current bound is larger
    if (clip_list[index].left < region_data->rdh.rcBound.left)
       region_data->rdh.rcBound.left = clip_list[index].left;

    if (clip_list[index].right > region_data->rdh.rcBound.right)
       region_data->rdh.rcBound.right = clip_list[index].right;

    if (clip_list[index].top < region_data->rdh.rcBound.top)
       region_data->rdh.rcBound.top = clip_list[index].top;

    if (clip_list[index].bottom > region_data->rdh.rcBound.bottom)
       region_data->rdh.rcBound.bottom = clip_list[index].bottom;

    } // end for index

// now we have computed the bounding rectangle region and set up the data
// now let's set the clipping list

if (FAILED(lpddclipper->SetClipList(region_data, 0)))
   {
   // release memory and return error
   free(region_data);
   return(NULL);
   } // end if

// now attach the clipper to the surface
if (FAILED(lpdds->SetClipper(lpddclipper)))
   {
   // release memory and return error
   free(region_data);
   return(NULL);
   } // end if

// all is well, so release memory and send back the pointer to the new clipper
free(region_data);
return(lpddclipper);

} // end DDraw_Attach_Clipper

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

int DDraw_Fill_Surface(LPDIRECTDRAWSURFACE7 lpdds,int color)
{
DDBLTFX ddbltfx; // this contains the DDBLTFX structure

// clear out the structure and set the size field 
DDRAW_INIT_STRUCT(ddbltfx);

// set the dwfillcolor field to the desired color
ddbltfx.dwFillColor = color; 

// ready to blt to surface
lpdds->Blt(NULL,       // ptr to dest rectangle
           NULL,       // ptr to source surface, NA            
           NULL,       // ptr to source rectangle, NA
           DDBLT_COLORFILL | DDBLT_WAIT,   // fill and wait                   
           &ddbltfx);  // ptr to DDBLTFX structure

// return success
return(1);
} // end DDraw_Fill_Surface

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

int DDraw_Draw_Surface(LPDIRECTDRAWSURFACE7 source, // source surface to draw
                      int x, int y,                 // position to draw at
                      int width, int height,        // size of source surface
                      LPDIRECTDRAWSURFACE7 dest,    // surface to draw the surface on
                      int transparent = 1)          // transparency flag
{
// draw a bob at the x,y defined in the BOB
// on the destination surface defined in dest

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆123| 亚洲综合色成人| 色噜噜狠狠色综合中国| 亚洲bt欧美bt精品| 国产美女主播视频一区| 色综合天天在线| 精品少妇一区二区三区日产乱码| 久久精品人人做| 亚洲国产你懂的| 99久久精品久久久久久清纯| 欧美成人女星排行榜| 极品销魂美女一区二区三区| 欧美日韩一区不卡| 亚洲欧美国产高清| 成人午夜视频在线| 精品剧情在线观看| 风流少妇一区二区| 国产偷国产偷亚洲高清人白洁| 成人av免费在线观看| 日韩精品一区二区三区三区免费| 亚洲大片精品永久免费| 日韩欧美不卡一区| 91丨porny丨最新| 亚洲成人精品一区二区| 精品对白一区国产伦| 日韩精品色哟哟| 欧美日韩不卡一区二区| 亚洲一区二区在线视频| 欧美不卡一区二区三区| 成人国产精品免费观看| 婷婷综合在线观看| 欧美久久久久久蜜桃| 亚洲图片欧美色图| 亚洲精品一区二区三区影院 | 日韩三级精品电影久久久| 亚洲三级在线播放| 一本色道久久综合亚洲aⅴ蜜桃| 中文字幕一区二区视频| 99久久婷婷国产综合精品| 日韩国产精品久久| 日韩午夜在线影院| 色婷婷精品大在线视频| 国产一区二区三区av电影| 亚洲成人你懂的| 欧美精彩视频一区二区三区| 日本va欧美va瓶| 日韩欧美国产小视频| 色综合色综合色综合| 国产精品一区免费视频| 国产精品美女久久久久久2018| 91在线高清观看| 激情综合色综合久久| 精品美女一区二区| 欧美日韩国产成人在线91| bt欧美亚洲午夜电影天堂| 亚洲国产精品久久不卡毛片| 国产精品天天看| 久久综合九色综合97_久久久| 99国产精品视频免费观看| 国产综合久久久久久鬼色| 日韩二区在线观看| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲男人电影天堂| 久久久久久99久久久精品网站| 激情综合色播五月| 日韩高清一级片| 亚洲国产日产av| 亚洲精品国产视频| 91精品国产综合久久久久久久久久| 九一久久久久久| 日韩av电影天堂| 天堂影院一区二区| 亚洲福利视频导航| 樱花影视一区二区| 一区二区三区在线视频观看58| 日韩亚洲欧美一区二区三区| 欧美美女黄视频| 欧美理论在线播放| 欧美精品一二三区| 91精品欧美一区二区三区综合在| 欧美三级蜜桃2在线观看| 日本韩国一区二区| 欧洲av一区二区嗯嗯嗯啊| 国产麻豆精品久久一二三| 国内精品国产成人国产三级粉色| 色吧成人激情小说| 99国产精品国产精品毛片| 成人精品视频一区二区三区 | 精品成人一区二区三区四区| 欧美一区二区三区免费在线看| 国产一区不卡精品| 国产一区二区导航在线播放| 国产精品一区二区在线观看不卡| 国产激情视频一区二区在线观看| 亚洲第一主播视频| 日韩精品乱码av一区二区| 美日韩一级片在线观看| 夜夜嗨av一区二区三区四季av| 亚洲一本大道在线| 日韩国产精品91| 国产一区二区在线看| 国产69精品久久久久毛片 | 蜜桃av一区二区在线观看| 久久99精品一区二区三区三区| 国产成人精品亚洲777人妖| 99国产精品久| 7777精品伊人久久久大香线蕉的 | 91欧美激情一区二区三区成人| 欧美日韩中文国产| 欧美tickling挠脚心丨vk| 国产色综合久久| 亚洲小少妇裸体bbw| 青娱乐精品视频| 国产成人免费视频精品含羞草妖精| 91免费在线播放| 日韩午夜激情av| 亚洲欧美综合在线精品| 视频一区中文字幕国产| 国产精品一区二区久激情瑜伽| 日本精品视频一区二区| 精品国产伦一区二区三区观看方式| 国产精品电影一区二区三区| 欧美韩国日本一区| 亚洲第一久久影院| 国产a区久久久| 337p亚洲精品色噜噜噜| 国产精品天天看| 日韩精品视频网| 99国产精品久久久久久久久久久| 欧美一级电影网站| 亚洲免费看黄网站| 国产一区二区三区四区在线观看| 欧美亚洲禁片免费| 欧美日韩国产成人在线免费| 国产日产欧美一区二区三区 | 全部av―极品视觉盛宴亚洲| aaa欧美日韩| 久久夜色精品一区| 天堂影院一区二区| 色悠悠久久综合| 国产亚洲成av人在线观看导航| 精品在线你懂的| 亚洲欧美另类小说| 国内精品伊人久久久久av一坑| 成人黄色a**站在线观看| 日韩精品一区二区在线观看| 亚洲精品videosex极品| 成人美女在线观看| 久久久精品国产免大香伊| 男女激情视频一区| 欧美中文字幕一区二区三区亚洲| 国产精品久久久久aaaa樱花| 国产一区欧美二区| 欧美成人精品福利| 日本最新不卡在线| 欧美精品tushy高清| 一区二区三区四区五区视频在线观看 | 国产精品成人免费| 国产一区不卡视频| 精品国产sm最大网站| 蓝色福利精品导航| 国产美女视频一区| 日韩一区二区三区四区| 丝袜国产日韩另类美女| 欧美日韩一二三| 亚洲成人久久影院| 欧美日韩久久久一区| 亚洲一区二区视频| 欧美性做爰猛烈叫床潮| 亚洲一区二区三区四区的| 99re这里都是精品| 欧美理论电影在线| 亚洲一区二区综合| 欧美性生交片4| 日韩国产高清在线| 日韩免费一区二区三区在线播放| 青青草成人在线观看| 精品美女在线播放| 国产精品一区二区黑丝| 国产精品久久午夜夜伦鲁鲁| www.欧美日韩| 亚洲综合色自拍一区| 欧美日韩精品欧美日韩精品一| 人妖欧美一区二区| 欧美精品一区二区三区在线 | 亚洲欧洲精品成人久久奇米网| 色综合一个色综合亚洲| 亚洲黄色免费电影| 欧美高清性hdvideosex| 精品一区二区免费| 国产精品视频免费看| 一本大道久久精品懂色aⅴ| 亚洲成人av一区二区| 中文一区二区在线观看| 成人高清视频在线| 日韩电影一区二区三区| 欧美肥妇毛茸茸| 国产在线不卡视频| 亚洲欧美日韩久久| 7777精品久久久大香线蕉|