Skip to content
Permalink
Browse files

Remove some junk from style.md and add general guidelines

  • Loading branch information
UnknownShadow200 committed Nov 29, 2019
1 parent b154d94 commit b26ab73a5e4aaf523f3f8f12e2357c4c5ecd288b
Showing with 9 additions and 9 deletions.
  1. +9 −9 misc/style.md
@@ -1,16 +1,16 @@
### Guidelines
* Code should be C89 compatible and compilable as C++.
* Each .c file should represent a module. (see architecture.md for more details)
* Public functions and variables should be prefixed by module to avoid name collisions. (e.g. `Game_Reset`)
* Private functions should be named using pascal case. Prefixing module is optional - do it when it makes sense.
* Private variables don't really have a consistent style.

### Types
* Integers generally use plain ```int```, floating point numbers use ```float``` or ```double```.
* Explicit integer types are also provided in ```Core.h```.
* There are a few typedefs of integer types to provide better context in some functions
* Explicit integer typedefs are provided in ```Core.h``` for when needed. Otherwise just use int.
* A few common simple structs are typedef-ed, but are rarely otherwise.
* ```bool``` is an alias for 8 bit unsigned integer
* ```GfxResourceID``` is not constant type - can be pointer or integer, depending on underlying 3D graphics API
* ```cc_bool``` is an alias for 8 bit unsigned integer
* ```PackedCol``` field order differs depending on the underlying 3D graphics API

As such, your compiler is required to support:
- explicit 8/16/32/64 bit signed and unsigned integers
- 32 and 64 bit floating point numbers

I may not have defined the appropriate types for your compiler, so you may need to modify ```Core.h```

### Strings

0 comments on commit b26ab73

Please sign in to comment.
You can’t perform that action at this time.