]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - utf8lib.c
Merge MR 'Make trace entity culling optional for spectators'
[xonotic/darkplaces.git] / utf8lib.c
index c66f06e1787207d3763fb804371904103ad4eb85..155b4aea9a8f949ecf8e2a583487c4fa122896cc 100644 (file)
--- a/utf8lib.c
+++ b/utf8lib.c
@@ -1,5 +1,6 @@
-#include "quakedef.h"
+#include "darkplaces.h"
 #include "utf8lib.h"
+#include "draw.h"
 
 /*
 ================================================================================
@@ -7,7 +8,7 @@ Initialization of UTF-8 support and new cvars.
 ================================================================================
 */
 // for compatibility this defaults to 0
-cvar_t utf8_enable = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
+cvar_t utf8_enable = {CF_CLIENT | CF_SERVER | CF_ARCHIVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
 
 void   u8_Init(void)
 {
@@ -59,7 +60,7 @@ Uchar utf8_range[5] = {
  * @return        Whether or not another valid character is in the string
  */
 #define U8_ANALYZE_INFINITY 7
-static qboolean u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *_ch, size_t _maxlen)
+static qbool u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *_ch, size_t _maxlen)
 {
        const unsigned char *s = (const unsigned char*)_s;
        size_t i, j;
@@ -771,9 +772,9 @@ all characters until the zero terminator.
 ============
 */
 size_t
-COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid);
+COM_StringLengthNoColors(const char *s, size_t size_s, qbool *valid);
 size_t
-u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
+u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qbool *valid)
 {
        const unsigned char *s = (const unsigned char*)_s;
        const unsigned char *end;
@@ -877,7 +878,7 @@ u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
  * @param maxwidth The maximum output width
  * @return        The number of bytes written, not including the terminating \0
  */
-size_t u8_strpad(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth)
+size_t u8_strpad(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth)
 {
        if(!utf8_enable.integer)
        {
@@ -895,7 +896,7 @@ size_t u8_strpad(char *out, size_t outsize, const char *in, qboolean leftalign,
        }
 }
 
-size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth)
+size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth)
 {
        size_t l = u8_bytelen_colorcodes(in, maxwidth);
        size_t actual_width = u8_strnlen_colorcodes(in, l);