Today, my own task is to "enter the user name and password when there is no cursor flashing, so that our users do not know whether or not to select the" problem changes.
My initial solution is a very simple approach, when the mouse click inside the box, the CUR variable will be set to 1, and in the draw () function to judge, if cur==1 in the frame to draw a small figure, prompted to select. As shown in the following:
and the specific implementation code is:
if (cur) { //Draw Enter line signal glcolor3f (111); Glbegin (Gl_polygon); for (int0; i < n; + +i ) 0.02 + r*cos (22 + r*sin (2 * pi/n*i)); Glend (); }
The code is drawn round, but I borrowed the program box body is a rectangular feature that compresses the circle and looks like an arrow. This is a lazy approach, the more optimized implementation will be changed later.
——————————————————————————————————————————————————————————————————————————————————————————————————————————————— ———
I'm a split line.
——————————————————————————————————————————————————————————————————————————————————————————————————————————————— ———
This new feature doesn't take a whole day, and today's extra discoveries are found in the process of playing the game. When I play with an account for a while, close the program offline, the server shows that the new user information has been stored, do not shut down the server to start the game again, log in the account, when the player was attacked by the monster, the servers will crash and exit.
After our analysis, the reason is that there is a pointer to the wrong finger. When monsters attack a player, they will query the player's linked list, and logging in and out will cause changes to the player's list (create and delete). So when the login, because we wrote the Monster attack query algorithm has a problem, the query error, the pointer to not know what the ghost place, causing the server crash. The problem has been solved by our changes. Specific changes can be seen in the Wang Chancheng students blog.
Iterative development of software engineering first article