Exemplo n.º 1
0
void ModelEditor::writeAnimation(AnimationBlock *ablock,
		AnimationHelper<T> help) {
	_TDn("void ModelEditor::writeAnimation(AnimationBlock *ablock,AnimationHelper<T>help)");
	ablock->nKeys = help.nAnims;
	ablock->nTimes = help.nAnims;
	ablock->seq = help.GlobalSequence;
	ablock->type = help.Interpolation;
	if (help.nAnims != 0) {
		ablock->ofsTimes = FileSize;
		ablock->ofsKeys = FileSize + sizeof(AnimSubStructure);
		AnimSubStructure *timesub = new AnimSubStructure[help.nAnims];
		AnimSubStructure *keysub = new AnimSubStructure[help.nAnims];
		for (int k = 0; k < help.nAnims; k++) {
			timesub[k].n = help.helper[k].nValues;
			keysub[k].n = help.helper[k].nValues;
		}
		int newSize = FileSize + 2 * sizeof(AnimSubStructure)*help.nAnims;
		char *n = f;
		f = SMemNew(newSize);
		memcpy(f, n, FileSize);
		SetStructure();
		memcpy(f + FileSize, timesub, sizeof(AnimSubStructure) * help.nAnims);
		memcpy(f + FileSize + sizeof(AnimSubStructure)*help.nAnims, keysub,
				sizeof(AnimSubStructure) * help.nAnims);
		int ofsSize = FileSize;
		FileSize = newSize;
		FillLine();
		//we need to reset the pointers whenever FileSize has changed..
		for (int j = 0; j < help.nAnims; j++) {
			//n was set before.. I think xD
			if (help.helper[j].nValues != 0 && !help.helper[j].inAnim) {
				timesub = (AnimSubStructure *) (f + ofsSize);
				timesub[j].ofs = FileSize;
				uint32 *time = new uint32[help.helper[j].nValues];
				for (int k = 0; k < help.helper[j].nValues; k++) {
					time[k] = help.helper[j].help[k].timestamp;
				}
				writeAnimblockData(time, help.helper[j].nValues);
				keysub = (AnimSubStructure *) (f + ofsSize
						+ sizeof(AnimSubStructure)*help.nAnims);
				keysub[j].ofs = FileSize;
				T *val = new T[help.helper[j].nValues];
				for (int k = 0; k < help.helper[j].nValues; k++) {
					val[k] = help.helper[j].help[k].value;
				}
				writeAnimblockData(val, help.helper[j].nValues);
			} else {
				timesub = (AnimSubStructure *) (f + ofsSize);
				timesub[j].ofs = help.helper[j].ofsTime;
				keysub = (AnimSubStructure *) (f + ofsSize
						+ sizeof(AnimSubStructure)*help.nAnims);
				keysub[j].ofs = help.helper[j].ofsKey;
			}
		}
		FillLine();
	} else {
		ablock->ofsTimes = 0;
		ablock->ofsKeys = 0;
	}
}
Exemplo n.º 2
0
void ModelEditor::newTexAnimLookup() {
	_Tn("newTexAnimLookup");
	if (header_m->nTexAnims != 0) {
		int newSize = FileSize + header_m->nTexAnims * sizeof(short);
		char *n = f;
		f = SMemNew(newSize);
		memcpy(f, n, FileSize);
		SetStructure();
		header_m->nTexAnimLookup = header_m->nTextures;
		header_m->ofsTexAnimLookup = FileSize;
		FileSize = newSize;
		SetStructure();
		for (int i = 0; i < header_m->nTexLookup; i++) {
			texanimlookup_m[i] = i;
		}
		FillLine();
	} else {
		int newSize = FileSize + sizeof(short);
		char *n = f;
		f = SMemNew(newSize);
		memcpy(f, n, FileSize);
		SetStructure();
		header_m->nTexAnimLookup = 1;
		header_m->ofsTexAnimLookup = FileSize;
		FileSize = newSize;
		SetStructure();
		texanimlookup_m[0] = -1;
		FillLine();
	}
}
Exemplo n.º 3
0
void ModelEditor::newTextures(TextureHelper help) {
	_Tn("newTextures");
	FillLine();
	int newSize = FileSize + help.nTextures * sizeof(ModelTextureDef);
	for (int i = 0; i < help.nTextures; i++) {
		help.texdefs[i].nameOfs = newSize;
		newSize += help.texdefs[i].nameLen + (16 - ((help.texdefs[i].nameLen)
				% 16));
	}
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsTextures = FileSize;
	header_m->nTextures = help.nTextures;
	texture_m = (ModelTextureDef *) (f + header_m->ofsTextures);
	for (int i = 0; i < help.nTextures; i++) {
		texture_m[i] = help.texdefs[i];
		char *texname = (char *) (f + texture_m[i].nameOfs);
		for (int k = 0; k < texture_m[i].nameLen; k++) {
			texname[k] = help.Texnames[i][k];
		}
	}
	FileSize = newSize;
	FillLine();
}
Exemplo n.º 4
0
void kpFloodFill::addLine (int y, int x1, int x2)
{
#if DEBUG_KP_FLOOD_FILL && 0
    kdDebug () << "kpFillCommand::fillAddLine (" << y << "," << x1 << "," << x2 << ")" << endl;
#endif

    m_fillLines.append (FillLine (y, x1, x2));
    m_fillLinesCache [y].append (FillLine (y /* OPT */, x1, x2));
    m_boundingRect = m_boundingRect.unite (QRect (QPoint (x1, y), QPoint (x2, y)));
}
Exemplo n.º 5
0
void SkinEditor::newProperties(int num){
	_Tn("newProps_n");
	FillLine();
	int newSize=FileSize+sizeof(VProp)*num;
	char *n=f;
	f=(char*)malloc(newSize);
	memcpy(f,n,FileSize);
	SetStructure();
	header_s->nProperties=num;
	header_s->ofsProperties=FileSize;
	FileSize=newSize;
	FillLine();
}
Exemplo n.º 6
0
void SkinEditor::newTriangles(Triangle *tri,int num){
	_Tn("newTriangles");
	FillLine();
	int newSize=FileSize+sizeof(Triangle)*num;
	char *n=f;
	f=(char*)malloc(newSize);
	memcpy(f,n,FileSize);
	SetStructure();
	header_s->nTriangles=num;
	header_s->ofsTriangles=FileSize;
	memcpy(f+FileSize,tri,sizeof(Triangle)*num);
	FileSize=newSize;
	FillLine();
}
Exemplo n.º 7
0
void ModelEditor::newGlobalSequences(uint32 *sequ, int nSequ) {
	_Tn("newGlobalSequences()");
	FillLine();
	int newSize = FileSize + sizeof(uint32) + nSequ;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsGlobalSequences = FileSize;
	header_m->nGlobalSequences = nSequ;
	memcpy(f + FileSize, sequ, sizeof(uint32) * nSequ);
	FileSize = newSize;
	FillLine();
}
Exemplo n.º 8
0
void ModelEditor::newRenderflags(ModelRenderFlags *flags, int num) {
	_Tn("new Renderflags");
	FillLine();
	int newSize = FileSize + sizeof(ModelRenderFlags) * num;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsRenderFlags = FileSize;
	header_m->nRenderFlags = num;
	memcpy(f + FileSize, flags, num * sizeof(ModelRenderFlags));
	FileSize = newSize;
	FillLine();
}
Exemplo n.º 9
0
void ModelEditor::newAttachments(ModelAttachmentDef*attachments, int num) {
	_Tn("newAttachments");
	FillLine();
	int newSize = FileSize + sizeof(ModelAttachmentDef) * num;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->nAttachments = num;
	header_m->ofsAttachments = FileSize;
	FileSize = newSize;
	memcpy(f + header_m->ofsAttachments, attachments, num
			* sizeof(ModelAttachmentDef));
	SetStructure();
	for (int i = 0; i < header_m->nAttachments; i++) {
		//I null this because I saw no difference,
		//and without animblocks it is much easier
		attach_m[i].unk.nKeys = 0;
		attach_m[i].unk.nTimes = 0;
		attach_m[i].unk.ofsKeys = 0;
		attach_m[i].unk.ofsTimes = 0;
	}
	FillLine();
	//Now we create the lookup!

	//40 should be enough atm
	//maybe we need later more?
	int nLook = 40;
	newSize = FileSize + nLook * sizeof(short);
	n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->nAttachLookup = nLook;
	header_m->ofsAttachLookup = FileSize;
	FileSize = newSize;
	SetStructure();
	for (int i = 0; i < header_m->nAttachLookup; i++) {
		for (int j = 0; j < header_m->nAttachments; j++) {
			if (attach_m[j].id = i) {
				attachlookup_m[i] = j;
				break;
			} else {
				attachlookup_m[i] = -1;
			}
		}
	}
	FillLine();

}
Exemplo n.º 10
0
void SkinEditor::newIndices(Index *ind,int num){
	_Tn("newIndices");
	FillLine();
	int newSize=FileSize+sizeof(Index)*num;
	char *n=f;
	f=(char*)malloc(newSize);
	memcpy(f,n,FileSize);
	SetStructure();
	header_s->nIndices=num;
	header_s->ofsIndices=FileSize;
	memcpy(f+FileSize,ind,sizeof(Index)*num);
	FileSize=newSize;
	FillLine();
}
Exemplo n.º 11
0
void SkinEditor::newTexUnits(TexUnit* tex, int num){
	_Tn("newTexUnits");
	FillLine();
	int newSize=FileSize+sizeof(TexUnit)*num;
	char *n=f;
	f=(char*)malloc(newSize);
	memcpy(f,n,FileSize);
	SetStructure();
	header_s->nTextureUnits=num;
	header_s->ofsTextureUnits=FileSize;
	memcpy(f+FileSize,tex,sizeof(TexUnit)*num);
	FileSize=newSize;
	FillLine();
}
Exemplo n.º 12
0
void SkinEditor::newSubmeshes(Submesh* sub,int num){
	_Tn("newSubmeshes");
	FillLine();
	int newSize=FileSize+sizeof(Submesh)*num;
	char *n=f;
	f=(char*)malloc(newSize);
	memcpy(f,n,FileSize);
	SetStructure();
	header_s->nSubmeshes=num;
	header_s->ofsSubmeshes=FileSize;
	memcpy(f+FileSize,sub,sizeof(Submesh)*num);
	FileSize=newSize;
	FillLine();
}
Exemplo n.º 13
0
/**
 *Note: This will not add any animated bones!
 *only Animationsdef will be added!
 **/
