| 1 |
# Contributing |
| 2 |
|
| 3 |
contributions to Furnace are welcome! |
| 4 |
|
| 5 |
# Issue reports |
| 6 |
|
| 7 |
if you find an issue with Furnace, see the Issues section. |
| 8 |
|
| 9 |
# Suggestions and other types of discussions |
| 10 |
|
| 11 |
see the Discussions section. |
| 12 |
|
| 13 |
**DO NOT USE THE ISSUES SECTION FOR THESE - it is only for ISSUES.** |
| 14 |
|
| 15 |
# Other |
| 16 |
|
| 17 |
## Getting ready |
| 18 |
|
| 19 |
log into your GitHub account, and click the Fork button in the header of the project's page. |
| 20 |
|
| 21 |
then open a terminal and clone your fork: |
| 22 |
|
| 23 |
``` |
| 24 |
git clone [email protected]:USERNAME/furnace.git |
| 25 |
``` |
| 26 |
|
| 27 |
(replace `USERNAME` with your username) |
| 28 |
|
| 29 |
## Working |
| 30 |
|
| 31 |
### Code |
| 32 |
|
| 33 |
bug fixes, improvements and several other things accepted. |
| 34 |
|
| 35 |
the coding style is described here: |
| 36 |
|
| 37 |
- indentation: two spaces. **strictly** spaces. do NOT use tabs. |
| 38 |
- modified 1TBS style: |
| 39 |
- no spaces in function calls |
| 40 |
- spaces between arguments in function declarations |
| 41 |
- no spaces in operations except for `||` and `&&` |
| 42 |
- no space between variable name and assignment |
| 43 |
- space between macro in string literals |
| 44 |
- space after comment delimiter |
| 45 |
- C++ pointer style: `void* variable` rather than `void *variable` |
| 46 |
- indent switch cases |
| 47 |
- preprocessor directives not intended |
| 48 |
- if macro comprises more than one line, indent |
| 49 |
- no new line after `template<>` |
| 50 |
- do not use `_t` types, except for 64-bit integers and `size_t`. |
| 51 |
- prefer built-in types: |
| 52 |
- `bool` |
| 53 |
- `signed char` or `unsigned char` are 8-bit |
| 54 |
- when the type is `char`, **always** specify whether it is signed or not. |
| 55 |
- unspecified `char` is signed on x86 and unsigned on ARM, so yeah. |
| 56 |
- the only situation in where unspecified `char` is allowed is for C strings (`const char*`). |
| 57 |
- `short` or `unsigned short` are 16-bit |
| 58 |
- `int` or `unsigned int` are 32-bit |
| 59 |
- `float` is 32-bit |
| 60 |
- `double` is 64-bit |
| 61 |
- `long long int` or `unsigned long long int` are 64-bit |
| 62 |
- avoid using 64-bit numbers as I still build for 32-bit systems. |
| 63 |
- two `long`s are required to make Windows happy. |
| 64 |
- prefer using `int64_t` or `uint64_t` for this specific case. |
| 65 |
- `size_t` are 32-bit or 64-bit, depending on architecture. |
| 66 |
- in float/double operations, always use decimal and `f` if single-precision. |
| 67 |
- e.g. `1.0f` or `1.0` instead of `1`. |
| 68 |
- prefer `NULL` over `nullptr` or any other proprietary null. |
| 69 |
- only use `auto` if needed. |
| 70 |
- avoid using `goto` unless absolutely required. |
| 71 |
- use `String` for `std::string` (this is typedef'd in ta-utils.h). |
| 72 |
- prefer using operator for String (std::string) comparisons (a==""). |
| 73 |
- if you have to work with C strings, only use safe C string operations: |
| 74 |
- snprintf |
| 75 |
- strncpy |
| 76 |
- strncat |
| 77 |
- any other operation which specifies a limit |
| 78 |
|
| 79 |
some files (particularly the ones in `src/engine/platform/sound` and `extern/`) don't follow this style. |
| 80 |
|
| 81 |
you don't have to follow this style. I will fix it after I accept your contribution. |
| 82 |
|
| 83 |
additional guidelines: |
| 84 |
|
| 85 |
- in general **strongly** avoid breaking compatibility. |
| 86 |
- do not touch loadFur/saveFur unless you know what you're doing! |
| 87 |
- new fields must be at the end of each block to ensure forward compatibility |
| 88 |
- likewise, the instrument read/write functions in DivInstrument have to be handled carefully |
| 89 |
- any change to the format requires a version bump (see `src/engine/engine.h`). |
| 90 |
- do not bump the version number under any circumstances! |
| 91 |
- if you are making major changes to the playback routine, make sure to test with older songs to ensure nothing breaks. |
| 92 |
- I will run a test suite to make sure this is the case. |
| 93 |
- if something breaks, you might want to add a compatibility flag (this requires changing the format though). |
| 94 |
- do not use `#pragma once`. |
| 95 |
- do not memcmp() structs. |
| 96 |
- on a switch block, **always** put `default` last and not in any other position. |
| 97 |
- I have fear of some C/C++ compilers ignoring the rest of cases upon hitting default. |
| 98 |
|
| 99 |
### Do NOT Force-Push after submitting Pull Request |
| 100 |
|
| 101 |
if you do so, your pull request will be closed. |
| 102 |
|
| 103 |
### Demo Songs |
| 104 |
|
| 105 |
we are not accepting demo song submissions at the moment. sorry! |
| 106 |
|
| 107 |
## Finishing |
| 108 |
|
| 109 |
after you've done your modifications, commit the changes and push. |
| 110 |
then open your fork on GitHub and send a pull request. |
| 111 |
|
| 112 |
## I don't know how to use Git but I want to contribute with a demo song |
| 113 |
|
| 114 |
you can also contact me directly! [find me here.](https://tildearrow.org/?p=contact) |