Some functions are changed to Inline mode optimization. Start writing the CCursor class.

xiaoxiao2021-03-06  41

At 4:30 in the morning, I read the last episode of the fairy sword, haha ​​and more hard drives were used. That 2046Down came to now two times, no more than 5 minutes each time. I really don't know what to say, find a chance to delete it.

Say back to the game development.

Some modes of calling frequently have been modified to INLINE. In addition, there were 6 possible access to abnormalities at the end of the game, and then 4, now there are two. It also needs to be converted into VC6 that what Check is needed to see where it is. This is too difficult to look at the code.

Today, it is difficult to endure the speed of Notebook compilation, and it is changed to the Remote Desktop console writing code compile NB running program debugging mode. It is also acceptable to accept, and then say such a division of labor cooperation, the shuttle will not be wasted.

Now start making a CCURSOR class, this class now is to place the variables in the CGAME as a class. CCURSOR is responsible for processing the current mouse in the game window, and initializes DirectInput (how to deal with the button? If you typing a Chinese symbol, the button will not be intercepted by DXInput?). Click, should double-click judgment to be implemented in the CCursor class? Then return the click position to cgame, CGAME calls the message processing function to handle click event? Maintain the mouse button status, whether the mouse is in a statement (for dragging object)? There is also a CCursor class contains a map of the pointer, the offset of the map, pointer shape, and more.

Initialization of DirectInput:

1. First define DirectInput version, before #include "dinput.h"

2. # include "dinput.h"

3. # Pragma Comment (lib, "dinput8.lib")

4.Declare: lpdirectinput8 lpdi;

5.createdDirectInput8 (LPDI)

6.Declare: LPDIRECTDEVICE8 LPDIDMOUSE;

7.lpdi-> CreateDevice (LPDIDMOUSE)

8.lpdidMouse Setting data format: & c_dfdimouse

9.lpdidMouse set collaboration

10. Set the buffer size (this step can be ignored)

11.lpdidmouse-> acquire ();

转载请注明原文地址:https://www.9cbs.com/read-56622.html

New Post(0)