dat comments and enum changes

This commit is contained in:
Eduardo Bart 2011-08-31 10:16:56 -03:00
parent 1da42f9a3b
commit 6187bdbbdb
2 changed files with 73 additions and 77 deletions

View File

@ -43,40 +43,40 @@ namespace Otc
"07119674283982419152118103759076030616683978566631413"; "07119674283982419152118103759076030616683978566631413";
enum DatFlag { enum DatFlag {
Bank = 0, DatGround = 0,
Clip, DatGroundClip,
Bottom, DatOnBottom,
Top, DatOnTop,
Container, DatContainer,
Cumulative, DatStackable,
ForceUse, DatForceUse,
MultiUse, DatMultiUse,
Write, DatWritable,
WriteOnce, DatWritableOnce,
LiquidContainer, DatFluidContainer,
LiquidPool, DatSplash,
Unpass, DatBlockWalk,
Unmove, DatNotMovable,
Unsight, DatBlockProjectile,
Avout, DatBlockPathFind,
Take, DatPickupable,
Hang, DatHangable,
HookSouth, DatHookSouth,
HookEast, DatHookEast,
Rotate, DatRotable,
Light, DatLight,
DontHide, DatDontHide,
Translucent, DatTranslucent,
Shift, DatDrawShift,
Height, DatDrawHeight,
LyingObject, DatLyingCorpse,
AnimateAlways, DatAnimateAlways,
Automap, DatMinimapColor,
LensHelp, DatLensHelp,
FullBank, DatFullGround,
IgnoreLook, DatIgnoreLook,
Clothes, DatClothe,
Animation, DatAnimation,
LastDatFlag LastDatFlag
}; };

View File

