mirror of
https://github.com/leozide/leocad
synced 2024-12-28 22:23:35 +01:00
Fixed Minifig Wizard crashes related to buffer operations without a context.
This commit is contained in:
parent
49a49125c2
commit
a31963f1bd
4 changed files with 8 additions and 4 deletions
|
@ -996,7 +996,6 @@ bool lcPiecesLibrary::LoadPiece(PieceInfo* Info)
|
||||||
|
|
||||||
Mesh->UpdateBuffers();
|
Mesh->UpdateBuffers();
|
||||||
Info->SetMesh(Mesh);
|
Info->SetMesh(Mesh);
|
||||||
Info->AddRef();
|
|
||||||
|
|
||||||
if (mZipFiles[LC_ZIPFILE_OFFICIAL])
|
if (mZipFiles[LC_ZIPFILE_OFFICIAL])
|
||||||
mSaveCache = true;
|
mSaveCache = true;
|
||||||
|
|
|
@ -3454,6 +3454,8 @@ void lcModel::ShowMinifigDialog()
|
||||||
if (!gMainWindow->DoDialog(LC_DIALOG_MINIFIG, &Minifig))
|
if (!gMainWindow->DoDialog(LC_DIALOG_MINIFIG, &Minifig))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
gMainWindow->mPreviewWidget->MakeCurrent();
|
||||||
|
|
||||||
lcGroup* Group = AddGroup("Minifig #", NULL);
|
lcGroup* Group = AddGroup("Minifig #", NULL);
|
||||||
lcArray<lcObject*> Pieces(LC_MFW_NUMITEMS);
|
lcArray<lcObject*> Pieces(LC_MFW_NUMITEMS);
|
||||||
|
|
||||||
|
|
|
@ -1055,6 +1055,8 @@ void MinifigWizard::ParseSettings(lcFile& Settings)
|
||||||
|
|
||||||
void MinifigWizard::OnDraw()
|
void MinifigWizard::OnDraw()
|
||||||
{
|
{
|
||||||
|
mContext->SetDefaultState();
|
||||||
|
|
||||||
float Aspect = (float)mWidth/(float)mHeight;
|
float Aspect = (float)mWidth/(float)mHeight;
|
||||||
mContext->SetViewport(0, 0, mWidth, mHeight);
|
mContext->SetViewport(0, 0, mWidth, mHeight);
|
||||||
|
|
||||||
|
@ -1404,6 +1406,8 @@ int MinifigWizard::GetSelectionIndex(int Type) const
|
||||||
|
|
||||||
void MinifigWizard::SetSelectionIndex(int Type, int Index)
|
void MinifigWizard::SetSelectionIndex(int Type, int Index)
|
||||||
{
|
{
|
||||||
|
MakeCurrent();
|
||||||
|
|
||||||
if (mMinifig->Parts[Type])
|
if (mMinifig->Parts[Type])
|
||||||
mMinifig->Parts[Type]->Release();
|
mMinifig->Parts[Type]->Release();
|
||||||
|
|
||||||
|
|
|
@ -140,9 +140,9 @@ bool GL_ExtensionSupported(const GLubyte* Extensions, const char* Name)
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
|
|
||||||
static void APIENTRY lcDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid *userParam)
|
static void APIENTRY lcDebugCallback(GLenum Source, GLenum Type, GLuint Id, GLenum Severity, GLsizei Length, const GLchar* Message, GLvoid* UserParam)
|
||||||
{
|
{
|
||||||
qDebug() << message;
|
qDebug() << Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -162,7 +162,6 @@ void GL_InitializeSharedExtensions(lcGLWidget* Window)
|
||||||
glEnable(GL_DEBUG_OUTPUT);
|
glEnable(GL_DEBUG_OUTPUT);
|
||||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
||||||
}
|
}
|
||||||
glBegin(-1);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue