src/gldraw.cpp

changeset 216
c8882ff62d61
parent 212
79c5205b807c
child 219
70eb948a2b02
equal deleted inserted replaced
215:eab460199114 216:c8882ff62d61
1238 obj->glLists[listType] = list; 1238 obj->glLists[listType] = list;
1239 compileList (obj, listType); 1239 compileList (obj, listType);
1240 1240
1241 glEndList (); 1241 glEndList ();
1242 } 1242 }
1243
1244 obj->m_glinit = true;
1243 } 1245 }
1244 1246
1245 // ============================================================================= 1247 // =============================================================================
1246 uchar* GLRenderer::screencap (ushort& w, ushort& h) { 1248 uchar* GLRenderer::screencap (ushort& w, ushort& h) {
1247 w = m_width; 1249 w = m_width;
1276 } 1278 }
1277 } 1279 }
1278 1280
1279 // ============================================================================= 1281 // =============================================================================
1280 void GLRenderer::deleteLists (LDObject* obj) { 1282 void GLRenderer::deleteLists (LDObject* obj) {
1283 // Delete the lists but only if they have been initialized
1284 if (!obj->m_glinit)
1285 return;
1286
1281 for (const GL::ListType listType : g_glListTypes) 1287 for (const GL::ListType listType : g_glListTypes)
1282 glDeleteLists (obj->glLists[listType], 1); 1288 glDeleteLists (obj->glLists[listType], 1);
1289
1290 obj->m_glinit = false;
1283 } 1291 }
1284 1292
1285 // ============================================================================= 1293 // =============================================================================
1286 Axis GLRenderer::cameraAxis (bool y) { 1294 Axis GLRenderer::cameraAxis (bool y) {
1287 const staticCameraMeta* cam = &g_staticCameras[m_camera]; 1295 const staticCameraMeta* cam = &g_staticCameras[m_camera];

mercurial