-
Notifications
You must be signed in to change notification settings - Fork 72
Style Guide
### This is a wip draft ###
A style guide makes PRs easier to review and boosts the quality of feedback. Also, it contributes a consistent naming scheme that keeps the code-base organized.
n64decomp uses a primitive form of the beloved Systems Hungarian Notation. See the sm64 style doc. This page extends that doc. It does not replace it.
Avoid abbreviations except for very common ones. Long names are preferred.
- Texture palette --> tlut
- Lookup table --> LUT
- Displaylist --> dl
- Vertex/vertices --> vtx
Variables defined in .c files use gCamelCase.
- Global variables begin with g -->
gMyVariable
- Static variables begin with s -->
sMyVariable
(static variables are limited to the file where it is defined)
Segmented data uses snake_case and are generally defined in .inc.c files.
course_course_name_datatype_dataname
then course_name, the name of the data, and then the data type.
Example:
course_royal_raceway_texture_tree
Begins with the common_
prefix.
common_texture_finishline
ceremony_model_gold_trophy