forked from ClemensLode/Wars
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest6.cpp
78 lines (63 loc) · 1.46 KB
/
test6.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
70
71
72
73
74
75
76
#include "engine.h"
#include <stdio.h>
BOOL Done = FALSE;
Engine_Info info;
Engine_Graphics graph;
Engine_Input input;
Engine_Sound sound;
long FAR PASCAL WindowProc( HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam )
{
switch ( message )
{
case WM_SIZE:
case WM_MOVE:
graph.UpdateClientArea();
break;
case WM_KEYDOWN:
switch ( wParam )
{
case VK_ESCAPE:
PostMessage ( hWnd, WM_CLOSE, 0, 0 );
break;
}
break;
case WM_DESTROY:
input.ReleaseObjects();
// sound.ReleaseObjects();
graph.ReleaseObjects();
PostQuitMessage( 0 );
break;
}
return DefWindowProc( hWnd, message, wParam, lParam);
}
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
MSG msg;
lpCmdLine = lpCmdLine;
hPrevInstance = hPrevInstance;
info.AppName = "WARS!";
info.WindowTitle = "WARS!";
info.DoWindowStuffFullscreen(hInstance,WindowProc,nCmdShow);
graph.info = info;
graph.SetGraphicsType(GRAPHICSTYPE_2D);
graph.InitDirectDraw(640,480,16,TRUE,FALSE);
Engine_AVIStream avi;
avi.En_Graph=graph;
avi.Load("we08.avi");
avi.PlayOnSurface(graph.Primaer,TRUE);
while(1)
{
if(PeekMessage(&msg, NULL,0,0,PM_NOREMOVE))
{
if(!GetMessage (&msg, NULL, 0, 0)) return msg.wParam;
TranslateMessage (&msg);
DispatchMessage (&msg);
}
else
{
}
}
return msg.wParam;
}