Sat, 16 Mar 2013 01:32:47 +0200
Added logf function to write to message log. Write warnings of unparsable files into the message log.
0 | 1 | #include "common.h" |
2 | #include "ldtypes.h" | |
13
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
3 | #include "io.h" |
0 | 4 | |
5 | const char* g_saObjTypeNames[] = { | |
6 | "unidentified", | |
7 | "unknown", | |
8 | "empty", | |
9 | "comment", | |
10 | "subfile", | |
11 | "line", | |
12 | "triangle", | |
13 | "quadrilateral", | |
14 | "condline", | |
15 | "vector", | |
16 | "vertex", | |
17 | }; | |
18 | ||
19 | // ============================================================================= | |
20 | // LDObject constructors | |
21 | LDObject::LDObject () { | |
22 | ||
23 | } | |
24 | ||
25 | LDGibberish::LDGibberish () { | |
26 | ||
27 | } | |
28 | ||
11
323390a03294
Color gibberish red. Check for line code length for gibberish (must be 1 to be valid)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
0
diff
changeset
|
29 | LDGibberish::LDGibberish (str _zContent, str _zReason) { |
323390a03294
Color gibberish red. Check for line code length for gibberish (must be 1 to be valid)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
0
diff
changeset
|
30 | zContent = _zContent; |
323390a03294
Color gibberish red. Check for line code length for gibberish (must be 1 to be valid)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
0
diff
changeset
|
31 | zReason = _zReason; |
323390a03294
Color gibberish red. Check for line code length for gibberish (must be 1 to be valid)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
0
diff
changeset
|
32 | } |
323390a03294
Color gibberish red. Check for line code length for gibberish (must be 1 to be valid)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
0
diff
changeset
|
33 | |
0 | 34 | LDEmpty::LDEmpty () { |
35 | ||
36 | } | |
37 | ||
38 | LDComment::LDComment () { | |
39 | ||
40 | } | |
41 | ||
42 | LDSubfile::LDSubfile () { | |
43 | ||
44 | } | |
45 | ||
46 | LDLine::LDLine () { | |
47 | ||
48 | } | |
49 | ||
50 | LDTriangle::LDTriangle () { | |
51 | ||
52 | } | |
53 | ||
54 | LDQuad::LDQuad () { | |
55 | ||
56 | } | |
57 | ||
58 | LDCondLine::LDCondLine () { | |
59 | ||
60 | } | |
61 | ||
62 | LDVector::LDVector () { | |
63 | ||
64 | } | |
65 | ||
66 | LDVertex::LDVertex () { | |
67 | ||
13
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
68 | } |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
69 | |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
70 | ulong LDObject::getIndex () { |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
71 | if (!g_CurrentFile) |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
72 | return -1u; |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
73 | |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
74 | // TODO: shouldn't rely on g_CurrentFile |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
75 | for (ulong i = 0; i < g_CurrentFile->objects.size(); ++i) { |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
76 | if (g_CurrentFile->objects[i] == this) |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
77 | return i; |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
78 | } |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
79 | |
3955ff2a7d72
Added logf function to write to message log. Write warnings of unparsable files into the message log.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
11
diff
changeset
|
80 | return -1u; |
0 | 81 | } |