-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgtitle.cpp
69 lines (53 loc) · 1.56 KB
/
gtitle.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//-----------------------------------------------------------------------------
// File: gTitle
// Desc: display title of game
// Auth: Lyp
// Date: 2003/11/22
//
// Copyright (c) 1985-2003 CTCRST Entertainment All rights reserved.
//-----------------------------------------------------------------------------
#include "stdafx.h"
#include "resource.h"
#include "gApp.h"
#include "gTitle.h"
#include "resmgr.h"
//-----------------------------------------------------------------------------
// construction/destruction
//-----------------------------------------------------------------------------
CTitle::CTitle(CApp* pApp)
{
ZeroMemory(this, sizeof(*this));
m_pApp = pApp;
ASSERT(m_pApp);
}
CTitle::~CTitle()
{
}
//-----------------------------------------------------------------------------
// »æÖƱêÌâ
//-----------------------------------------------------------------------------
void CTitle::DrawTitle()
{
HRESULT hr;
CDisplay* pDisplay = m_pApp->GetDisplay();
CResMgr* pResMgr = m_pApp->GetResMgr();
pDisplay->DDClear( NULL, 0 );
hr = pDisplay->GetBackBuffer()->BLT( 135, 130, pResMgr->GetBmp(10), NULL );
if( hr == DDERR_SURFACELOST )
{
pDisplay->RestoreSurfaces();
pResMgr->RestoreRes();
}
RECT rc;
rc.left = 0;
rc.right = 28;
rc.top = 28;
rc.bottom = 56;
bool bServer = m_pApp->IsServer();
pDisplay->GetBackBuffer()->BLT( 200, 300 + 30*(!bServer), pResMgr->GetBmp(1), &rc );
if( false == pDisplay->FlipScreen() )
{
pDisplay->RestoreSurfaces();
pResMgr->RestoreRes();
}
}