Forum > Resources and Tools
[C++] LightAdder
<< < (2/7) > >>
schlumpf:
OSX: http://cl.ly/312j2g0X0S2t3t0q0A41 Linux: http://cl.ly/2B173o3M0o1o3V0Y2X0H
light.cpp:183: warning: converting to non-pointer type ‘char’ from NULL
You may want to end couting with a new line. You may want not to keep the application open by tricks but should end the application as soon as its over. (waiting for a key press, that trick is.) You may want to use two or three whitespaces instead of tabs. Global variables are bad. Use a class if you need some semi global state and add functions needing the globals as methods. using namespace is evil. Do full name qualification instead. std::endl does not only "n" or "rn" but also flushes the buffer. Better do that only when really needing the text to be printed _now_ and use "n" instead. const char null = NULL; might be nice for you coming from a null background, but better get used to NULL. Also, NULL is a void* so converting it into a const char might not be a good idea. Or that const char was supposed to be a const char*. For the sake of performance, better write into an allocated buffer in memory first, then when you're done, write that to disk. Disk access still is slow. This also enables you to do writes easier. *(float*)&buffer[address] = 0.0f; is easier than calling a function to modify the file. And is more save than reinterpret_casting that float to a char*.
Tigurius:
--- Quote from: "schlumpf" ---You may want to use two or three whitespaces instead of tabs. --- End quote --- Well the benefit of tabs is, that everyone who reads the code can make his editor show the indentation the way he likes. That's why on my university the tab-indentation is preferred.
Steff:
I want to add DBC light stuff to noggit some day. Tahts why the lights are displayed in the mapview (m). You should be able then to select the lights in the mapview and change the parameters. Noggit updates then the view direct and save the dbc changes. You will also be able to add new lights.
So the plan :)
And very nice tool. Another point everyone can do.
schlumpf:
--- Quote from: "Tigurius" --- --- Quote from: "schlumpf" ---You may want to use two or three whitespaces instead of tabs. --- End quote --- Well the benefit of tabs is, that everyone who reads the code can make his editor show the indentation the way he likes. That's why on my university the tab-indentation is preferred. --- End quote --- This is correct, while n the other hand, people tend to align more than the beginning of lines like in his code, the variables in structures. With different tab width, that will fuck up the formatting for others.
Putte08:
Gotta try this out. Looks awesome.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
|