Onetimesceneinit
In this case, the first thing to do is to find the position of Donuts4.ini, and then determine the current work directory. Optimized to ensure that Donuts4 can find other objects smoothly, such as Texture or Model.
Then you read the information of INI. After reading, add the INI file to the FileWatch. In this case, once the INI file is updated, RELOAD (still can't be understood).
After the setting is complete, it is some corresponding creation. For example, INPUTMANAGER and 3DDrawManager, also call their member ontimesceneinit. Then, Audio Stuff and Display Stuff are initialized.
After creating a menu (I really didn't see the menu ...), the game's State was set on loadsplash.
Preparation is completed, the game will start.
CreatesoundObjects
In OneTimesceneinit, the initialization of Audio Stuff is done to the createSoundObjects () function. In this function, it is mainly to declare a class of MusicManager. I am not too familiar with the sound part of DX, so this can stay again later.
INitDeviceObjects
InitDeviceObjects completed initialization of video. The first is to create a device. It should be noted here that iDriect3d9 does not seem to use it, just use it when you create a device, and create Release. Another interesting thing is that Donuts are also perfect in choosing the display mode: first, in accordance with the advantage of the margin to the pattern, then try one by one until it can support mode. After setting the Presentation Parameter, CreateDevice.
Finished the device, the second step is to show that Loading screen, naturally not declare the relevant font.
The third step is to read. The program loaded SKY, UI, Splash and Particle Texture and Sky Dome's Mesh, and some VextEx buffers were created. Finally, Load is Enemy, Bullet, and Playership Model.
The final step is to create Terrain Engine. In addition, the program says the M_PSHIP is added to the Display List, and the command is: g_pterrain-> adddisplayObject (m_pship), is it said that the management display list is a topographical engine? Confuse ING.
RESTOREDEVICEOBJECTS
In Common Framework, OneTimesceneinit () and FinalClearup () are pair of things for creating and deleting devices (such as geometric information). INitDeviceObjects () and deleteDeviceObjects () are pair of information for creating and deleting devices. RESTOREDEVICEOBJECTS () and invalidateDeviceObjects () are pair, but this is very blurred in the role of functions.
In this inside, in addition to setting the light and create Texture for Radar, it is RESTOREDEVICEOBJECTS that calls other objects.
It is said that RestoreviceObjects can recover quickly in Device Lost. If the delete re-init, it takes too time. Still dizzy, wait for the high people to say ...
In Updatescene, an automaton is seen. UpdateScene will make a corresponding action according to the current state. In the App class, the status conversion can be performed anywhere. In this case, it is more flexible.
After the game Active, the UPDATE operation is done by calling framemove ().
Framemove () In addition to calling some members of Framemove (), the main thing is to pass the speed simulation to 60Hz by the method, which is not considered. I am more accustomed to the limited frame. There is a pile of sounds, it seems that DX Sound and DX Music are more troubles than DX Graphics ...
In Renderscene (), first look at whether Device Lost has occurred. If you happen, you will first reset, then restore. Then, it is rendered according to the current state. For example, when proceding to Display Splash, calling rendersplash (), and when it is displayed, it is called DisplayLevelIntroscreen (), and the rendering of the real game is renderframe ().