From: Laszlo T. <ave...@us...> - 2013-04-03 18:48:07
|
gemrb: Infinity Engine emulator The branch master has been updated via 4178701359e9314ff9b042ba92281a14f2140ce6 (commit) Summary of changes: gemrb/core/Map.h | 2 +- gemrb/plugins/AREImporter/AREImporter.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) from 3004f4ab1093eeb789c6d371b340fa23d3b2995d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=4178701359e9314ff9b042ba92281a14f2140ce6 commit 4178701359e9314ff9b042ba92281a14f2140ce6 Author: Avenger <ave...@so...> Date: Wed Apr 3 20:46:30 2013 +0200 implemented A_ANI_RANDOM_START diff --git a/gemrb/core/Map.h b/gemrb/core/Map.h index b376e48..df535fc 100644 --- a/gemrb/core/Map.h +++ b/gemrb/core/Map.h @@ -208,7 +208,7 @@ public: ieWord transparency; ieWordSigned height; //these are on one dword - ieWord unknown3c; + ieWord startFrameRange; ieByte skipcycle; ieByte startchance; ieDword unknown48; diff --git a/gemrb/plugins/AREImporter/AREImporter.cpp b/gemrb/plugins/AREImporter/AREImporter.cpp index d301e4d..0f1ad8f 100644 --- a/gemrb/plugins/AREImporter/AREImporter.cpp +++ b/gemrb/plugins/AREImporter/AREImporter.cpp @@ -1050,7 +1050,7 @@ Map* AREImporter::GetMap(const char *ResRef, bool day_or_night) for (i = 0; i < AnimCount; i++) { AreaAnimation* anim = new AreaAnimation(); str->Read(anim->Name, 32); - ieWord animX, animY; + ieWord animX, animY, startFrameRange; str->ReadWord( &animX ); str->ReadWord( &animY ); anim->Pos.x=animX; @@ -1062,11 +1062,15 @@ Map* AREImporter::GetMap(const char *ResRef, bool day_or_night) str->ReadDword( &anim->Flags ); str->ReadWordSigned( &anim->height ); str->ReadWord( &anim->transparency ); - str->ReadWord( &anim->unknown3c ); //not completely understood, if not 0, sequence is started + str->ReadWord( &startFrameRange ); str->Read( &anim->startchance,1 ); if (anim->startchance<=0) { anim->startchance=100; //percentage of starting a cycle } + if (startFrameRange && (anim->Flags&A_ANI_RANDOM_START) ) { + anim->frame = core->Roll(0,startFrameRange, -1); //roll a number between 0 and startFrameRange + } + anim->startFrameRange = 0; //this will never get resaved (iirc) str->Read( &anim->skipcycle,1 ); //how many cycles are skipped (100% skippage) str->ReadResRef( anim->PaletteRef ); str->ReadDword( &anim->unknown48 ); @@ -1974,7 +1978,7 @@ int AREImporter::PutAnimations( DataStream *stream, Map *map) stream->WriteDword( &an->Flags); stream->WriteWord( (ieWord *) &an->height); stream->WriteWord( &an->transparency); - stream->WriteWord( &an->unknown3c); //animation already played? + stream->WriteWord( &an->startFrameRange); //used by A_ANI_RANDOM_START stream->Write( &an->startchance,1); stream->Write( &an->skipcycle,1); stream->WriteResRef( an->PaletteRef); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |