[Kst] extragear/graphics/kst/src/datasources/scuba2
Andrew Walker
arwalker at sumusltd.com
Thu Feb 22 10:49:20 CET 2007
SVN commit 636193 by arwalker:
more info on data storage format
M +17 -41 scuba.cpp
--- trunk/extragear/graphics/kst/src/datasources/scuba2/scuba.cpp #636192:636193
@@ -108,7 +108,7 @@
class ScubaSource::Config {
public:
Config() {
- _readMatrices = false;
+ _readMatrices = true;
_validateChecksum = true;
}
@@ -531,33 +531,21 @@
break;
case Data18_14:
if (!error) {
- lvalue >>= 14;
- lvalue &= 0x3FFFF;
- if (lvalue & 0x40000) {
- lvalue &= 0x1FFFF;
- lvalue *= -1;
- }
+ lvalue /= 0x4000;
} else {
- lvalue &= 0x3FFF;
- if (lvalue & 0x4000) {
- lvalue &= 0x1FFF;
- lvalue *= -1;
+ lvalue -= 0x4000 * ( lvalue / 0x4000 );
+ if (lvalue > 0x2000) {
+ lvalue = 0x4000 - lvalue;
}
}
break;
case Data24_8:
if (!error) {
- lvalue >>= 8;
- lvalue &= 0xFFFFFF;
- if (lvalue & 0x800000) {
- lvalue &= 0x7FFFFF;
- lvalue *= -1;
- }
+ lvalue /= 0x100;
} else {
- lvalue &= 0xFF;
- if (lvalue & 0x80) {
- lvalue &= 0x7F;
- lvalue *= -1;
+ lvalue -= 0x100 * ( lvalue / 0x100 );
+ if (lvalue > 0x80) {
+ lvalue = 0x100 - lvalue;
}
}
break;
@@ -719,33 +707,21 @@
break;
case Data18_14:
if (valueIndex % 2 == 0) {
- lvalue >>= 14;
- lvalue &= 0x3FFFF;
- if (lvalue & 0x40000) {
- lvalue &= 0x1FFFF;
- lvalue *= -1;
- }
+ lvalue /= 0x4000;
} else {
- lvalue &= 0x3FFF;
- if (lvalue & 0x4000) {
- lvalue &= 0x1FFF;
- lvalue *= -1;
+ lvalue -= 0x4000 * ( lvalue / 0x4000 );
+ if (lvalue > 0x2000) {
+ lvalue = 0x4000 - lvalue;
}
}
break;
case Data24_8:
if (valueIndex % 2 == 0) {
- lvalue >>= 8;
- lvalue &= 0xFFFFFF;
- if (lvalue & 0x800000) {
- lvalue &= 0x7FFFFF;
- lvalue *= -1;
- }
+ lvalue /= 0x100;
} else {
- lvalue &= 0xFF;
- if (lvalue & 0x80) {
- lvalue &= 0x7F;
- lvalue *= -1;
+ lvalue -= 0x100 * ( lvalue / 0x100 );
+ if (lvalue > 0x80) {
+ lvalue = 0x100 - lvalue;
}
}
break;
More information about the Kst
mailing list