Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.blamite
The core library for the Blamite Game Engine.
binary_to_compressed_c.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

Macros

#define _CRT_SECURE_NO_WARNINGS
 
#define stb_out(v)   do { if (stb__out) *stb__out++ = (stb_uchar) (v); else stb__write((stb_uchar) (v)); } while (0)
 
#define stb__hc(q, h, c)   (((h) << 7) + ((h) >> 25) + q[c])
 
#define stb__hc2(q, h, c, d)   (((h) << 14) + ((h) >> 18) + (q[c] << 7) + q[d])
 
#define stb__hc3(q, c, d, e)   ((q[c] << 14) + (q[d] << 7) + q[e])
 
#define STB__SCRAMBLE(h)   (((h) + ((h) >> 16)) & mask)
 
#define stb__nc(b, d)   ((d) <= window && ((b) > 9 || stb_not_crap(b,d)))
 
#define STB__TRY(t, p)
 

Typedefs

typedef unsigned int stb_uint
 
typedef unsigned char stb_uchar
 

Functions

stb_uint stb_compress (stb_uchar *out, stb_uchar *in, stb_uint len)
 
int main (int argc, char **argv)
 
char Encode85Byte (unsigned int x)
 

Macro Definition Documentation

◆ _CRT_SECURE_NO_WARNINGS

#define _CRT_SECURE_NO_WARNINGS

◆ stb__hc

#define stb__hc (   q,
  h,
 
)    (((h) << 7) + ((h) >> 25) + q[c])

◆ stb__hc2

#define stb__hc2 (   q,
  h,
  c,
 
)    (((h) << 14) + ((h) >> 18) + (q[c] << 7) + q[d])

◆ stb__hc3

#define stb__hc3 (   q,
  c,
  d,
 
)    ((q[c] << 14) + (q[d] << 7) + q[e])

◆ stb__nc

#define stb__nc (   b,
 
)    ((d) <= window && ((b) > 9 || stb_not_crap(b,d)))

◆ STB__SCRAMBLE

#define STB__SCRAMBLE (   h)    (((h) + ((h) >> 16)) & mask)

◆ STB__TRY

#define STB__TRY (   t,
 
)
Value:
/* avoid retrying a match we already tried */ \
if (p ? dist != q-t : 1) \
if ((m = stb_matchlen(t, q, match_max)) > best) \
if (stb__nc(m,q-(t))) \
best = m, dist = q - (t)

◆ stb_out

#define stb_out (   v)    do { if (stb__out) *stb__out++ = (stb_uchar) (v); else stb__write((stb_uchar) (v)); } while (0)

Typedef Documentation

◆ stb_uchar

typedef unsigned char stb_uchar

◆ stb_uint

typedef unsigned int stb_uint

Function Documentation

◆ Encode85Byte()

char Encode85Byte ( unsigned int  x)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ stb_compress()

stb_uint stb_compress ( stb_uchar out,
stb_uchar in,
stb_uint  len 
)
stb__nc
#define stb__nc(b, d)