]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.h
first part of fog changes: no longer use a complex glsl equation; modify the table...
[xonotic/darkplaces.git] / common.h
index 460d5325dd7107d20bd78dd6353cccb57d1d0f28..52466fd6303307a6e0a6283caa20d3a320267809 100644 (file)
--- a/common.h
+++ b/common.h
@@ -60,6 +60,7 @@ void SZ_HexDumpToConsole(const sizebuf_t *buf);
 void Com_HexDumpToConsole(const unsigned char *data, int size);
 
 unsigned short CRC_Block(const unsigned char *data, size_t size);
+unsigned short CRC_Block_CaseInsensitive(const unsigned char *data, size_t size); // for hash lookup functions that use strcasecmp for comparison
 
 unsigned char COM_BlockSequenceCRCByteQW(unsigned char *base, int length, int sequence);
 
@@ -203,6 +204,10 @@ float MSG_ReadAngle (protocolversion_t protocol);
 
 //============================================================================
 
+typedef float (*COM_WordWidthFunc_t) (void *passthrough, const char *w, size_t *length, float maxWidth); // length is updated to the longest fitting string into maxWidth; if maxWidth < 0, all characters are used and length is used as is
+typedef int (*COM_LineProcessorFunc) (void *passthrough, const char *line, size_t length, float width, qboolean isContination);
+int COM_Wordwrap(const char *string, size_t length, float continuationSize, float maxWidth, COM_WordWidthFunc_t wordWidth, void *passthroughCW, COM_LineProcessorFunc processLine, void *passthroughPL);
+
 extern char com_token[MAX_INPUTLINE];
 
 int COM_ParseToken_Simple(const char **datapointer, qboolean returnnewline, qboolean parsebackslash);