diff options
author | aap <aap@papnet.eu> | 2019-06-16 23:33:20 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-16 23:33:20 +0200 |
commit | e8c5f7da528ae8ddb5bf77671e3b95323fd7e975 (patch) | |
tree | 0979661b439f5651caa2e9bd7971a8e3439aadfe /README.md | |
parent | some more cleanup (diff) | |
download | re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.tar re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.tar.gz re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.tar.bz2 re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.tar.lz re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.tar.xz re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.tar.zst re3-e8c5f7da528ae8ddb5bf77671e3b95323fd7e975.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 41 |
1 files changed, 37 insertions, 4 deletions
@@ -24,6 +24,7 @@ to reverse at the time, calling the original functions is acceptable. This is a list of some things that have been reversed to some non-trivial extent. Not everything is listed, check the code. +(TODO: keep this list at least a bit up to date...) ``` CPool @@ -52,6 +53,11 @@ CPathFind CCam CParticle CParticleMgr +CPointLights +CCoronas +CAntennas +CClouds +CHud ``` # Low hanging fruit @@ -79,9 +85,12 @@ functionname(args) if(a == b){ s1; s2; + }else{ + s3; + s4; } if(x != y) - s3; + s5; } type functionname(args) @@ -89,9 +98,12 @@ type functionname(args) if (a == b) { s1; s2; + } else { + s3; + s4; } if (x != y) - s3; + s5; } ``` @@ -105,14 +117,31 @@ type functionname ( args ) s1; s2; } - if ( x != y ) + else { s3; + s4; + } + if ( x != y ) + { + s5; } } ``` -Indentation is done with TABS. +i.e. + +* Put the brace on the same line as control statements + +* Put the brace on the next line after function definitions and structs/classes + +* Put an `else` on the same line with the braces + +* Don't put braces around single statements + +* Put the function return type on a separate line + +* Indent with TABS As for the less cosmetic choices, here are some guidelines how the code should look: @@ -124,6 +153,8 @@ since `4` will be used in other places and you can't easily see where else the e * Use the right types. In particular: + * use the lower case types! (unless you're Fire_Head) + * don't use types like `__int16`, we have `int16` for that * don't use `unsigned`, we have typedefs for that @@ -132,6 +163,8 @@ since `4` will be used in other places and you can't easily see where else the e * don't even think about using win32 types (`BYTE`, `WORD`, &c.) unless you're writing win32 specific code + * declare pointers like `int *ptr;`, not `int* ptr;` + * As for variable names, the original gta source code was not written in a uniform style, but here are some observations: |