- Timestamp:
- Nov 14, 2004, 6:19:50 AM (20 years ago)
- Location:
- orxonox/trunk/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r2850 r2851 131 131 132 132 /** 133 \brief Draws the Object 134 It does this by just calling the List that must have been created earlier.133 \brief Draws the Objects of all Groups. 134 It does this by just calling the Lists that must have been created earlier. 135 135 */ 136 136 void Object::draw (void) 137 137 { 138 if (verbose >= 3)139 printf("drawing the 3D-Object \n");138 if (verbose >=2) 139 printf("drawing the 3D-Objects\n"); 140 140 Group* walker = firstGroup; 141 141 while (walker != NULL) 142 142 { 143 if (verbose >= 3) 144 printf ("Drawing object %s\n", walker->name); 143 145 glCallList (walker->listNumber); 144 146 walker = walker->nextGroup; 145 147 } 146 148 } 149 150 /** 151 \brief Draws the Object number groupNumber 152 It does this by just calling the List that must have been created earlier. 153 \param groupNumber The number of the Group that will be displayed. 154 */ 155 void Object::draw (int groupNumber) 156 { 157 if (verbose >=2) 158 printf("drawing the requested 3D-Objects if found.\n"); 159 Group* walker = firstGroup; 160 int counter = 0; 161 while (walker != NULL) 162 { 163 if (counter == groupNumber) 164 { 165 if (verbose >= 2) 166 printf ("Drawing object number %s named %s\n", counter, walker->name); 167 glCallList (walker->listNumber); 168 return; 169 } 170 ++counter; 171 walker = walker->nextGroup; 172 } 173 if (verbose >= 2) 174 printf("Object number %i in %s not Found.\n", groupNumber, objFileName); 175 return; 176 177 } 178 void Object::draw (char* groupName) 179 { 180 if (verbose >=2) 181 printf("drawing the requested 3D-Objects if found.\n"); 182 Group* walker = firstGroup; 183 while (walker != NULL) 184 { 185 if (!strcmp(walker->name, groupName)) 186 { 187 if (verbose >= 2) 188 printf ("Drawing object %s\n", walker->name); 189 glCallList (walker->listNumber); 190 return; 191 } 192 walker = walker->nextGroup; 193 } 194 if (verbose >= 2) 195 printf("Object Named %s in %s not Found.\n", groupName, objFileName); 196 return; 197 } 198 147 199 148 200 /** … … 154 206 printf("Adding new Group\n"); 155 207 group->faceMode = -1; 208 group->name = ""; 156 209 if ((group->listNumber = glGenLists(1)) == 0 ) 157 210 { … … 159 212 return false; 160 213 } 161 214 162 215 if (groupCount == 0) 163 216 { … … 429 482 else 430 483 { 431 currentGroup->name = groupString; 484 485 currentGroup->name = new char [strlen(groupString)]; 486 strcpy(currentGroup->name, groupString); 432 487 } 433 488 } -
orxonox/trunk/importer/object.h
r2850 r2851 32 32 bool finalize(void); 33 33 void draw (void); 34 35 34 void draw (int groupNumber); 35 void draw (char* groupName); 36 36 37 37 private:
Note: See TracChangeset
for help on using the changeset viewer.