<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
  <compounddef id="ObjSerialize_8h" kind="file" language="C++">
    <compoundname>ObjSerialize.h</compoundname>
    <includes refid="tools_8h" local="no">../tools.h</includes>
    <includedby refid="serialize_8h" local="yes">/root/cis_interface/cis_interface/cis_interface/serialize/serialize.h</includedby>
    <incdepgraph>
      <node id="2806">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="2807" relation="include">
        </childnode>
        <childnode refid="2808" relation="include">
        </childnode>
      </node>
      <node id="2801">
        <label>stdarg.h</label>
      </node>
      <node id="2800">
        <label>stdlib.h</label>
      </node>
      <node id="2802">
        <label>errno.h</label>
      </node>
      <node id="2796">
        <label>/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h</label>
        <link refid="ObjSerialize_8h"/>
        <childnode refid="2797" relation="include">
        </childnode>
      </node>
      <node id="2808">
        <label>stddef.h</label>
      </node>
      <node id="2797">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="2798" relation="include">
        </childnode>
        <childnode refid="2799" relation="include">
        </childnode>
        <childnode refid="2800" relation="include">
        </childnode>
        <childnode refid="2801" relation="include">
        </childnode>
        <childnode refid="2802" relation="include">
        </childnode>
        <childnode refid="2803" relation="include">
        </childnode>
        <childnode refid="2804" relation="include">
        </childnode>
        <childnode refid="2806" relation="include">
        </childnode>
        <childnode refid="2809" relation="include">
        </childnode>
      </node>
      <node id="2807">
        <label>wchar.h</label>
      </node>
      <node id="2798">
        <label>string.h</label>
      </node>
      <node id="2809">
        <label>unistd.h</label>
      </node>
      <node id="2804">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="2805" relation="include">
        </childnode>
        <childnode refid="2806" relation="include">
        </childnode>
      </node>
      <node id="2803">
        <label>time.h</label>
      </node>
      <node id="2805">
        <label>regex.h</label>
      </node>
      <node id="2799">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="2810">
        <label>/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h</label>
        <link refid="ObjSerialize_8h"/>
        <childnode refid="2811" relation="include">
        </childnode>
      </node>
      <node id="2815">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.hpp</label>
        <link refid="PsiInterface_8hpp_source"/>
      </node>
      <node id="2813">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="2814" relation="include">
        </childnode>
        <childnode refid="2816" relation="include">
        </childnode>
      </node>
      <node id="2811">
        <label>/root/cis_interface/cis_interface/cis_interface/serialize/serialize.h</label>
        <link refid="serialize_8h_source"/>
        <childnode refid="2812" relation="include">
        </childnode>
      </node>
      <node id="2816">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.h</label>
        <link refid="PsiInterface_8h_source"/>
      </node>
      <node id="2814">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.hpp</label>
        <link refid="CisInterface_8hpp_source"/>
        <childnode refid="2815" relation="include">
        </childnode>
      </node>
      <node id="2812">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="2813" relation="include">
        </childnode>
        <childnode refid="2816" relation="include">
        </childnode>
      </node>
    </invincdepgraph>
    <innerclass refid="structobj__t" prot="public">obj_t</innerclass>
      <sectiondef kind="typedef">
      <memberdef kind="typedef" id="ObjSerialize_8h_1a34fb51868ef0f17dfaa104fbac6c2d9f" prot="public" static="no">
        <type>struct <ref refid="structobj__t" kindref="compound">obj_t</ref></type>
        <definition>typedef struct obj_t  obj_t</definition>
        <argsstring></argsstring>
        <name>obj_t</name>
        <briefdescription>
<para>Obj structure. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" line="24" column="1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="ObjSerialize_8h_1aab97abc7b3e7725b67713220a5524b0a" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structobj__t" kindref="compound">obj_t</ref></type>
        <definition>static obj_t init_obj</definition>
        <argsstring>()</argsstring>
        <name>init_obj</name>
        <briefdescription>
<para>Initialize empty obj structure. </para>        </briefdescription>
        <detaileddescription>
<para><simplesect kind="return"><para><ref refid="structobj__t" kindref="compound">obj_t</ref> Obj structure. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" line="31" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" bodystart="31" bodyend="46"/>
      </memberdef>
      <memberdef kind="function" id="ObjSerialize_8h_1a818320c015a0febb2c0d03a9d97312ed" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void free_obj</definition>
        <argsstring>(obj_t *p)</argsstring>
        <name>free_obj</name>
        <param>
          <type><ref refid="structobj__t" kindref="compound">obj_t</ref> *</type>
          <declname>p</declname>
        </param>
        <briefdescription>
