mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-29 06:07:57 +03:00
Fixed a tiny mistake that prevented morphs from working correctly
Actors now have a working dynamic facial expression (moving eyes/mouth/brown...)
This commit is contained in:
parent
4d231fbc50
commit
fb15f0f2b3
2 changed files with 7 additions and 11 deletions
|
@ -217,6 +217,6 @@ void skeletor_c::LoadMorphTargetNames(skelHeaderGame_t *modelHeader)
|
||||||
m_targetBlink = morphTargetIndex;
|
m_targetBlink = morphTargetIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
newTargetName += strlen(newTargetName + 1);
|
newTargetName += strlen(newTargetName) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -439,14 +439,12 @@ void TIKI_CacheFileSkel(skelHeader_t *pHeader, skelcache_t *cache, int length)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nBoxBytes) {
|
if (nBoxBytes) {
|
||||||
const int ofsBoxes = LongNoSwapPtr(&pHeader->ofsBoxes);
|
if (pHeader->ofsBoxes <= 0 || (nBoxBytes + pHeader->ofsBoxes) > length) {
|
||||||
|
|
||||||
if (ofsBoxes <= 0 || (nBoxBytes + ofsBoxes) >= length) {
|
|
||||||
Com_Printf("^~^~^ Box data is corrupted for '%s'\n", cache->path);
|
Com_Printf("^~^~^ Box data is corrupted for '%s'\n", cache->path);
|
||||||
pSkel->numMorphTargets = 0;
|
pSkel->numBoxes = 0;
|
||||||
pSkel->pMorphTargets = NULL;
|
pSkel->pBoxes = NULL;
|
||||||
} else {
|
} else {
|
||||||
memcpy(pSkel->pBoxes, ((byte *)pHeader + ofsBoxes), nBoxBytes);
|
memcpy(pSkel->pBoxes, ((byte *)pHeader + pHeader->ofsBoxes), nBoxBytes);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pSkel->numBoxes = 0;
|
pSkel->numBoxes = 0;
|
||||||
|
@ -460,14 +458,12 @@ void TIKI_CacheFileSkel(skelHeader_t *pHeader, skelcache_t *cache, int length)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nMorphBytes) {
|
if (nMorphBytes) {
|
||||||
const int ofsMorphTargets = LongNoSwapPtr(&pHeader->ofsBoxes);
|
if (pHeader->ofsMorphTargets <= 0 || (nMorphBytes + pHeader->ofsMorphTargets) > length) {
|
||||||
|
|
||||||
if (ofsMorphTargets <= 0 || (nMorphBytes + ofsMorphTargets) >= length) {
|
|
||||||
Com_Printf("^~^~^ Morph targets data is corrupted for '%s'\n", cache->path);
|
Com_Printf("^~^~^ Morph targets data is corrupted for '%s'\n", cache->path);
|
||||||
pSkel->numMorphTargets = 0;
|
pSkel->numMorphTargets = 0;
|
||||||
pSkel->pMorphTargets = NULL;
|
pSkel->pMorphTargets = NULL;
|
||||||
} else {
|
} else {
|
||||||
memcpy(pSkel->pMorphTargets, ((byte *)pHeader + ofsMorphTargets), nMorphBytes);
|
memcpy(pSkel->pMorphTargets, ((byte *)pHeader + pHeader->ofsMorphTargets), nMorphBytes);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pSkel->numMorphTargets = 0;
|
pSkel->numMorphTargets = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue