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

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

?? ddbutton.cpp

?? 赤壁之戰的游戲源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/////////////
//	DDButton.cpp	:	v0010
//	Written by		:	Li Haijun
//	Compiler		:	Microsoft Visual C++ 4.2 & DirectX
//	Library			:	DDraw.Lib
//	Copyright (C)	:	1996 WayAhead Corporation 
//	v0010			:	Oct.25.1996
//	V0011			:	Dec.23.1996
/////////////
// implementation file

// This file provide basic interfaces for deal with bitmap of interface 
//////////////////////////////

#include "stdafx.h"
#include <stdio.h>

#include <ddraw.h>
#include "DDCompo.h"	// only include this one
#include "DsApi.h"	// sound
#include "DDApi.h"	// surface
#include "Assert.h"

#include "Marco.h"	//macro define
#include "DDButton.h"
#include "interfac.h"
#include "interfa2.h"

//	to include this tempory
#include	"DDComUn.h"

// to include this for to use One Fish's l_text
#include "l_text.h"


////////////////////////////
#include "l_allbmp.h"
char	bmpfilename[30]="bmp\\bmp.lwc";
char	listfilename[30]="bmp\\bmp.idx";
/////////////////////////////////////

/////////////////////////////////////
//	to restore all button's pointer
class	CDDButton	*	pAllButton[MAX_BUTTON];

class	CDDButton	*	pCurrentButton;		// a pointer point to the current button
class	CDDButton	*	pPreviousButton;	// a pointer point to the previous button
int		nPreviousButtonState = NONE;	// previous button's state,0-up,1-down,2-disable,3-focus,4-disable,5-hide
int		nCurrentButtonState = NONE;	// current button's state,0-up,1-down,2-disable,3-focus,4-disable,5-hide

extern	class	CDDCommandUnit	* pCurrentCommandUnit ;	// a pointer point to the current command unit

/////////////////////////////////////////////////
//	this veriable is decleared only for net_work
extern BOOL GAME_bNetwork ;
/////////////////////////////////////////////////

WAVEDYNAMIC Wave;	  // to broadcast a sound when click a button

//constructor
CDDButton::CDDButton()
{
	m_nFileNameId = NONE;
	m_PromptString[0] = '\0';
	m_szOneBitmap.cx = 0L;
	m_szOneBitmap.cy = 0L;

	m_rTotal.left	= 0L;
	m_rTotal.top	= 0L;
	m_rTotal.right	= 0L;
	m_rTotal.bottom	= 0L;

	m_rCurrent.left	= 0L;
	m_rCurrent.top	= 0L;
	m_rCurrent.right	= 0L;
	m_rCurrent.bottom	= 0L;

	m_dwX = 0;	m_dwY = 0;

	m_nState = 0;
	m_nPreviousState = 0;
	m_nPart = 0;

	m_bEnableSound = TRUE;
}
//constructor
CDDButton::~CDDButton()
{
	Release();
	m_nFileNameId = NONE;
	m_PromptString[0] = '\0';
	m_bEnableSound = TRUE;
}