<para>Free obj structure. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">p</parametername>
</parameternamelist>
<parameterdescription>
<para>*obj_t Pointer to obj structure. </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" line="53" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" bodystart="53" bodyend="130"/>
      </memberdef>
      <memberdef kind="function" id="ObjSerialize_8h_1a1529d01629408a21556240780e7b531f" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int alloc_obj</definition>
        <argsstring>(obj_t *p, int nvert, int nface, int ntexc, int nnorm, int do_color)</argsstring>
        <name>alloc_obj</name>
        <param>
          <type><ref refid="structobj__t" kindref="compound">obj_t</ref> *</type>
          <declname>p</declname>
        </param>
        <param>
          <type>int</type>
          <declname>nvert</declname>
        </param>
        <param>
          <type>int</type>
          <declname>nface</declname>
        </param>
        <param>
          <type>int</type>
          <declname>ntexc</declname>
        </param>
        <param>
          <type>int</type>
          <declname>nnorm</declname>
        </param>
        <param>
          <type>int</type>
          <declname>do_color</declname>
        </param>
        <briefdescription>
<para>Allocate obj structure. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="inout">p</parametername>
</parameternamelist>
<parameterdescription>
<para>*obj_t Pointer to obj structure that should be allocated. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">nvert</parametername>
</parameternamelist>
<parameterdescription>
<para>int Number of vertices that should be allocated for. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">nface</parametername>
</parameternamelist>
<parameterdescription>
<para>int Number of faces that should be allocated for. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">ntexc</parametername>
</parameternamelist>
<parameterdescription>
<para>int Number of texcoords that should be allocated for. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">nnorm</parametername>
</parameternamelist>
<parameterdescription>
<para>int Number of normals that should be allocated for. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">do_color</parametername>
</parameternamelist>
<parameterdescription>
<para>int 1 if vertex colors should be allocated, 0 if not. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int 0 if successful, -1 otherwise. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" line="143" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" bodystart="143" bodyend="283"/>
      </memberdef>
      <memberdef kind="function" id="ObjSerialize_8h_1a5dec3b46eb147e3267ac247111b5f507" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int serialize_obj</definition>
        <argsstring>(const seri_t s, char *buf, const size_t buf_size, int *args_used, va_list ap)</argsstring>
        <name>serialize_obj</name>
        <param>
          <type>const <ref refid="structseri__t" kindref="compound">seri_t</ref></type>
          <declname>s</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>buf_size</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>args_used</declname>
        </param>
        <param>
          <type>va_list</type>
          <declname>ap</declname>
        </param>
        <briefdescription>
<para>Serialize obj information to create a message. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">s</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structseri__t" kindref="compound">seri_t</ref> Structure sepcifying how to serialize arguments. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">buf</parametername>
</parameternamelist>
<parameterdescription>
<para>character pointer to memory where serialized message should be stored. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">buf_siz</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of memory allocated to buf. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="out">args_used</parametername>
</parameternamelist>
<parameterdescription>
<para>int Number of arguments formatted. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">ap</parametername>
</parameternamelist>
<parameterdescription>
<para>va_list Arguments to be formatted. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>: int The length of the serialized message or -1 if there is an error. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" line="296" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" bodystart="296" bodyend="403"/>
      </memberdef>
      <memberdef kind="function" id="ObjSerialize_8h_1a498c8679a9be80cc700d4c28e13ddd2e" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int deserialize_obj</definition>
        <argsstring>(const seri_t s, const char *buf, const size_t buf_siz, va_list ap)</argsstring>
        <name>deserialize_obj</name>
        <param>
          <type>const <ref refid="structseri__t" kindref="compound">seri_t</ref></type>
          <declname>s</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>buf_siz</declname>
        </param>
        <param>
          <type>va_list</type>
          <declname>ap</declname>
        </param>
        <briefdescription>
