-
Notifications
You must be signed in to change notification settings - Fork 0
/
stdafx.cpp
62 lines (51 loc) · 2.16 KB
/
stdafx.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
// stdafx.cpp : 只包括标准包含文件的源文件
// Fr2DSTG.pch 将作为预编译标头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"
// TODO: 在 STDAFX.H 中引用任何所需的附加头文件,
//而不是在此文件中引用
void Obj::Show(Fr2DHDL device, Fr2DBrush brush) {
D2D1_SIZE_F size = hpic->GetSize();
device->DrawBitmap(hpic,D2D1::RectF(x,y,x + size.width,y + size.height));
}
void Obj::Update(float dx, float dy) {
x += dx;
y += dy;
OutOfScreen();
}
void Obj::OutOfScreen() {
if (x > scrsize.height || y > scrsize.width || x < 0 || y < 0)
del = true;
}
Bul::Bul(float sx, float sy, FrPicHDL h, float s,int height,int width) {
x = sx;
y = sy;
size = s;
hpic = h;
del = false;
scrsize.height = height;
scrsize.width = width;
}
/*
bul::bul(float x, float y, FrPicHDL h, float s=10) {
sx = x;
sy = y;
size = s;
hbulpic = h;
}
void bul::show(Fr2DHDL device, Fr2DBrush brush) {
D2D1_SIZE_F size = hbulpic->GetSize();
device->DrawBitmap(
hbulpic,
D2D1::RectF(
sx,
sy,
sx + size.width,
sy + size.height)
);
}
void bul::update(float x,float y) {
sx += x;
sy += y;
}
*/