Third-party patches for Xash3D FWGS are great idea.
But if you want your patch to be accepted, we can give you few guidelines.
## If you are reporting bugs
## If you are reporting bugs
1. Check you are using latest version. You can build latest Xash3D FWGS for yourself, look to README.md.
1. Check you are using latest version. You can build latest Xash3D FWGS for yourself, look to README.md.
2. Check open issues is your bug is already reported and closed issues if it reported and fixed. Don't send bug if it's already reported.
2. Check open issues is your bug is already reported and closed issues if it reported and fixed. Don't send bug if it's already reported.
3. Now you can write bugreport.
3. Re-run engine with `-dev 2 -log` arguments, reproduce bug and post engine.log which can be found in your working directory.
4. Describe steps to reproduce bug.
3. Describe steps to reproduce bug.
5. Describe which OS and architecture you are using.
4. Describe which OS and architecture you are using.
6. Re-run engine with `-dev 2 -log` arguments, reproduce bug and post engine.log which can be found in your working directory.
6. Attach screenshot if it will help clarify the situation.
7. Attach screenshot if it will help clarify the situation.
## If you are contributing code
## If you are contributing code
### Which branch?
### Which branch?
* We recommend using `master` branch. But you still can use any of our branches, if they are up-to-date.
* We recommend using `master` branch.
### Third-party libraries
### Third-party libraries
* Philosophy of any Xash Project by Uncle Mike: don't be bloated. We follow it too.
* Philosophy of any Xash Project by Uncle Mike: don't be bloated. We follow it too.
* There is allowed only these libraries, which is used in Linux GoldSrc version or if there is a REAL reason to use library.
* There is allowed only these libraries, if there is a REAL reason to use library and library is crossplatform. It's will be nice, if you will leave a possibility to remove new dependency at build-time.
* Adding new dependencies for Waf Build System is not welcomed.
### Portability level
### Portability level
* Xash3D have it's own crt library. It's recommended to use it. It most cases it's just a wrappers around standart C library.
* Xash3D have it's own crt library. It's recommended to use it. It most cases it's just a wrappers around standart C library.
* If your feature need platform-specific code, try to implement to every supported OS and every supported compiler.
* If your feature need platform-specific code, move it to `engine/platform` and try to implement to every supported OS and every supported compiler or at least leave a stubs.
* You must put it under appopriate macro. It's a rule: Xash3D FWGS must at least compile everywhere.
* You must put it under appopriate macro. It's a rule: Xash3D FWGS must at least compile everywhere.
| OS | Macro |
| OS | Macro |
@ -45,9 +40,10 @@ But if you want your patch to be accepted, we can give you few guidelines.
* This project uses mixed Quake's and HLSDK's C/C++ code style convention.
* This project uses mixed Quake's and HLSDK's C/C++ code style convention.
* In short:
* In short:
* Use spaces in parenthesis. Even in empty.
* Use spaces in parenthesis.
* Use tabs, not spaces, for indentation.
* Only tabs for indentation.
* Any brace must have it's own line.
* Any brace must have it's own line.
* Short blocks, if statements and loops on single line are allowed.
* Short blocks, if statements and loops on single line are allowed.
* Try to avoid magic numbers.
* Avoid magic numbers.
* While macros are powerful, it's better to avoid overusing them.
* If you unsure, try to mimic code style from anywhere else of engine source code.
* If you unsure, try to mimic code style from anywhere else of engine source code.