/*
 * Load routine. This operation restores the state of the object from
 * a data source.
 *
 * The object system will automatically invoke the load routines of
 * the parent beforehand.
 */
static int
Load(void *obj, AG_DataSource *ds, const AG_Version *ver)
{
	Mammal *mammal = obj;

	mammal->hairColor.h = AG_ReadFloat(ds);
	mammal->hairColor.s = AG_ReadFloat(ds);
	mammal->hairColor.v = AG_ReadFloat(ds);
	return (0);
}
Exemple #2
0
/*
 * Load routine. This operation restores the state of the object from
 * a data source.
 *
 * The object system will automatically invoke the load routines of
 * the parent beforehand.
 */
static int
Load(void *obj, AG_DataSource *ds, const AG_Version *ver)
{
	Animal *animal = obj;

	animal->age = AG_ReadFloat(ds);
	animal->cellCount = (int)AG_ReadUint32(ds);
	return (0);
}
Exemple #3
0
static int
Load(void *p, AG_DataSource *ds, const AG_Version *ver)
{
	VG_Circle *vc = p;

	if ((vc->p = VG_ReadRef(ds, vc, "Point")) == NULL) {
		return (-1);
	}
	vc->r = AG_ReadFloat(ds);
	return (0);
}