void ModelEditor::newAnimations(ModelAnimation *anim, int nanim) {
	_Tn("newAnimations");
	FillLine();
	int newSize = FileSize + sizeof(ModelAnimation) * (nanim);
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	memcpy(f + FileSize, anim, nanim * sizeof(ModelAnimation));
	header_m->ofsAnimations = FileSize;
	header_m->nAnimations = nanim;
	FileSize = newSize;
	FillLine();
	SetStructure();
}
Exemplo n.º 14
0
void ModelEditor::newVertices(ModelVertex * vert, int nvert) {
	_Tn("newVertices");
	FillLine();
	int newSize = FileSize + sizeof(ModelVertex) * (nvert);
	char *newc = SMemNew(newSize);
	memcpy(newc, f, FileSize);
	f = newc;
	SetStructure();
	memcpy(f + FileSize, vert, nvert * sizeof(ModelVertex));
	header_m->ofsVertices = FileSize;
	header_m->nVertices = nvert;
	FileSize = newSize;
	FillLine();
	SetStructure();
}
Exemplo n.º 15
0
void ScrollDown
(
	int	lines
)
{
//	Report_Function(ScrollDown)

	int rest = ScreenLength - lines;
	short *db = DisplayBuffer+(ScreenWidth*(ScreenLength-1));
	
	while( rest )
	{
		MoveLine
		(
			db,
			db-ScreenWidth,
			ScreenWidth
		);

		rest--;
		db -= ScreenWidth;
	}

	FillLine
	(
		DisplayBuffer,
		' ' | DisplayAttr,
		lines*ScreenWidth
	);
	
} /* ScrollDown */
Exemplo n.º 16
0
void ModelEditor::newColors(ColorHelper help) {
	_Tn("newColors()");
	int newSize = FileSize + sizeof(ModelColorDef) * help.nColors;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsColors = FileSize;
	header_m->nColors = help.nColors;
	FileSize = newSize;
	FillLine();
	for (int i = 0; i < help.nColors; i++) {
		writeAnimation(&(color_m[i].color), help.color[i]);
		writeAnimation(&(color_m[i].opacity), help.opacity[i]);
	}
	FillLine();
}
Exemplo n.º 17
0
void SkinEditor::newIndices(int num){
	_Tn("newIndices_n");
	FillLine();
	int newSize=FileSize+sizeof(Index)*num;
	char *n=f;
	f=(char*)malloc(newSize);
	memcpy(f,n,FileSize);
	SetStructure();
	header_s->nIndices=num;
	header_s->ofsIndices=FileSize;
	SetStructure();
	for(int i=0;i<header_s->nIndices;i++){
		index_s[i].Vertex=i;
	}
	FileSize=newSize;
	FillLine();

}
Exemplo n.º 18
0
void ModelEditor::newTransparencyLookup() {
	_Tn("newTransparencyLookup()");
	FillLine();
	int newSize = FileSize + header_m->nTransparency * sizeof(short);
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->nTransparencyLookup = header_m->nTransparency;
	header_m->ofsTransparencyLookup = FileSize;
	printf("Setted Offsets\n");
	SetStructure();
	FileSize = newSize;
	for (int i = 0; i < header_m->nTransparencyLookup; i++) {
		translookup_m[i] = i;
	}
	FillLine();
}
Exemplo n.º 19
0
void ModelEditor::addTexture(ModelTextureDef tex, const char * texname) {
	_Tn("addTexture");
	FillLine();
	//let's calc the needed space
	int newSize = FileSize + sizeof(ModelTextureDef)
			* (header_m->nTextures + 1) +
	//(16-((sizeof(ModelTextureDef)*(header_m->nTextures+1))%16))+ //we don't need this as (sizeof(ModelTextureDef)==0x10
			tex.nameLen + (16 - (tex.nameLen) % 16) + sizeof(uint16)
			* (header_m->nTexLookup + 1) + (16 - ((sizeof(uint16)
			* (header_m->nTexLookup + 1)) % 16));
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	memcpy(f + FileSize, (f + header_m->ofsTextures), sizeof(ModelTextureDef)
			* header_m->nTextures);
	memcpy(f + FileSize + sizeof(ModelTextureDef) * (header_m->nTextures + 1),
			texname, tex.nameLen);
	memcpy(f + FileSize + sizeof(ModelTextureDef) * (header_m->nTextures + 1)
			+ tex.nameLen + (16 - (sizeof(tex.nameLen)) % 16), (f
			+ header_m->ofsTexLookup), sizeof(short) * header_m->nTexLookup);
	header_m = (ModelHeader *) (f);

	header_m->ofsTextures = FileSize;
	texture_m = (ModelTextureDef *) (f + header_m->ofsTextures);
	texture_m[header_m->nTextures].flags = tex.flags;
	texture_m[header_m->nTextures].type = tex.type;
	texture_m[header_m->nTextures].nameLen = tex.nameLen;
	texture_m[header_m->nTextures].nameOfs = FileSize + sizeof(ModelTextureDef)
			* (header_m->nTextures + 1);

	header_m->ofsTexLookup = FileSize + sizeof(ModelTextureDef)
			* (header_m->nTextures + 1) + tex.nameLen + (16 - (tex.nameLen)
			% 16);
	texturelookup_m = (uint16 *) (f + header_m->ofsTexLookup);
	texturelookup_m[header_m->nTexLookup] = header_m->nTextures;

	header_m->nTextures++;
	header_m->nTexLookup++;

	FileSize = newSize;
	FillLine();
	SetStructure();
}
Exemplo n.º 20
0
void ModelEditor::newBounds(BoundVolumeHelper help) {
	_Tn("void ModelEditor::newBounds(BoundVolumeHelper help)");
	//normals
	int newSize = FileSize + sizeof(Vec3D) * help.nBNormals;
	char *n = f;
	f = new char[newSize];
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsBoundingNormals = FileSize;
	header_m->nBoundingNormals = help.nBNormals;
	memcpy(f + FileSize, help.BNormals, help.nBNormals * sizeof(Vec3D));
	FileSize = newSize;
	FillLine();

	//vertices
	newSize = FileSize + sizeof(Vec3D) * help.nBVertices;
	n = f;
	f = new char[newSize];
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsBoundingVertices = FileSize;
	header_m->nBoundingVertices = help.nBVertices;
	memcpy(f + FileSize, help.BVertices, sizeof(Vec3D) * help.nBVertices);
	FileSize = newSize;
	FillLine();

	//triangles
	newSize = FileSize + sizeof(ModelBoundTriangle) * help.nBTriangles;
	n = f;
	f = new char[newSize];
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsBoundingTriangles = FileSize;
	header_m->nBoundingTriangles = help.nBTriangles;
	memcpy(f + FileSize, help.BTriangles, sizeof(ModelBoundTriangle)
			* help.nBTriangles);
	FileSize = newSize;
	FillLine();

	calcBoundingBox();

}
Exemplo n.º 21
0
void ModelEditor::setModelName(char *name, int length) {
	int newSize = FileSize + length;
	char*n = f;
	f = new char[newSize];
	memcpy(f, n, FileSize);
	memcpy(f + FileSize, name, length);
	SetStructure();
	header_m->nameOfs = FileSize;
	header_m->nameLength = length;
	FillLine();
}
Exemplo n.º 22
0
void ModelEditor::newTexAnim(TexAnimHelper help) {
	_Tn("newTexAnim");
	int newSize = FileSize + sizeof(ModelTexAnimDef) * help.nTexAnims;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	memcpy(f + FileSize, help.TexAnims, sizeof(ModelTexAnimDef)
			* help.nTexAnims);
	SetStructure();
	header_m->ofsTexAnims = FileSize;
	header_m->nTexAnims = help.nTexAnims;
	FileSize = newSize;
	FillLine();
	for (int i = 0; i < header_m->nTexAnims; i++) {
		writeAnimation(&(texanim_m[i].trans), help.trans[i]);
		writeAnimation(&(texanim_m[i].rot), help.rot[i]);
		writeAnimation(&(texanim_m[i].scale), help.scaling[i]);
	}
	FillLine();

}
Exemplo n.º 23
0
int ModelEditor::writeAnimblockData(T *data, int nValues) {
	_TDn("writeAnimblockData");
	int newSize = FileSize + sizeof(T) * nValues;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	memcpy(f + FileSize, data, sizeof(T) * nValues);
	FileSize = newSize;
	FillLine();
	return 0;
}
Exemplo n.º 24
0
void ModelEditor::newCameras(CamHelper help) {
	_Tn("newCameras");
	int newSize = FileSize + sizeof(ModelCameraDef) * help.nCameras;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	memcpy(f + FileSize, help.camera, sizeof(ModelCameraDef) * help.nCameras);
	SetStructure();
	header_m->ofsCameras = FileSize;
	header_m->nCameras = help.nCameras;
	FileSize = newSize;
	FillLine();
	for (int i = 0; i < header_m->nCameras; i++) {
		writeAnimation(&(cam_m[i].rot), help.rotation[i]);
		writeAnimation(&(cam_m[i].transTarget), help.translationtar[i]);
		writeAnimation(&(cam_m[i].transPos), help.translationpos[i]);
	}
	FillLine();
	//I only know about two different cameras...
	int nCamLookup = 2;
	newSize = FileSize + sizeof(short) * nCamLookup;
	n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsCameraLookup = FileSize;
	header_m->nCameraLookup = nCamLookup;
	SetStructure();
	for (int i = 0; i < header_m->nCameraLookup; i++) {
		for (int j = 0; j < header_m->nCameras; j++) {
			if (cam_m[j].id == i) {
				camlookup_m[i] = j;
				break;
			} else
				camlookup_m[i] = -1;
		}
	}
	FileSize = newSize;
	FillLine();
}
Exemplo n.º 25
0
void ModelEditor::newRibbons(RibbonHelper help){
	_Tn("void ModelEditor::newRibbons(RibbonHelper help)");
	int newSize = FileSize + sizeof(ModelRibbonEmitterDef) * help.nRibbons;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	memcpy(f+FileSize,help.ribbons,sizeof(ModelRibbonEmitterDef) * help.nRibbons);
	SetStructure();
	header_m->ofsRibbonEmitters = FileSize;
	header_m->nRibbonEmitters = help.nRibbons;
	FileSize = newSize;
	FillLine();
	for (int i = 0; i < help.nRibbons; i++) {
		writeAnimation(&(ribbon_m[i].color), help.Color[i]);
		writeAnimation(&(ribbon_m[i].opacity), help.Opacity[i]);
		writeAnimation(&(ribbon_m[i].above), help.Above[i]);
		writeAnimation(&(ribbon_m[i].below), help.Below[i]);
		writeAnimation(&(ribbon_m[i].enabled), help.Enabled[i]);
		writeAnimation(&(ribbon_m[i].unk1), help.Unk1[i]);
	}
	FillLine();
}
Exemplo n.º 26
0
void ModelEditor::newLights(LightHelper help){
	_Tn("void ModelEditor::newLights(LightHelper help)");
	int newSize = FileSize + sizeof(ModelLightDef) * help.nLights;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	memcpy(f+FileSize,help.lights,sizeof(ModelLightDef) * help.nLights);
	SetStructure();
	header_m->ofsLights = FileSize;
	header_m->nLights = help.nLights;
	FileSize = newSize;
	FillLine();
	for (int i = 0; i < help.nLights; i++) {
		writeAnimation(&(light_m[i].ambColor), help.AmbientColor[i]);
		writeAnimation(&(light_m[i].ambIntensity), help.AmbientIntensity[i]);
		writeAnimation(&(light_m[i].diffcolor), help.DiffuseColor[i]);
		writeAnimation(&(light_m[i].diffintensity), help.DiffuseIntensity[i]);
		writeAnimation(&(light_m[i].attEnd), help.AttenuationEnd[i]);
		writeAnimation(&(light_m[i].attStart), help.AttenuationStart[i]);
		writeAnimation(&(light_m[i].Enabled), help.Enabled[i]);
	}
	FillLine();
}
Exemplo n.º 27
0
/**
 *in fact..this is bullshit oO
 *
 *it should be more like:
 *read in the animations and check for which animation they are...
 **/
