📄 cexplored.cpp
字号:
//----------------------------------------------------------------------------
// 文件名: CExplored.cpp
//
// 描述:爆破对象实现
//
// 作者:朱波 创建日期:2007-03-22
//----------------------------------------------------------------------------
#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 <sys/timeb.h>
#include <time.h>
#include <vector>
#include <string>
using namespace std;
#include <ddraw.h>
#include <dsound.h>
#include "dxtools.h"
#include "CExplored.h"
CExplored::CExplored( void )
{
m_pic_count = 0;
m_cur_pic_index = 0;
m_draw_width = 0;
m_draw_height = 0;
m_draw_lppSurface = NULL;
m_cur_time = 0;
m_pre_time_change = 0;
}
CExplored::~CExplored( void )
{}
int CExplored::Create( POINT pos, int width, int height, int pic_count,
LPDIRECTDRAWSURFACE7 surface[] )
{
if ( pic_count <= 0 )
return(0);
if ( NULL == surface )
return(0);
m_position.x = pos.x;
m_position.y = pos.y;
m_draw_start.x = pos.x - width/2;
m_draw_start.y = pos.y - height/2;
m_draw_width = width;
m_draw_height = height;
m_pic_count = pic_count;
m_draw_lppSurface = surface;
m_cur_pic_index = 0;
return(1);
}
int CExplored::DoExplored( void )
{
int time;
m_cur_time=GetTickCount()%100000;
if(m_cur_time - m_pre_time_change < 0)
time = 100000 - m_pre_time_change + m_cur_time;
else
time = m_cur_time - m_pre_time_change;
if ( time > 50)
{
m_pre_time_change = m_cur_time;
m_cur_pic_index++;
if ( m_cur_pic_index == m_pic_count )
{
return(0);
}
}
return(1);
}
int CExplored::Draw( void )
{
DDraw_Draw_Surface(m_draw_lppSurface[m_cur_pic_index],
m_draw_start.x, m_draw_start.y, m_draw_width, m_draw_height, lpddsback,1);
return(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -