projects
/
vuplus_xbmc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e10e60e
)
check the result of lzo1x_optimize
author
Jonathan Marshall
<jmarshall@never.you.mind>
Sun, 6 Jan 2013 02:24:42 +0000
(15:24 +1300)
committer
S. Davilla
<davilla@4pi.com>
Sun, 6 Jan 2013 13:36:21 +0000
(08:36 -0500)
tools/TexturePacker/XBMCTex.cpp
patch
|
blob
|
history
diff --git
a/tools/TexturePacker/XBMCTex.cpp
b/tools/TexturePacker/XBMCTex.cpp
index
488e909
..
21404df
100644
(file)
--- a/
tools/TexturePacker/XBMCTex.cpp
+++ b/
tools/TexturePacker/XBMCTex.cpp
@@
-210,8
+210,15
@@
CXBTFFrame appendContent(CXBTFWriter &writer, int width, int height, unsigned ch
else
{ // success
lzo_uint optimSize = size;
- lzo1x_optimize(packed, packedSize, data, &optimSize, NULL);
- writer.AppendContent(packed, packedSize);
+ if (lzo1x_optimize(packed, packedSize, data, &optimSize, NULL) != LZO_E_OK || optimSize != size)
+ { //optimisation failed
+ packedSize = size;
+ writer.AppendContent(data, size);
+ }
+ else
+ { // success
+ writer.AppendContent(packed, packedSize);
+ }
}
delete[] working;
delete[] packed;