void ModelEditor::addAnimationLookup(int nanim) {
	_Tn("addAnimLookup");
	FillLine();
	int newSize = FileSize + sizeof(uint16) * (header_m->nAnimationLookup
			+ nanim);
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	memcpy(f + FileSize, (f + header_m->ofsAnimationLookup), sizeof(uint16)
			* (header_m->nAnimationLookup));
	header_m->ofsAnimationLookup = FileSize;
	animlookup_m = (int16*) (f + header_m->ofsAnimationLookup);
	for (int i = 0; i < nanim; i++) {
		//not really...
		animlookup_m[i + header_m->nAnimationLookup] = i
				+ header_m->nAnimationLookup;
	}
	header_m->nAnimationLookup += nanim;
	FileSize = newSize;
	FillLine();
	SetStructure();
}
Exemplo n.º 28
0
void ModelEditor::newTexReplace() {
	_Tn("newTexReplace");
	int newSize = FileSize + sizeof(short);
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->nTexReplace = 1;
	header_m->ofsTexReplace = FileSize;
	FileSize = newSize;
	SetStructure();
	texreplacelookup_m[0] = 0;
	FillLine();
}
Exemplo n.º 29
0
/**
 * Just some dummy to have the keylookup in the file...
 */
void ModelEditor::newKeyBoneLookup() {
	_Tn("newKeyBoneLookup");
	int newSize = FileSize + sizeof(short);
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->nKeyBoneLookup = 1;
	header_m->ofsKeyBoneLookup = FileSize;
	FileSize = newSize;
	SetStructure();
	keybonelookup_m[0] = -1;
	FillLine();
}
Exemplo n.º 30
0
void ModelEditor::newTransparency(AnimationHelper<short> *help, int nTrans) {
	_Tn("void ModelEditor::newTransparency(AnimationHelper<short> *help,int nTrans)");
	int newSize = FileSize + sizeof(AnimationBlock) * nTrans;
	char *n = f;
	f = SMemNew(newSize);
	memcpy(f, n, FileSize);
	SetStructure();
	header_m->ofsTransparency = FileSize;
	header_m->nTransparency = nTrans;
	FileSize = newSize;
	FillLine();
	for (int i = 0; i < nTrans; i++) {
		writeAnimation(&(trans_m[i].trans), help[i]);
	}
}