diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-06-13 02:40:46 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-06-13 02:40:46 +0200 |
commit | 06e48c70595808f8c3143d4284e5757e29d81800 (patch) | |
tree | e321a452104d4dd3716b1bdfaa1bda81a739be26 /README.md | |
parent | CPad done (diff) | |
parent | Merge pull request #6 from GTAmodding/master (diff) | |
download | re3-06e48c70595808f8c3143d4284e5757e29d81800.tar re3-06e48c70595808f8c3143d4284e5757e29d81800.tar.gz re3-06e48c70595808f8c3143d4284e5757e29d81800.tar.bz2 re3-06e48c70595808f8c3143d4284e5757e29d81800.tar.lz re3-06e48c70595808f8c3143d4284e5757e29d81800.tar.xz re3-06e48c70595808f8c3143d4284e5757e29d81800.tar.zst re3-06e48c70595808f8c3143d4284e5757e29d81800.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -110,3 +110,35 @@ type functionname ( args ) Indentation is done with TABS. +As for the less cosmetic choices, here are some guidelines how the code should look: + +* Don't use magic numbers where the original source code would have had an enum or similar. +Even if you don't know the exact meaning it's better to call something `FOOBAR_TYPE_4` than just `4`, +since `4` will be used in other places and you can't easily see where else the enum value is used. + +* Don't just copy paste code from IDA, make it look nice + +* Use the right types. In particular: + + * don't use types like `__int16`, we have `int16` for that + + * don't use `unsigned`, we have typedefs for that + + * don't use `char` for anything but actual characters, use `int8`, `uint8` or `bool` + + * don't even think about using win32 types (`BYTE`, `WORD`, &c.) unless you're writing win32 specific code + +* As for variable names, the original gta source code was not written in a uniform style, +but here are some observations: + + * many variables employ a form of hungarian notation, i.e.: + + * `m_` may be used for class member variables (mostly those that are considered private) + + * `ms_` for (mostly private) static members + + * `f` is a float, `i` or `n` is an integer, `b` is a boolean, `a` is an array + + * do *not* use `dw` for `DWORD` or so, we're not programming win32 + +* Generally, try to make the code look as if R* could have written it |