@ -111,118 +111,114 @@ void DatManager::parseThingAttributes(std::stringstream& fin, ThingAttributes& t
void DatManager::parseThingAttributesOpt(std::stringstream& fin, ThingAttributes& thingAttributes, uint8 opt) void DatManager::parseThingAttributesOpt(std::stringstream& fin, ThingAttributes& thingAttributes, uint8 opt)
{ {
switch(opt) { switch(opt) {
case Otc::Bank: // Ground tile case Otc::DatGround: // Grounds, must be drawn first
thingAttributes.speed = Fw::getU16(fin); thingAttributes.speed = Fw::getU16(fin);
thingAttributes.group = Otc::ThingGroundGroup; thingAttributes.group = Otc::ThingGroundGroup;
break; break;
case Otc::Clip: // Ground borders case Otc::DatGroundClip: // Objects that clips (has transparent pixels) and must be drawn just after ground (e.g: ground borders)
thingAttributes.alwaysOnTop = true; thingAttributes.alwaysOnTop = true;
thingAttributes.alwaysOnTopOrder = 1; thingAttributes.alwaysOnTopOrder = 1;
break; break;
case Otc::Bottom: // Bottom items case Otc::DatOnBottom: // Bottom items, must be drawn above general items and below creatures (e.g: stairs)
thingAttributes.alwaysOnTop = true; thingAttributes.alwaysOnTop = true;
thingAttributes.alwaysOnTopOrder = 2; thingAttributes.alwaysOnTopOrder = 2;
break; break;
case Otc::Top: // Top items case Otc::DatOnTop: // Top items, must be drawn above creatures (e.g: doors)
thingAttributes.alwaysOnTop = true; thingAttributes.alwaysOnTop = true;
thingAttributes.alwaysOnTopOrder = 3; thingAttributes.alwaysOnTopOrder = 3;
break; break;
case Otc::Container: // Container case Otc::DatContainer: // Containers
thingAttributes.group = Otc::ThingContainerGroup; thingAttributes.group = Otc::ThingContainerGroup;
break; break;
case Otc::Cumulative: // Stackable case Otc::DatStackable: // Stackable
thingAttributes.stackable = true; thingAttributes.stackable = true;
break; break;
case Otc::ForceUse: // Unknown, some corpses, stairs, even ground ???? case Otc::DatForceUse: // Items that are automatically used when step over?
break; break;
case Otc::MultiUse: // Useable case Otc::DatMultiUse: // Usable items
thingAttributes.useable = true; thingAttributes.useable = true;
break; break;
case Otc::Write: // Writtable case Otc::DatWritable: // Writable
thingAttributes.group = Otc::ThingWriteableGroup; thingAttributes.group = Otc::ThingWriteableGroup;
thingAttributes.readable = true; thingAttributes.readable = true;
thingAttributes.subParam08 = Fw::getU16(fin); thingAttributes.subParam08 = Fw::getU16(fin);
break; break;
case Otc::WriteOnce: // Writtable once. objects that can't be edited by players case Otc::DatWritableOnce: // Writable once. objects that can't be edited by players
thingAttributes.readable = true; thingAttributes.readable = true;
thingAttributes.subParam08 = Fw::getU16(fin); thingAttributes.subParam08 = Fw::getU16(fin);
break; break;
case Otc::LiquidContainer: // Fluid containers case Otc::DatFluidContainer: // Fluid containers
thingAttributes.group = Otc::ThingFluidGroup; thingAttributes.group = Otc::ThingFluidGroup;
Fw::getU8(fin); Fw::getU8(fin);
break; break;
case Otc::LiquidPool: // Splashes case Otc::DatSplash: // Splashes
thingAttributes.group = Otc::ThingSplashGroup; thingAttributes.group = Otc::ThingSplashGroup;
break; break;
case Otc::Unpass: // Blocks solid objects (creatures, walls etc) case Otc::DatBlockWalk: // Blocks solid objects (creatures, walls etc)
thingAttributes.blockSolid = true; thingAttributes.blockSolid = true;
break; break;
case Otc::Unmove: // Not moveable case Otc::DatNotMovable: // Not movable
thingAttributes.moveable = false; thingAttributes.moveable = false;
break; break;
case Otc::Unsight: // Blocks missiles (walls, magic wall etc) case Otc::DatBlockProjectile: // Blocks missiles (walls, magic wall etc)
thingAttributes.blockProjectile = true; thingAttributes.blockProjectile = true;
break; break;
case Otc::Avout: // Blocks pathfind algorithms (monsters) case Otc::DatBlockPathFind: // Blocks pathfind algorithms (monsters)
thingAttributes.blockPathFind = true; thingAttributes.blockPathFind = true;
break; break;
case Otc::Take: // Pickupable case Otc::DatPickupable: // Pickupable
thingAttributes.pickupable = true; thingAttributes.pickupable = true;
break; break;
case Otc::Hang: // Hangable objects (wallpaper etc) case Otc::DatHangable: // Hangable objects (wallpaper etc)
thingAttributes.isHangable = true; thingAttributes.isHangable = true;
break; break;
case Otc::HookSouth: // Horizontal wall?? case Otc::DatHookSouth: // Horizontal walls
thingAttributes.isHorizontal = true; thingAttributes.isHorizontal = true;
break; break;
case Otc::HookEast: // Vertical wall?? case Otc::DatHookEast: // Vertical walls
thingAttributes.isVertical = true; thingAttributes.isVertical = true;
break; break;
case Otc::Rotate: // Rotable case Otc::DatRotable: // Rotable
thingAttributes.rotable = true; thingAttributes.rotable = true;
break; break;
case Otc::Light: // Light info case Otc::DatLight: // Light info
thingAttributes.lightLevel = Fw::getU16(fin); thingAttributes.lightLevel = Fw::getU16(fin);
thingAttributes.lightColor = Fw::getU16(fin); thingAttributes.lightColor = Fw::getU16(fin);
break; break;
case Otc::DontHide: // Unknown, just a few monuments case Otc::DatDontHide: // A few monuments that are not supposed to be hidden by floors
break; break;
case Otc::Translucent: // Unknown description case Otc::DatTranslucent: // Grounds that are translucent
thingAttributes.changesFloor = true; thingAttributes.changesFloor = true;
break; break;
case Otc::Shift: // Thing must be drawed with offset case Otc::DatDrawShift: // Must shift draw
thingAttributes.hasHeight = true; thingAttributes.hasHeight = true;
thingAttributes.drawOffset = Fw::getU8(fin); thingAttributes.drawOffset = Fw::getU16(fin);
Fw::getU8(fin);
Fw::getU16(fin); Fw::getU16(fin);
break; break;
case Otc::Height: // pixels characters height case Otc::DatDrawHeight: // pixels characters height
thingAttributes.drawNextOffset = Fw::getU8(fin); thingAttributes.drawNextOffset = Fw::getU16(fin);
Fw::getU8(fin);
break; break;
case Otc::LyingObject: // Unknown, some corpses case Otc::DatLyingCorpse: // Some corpses
//thingAttributes.hasHeight = true;
break; break;
case Otc::AnimateAlways: // Unknown, check if firesword is a kind of AnimateAlways. case Otc::DatAnimateAlways: // Unknown, check if firesword is a kind of AnimateAlways.
break; break;
case Otc::Automap: // Minimap color case Otc::DatMinimapColor: // Minimap color
thingAttributes.miniMapColor = Fw::getU16(fin);
thingAttributes.hasMiniMapColor = true; thingAttributes.hasMiniMapColor = true;
thingAttributes.miniMapColor = Fw::getU16(fin);
break; break;
case Otc::LensHelp: // Unknown case Otc::DatLensHelp: // Used for giving players tips?
if(Fw::getU16(fin) == 1112) Fw::getU16(fin);
thingAttributes.readable = true;
break; break;
case Otc::FullBank: // Ground has no transparent pixels. case Otc::DatFullGround: // Grounds that has no transparent pixels
break; break;
case Otc::IgnoreLook: // Ignore look, then looks at the item on the bottom of it. case Otc::DatIgnoreLook: // Ignore look, then looks at the item on the bottom of it
thingAttributes.lookThrough = true; thingAttributes.lookThrough = true;
break; break;
case Otc::Clothes: // Unknown case Otc::DatClothe: // Clothes
break; break;
case Otc::Animation: // Not used in 8.62 case Otc::DatAnimation: // Not used in 8.62
break; break;
default: default:
throw std::runtime_error(Fw::mkstr("unknown .dat byte code: 0x", std::hex, (int)opt)); throw std::runtime_error(Fw::mkstr("unknown .dat byte code: ", (int)opt));
} }
} }