Added new type 'Binary Data' to Fluid. Use this to include an arbitrary file as a byte array into your source code. Changes to load jpegs etc. from program memory will follow.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher
2010-02-15 16:43:51 +00:00
parent ea31edb241
commit fb1b0fab0a
11 changed files with 600 additions and 102 deletions
+11
View File
@@ -235,6 +235,17 @@ void write_cdata(const char *s, int length) {
varused = 1;
return;
}
if (write_sourceview) {
if (length>=0)
fprintf(code_file, "{ /* ... %d bytes of binary data... */ }", length);
else
fprintf(code_file, "{ /* ... binary data... */ }");
return;
}
if (length==-1) {
fprintf(code_file, "{ /* ... undefined size binary data... */ }");
return;
}
const unsigned char *w = (const unsigned char *)s;
const unsigned char *e = w+length;
int linelength = 1;