BOOL CDDButton::PreLoad(int FilenameId, int x, int y,
				int OneBitmapWidth/*=0*/, int OneBitmapHeight/*=0*/, int ColorKeyFlag/*=FALSE*/ )
{
	char	fname[20];

	HRESULT			ddrval;
	DDSURFACEDESC	ddsd;

//////////////////////////////////////////////////
	_itoa( FilenameId, fname, 10 );

	class CPicture_imageall picture;

	picture.image_open_compress(bmpfilename);
	picture.image_open_index(listfilename);
	picture.LoadBitmap( &m_BitmapSurface, FilenameId );
	picture.image_close_index();
	picture.image_close_compress();

	if( ColorKeyFlag == TRUE )
	{
		m_BitmapSurface.SetColorKeyPAL(0);
	}

	// to set the value of m_FileName
	m_nFileNameId = FilenameId;	//set the member veriable m_FileName
/////////////////////////////////////////////////////////
    //
    // get size of surface.
    //
    ddsd.dwSize = sizeof(ddsd);
    ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH;

    ddrval = m_BitmapSurface.GetSurface()->GetSurfaceDesc(&ddsd);
	if(ddrval != DD_OK)
		return FALSE;
	m_rTotal.left = m_rTotal.top = 0;
	m_rTotal.right = ddsd.dwWidth;
	m_rTotal.bottom = ddsd.dwHeight;
// to set the value of m_szOneBitmap
	if( (OneBitmapWidth==0)&&(OneBitmapHeight==0) )
	{
		// I assume that all single bitmaps' height is equal to it's width
		if(m_rTotal.bottom > m_rTotal.right)
			m_szOneBitmap.cx = m_szOneBitmap.cy = m_rTotal.right;
		else
			m_szOneBitmap.cx = m_szOneBitmap.cy = m_rTotal.bottom;
		// to set the value of m_rCurrent
		m_rCurrent.left = m_rCurrent.top = 0;
		m_rCurrent.right = m_rCurrent.bottom = m_szOneBitmap.cx;
	}
	else if( OneBitmapWidth * OneBitmapHeight == 0 )
		return FALSE;
	else
	{
		// I assume that all single bitmaps' height is not equal to it's width
		m_szOneBitmap.cx = OneBitmapWidth;
		m_szOneBitmap.cy = OneBitmapHeight;
	}
//to set the value of m_dwX, m_dwY
	m_dwX = x; m_dwY = y;

	SetState(BUTTON_UP);
// to insert this button into pAllButton array
	for( int i=0; i<MAX_BUTTON; i++ )
	{
		if( pAllButton[i] == NULL )
		{
			pAllButton[i] = this;
			break;
		}
	}
	return TRUE;
}
// to release this button's pointer
void CDDButton::Release()
{
	for( int i=0; i<MAX_BUTTON; i++ )
	{
		if( (pAllButton[i] != NULL)&&(pAllButton[i] == this) )
		{
			pAllButton[i] = NULL;
			break;
		}
	}
	// release the surface that this button's bitmap used
	m_BitmapSurface.Release();
}
// to set the position of left top corner of this button to show
void CDDButton::SetPosition(int PosX, int PosY)
{
	//to set the value of m_dwX, m_dwY
	m_dwX = PosX;
	m_dwY = PosY;
}
// to set this button's ID
void CDDButton::SetID(int ID)
{
	m_nID = ID ;	// button id
}
// to get this button's ID
int CDDButton::GetID(void)
{
	return m_nID;
}
// to set this button's state
void CDDButton::SetState(int state)	// let button up or down or ...
{
	if( GAME_bNetwork == TRUE && m_nID == BUTTON_PAUSE )
		m_nState = BUTTON_DISABLE ;
	else
		m_nState = state ;

	if( state == BUTTON_HIDE )
		return ;
	if( m_szOneBitmap.cx == m_rTotal.right )
	{
		m_rCurrent.left = m_rTotal.left;
		m_rCurrent.top = m_rTotal.top + m_nState * m_szOneBitmap.cy;
		m_rCurrent.right = m_rCurrent.left + m_szOneBitmap.cx;
		m_rCurrent.bottom = m_rCurrent.top + m_szOneBitmap.cy;
	}
	else
	{
		m_rCurrent.left = m_rTotal.left + m_nState * m_szOneBitmap.cx;
		m_rCurrent.top = m_rTotal.top;
		m_rCurrent.right = m_rCurrent.left + m_szOneBitmap.cx;
		m_rCurrent.bottom = m_rCurrent.top + m_szOneBitmap.cy;
	}
}
// to set the prompt string
void CDDButton::SetPromptString( LPCTSTR lpszPromptString )
{
	strcpy( m_PromptString, lpszPromptString );

	int		strlenth=0;
	strlenth = strlen( m_PromptString ) ;
	for( int i=0; i<strlenth; i++ )
	{
		if( m_PromptString[i] == '$' )
			m_PromptString[i] = ' ' ;
	}
}
// to cat the four data to the prompt string
void CDDButton::CatPromptString( int Money, int Food, int Wood, int Iron )
{
	char	money[50];
	char	food[50];
	char	wood[50];
	char	iron[50];

	_itoa(Money, money, 10) ;
	_itoa(Food, food, 10) ;
	_itoa(Wood, wood, 10) ;
	_itoa(Iron, iron, 10) ;

	strcat(m_PromptString, "@") ;
	strcat(m_PromptString, money) ;

	strcat(m_PromptString, "@") ;
	strcat(m_PromptString, food) ;

	strcat(m_PromptString, "@") ;
	strcat(m_PromptString, wood) ;

	strcat(m_PromptString, "@") ;
	strcat(m_PromptString, iron) ;
	strcat(m_PromptString, "@") ;
}
// to cat the 所需計謀 value to the prompt string
void CDDButton::CatJmString( int Jm )
{
	char	jm[50];

	_itoa(Jm, jm, 10) ;

	strcat(m_PromptString, "&") ;
	strcat(m_PromptString, jm) ;
	strcat(m_PromptString, "&") ;
}
// to show the prompt string
void CDDButton::ShowPromptString()
{
	char	HotKey = '\0' ;		// to store the hot kye that should be show
	char	TempString[256] ;	// to out put this string

	if( m_PromptString[0] == '\0' )
		return;
	// TO ADD SOME HOT KEY HERE
	if(pCurrentCommandUnit != NULL)
	{
		if( this == pCurrentCommandUnit->m_pButton[0] )
			HotKey = 'Q' ;
		else if( this == pCurrentCommandUnit->m_pButton[1] )
			HotKey = 'W' ;
		else if( this == pCurrentCommandUnit->m_pButton[2] )
			HotKey = 'E' ;
		else if( this == pCurrentCommandUnit->m_pButton[3] )
			HotKey = 'A' ;
		else if( this == pCurrentCommandUnit->m_pButton[4] )
			HotKey = 'S' ;
		else if( this == pCurrentCommandUnit->m_pButton[5] )
			HotKey = 'D' ;
		else if( this == pCurrentCommandUnit->m_pButton[6] )
			HotKey = 'Z' ;
		else if( this == pCurrentCommandUnit->m_pButton[7] )
			HotKey = 'X' ;
		else if( this == pCurrentCommandUnit->m_pButton[8] )
			HotKey = 'C' ;
	}

	if( HotKey != '\0' )
	{
		TempString[0] = '(' ;
		TempString[1] = HotKey ;
		TempString[2] = ')' ;
		TempString[3] = '\0' ;
		strcat(TempString, m_PromptString) ;
	}
	else
		strcpy(TempString, m_PromptString) ;

	FACE_Prompt( DD_GetBackBuffer(), TempString );
}
// to erase the prompt area when mouse move out the command button or mouse-left-button down on the command button
void CDDButton::ErasePromptRect()
{
	if( m_PromptString[0] == '\0' )
		return;
	FACE_UpdateMessageRect();
}
/////////////////////////////////////////
// to set all button's state when change the command state
void CDDButton::SetAllButtonState(int state)	// let button up or down or ...
{
	if( m_nState != BUTTON_HIDE )
	{
		m_nPreviousState = m_nState;	//to store current button state to previous region
		m_nState = state;		// to set button's state
//		Show();			// to show the changed button
	}
}
// to restore all button's state when change the command state
void CDDButton::RestoreAllButtonState()	// let button up or down or ...
{
	if( m_nState != BUTTON_HIDE )
	{
		m_nState = m_nPreviousState ;	//to restore button's state from the previous region
//		Show();			// to show this change
	}
}
//to test if the given point on this button
BOOL CDDButton::OnButton( int x, int y)
{
	int	m_nLeftEdge = m_dwX;
	int m_nRightEdge = m_nLeftEdge + (int)m_szOneBitmap.cx;
	int m_nTopEdge = m_dwY;
	int m_nBottomEdge = m_nTopEdge + (int)m_szOneBitmap.cy;

	if( (m_nState == BUTTON_DISABLE)||(m_nState==BUTTON_HIDE) )
		return FALSE;
	else if( (x >= m_nLeftEdge)&&(x <= m_nRightEdge )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线中文字幕一区二区| 亚洲国产中文字幕| 丁香一区二区三区| 国产精品久久久久久久久快鸭 | 在线观看欧美日本| 夜夜嗨av一区二区三区四季av| 91黄色免费观看| 性欧美疯狂xxxxbbbb| 欧美大肚乱孕交hd孕妇| 国产精品白丝jk黑袜喷水| 亚洲欧洲日韩一区二区三区| 欧美主播一区二区三区| 免费成人在线影院| 国产女主播在线一区二区| 91论坛在线播放| 蜜臀久久99精品久久久久宅男 | 日本一区二区三区在线观看| 91亚洲国产成人精品一区二三| 亚洲乱码国产乱码精品精小说| 欧美日韩一级大片网址| 国模无码大尺度一区二区三区| 中文字幕一区二区三中文字幕| 欧美日韩一二三区| 国产.精品.日韩.另类.中文.在线.播放| 亚洲成a人v欧美综合天堂下载 | 91在线小视频| 欧美午夜在线一二页| 欧美日韩一级视频| 久久久午夜精品理论片中文字幕| 亚洲欧美电影院| 美腿丝袜亚洲一区| 欧美视频一区在线| 国产精品久久久久久久第一福利| 另类综合日韩欧美亚洲| 色噜噜久久综合| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美色区777第一页| 国产精品自在在线| 欧美成人乱码一区二区三区| 一区二区三区在线免费| 欧美日韩成人综合天天影院| 色88888久久久久久影院按摩| 日韩精品一区二| 97精品国产露脸对白| 精品在线一区二区三区| 亚洲精品亚洲人成人网在线播放| 精品日韩欧美一区二区| 欧美视频第二页| 99在线精品视频| 韩国理伦片一区二区三区在线播放| 一区二区三区精品在线观看| 久久久一区二区| 日韩视频一区在线观看| 欧美亚洲免费在线一区| 成人激情午夜影院| 国产乱国产乱300精品| 蜜臀av一级做a爰片久久| 一区二区三区日韩精品| 国产精品理论片在线观看| 日韩精品影音先锋| 欧美一级高清片在线观看| 欧美日韩一区二区欧美激情| 日本韩国一区二区| 91丨九色porny丨蝌蚪| 丁香桃色午夜亚洲一区二区三区| 久久国产夜色精品鲁鲁99| 视频一区二区不卡| 视频在线在亚洲| 日韩成人av影视| 日韩专区在线视频| 日本少妇一区二区| 麻豆免费精品视频| 日韩av一级片| 久久国产欧美日韩精品| 免费观看在线综合| 美女网站一区二区| 日本中文一区二区三区| 蜜桃在线一区二区三区| 久久精品72免费观看| 激情av综合网| 国产麻豆欧美日韩一区| 国产aⅴ精品一区二区三区色成熟| 国产成人精品影院| 成人91在线观看| 91丨porny丨首页| 欧美日韩在线播| 91精品国模一区二区三区| 精品日韩成人av| 国产欧美精品一区二区色综合| 国产欧美日韩三区| 亚洲欧洲99久久| 亚洲韩国精品一区| 美女视频黄久久| 国产成人无遮挡在线视频| 成人av在线网| 欧美在线你懂得| 日韩欧美视频一区| 日本一区二区三区视频视频| 亚洲精品v日韩精品| 日韩精品国产精品| 国产成人在线视频网址| 99riav久久精品riav| 欧美欧美午夜aⅴ在线观看| 日韩丝袜情趣美女图片| 亚洲国产精品黑人久久久| 一区二区三区在线视频播放| 麻豆精品精品国产自在97香蕉| 国产精品 日产精品 欧美精品| 91美女在线看| 欧美大片在线观看一区| 国产精品福利电影一区二区三区四区| 亚洲最新视频在线观看| 国内精品国产三级国产a久久 | 日韩成人免费在线| 国产很黄免费观看久久| 在线观看网站黄不卡| 日韩久久免费av| 亚洲精品伦理在线| 韩国成人福利片在线播放| 色老头久久综合| 久久婷婷国产综合精品青草| 一区二区三区欧美在线观看| 国产精品一区专区| 欧美另类z0zxhd电影| 中文字幕中文字幕在线一区 | 久久久99精品免费观看| 亚洲一级在线观看| 成人午夜伦理影院| 日韩视频一区在线观看| 亚洲一区二区四区蜜桃| 国产精品资源在线看| 欧美精品v国产精品v日韩精品| 欧美国产成人精品| 久久激情五月激情| 欧美日韩免费一区二区三区视频 | 99在线视频精品| 精品国产伦理网| 日日摸夜夜添夜夜添亚洲女人| 懂色av噜噜一区二区三区av| 精品少妇一区二区三区日产乱码| 亚洲综合精品自拍| 不卡免费追剧大全电视剧网站| 日韩免费福利电影在线观看| 午夜私人影院久久久久| 日本高清视频一区二区| 亚洲欧美在线视频观看| 成人一区二区视频| 精品国产一区二区在线观看| 亚洲国产欧美在线| 日本精品一级二级| 亚洲人成网站影音先锋播放| 粉嫩在线一区二区三区视频| 26uuu国产日韩综合| 久久精品国产亚洲a| 日韩手机在线导航| 日韩经典一区二区| 欧美精品一级二级三级| 午夜激情一区二区| 69堂亚洲精品首页| 日韩影院精彩在线| 欧美久久一二三四区| 日韩经典中文字幕一区| 欧美日本高清视频在线观看| 午夜免费久久看| 欧美一区二区日韩| 另类小说色综合网站| 日韩免费成人网| 国产精品自拍网站| 欧美国产成人在线| 99久精品国产| 一区二区三区久久久| 欧美怡红院视频| 天天色天天爱天天射综合| 91精品午夜视频| 国产在线一区二区| 国产婷婷精品av在线| 成av人片一区二区| 亚洲人123区| 欧美日本国产视频| 老司机精品视频线观看86| 精品毛片乱码1区2区3区| 国产一区二区三区最好精华液| 国产色产综合产在线视频| 成人免费视频国产在线观看| 亚洲三级视频在线观看| 欧美猛男超大videosgay| 日本欧美大码aⅴ在线播放| 欧美不卡一区二区三区四区| 国产精品一区在线| 亚洲女同ⅹxx女同tv| 欧美日韩精品一区二区三区蜜桃| 蜜臀精品久久久久久蜜臀| 国产亚洲精品免费| 欧美性猛交xxxx黑人交| 蜜臀久久99精品久久久久宅男| 国产日韩欧美精品电影三级在线| 91色porny| 蜜桃视频一区二区| 国产精品国产三级国产三级人妇| 欧美日韩三级一区二区|