📄 gengine.cpp
字号:
#include "..\common.h"
#include "gl.h"
#include "gengine.h"
//#define _OFFDDRAW //关闭DirectDraw
Hero *warrior;
int InitGraphicEngine( DWORD w, DWORD h, DWORD colordepth )
{
CheckCPU();
#ifdef _DEBUG
// if( cpu.mmx )
// OutDebugString( "mmx" );
#endif
screenInfo.width = w;
screenInfo.height = h;
screenInfo.colorDepth = colordepth;
#ifndef _OFFDDRAW
// 初始化DirectDraw
if( InitDDraw() != 0 )
return -1;
#else
backScreen = CreateBitmapEx( w, h, colordepth );
#endif
#ifndef _OFFDDRAW
if( InitDInput( hInst ) != 0 ){
return -1;
}
// 初始化文字显示例程
if( InitHanzi( Hanzi::SmallFont ) != 0 ){
MsgBox( "InitHanzi failed." );
return -1;
}
// 初始化光影效果, call InitDDraw() first !!!
if( InitBrighter() != 0 ){
MsgBox( "InitBrighter failed" );
return -1;
}
// 初始化简单精灵显示例程
if( InitSprite() != 0 ){
MsgBox( "InitSprite failed" );
return -1;
}
if( scene.InitScene( 0, 24, 24 ) != 0 ){
MsgBox( "InitScene failed" );
return -1;
}
#endif
// initRleBitmap( );
// InitAni();
MouseOn();
warrior = new Hero( 24, 24 );
warrior->LoadPicture();
if( warrior->LoginMaze() != 0 )
return -1;
OutDebugString( "init engine end" );
return 0;
}
int ExitGraphicEngine( void )
{
#ifndef _OFFDDRAW
DestroyDDraw();
#endif
DestroyDInput();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -