⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cbdraw.h

📁 赤壁之战的游戏源代码
💻 H
字号:
/////////////
//	CBDraw.h		:	v0032
//	Written by		:	Liu Gang
//	Compiler		:	Microsoft Visual C++ 4.0 & DirectX
//	Library			:	DDraw.Lib
//	Copyright (C)	:	1996 WayAhead Corporation 
//	v0010			:	Sep.26.1996
//	v0011			:	Nov.16.1996
//	v0020			:	Dec.12.1996, changed the display method to MMX
//	v0021			:	Jan.22.1997, changed drawing border method
//	v0030			:	Mar.7.1997, Great changes since optimze display core functions
//						Optimize display functions again, this time, compressed the file
//						to one third, and the speed is faster 2-3 frames/second.
//						Optimzed the border drawing functions too.
//	v0031			:	Mar.12.1997, add new MMX features in code
//	v0032			:	Mar.29.1997, change drawing method of special items
/////////////
// header file
// display core codes

#ifndef	__CBDRAW_H__
#define	__CBDRAW_H__

#define		DRAW_ERROR_ID	1100

//////////////////
// 装入所有战场上需要的位图和缓冲区
// load user defined surfaces
// TRUE if succeeded
// return	:	TRUE if successful
BOOL DRAW_LoadMaps();

// 释放所有在战场上装入的缓冲区和位图
// release user defined surfaces
void DRAW_ReleaseMaps();
//////////////////

//////////////////
// 显示单元、阴影、水纹的效果、汉字、更新缩略图等
// 每秒钟要运行几十次
// draw maps in every program cycle
void DRAW_DrawMaps();

// 检测是否移动屏幕
// test if should move screen, if so move it
// return value	:	TRUE if moved
int  DRAW_MoveScreen();

// 如果鼠标点击缩略图,或者游戏一开始时,使屏幕跳到相应位置
// if mouse hit minimap, should jump the screen to the point
// ptCenter		:	mouse hit point, in grid
// return value	:	TRUE if jumped
BOOL  DRAW_JumpScreen( POINT ptCenter );

// draw all the user defined maps to screen
void DRAW_UpdateScreen( BOOL bFront = TRUE );
//////////////////

//////////////////
// 能够覆盖某点的所有点的相对坐标
#define	DRAW_COVER_MAX	56
#define	DRAW_LOCATION_MAX 4

// 读取遮挡数据
struct DRAW_COVER_STRUCT
{
	// stores the number of the last dimension in ptCover
	int   nCoveredMax[2][DRAW_LOCATION_MAX];
	int   nCoveringMax[2][DRAW_LOCATION_MAX];

	// stores points
	// First Dimension:		Even or Odd
	// Second Dimension:	Locatoin Max, always 4
	// Third Dimension:		max cover itmes
	// Covered 
	POINT ptCovered[2][DRAW_LOCATION_MAX][DRAW_COVER_MAX];
	// Covering
	POINT ptCovering[2][DRAW_LOCATION_MAX][DRAW_COVER_MAX];
};
extern struct DRAW_COVER_STRUCT DRAW_CoverLib;

// defined in CBFile.cpp
// 读取遮挡数据
BOOL DRAW_ReadCoverFile( HWND hwnd, LPCTSTR filename, LPCTSTR path );
//////////////////

// for draw only
#define	DRAW_SCREEN_ADJUST	2

//////////////////
// defined in CBDrawM.cpp
//////////////////
// for copy screen
// copy back buffer to a file named "ScreenXX.bmp"
// to make screen shots, advertising
// true if succeeded
BOOL DRAW_CopyScreen();

// draw blinking water, change palette to perform it
void DRAW_FlipWater();
//////////////////

//////////////////
// draw other maps
// prcCut	:	剪切的矩形
// nFile	:	OTHER图素的文件号
// nFrame	:	当前帧
// nZ,nX,nY :	格子坐标
extern void DRAW_OTHER_Draw( const RECT *prcCut, int nFile, int nFrame, int nZ, int nX, int nY );

// 当资源状态改变时(被砍伐,收割后),要更新该区域
// nZ,nX,nY :	格子坐标
extern void DRAW_OTHER_UpdateResource( int nZ, int nX, int nY );
//////////////////
//////////////////
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -