void exportTo(fr::stream &f, const frGraphExporter &exp) { const sBool furtherParams=!aboutEqual(params[6].tfloatv.a, 0.0f) || !aboutEqual(params[6].tfloatv.b, 0.0) || !aboutEqual(params[7].tfloatv.a, 1.0f) || !aboutEqual(params[7].tfloatv.b, 1.0f) || params[8].selectv.sel != 3 || params[9].selectv.sel != 0 || params[12].floatv != 1.0f; f.putsU8((furtherParams ? 1 : 0) | (params[1].selectv.sel << 1) | (params[8].selectv.sel << 2) | (params[9].selectv.sel << 4)); putPackedVector(f, params[2].trfloatv, sFALSE); putPackedVector(f, params[3].trfloatv, sFALSE); f.putsU8(params[4].colorv.b); f.putsU8(params[4].colorv.g); f.putsU8(params[4].colorv.r); putPackedFloat(f, params[5].floatv); if (furtherParams) { putPackedFloat(f, params[6].tfloatv.a); putPackedFloat(f, params[6].tfloatv.b); putPackedFloat(f, params[7].tfloatv.a); putPackedFloat(f, params[7].tfloatv.b); if (params[9].selectv.sel) { putPackedFloat(f, params[10].floatv); putPackedFloat(f, params[11].floatv); } putPackedFloat(f, params[12].floatv); } }
void exportTo(fr::stream &f, const frGraphExporter &exp) { sU16 angtemp = fmod(params[0].floatv + 36000.0f, 360.0f) * 65536.0f / 360.0f; f.putsU16(angtemp); sF32 ang = angtemp * 3.1415926535f / 32768.0f; sF32 zoomtemp1 = params[1].tfloatv.a * 65536.0f, zoomtemp2 = params[1].tfloatv.b * 65536.0f; sF32 scrollx = (params[2].tfloatv.a + params[3].pointv.x) * data->w; sF32 scrolly = (params[2].tfloatv.b + params[3].pointv.y) * data->h; sF32 centerx = params[3].pointv.x * data->w * 65536.0f; sF32 centery = params[3].pointv.y * data->h * 65536.0f; sF32 xsx = zoomtemp1 * cos(ang), ysx = zoomtemp2 * sin(ang); sF32 xsy = -zoomtemp1 * sin(ang), ysy = zoomtemp2 * cos(ang); putPackedFloat(f, zoomtemp1); putPackedFloat(f, zoomtemp2); f.putsS32(centerx -scrollx * xsx - scrolly * xsy); f.putsS32(centery -scrollx * ysx - scrolly * ysy); // 13 bytes data+1 byte id+1 byte src+1 byte dst=16 bytes }
void exportTo(fr::stream &f, const frGraphExporter &exp) { f.putsU8(params[2].selectv.sel); f.putsU16(params[1].floatv*256); f.putsU8(params[3].selectv.sel); f.putsU16((params[0].tfloatv.a-1)*512); f.putsU16((params[0].tfloatv.b-1)*512); // 8 bytes data+1 byte id+1 byte src+1 byte dest=11 bytes }
void exportTo(fr::stream &f, const frGraphExporter &exp) { f.putsU16(params[0].floatv*1024); // 3 bytes data+1 byte id+1 byte src+1 byte dst=6 bytes }
void exportStage(sInt stage, fr::stream& f) { f.putsU8((mtrl->uAddressMode[stage] << 0) | (mtrl->vAddressMode[stage] << 2) | (mtrl->filterMode[stage] << 4) | (mtrl->coordMode[stage] << 6)); }