]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blobdiff - Programming-Tips.md
Update Compiling: add libtool dependency
[xonotic/xonotic.wiki.git] / Programming-Tips.md
index 487aca3235c5d1a5421e426326911b4fc425b3ff..75308606f0675fdd513476a220907f134ecff642 100644 (file)
@@ -1,10 +1,20 @@
 ### Faster compiling and reloading of QuakeC
 
-You can use `QCCFLAGS_WERROR="" ZIP=: ./all compile` to let the build succeed even with warnings and to skip compressing the resulting csprogs.dat (client gamecode) into a pk3.
+You can use `QCCFLAGS_WERROR=""` to let the build succeed even with some warnings and `ZIP=:` to skip compressing the resulting csprogs.dat (client gamecode) into a pk3. A compressed csprogs.dat is only useful to increase download speed of such file if you host an online dedicated server.
+
+`QCCFLAGS_WERROR="" ZIP=: ./all compile`
 
 Server and menu code produce progs.dat and menu.dat respectively.
 
-No need to restart Xonotic to load the new client and server code, just start a new map with `map XXX` (depending on how you launch Xonotic you may need to use `fs_rescan; map XXX`). You can restart the menu with `menu_restart`.
+Compiling the Xonotic game code without trying to compile the engine code reduces compile time a little bit, in the case you aren't interested in changing the engine code. You can do so by running this command from the xonotic-data.pk3dir directory:
+
+`make qc -j4`
+
+where `-j4` is an option that lets you use up to 4 CPU cores for the compilation (it's enabled by default in `./all compile`). If you want you can run `make all -j4` to enable csprogs.dat compression.
+
+To test the QC client and server programs you don't need to restart Xonotic, you just have to start a new game with `map <mapname>` (depending on how you launch Xonotic you may need to use `fs_rescan; map <mapname>`).
+
+To test the QC menu program, you just have to restart the menu by executing `menu_restart` in the console.
 
 ### Debug prints
 
@@ -15,8 +25,11 @@ You can draw text anywhere on the map using `debug_text_3d(world_coords, message
 ### Multiple clients + clean config
 
 If you need 2 players for debugging, you can launch another client locally:
- - use -sessionid (e.g. `./all run -sessionid testing`) to keep your config
- - use -userdir (e.g. `./all run -userdir ~/.xonotic-testing +name tester +cl_allow_uid2name 0`) to get a clean config (`+cl_allow_uid2name 0` to avoid an annoying popup). You can set whatever cvar on start with `+cvar_name value`.
+- use -sessionid (e.g. `./all run -sessionid testing`) to keep your config
+- use -userdir (e.g. `./all run -userdir ~/.xonotic-testing +name tester +cl_allow_uid2name 0`) to get a clean config (if you delete the dir before each use)
+  - you can set any cvar or run any command on start with `+cvar_name value`
+    - `+name tester` avoids the nick selection dialog
+    - `+cl_allow_uid2name 0` avoids an annoying popup 
 
 ### Testing with bots
 
@@ -65,6 +78,12 @@ prvm_globalwatchpoint server
 prvm_edictwatchpoint server
 ```
 
+### Doxygen
+
+Incomplete [Doxygen documentation](https://timepath.github.io/scratchspace/index.html) is generated as part of CI on [xonotic-data.pk3dir](https://gitlab.com/xonotic/xonotic-data.pk3dir) - you can search functions, "classes", globals, etc.
+
+Note that it might be incomplete or incorrect because [Doxygen](https://www.doxygen.nl) doesn't understand all of QC's constructs and our code heavily uses macros. See the `doxygen` section of the [CI file](https://gitlab.com/xonotic/xonotic-data.pk3dir/blob/master/.gitlab-ci.yml) for details what's missing.
+
 ### Tool to find C symbols, functions, declarations and definitions inside source code
 
 For this purpose it's possible to use a text-based tool called [Cscope](https://en.wikipedia.org/wiki/Cscope) together with a GUI (it can be either an application or a plugin for a text editor).
@@ -114,5 +133,5 @@ Windows users must download the Windows version of cscope from https://code.goog
 
 ### QC syntax highlighting:
 
-* For jEdit: [qc.xml](https://gitlab.com/terencehill/qc-syntax-highlighting-for-jedit/blob/master/qc.xml)
-* For Kate: [qc.xml](https://gist.github.com/DefaultUser/998f030ab41a9e8edf4a9f8e703c6350)
\ No newline at end of file
+* terencehill's version for jEdit: [qc.xml](https://gitlab.com/terencehill/qc-syntax-highlighting-for-jedit/blob/master/qc.xml)
+* EACFreddy's version for Kate: [qc.xml](https://gist.github.com/DefaultUser/998f030ab41a9e8edf4a9f8e703c6350)
\ No newline at end of file