]> Shamusworld >> Repos - architektonas/blobdiff - src/fileio.cpp
Added miscellaneous features.
[architektonas] / src / fileio.cpp
index 7f1a90a8d08b7e7c634545c0fb78b34dbc1b94c8..02ab2f577dc60af0a95f392a60e069b32b57b631 100644 (file)
@@ -245,6 +245,7 @@ enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFObject, OTFEndOfFile };
 /*static*/ Object * FileIO::GetObjectFromFile(FILE * file, bool extended/*= false*/)
 {
        char buffer[256];
+       char textBuffer[65536];
        int foundLayer = 0;
        /*int num =*/ fscanf(file, "%s", buffer);
        Object * obj = NULL;
@@ -299,6 +300,12 @@ if (errno)
                fscanf(file, "(%lf,%lf) %lf, %lf, %lf", &p.x, &p.y, &r, &a1, &a2);
                obj = (Object *)new Arc(p, r, a1, a2);
        }
+       else if (strcmp(buffer, "TEXT") == 0)
+       {
+               Point p;
+               fscanf(file, "(%lf,%lf) \"%[^\"]\"", &p.x, &p.y, textBuffer);
+               obj = (Object *)new Text(p, textBuffer);
+       }
        else if (strcmp(buffer, "DIMENSION") == 0)
        {
                Point p1, p2;
@@ -319,6 +326,8 @@ if (errno)
        {
                objectFileType = OTFEndOfFile;
        }
+       else
+               printf("Unknown object type '%s'...\n", buffer);
 
        if (obj != NULL)
        {