1 /* |
1 /* |
2 * LDForge: LDraw parts authoring CAD |
2 * LDForge: LDraw parts authoring CAD |
3 * Copyright (C) 2013 Santeri `arezey` Piippo |
3 * Copyright (C) 2013 Santeri Piippo |
4 * |
4 * |
5 * This program is free software: you can redistribute it and/or modify |
5 * This program is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation, either version 3 of the License, or |
7 * the Free Software Foundation, either version 3 of the License, or |
8 * (at your option) any later version. |
8 * (at your option) any later version. |
138 vector<LDObject*> objs = ref->inlineContents (bDeep, true); |
138 vector<LDObject*> objs = ref->inlineContents (bDeep, true); |
139 |
139 |
140 // Merge in the inlined objects |
140 // Merge in the inlined objects |
141 for (LDObject* inlineobj : objs) { |
141 for (LDObject* inlineobj : objs) { |
142 ulaBitIndices.push_back (idx); |
142 ulaBitIndices.push_back (idx); |
|
143 |
|
144 // This object is now inlined so it has no parent anymore. |
|
145 inlineobj->parent = null; |
|
146 |
143 g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + idx++, inlineobj); |
147 g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + idx++, inlineobj); |
144 } |
148 } |
145 |
149 |
146 // Delete the subfile now as it's been inlined. |
150 // Delete the subfile now as it's been inlined. |
147 g_CurrentFile->forgetObject (ref); |
151 g_CurrentFile->forgetObject (ref); |
322 { |
326 { |
323 vector<ulong> ulaIndices; |
327 vector<ulong> ulaIndices; |
324 vector<LDObject*> paObjs; |
328 vector<LDObject*> paObjs; |
325 |
329 |
326 for (LDObject* obj : g_ForgeWindow->getSelectedObjects ()) { |
330 for (LDObject* obj : g_ForgeWindow->getSelectedObjects ()) { |
327 vertex* vaCoords = nullptr; |
331 vertex* vaCoords = null; |
328 ushort uNumCoords = 0; |
332 ushort uNumCoords = 0; |
329 |
333 |
330 switch (obj->getType ()) { |
334 switch (obj->getType ()) { |
331 case OBJ_Quad: |
335 case OBJ_Quad: |
332 uNumCoords = 4; |
336 uNumCoords = 4; |