]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blobdiff - Programming-Tips.md
Upload attachment zzz-bai-sounds-v11.pk3
[xonotic/xonotic.wiki.git] / Programming-Tips.md
index b56c04dadf439a87a5b8650aa956e8fb58c3e92d..d05c4b10d0988f1f4572311a6c38775982e7779a 100644 (file)
@@ -1,3 +1,11 @@
+### 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.
+
+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`.
+
 ### Debug prints
 
 Use `con_notify 4` together with `LOG_INFOF("my_var: %s", my_var);` (`%s` string, `%f` float, `%d` integer, `%v` vector) to see debug output without opening the console. Type `con_notify` and press `<TAB>` to see descriptions and more options (or use `apropos con_notify`).
@@ -7,8 +15,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
 
@@ -57,11 +68,17 @@ 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).
 
-#### Download / Installation
+##### Download / Installation
 
 * Download and install cscope with `pacman -S cscope`  
 Windows users must download the Windows version of cscope from https://code.google.com/archive/p/cscope-win32/downloads and put it into the main xonotic repo directory. The mingw version can't be used as it puts Unix paths into the generated indices, making them unusable.
@@ -74,7 +91,7 @@ Windows users must download the Windows version of cscope from https://code.goog
 * If you don't use Atom, you also need to copy ~~[cscope_createindex.sh](uploads/17c725e19be8f4935c30c2506e168405/cscope_createindex.sh)(old version)~~ [cscope_createindex.sh](uploads/451835f6b1894145af06050915256048/cscope_createindex.sh) into the main xonotic repo directory.
 
 
-#### Configuration
+##### Configuration
 
 * Configure your plugin if needed:  
   * jEdit's CscopeFinder settings:  
@@ -97,7 +114,7 @@ Windows users must download the Windows version of cscope from https://code.goog
 
 * With Atom you can build cscope indices in the atom-cscope window (open with `Ctrl + Alt + o`) by clicking the flash icon.
 
-#### Usage
+##### Usage
 
 * jEdit: select a word in the editor, right-click and select "Find this C symbol" or another "Find ..." entry (if you don't see these entries you should add them in the context menu settings).
 * SublimeText: select a word in the editor, right-click and select "Look up symbol" or another "Look up ..." entry.
@@ -106,5 +123,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