<para>Deserialize message to populate obj structure. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">s</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structseri__t" kindref="compound">seri_t</ref> Structure sepcifying how to deserialize message. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">buf</parametername>
</parameternamelist>
<parameterdescription>
<para>character pointer to serialized message. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">buf_siz</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of buf. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="out">ap</parametername>
</parameternamelist>
<parameterdescription>
<para>va_list Arguments to be parsed from message. returns: int The number of populated arguments. -1 indicates an error. </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" line="415" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h" bodystart="415" bodyend="580"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#ifndef<sp/>CISOBJSERIALIZE_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>CISOBJSERIALIZE_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;../tools.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__cplusplus<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>this<sp/>is<sp/>a<sp/>C++<sp/>compiler,<sp/>use<sp/>C<sp/>linkage<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="keyword">extern</highlight><highlight class="normal"><sp/></highlight><highlight class="stringliteral">&quot;C&quot;</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight></codeline>
<codeline lineno="11" refid="structobj__t" refkind="compound"><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>{</highlight></codeline>
<codeline lineno="12" refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>;<sp/></highlight></codeline>
<codeline lineno="13" refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/></highlight></codeline>
<codeline lineno="14" refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>;<sp/></highlight></codeline>
<codeline lineno="15" refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>;<sp/></highlight></codeline>
<codeline lineno="16" refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>;<sp/></highlight></codeline>
<codeline lineno="17" refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>[100];<sp/></highlight></codeline>
<codeline lineno="18" refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref>;<sp/></highlight></codeline>
<codeline lineno="19" refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref>;<sp/></highlight></codeline>
<codeline lineno="20" refid="structobj__t_1a9477aca6c3d6977280f1082410576438" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>;<sp/></highlight></codeline>
<codeline lineno="21" refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>;<sp/></highlight></codeline>
<codeline lineno="22" refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>;<sp/></highlight></codeline>
<codeline lineno="23" refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>;<sp/></highlight></codeline>
<codeline lineno="24"><highlight class="normal">}<sp/><ref refid="structobj__t" kindref="compound">obj_t</ref>;</highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"><ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>init_obj()<sp/>{</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>x;</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/>x.<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>x;</highlight></codeline>
<codeline lineno="46"><highlight class="normal">};</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>free_obj(<ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>*p)<sp/>{</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i]);</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i]);</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>);</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>[i]);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[i]);</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i]);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>);</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[i]);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>);</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[i]);</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[i]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/>free(p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>);</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="130"><highlight class="normal">};</highlight></codeline>
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="143"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>alloc_obj(<ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>*p,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nvert,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nface,</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ntexc,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nnorm,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>do_color)<sp/>{</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/>free_obj(p);<sp/></highlight><highlight class="comment">//<sp/>Ensure<sp/>that<sp/>existing<sp/>data<sp/>is<sp/>freed</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref><sp/>=<sp/>nvert;</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref><sp/>=<sp/>nface;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref><sp/>=<sp/>ntexc;</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref><sp/>=<sp/>nnorm;</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>vertices</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>**new_vert<sp/>=<sp/>(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_vert<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>vertices.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref><sp/>=<sp/>new_vert;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>*ivert<sp/>=<sp/>(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">*)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ivert<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>vertex<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i]<sp/>=<sp/>ivert;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>vertices.&quot;</highlight><highlight class="normal">,<sp/>nvert);</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>vertex<sp/>colors</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(do_color)<sp/>{</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**new_vert<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_vert<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>vertex_colors.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref><sp/>=<sp/>new_vert;</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*ivert<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ivert<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>vertex<sp/>color<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i]<sp/>=<sp/>ivert;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>vertex<sp/>colors.&quot;</highlight><highlight class="normal">,<sp/>nvert);</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>texcoords</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>**new_texc<sp/>=<sp/>(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_texc<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>texcoords.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref><sp/>=<sp/>new_texc;</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>*itexc<sp/>=<sp/>(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">*)malloc(2*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(itexc<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>texcoord<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[i]<sp/>=<sp/>itexc;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>texcoords.&quot;</highlight><highlight class="normal">,<sp/>ntexc);</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>normals</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>**new_norm<sp/>=<sp/>(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_norm<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>normals.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref><sp/>=<sp/>new_norm;</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>*inorm<sp/>=<sp/>(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">*)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(inorm<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>normal<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i]<sp/>=<sp/>inorm;</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>normals.&quot;</highlight><highlight class="normal">,<sp/>nnorm);</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>faces</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**new_face<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_face<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>faces.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref><sp/>=<sp/>new_face;</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*iface<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(iface<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>face<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>[i]<sp/>=<sp/>iface;</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>faces.&quot;</highlight><highlight class="normal">,<sp/>nface);</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>face<sp/>texcoords</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**new_ftexc<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_ftexc<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>face<sp/>texcoords.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref><sp/>=<sp/>new_ftexc;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*iftexc<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(iftexc<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>texcoords<sp/>for<sp/>face<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[i]<sp/>=<sp/>iftexc;</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>face<sp/>texcoords.&quot;</highlight><highlight class="normal">,<sp/>nface);</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate<sp/>face<sp/>normals</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>**new_fnorm<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">**)malloc(p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*));</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(new_fnorm<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>face<sp/>normals.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/>p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref><sp/>=<sp/>new_fnorm;</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*ifnorm<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)malloc(3*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ifnorm<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Failed<sp/>to<sp/>allocate<sp/>normals<sp/>for<sp/>face<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[i]<sp/>=<sp/>ifnorm;</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>%d<sp/>face<sp/>normals.&quot;</highlight><highlight class="normal">,<sp/>nface);</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Return</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;alloc_obj:<sp/>Allocated<sp/>for<sp/>%d<sp/>vertices<sp/>and<sp/>%d<sp/>faces.&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>,<sp/>p-&gt;<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>);</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="283"><highlight class="normal">};</highlight></codeline>
<codeline lineno="284"><highlight class="normal"></highlight></codeline>
<codeline lineno="295"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="296"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>serialize_obj(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structseri__t" kindref="compound">seri_t</ref><sp/>s,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*buf,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>buf_size,</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*args_used,<sp/>va_list<sp/>ap)<sp/>{</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/>args_used[0]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>msg_len<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ilen;</highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>iline[500];</highlight></codeline>
<codeline lineno="302"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>argument</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/><ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>p<sp/>=<sp/>va_arg(ap,<sp/><ref refid="structobj__t" kindref="compound">obj_t</ref>);</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/>args_used[0]<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/>buf[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Format<sp/>header</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>header_format[500]<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;#<sp/>Author<sp/>cis_auto\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;#<sp/>Generated<sp/>by<sp/>cis_interface\n&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(p.<ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>)<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(header_format<sp/>+<sp/>strlen(header_format),<sp/></highlight><highlight class="stringliteral">&quot;usemtl<sp/>%s\n&quot;</highlight><highlight class="normal">,<sp/>p.<ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>);</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/>ilen<sp/>=<sp/>strlen(header_format);</highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&gt;=<sp/>(buf_size<sp/>-<sp/>msg_len))<sp/>{</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Buffer<sp/>(size<sp/>=<sp/>%d)<sp/>is<sp/>not<sp/>large<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;enough<sp/>to<sp/>contain<sp/>the<sp/>header<sp/>(size<sp/>=<sp/>%d).&quot;</highlight><highlight class="normal">,<sp/>buf_size,<sp/>ilen);</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/>strcat(buf,<sp/>header_format);</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/>msg_len<sp/>=<sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>vertex<sp/>information</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j;</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p.<ref refid="structobj__t_1aa08e8272f5b5f143afac1cab58d30518" kindref="member">nvert</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p.<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ilen<sp/>=<sp/>snprintf(buf<sp/>+<sp/>msg_len,<sp/>buf_size<sp/>-<sp/>msg_len,<sp/></highlight><highlight class="stringliteral">&quot;v<sp/>%f<sp/>%f<sp/>%f<sp/>%d<sp/>%d<sp/>%d\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i][0],<sp/>p.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i][1],<sp/>p.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i][2],</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p.<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i][0],<sp/>p.<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i][1],<sp/>p.<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[i][2]);</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ilen<sp/>=<sp/>snprintf(buf<sp/>+<sp/>msg_len,<sp/>buf_size<sp/>-<sp/>msg_len,<sp/></highlight><highlight class="stringliteral">&quot;v<sp/>%f<sp/>%f<sp/>%f\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i][0],<sp/>p.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i][1],<sp/>p.<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[i][2]);</highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Error<sp/>formatting<sp/>vertex<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&gt;=<sp/>(buf_size<sp/>-<sp/>msg_len))<sp/>{</highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Buffer<sp/>(size<sp/>=<sp/>%d)<sp/>is<sp/>not<sp/>large<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;enough<sp/>to<sp/>contain<sp/>vertex<sp/>%d<sp/>(size<sp/>=<sp/>%d).&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buf_size,<sp/>i,<sp/>ilen<sp/>+<sp/>msg_len);</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/>msg_len<sp/>=<sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="341"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>texcoord<sp/>information</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="343"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p.<ref refid="structobj__t_1aaa36aa6eda039139d79a807b591d1a1a" kindref="member">ntexc</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/>ilen<sp/>=<sp/>snprintf(buf<sp/>+<sp/>msg_len,<sp/>buf_size<sp/>-<sp/>msg_len,<sp/></highlight><highlight class="stringliteral">&quot;vt<sp/>%f<sp/>%f\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="345"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p.<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[i][0],<sp/>p.<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[i][1]);</highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Error<sp/>formatting<sp/>texcoord<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&gt;=<sp/>(buf_size<sp/>-<sp/>msg_len))<sp/>{</highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Buffer<sp/>(size<sp/>=<sp/>%d)<sp/>is<sp/>not<sp/>large<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;enough<sp/>to<sp/>contain<sp/>texcoord<sp/>%d<sp/>(size<sp/>=<sp/>%d).&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buf_size,<sp/>i,<sp/>ilen<sp/>+<sp/>msg_len);</highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/>msg_len<sp/>=<sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>normal<sp/>information</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p.<ref refid="structobj__t_1aeaae61787b92ea57ef185bdd9e996b02" kindref="member">nnorm</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/>ilen<sp/>=<sp/>snprintf(buf<sp/>+<sp/>msg_len,<sp/>buf_size<sp/>-<sp/>msg_len,<sp/></highlight><highlight class="stringliteral">&quot;vn<sp/>%f<sp/>%f<sp/>%f\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p.<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i][0],<sp/>p.<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i][1],<sp/>p.<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[i][2]);</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Error<sp/>formatting<sp/>normal<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&gt;=<sp/>(buf_size<sp/>-<sp/>msg_len))<sp/>{</highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Buffer<sp/>(size<sp/>=<sp/>%d)<sp/>is<sp/>not<sp/>large<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;enough<sp/>to<sp/>contain<sp/>normal<sp/>%d<sp/>(size<sp/>=<sp/>%d).&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buf_size,<sp/>i,<sp/>ilen<sp/>+<sp/>msg_len);</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/>msg_len<sp/>=<sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>face<sp/>information</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>p.<ref refid="structobj__t_1a28c4194c71f1cd6c719f43c70ee14df6" kindref="member">nface</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>ival[10];</highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(iline,<sp/></highlight><highlight class="stringliteral">&quot;f&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>3;<sp/>j++)<sp/>{</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>sprintf(ival,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>%d&quot;</highlight><highlight class="normal">,<sp/>p.<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>[i][j]<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>strcat(iline,<sp/>ival);</highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>strcat(iline,<sp/></highlight><highlight class="stringliteral">&quot;/&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p.<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[i][j]<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(ival,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>p.<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[i][j]<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/>strcat(iline,<sp/>ival);</highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>strcat(iline,<sp/></highlight><highlight class="stringliteral">&quot;/&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p.<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[i][j]<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(ival,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>p.<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[i][j]<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/>strcat(iline,<sp/>ival);</highlight></codeline>
<codeline lineno="388"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="389"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="390"><highlight class="normal"><sp/><sp/><sp/><sp/>ilen<sp/>=<sp/>snprintf(buf<sp/>+<sp/>msg_len,<sp/>buf_size<sp/>-<sp/>msg_len,<sp/></highlight><highlight class="stringliteral">&quot;%s\n&quot;</highlight><highlight class="normal">,<sp/>iline);</highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="392"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Error<sp/>formatting<sp/>line<sp/>face<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>i);</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ilen<sp/>&gt;<sp/>(buf_size<sp/>-<sp/>msg_len))<sp/>{</highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;serialize_obj:<sp/>Buffer<sp/>(size<sp/>=<sp/>%d)<sp/>is<sp/>not<sp/>large<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="396"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;enough<sp/>to<sp/>contain<sp/>line<sp/>for<sp/>face<sp/>%d<sp/>(size<sp/>=<sp/>%d).&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buf_size,<sp/>i,<sp/>ilen<sp/>+<sp/>msg_len);</highlight></codeline>
<codeline lineno="398"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="399"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/><sp/><sp/>msg_len<sp/>=<sp/>msg_len<sp/>+<sp/>ilen;</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="402"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg_len;</highlight></codeline>
<codeline lineno="403"><highlight class="normal">};</highlight></codeline>
<codeline lineno="404"><highlight class="normal"></highlight></codeline>
<codeline lineno="405"><highlight class="normal"></highlight></codeline>
<codeline lineno="414"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="415"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>deserialize_obj(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structseri__t" kindref="compound">seri_t</ref><sp/>s,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*buf,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>buf_siz,</highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_list<sp/>ap)<sp/>{</highlight></codeline>
<codeline lineno="417"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>out<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>do_colors<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="419"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*sind<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*eind<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="421"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nlines<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="422"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j;</highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nvert<sp/>=<sp/>0,<sp/>nface<sp/>=<sp/>0,<sp/>ntexc<sp/>=<sp/>0,<sp/>nnorm<sp/>=<sp/>0,<sp/>nmatl<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>argument</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><ref refid="structobj__t" kindref="compound">obj_t</ref><sp/>*p<sp/>=<sp/>va_arg(ap,<sp/><ref refid="structobj__t" kindref="compound">obj_t</ref>*);</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Counts</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_re_vert<sp/>=<sp/>7;</highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_re_face<sp/>=<sp/>3*3<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="429"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_re_texc<sp/>=<sp/>3;</highlight></codeline>
<codeline lineno="430"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_re_norm<sp/>=<sp/>4;</highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_re_matl<sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_vert[100]<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;v<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_face[100]<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;f<sp/>([^<sp/>\n/]*)/([^<sp/>\n/]*)/([^<sp/>\n/]*)<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;([^<sp/>\n/]*)/([^<sp/>\n/]*)/([^<sp/>\n/]*)<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;([^<sp/>\n/]*)/([^<sp/>\n/]*)/([^<sp/>\n/]*)&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="436"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_texc[100]<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;vt<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="437"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_norm[100]<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;vn<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_matl[100]<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;usemtl<sp/>([^\n]+)&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="439"><highlight class="normal"><sp/><sp/>nvert<sp/>=<sp/>count_matches(re_vert,<sp/>buf);</highlight></codeline>
<codeline lineno="440"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(nvert<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="441"><highlight class="normal"><sp/><sp/><sp/><sp/>do_colors<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="442"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(re_vert,<sp/></highlight><highlight class="stringliteral">&quot;v<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)<sp/>([^<sp/>\n]+)&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="444"><highlight class="normal"><sp/><sp/><sp/><sp/>n_re_vert<sp/>=<sp/>4;</highlight></codeline>
<codeline lineno="445"><highlight class="normal"><sp/><sp/><sp/><sp/>nvert<sp/>=<sp/>count_matches(re_vert,<sp/>buf);</highlight></codeline>
<codeline lineno="446"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="447"><highlight class="normal"><sp/><sp/>nface<sp/>=<sp/>count_matches(re_face,<sp/>buf);</highlight></codeline>
<codeline lineno="448"><highlight class="normal"><sp/><sp/>ntexc<sp/>=<sp/>count_matches(re_texc,<sp/>buf);</highlight></codeline>
<codeline lineno="449"><highlight class="normal"><sp/><sp/>nnorm<sp/>=<sp/>count_matches(re_norm,<sp/>buf);</highlight></codeline>
<codeline lineno="450"><highlight class="normal"><sp/><sp/>nmatl<sp/>=<sp/>count_matches(re_matl,<sp/>buf);</highlight></codeline>
<codeline lineno="451"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>expecting<sp/>%d<sp/>verts,<sp/>%d<sp/>faces,<sp/>%d<sp/>texcoords,<sp/>%d<sp/>normals&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="452"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>nvert,<sp/>nface,<sp/>ntexc,<sp/>nnorm);</highlight></codeline>
<codeline lineno="453"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Allocate</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="454"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(out<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="455"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>alloc_obj(p,<sp/>nvert,<sp/>nface,<sp/>ntexc,<sp/>nnorm,<sp/>do_colors);</highlight></codeline>
<codeline lineno="456"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="457"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Error<sp/>allocating<sp/>obj<sp/>structure.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="458"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="459"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="460"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="461"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Locate<sp/>lines</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>cvert<sp/>=<sp/>0,<sp/>cface<sp/>=<sp/>0,<sp/>ctexc<sp/>=<sp/>0,<sp/>cnorm<sp/>=<sp/>0,<sp/>cmatl<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>cur_pos<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>iline[500];</highlight></codeline>
<codeline lineno="465"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>iline_siz<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>sind_line,<sp/>eind_line;</highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(out<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="468"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>char<sp/>ival[10];<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="469"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>size_t<sp/>ival_siz<sp/>=<sp/>0;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="470"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(cur_pos<sp/>&lt;<sp/>buf_siz)<sp/>{</highlight></codeline>
<codeline lineno="471"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Starting<sp/>position<sp/>%d/%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="472"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cur_pos,<sp/>buf_siz);</highlight></codeline>
<codeline lineno="473"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_sub_matches<sp/>=<sp/>find_match(</highlight><highlight class="stringliteral">&quot;([^\n]*)\n&quot;</highlight><highlight class="normal">,<sp/>buf<sp/>+<sp/>cur_pos,</highlight></codeline>
<codeline lineno="474"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;sind_line,<sp/>&amp;eind_line);</highlight></codeline>
<codeline lineno="475"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n_sub_matches<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="476"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>End<sp/>of<sp/>file.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="477"><highlight class="normal"><sp/><sp/><sp/><sp/>sind_line<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="478"><highlight class="normal"><sp/><sp/><sp/><sp/>eind_line<sp/>=<sp/>buf_siz<sp/>-<sp/>cur_pos;</highlight></codeline>
<codeline lineno="479"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="480"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>iline_siz<sp/>=<sp/>eind_line<sp/>-<sp/>sind_line;</highlight></codeline>
<codeline lineno="481"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>memcpy(iline,<sp/>buf<sp/>+<sp/>cur_pos,<sp/>iline_siz);</highlight></codeline>
<codeline lineno="482"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>iline[iline_siz]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="483"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>iline<sp/>=<sp/>%s&quot;</highlight><highlight class="normal">,<sp/>iline);</highlight></codeline>
<codeline lineno="484"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Match<sp/>line</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(</highlight><highlight class="stringliteral">&quot;#[^\n]*&quot;</highlight><highlight class="normal">,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="486"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Comment</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Comment&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="488"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(re_matl,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>n_re_matl)<sp/>{</highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Material</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="490"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Material&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="491"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>matl_size<sp/>=<sp/>eind[1]<sp/>-<sp/>sind[1];</highlight></codeline>
<codeline lineno="492"><highlight class="normal"><sp/><sp/><sp/><sp/>memcpy(p-&gt;<ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>,<sp/>iline+sind[1],<sp/>matl_size);</highlight></codeline>
<codeline lineno="493"><highlight class="normal"><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac8ff1d64bfbec1df635bf72ba7fd5486" kindref="member">material</ref>[matl_size]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="494"><highlight class="normal"><sp/><sp/><sp/><sp/>cmatl++;</highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(re_vert,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>n_re_vert)<sp/>{</highlight></codeline>
<codeline lineno="496"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Vertex</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="497"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Vertex&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="498"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>3;<sp/>j++)<sp/>{</highlight></codeline>
<codeline lineno="499"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a57882cfdbfe09ad7b4a5fcede3681b6b" kindref="member">vertices</ref>[cvert][j]<sp/>=<sp/>atof(iline<sp/>+<sp/>sind[j+1]);</highlight></codeline>
<codeline lineno="500"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="501"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(do_colors)<sp/>{</highlight></codeline>
<codeline lineno="502"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>3;<sp/>j++)<sp/>{</highlight></codeline>
<codeline lineno="503"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a26c45b63e6ff01ff6f9f1d5f25bb7d0b" kindref="member">vertex_colors</ref>[cvert][j]<sp/>=<sp/>atoi(iline<sp/>+<sp/>sind[j+4]);</highlight></codeline>
<codeline lineno="504"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="505"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="506"><highlight class="normal"><sp/><sp/><sp/><sp/>cvert++;</highlight></codeline>
<codeline lineno="507"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(re_norm,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>n_re_norm)<sp/>{</highlight></codeline>
<codeline lineno="508"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Normals</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="509"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Normals&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="510"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>3;<sp/>j++)<sp/>{</highlight></codeline>
<codeline lineno="511"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ac61278759dc377f187ce6ae7c8b3c668" kindref="member">normals</ref>[cnorm][j]<sp/>=<sp/>atof(iline<sp/>+<sp/>sind[j+1]);</highlight></codeline>
<codeline lineno="512"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="513"><highlight class="normal"><sp/><sp/><sp/><sp/>cnorm++;</highlight></codeline>
<codeline lineno="514"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(re_texc,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>n_re_texc)<sp/>{</highlight></codeline>
<codeline lineno="515"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Texcoords</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="516"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Texcoords&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="517"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>2;<sp/>j++)<sp/>{</highlight></codeline>
<codeline lineno="518"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a9477aca6c3d6977280f1082410576438" kindref="member">texcoords</ref>[ctexc][j]<sp/>=<sp/>atof(iline<sp/>+<sp/>sind[j+1]);</highlight></codeline>
<codeline lineno="519"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="520"><highlight class="normal"><sp/><sp/><sp/><sp/>ctexc++;</highlight></codeline>
<codeline lineno="521"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(re_face,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>n_re_face)<sp/>{</highlight></codeline>
<codeline lineno="522"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Face</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="523"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_sub_matches<sp/>=<sp/>find_matches(re_face,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind);</highlight></codeline>
<codeline lineno="524"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Face&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="525"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>3;<sp/>j++)<sp/>{</highlight></codeline>
<codeline lineno="526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a450705239dad767420e27d4bb2b1a7cb" kindref="member">faces</ref>[cface][j]<sp/>=<sp/>atoi(iline<sp/>+<sp/>sind[3*j+1])<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="527"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((eind[3*j+2]<sp/>-<sp/>sind[3*j+2])<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="528"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[cface][j]<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="529"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="530"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1a06e3e2f89a4bd511413240569bd3f98e" kindref="member">face_texcoords</ref>[cface][j]<sp/>=<sp/>atoi(iline<sp/>+<sp/>sind[3*j+2])<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="531"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((eind[3*j+3]<sp/>-<sp/>sind[3*j+3])<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="532"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[cface][j]<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="533"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="534"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p-&gt;<ref refid="structobj__t_1ae48ff9d93e071669d7b6edccb7aaf642" kindref="member">face_normals</ref>[cface][j]<sp/>=<sp/>atoi(iline<sp/>+<sp/>sind[3*j+3])<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="535"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="536"><highlight class="normal"><sp/><sp/><sp/><sp/>cface++;</highlight></codeline>
<codeline lineno="537"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(find_matches(</highlight><highlight class="stringliteral">&quot;\n+&quot;</highlight><highlight class="normal">,<sp/>iline,<sp/>&amp;sind,<sp/>&amp;eind)<sp/>==<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="538"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Empty<sp/>line</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="539"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Empty<sp/>line&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="540"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="541"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Could<sp/>not<sp/>match<sp/>line:<sp/>%s&quot;</highlight><highlight class="normal">,<sp/>iline);</highlight></codeline>
<codeline lineno="542"><highlight class="normal"><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="543"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="544"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="545"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>nlines++;</highlight></codeline>
<codeline lineno="546"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cur_pos<sp/>=<sp/>cur_pos<sp/>+<sp/>eind_line;</highlight></codeline>
<codeline lineno="547"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Advancing<sp/>to<sp/>position<sp/>%d/%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="548"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cur_pos,<sp/>buf_siz);</highlight></codeline>
<codeline lineno="549"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="550"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="551"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(out<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="552"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cvert<sp/>!=<sp/>nvert)<sp/>{</highlight></codeline>
<codeline lineno="553"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Found<sp/>%d<sp/>verts,<sp/>expected<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>cvert,<sp/>nvert);</highlight></codeline>
<codeline lineno="554"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="555"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="556"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cface<sp/>!=<sp/>nface)<sp/>{</highlight></codeline>
<codeline lineno="557"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Found<sp/>%d<sp/>faces,<sp/>expected<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>cface,<sp/>nface);</highlight></codeline>
<codeline lineno="558"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="559"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="560"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ctexc<sp/>!=<sp/>ntexc)<sp/>{</highlight></codeline>
<codeline lineno="561"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Found<sp/>%d<sp/>texcs,<sp/>expected<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>ctexc,<sp/>ntexc);</highlight></codeline>
<codeline lineno="562"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="563"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="564"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cnorm<sp/>!=<sp/>nnorm)<sp/>{</highlight></codeline>
<codeline lineno="565"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Found<sp/>%d<sp/>norms,<sp/>expected<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>cnorm,<sp/>nnorm);</highlight></codeline>
<codeline lineno="566"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="567"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="568"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cmatl<sp/>!=<sp/>nmatl)<sp/>{</highlight></codeline>
<codeline lineno="569"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;deserialize_obj:<sp/>Found<sp/>%d<sp/>materials,<sp/>expected<sp/>%d.&quot;</highlight><highlight class="normal">,<sp/>cmatl,<sp/>nmatl);</highlight></codeline>
<codeline lineno="570"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="571"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="572"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="573"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Return</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="574"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sind<sp/>!=<sp/>NULL)<sp/>free(sind);<sp/></highlight></codeline>
<codeline lineno="575"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eind<sp/>!=<sp/>NULL)<sp/>free(eind);</highlight></codeline>
<codeline lineno="576"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(out<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="577"><highlight class="normal"><sp/><sp/><sp/><sp/>free_obj(p);</highlight></codeline>
<codeline lineno="578"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="579"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="580"><highlight class="normal">};</highlight></codeline>
<codeline lineno="581"><highlight class="normal"></highlight></codeline>
<codeline lineno="582"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__cplusplus<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>this<sp/>is<sp/>a<sp/>C++<sp/>compiler,<sp/>end<sp/>C<sp/>linkage<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="583"><highlight class="normal">}</highlight></codeline>
<codeline lineno="584"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="585"><highlight class="normal"></highlight></codeline>
<codeline lineno="586"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*CISOBJSERIALIZE_H_*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/serialize/ObjSerialize.h"/>
  </compounddef>
</doxygen>
