This article will record all the skills I have learned about game production on the way to game development.
Map
Irregular graph display:
Method 1: Use a transparent texture
Method 2: Use the Alpha texture as the display template and multiply the Alpha value when using it.
Click to judge:
Method 1: use an approximate shape for mouse Inclusion Detection.
Method 2: Use the Alpha texture to reserve an Alpha texture in the memory and determine the Alpha value of the mouse point.
Ogre
Obtain the mesh object from the. Mesh File
The core idea is to use the file stream reading method specified by ogre to obtain the data.
Method 1:
Use meshmanager: load ("mesh file name. Note: This function searches for paths in the Ogre Resource Manager.
Method 2:
Use STD: ifstream to read mesh files using STD: IOS: Binary
Then, use the Ogre: fileserializerstream object. The created object uses the STD: ifstream object
Use the importmesh method of the Ogre: meshserializer object.
Note that the importmesh function must have actual space for the mesh pointer,
That is, ogre: mesh * pdest = new ogre: mesh (null, "DASD", 0 ,"");
Compilation skills
Vs2005:
Each time an EXE file is generated, the version number is automatically added to 1.
The main idea is to use macros to replace text before compilation.
1. Open vs2005 and press Alt + F11 to start macro IDE.
2. Double-click the mymacros project and double-click environmentevents.
3. Select buildevents from the class name in the text editor and onbuildbegin from the method name. The following code is generated:
Private sub buildevents_onbuildbegin (byval scope as envdte. vsbuilds.pdf ,........)
End sub
Add the following code in this section:
Dim full_path as string
Full_path = "D:/vsproject/code/version. H" 'if you need the version information in the. RC file, change it to the RC file path.
Dim text as string
Using file as streamreader = new streamreader (full_path)
TEXT = file. readtoend ()
End using
Dim Pat as string = "# defines + clientbuildnumbers + ([0-9] +)" 'you need to change it to the text you are concerned about. Use Regular Expressions
Dim R as RegEx = new RegEx (Pat, regexoptions. ignorecase)
Dim M as match = R. Match (text)
Dim old = Val (M. Groups. Item (1). value)
Old = old + 1
Dim result as string = "# define clientbuildnumber" & old'
TEXT = R. Replace (text, Pat, result)
Using output as streamwriter = new streamwriter (full_path)
Output. Write (text)
End using
4. Compile the macro. In this way, when you execute the build command, the clientbuildnumber in the header file version. H is + 1 each time.