static void Save(void *p, AG_DataSource *ds) { VG_Text *vt = p; VG_WriteRef(ds, vt->p1); VG_WriteRef(ds, vt->p2); AG_WriteUint8(ds, (Uint8)vt->align); AG_WriteString(ds, vt->fontFace); AG_WriteUint8(ds, (Uint8)vt->fontSize); AG_WriteUint16(ds, (Uint16)vt->fontFlags); AG_WriteString(ds, vt->text); }
void M_PolyhedronWrite(AG_DataSource *ds, const M_Polyhedron *P) { Uint i, j; AG_WriteUint32(ds, (Uint32)P->nv); AG_WriteUint32(ds, (Uint32)P->ne); AG_WriteUint32(ds, (Uint32)P->nf); /* Write vertices */ for (i = 0; i < P->nv; i++) M_WriteVector3(ds, &P->v[i]); /* Write edges */ for (i = 0; i < P->ne; i+=2) { M_Halfedge *eHead = &P->e[i]; M_Halfedge *eTail = &P->e[i+1]; AG_WriteUint32(ds, (Uint32)eHead->v); AG_WriteUint32(ds, (Uint32)eTail->v); AG_WriteUint32(ds, (Uint32)eHead->f); AG_WriteUint32(ds, (Uint32)eTail->f); } /* Write facets */ for (i = 0; i < P->nf; i++) { M_Facet *f = &P->f[i]; AG_WriteUint8(ds, (Uint8)f->n); for (j = 0; j < f->n; j++) AG_WriteUint32(ds, (Uint32)f->e[j]); } }
void RG_FillSave(void *p, AG_DataSource *buf) { struct rg_fill_feature *f = p; AG_WriteVersion(buf, "RG_Feature:RG_Fill", &rgFillVer); AG_WriteUint8(buf, (Uint8)f->type); switch (f->type) { case FILL_SOLID: AG_WriteColor(buf, f->f_solid.c); break; case FILL_HGRADIENT: case FILL_VGRADIENT: case FILL_CGRADIENT: AG_WriteColor(buf, f->f_gradient.c1); AG_WriteColor(buf, f->f_gradient.c2); break; case FILL_PATTERN: AG_WriteUint32(buf, (Uint32)f->f_pattern.texid); AG_WriteUint32(buf, (Uint32)f->f_pattern.tex_xoffs); AG_WriteUint32(buf, (Uint32)f->f_pattern.tex_yoffs); break; } }
static int Save(void *obj, AG_DataSource *ds) { AG_Config *cfg = obj; char buf[30]; AG_SetInt(cfg, "initial-run", 0); #ifdef AG_DEBUG AG_WriteUint8(ds, (Uint8)agDebugLvl); #else AG_WriteUint8(ds, 0); #endif /* For backward compatibility with <9.5 (pre-1.4.2) saves. */ memset(buf, 0, sizeof(buf)); AG_Write(ds, buf, sizeof(buf)); AG_WriteString(ds, ""); /* agRcsHostname */ AG_WriteUint16(ds, 0); /* agRcsPort */ AG_WriteString(ds, ""); /* agRcsUsername */ AG_WriteString(ds, ""); /* agRcsPassword */ return (0); }