summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorleo2006-02-14 05:47:16 +0000
committerleo2006-02-14 05:47:16 +0000
commit517715abd19f057b9d4894bcc86de8a4edd52234 (patch)
treec00bfdc017c28f69b97eeb9969ce09a987e2c068 /win
parente7a01e3d8402bce14ba6433d41095c5362076ff3 (diff)
Added the lcApplication class.
git-svn-id: http://svn.leocad.org/trunk@473 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win')
-rw-r--r--win/Cadview.cpp46
-rw-r--r--win/EdGrpDlg.cpp3
-rw-r--r--win/Leocad.cpp54
-rw-r--r--win/Libdlg.cpp30
-rw-r--r--win/Mainfrm.cpp30
-rw-r--r--win/Moddlg.cpp23
-rw-r--r--win/Piecebar.cpp13
-rw-r--r--win/Piececmb.cpp9
-rw-r--r--win/Print.cpp10
-rw-r--r--win/Steppop.cpp5
-rw-r--r--win/System.cpp53
-rw-r--r--win/Tools.cpp3
-rw-r--r--win/texdlg.cpp13
13 files changed, 175 insertions, 117 deletions
diff --git a/win/Cadview.cpp b/win/Cadview.cpp
index 9e26db1..f38c80b 100644
--- a/win/Cadview.cpp
+++ b/win/Cadview.cpp
@@ -16,6 +16,7 @@
#include "view.h"
#include "MainFrm.h"
#include "PiecePrv.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -160,8 +161,8 @@ BOOL CCADView::OnPreparePrinting(CPrintInfo* pInfo)
int cols = theApp.GetProfileInt("Default", "Print Columns", 1);
int rows = theApp.GetProfileInt("Default", "Print Rows", 1);
- int Max = (project->GetLastStep()/(rows*cols));
- if (project->GetLastStep()%(rows*cols) != 0)
+ int Max = (lcGetActiveProject()->GetLastStep()/(rows*cols));
+ if (lcGetActiveProject()->GetLastStep()%(rows*cols) != 0)
Max++;
pInfo->SetMaxPage(Max);
@@ -190,8 +191,8 @@ void CCADView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* pInfo)
{
int cols = theApp.GetProfileInt("Default", "Print Columns", 1);
int rows = theApp.GetProfileInt("Default", "Print Rows", 1);
- int Max = (project->GetLastStep()/(rows*cols));
- if (project->GetLastStep()%(rows*cols) != 0)
+ int Max = (lcGetActiveProject()->GetLastStep()/(rows*cols));
+ if (lcGetActiveProject()->GetLastStep()%(rows*cols) != 0)
Max++;
pInfo->SetMaxPage(Max);
}
@@ -200,6 +201,8 @@ void CCADView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int cols = theApp.GetProfileInt("Default","Print Columns", 1);
int rows = theApp.GetProfileInt("Default","Print Rows", 1);
+ Project* project = lcGetActiveProject();
+
if (rows < 1) rows = 1;
if (cols < 1) cols = 1;
CRect rc(0, 0, pDC->GetDeviceCaps(HORZRES), pDC->GetDeviceCaps(VERTRES));
@@ -426,6 +429,7 @@ void CCADView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
void CCADView::PrintHeader(BOOL bFooter, HDC hDC, CRect rc, UINT nCurPage, UINT nMaxPage, BOOL bCatalog)
{
+ Project* project = lcGetActiveProject();
CString str,tmp;
UINT nFormat = DT_CENTER;
int r;
@@ -734,25 +738,25 @@ CCADDoc* CCADView::GetDocument() // non-debug version is inline
int CCADView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
- if (CView::OnCreate(lpCreateStruct) == -1)
+ if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
- m_pView = new View (project, NULL);
- m_pView->Create (m_hWnd);
- m_pView->OnInitialUpdate ();
+ m_pView = new View (lcGetActiveProject(), NULL);
+ m_pView->Create (m_hWnd);
+ m_pView->OnInitialUpdate ();
- SetTimer (IDT_LC_SAVETIMER, 5000, NULL);
+ SetTimer (IDT_LC_SAVETIMER, 5000, NULL);
- return 0;
+ return 0;
}
void CCADView::OnDestroy()
{
- delete m_pView;
- m_pView = NULL;
+ delete m_pView;
+ m_pView = NULL;
+
+ KillTimer (IDT_LC_SAVETIMER);
- KillTimer (IDT_LC_SAVETIMER);
-
CView::OnDestroy();
}
@@ -845,9 +849,9 @@ BOOL CCADView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
BOOL CCADView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
if (zDelta > 0)
- project->HandleCommand(LC_VIEW_ZOOMOUT, 0);
+ lcGetActiveProject()->HandleCommand(LC_VIEW_ZOOMOUT, 0);
else
- project->HandleCommand(LC_VIEW_ZOOMIN, 0);
+ lcGetActiveProject()->HandleCommand(LC_VIEW_ZOOMIN, 0);
return CView::OnMouseWheel(nFlags, zDelta, pt);
}
@@ -873,7 +877,7 @@ LONG CCADView::OnAutoPan(UINT lParam, LONG wParam)
pt2.y = -pt2.y;
unsigned long pt = ((short)pt2.x) | ((unsigned long)(((short)pt2.y) << 16));
- project->HandleCommand(LC_VIEW_AUTOPAN, pt);
+ lcGetActiveProject()->HandleCommand(LC_VIEW_AUTOPAN, pt);
return TRUE;
}
@@ -881,7 +885,7 @@ LONG CCADView::OnAutoPan(UINT lParam, LONG wParam)
void CCADView::OnTimer(UINT nIDEvent)
{
if (nIDEvent == IDT_LC_SAVETIMER)
- project->CheckAutoSave();
+ lcGetActiveProject()->CheckAutoSave();
CView::OnTimer(nIDEvent);
}
@@ -890,7 +894,7 @@ void CCADView::OnTimer(UINT nIDEvent)
LONG CCADView::OnSetStep(UINT lParam, LONG /*wParam*/)
{
if (lParam > 0)
- project->HandleCommand(LC_VIEW_STEP_SET, lParam);
+ lcGetActiveProject()->HandleCommand(LC_VIEW_STEP_SET, lParam);
return TRUE;
}
@@ -898,7 +902,7 @@ LONG CCADView::OnSetStep(UINT lParam, LONG /*wParam*/)
void CCADView::OnCaptureChanged(CWnd *pWnd)
{
if (pWnd != this)
- project->HandleNotify(LC_CAPTURE_LOST, 0);
+ lcGetActiveProject()->HandleNotify(LC_CAPTURE_LOST, 0);
CView::OnCaptureChanged(pWnd);
}
@@ -951,7 +955,7 @@ void CCADView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
} break;
}
- project->OnKeyDown(nKey, GetKeyState (VK_CONTROL) < 0, GetKeyState (VK_SHIFT) < 0);
+ lcGetActiveProject()->OnKeyDown(nKey, GetKeyState (VK_CONTROL) < 0, GetKeyState (VK_SHIFT) < 0);
/*
switch (nChar)
{
diff --git a/win/EdGrpDlg.cpp b/win/EdGrpDlg.cpp
index 48c894d..8ab3b8f 100644
--- a/win/EdGrpDlg.cpp
+++ b/win/EdGrpDlg.cpp
@@ -6,6 +6,7 @@
#include "EdGrpDlg.h"
#include "globals.h"
#include "project.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -90,7 +91,7 @@ void CEditGroupsDlg::OnEditgrpNewgroup()
pParent = m_Tree.opts->groups[item.lParam - 0xFFFF];
}
- pGroup = project->AddGroup (NULL, pParent, 0, 0, 0);
+ pGroup = lcGetActiveProject()->AddGroup (NULL, pParent, 0, 0, 0);
m_Tree.opts->groupcount++;
m_Tree.opts->groups = (Group**)realloc(m_Tree.opts->groups, m_Tree.opts->groupcount*sizeof(Group*));
diff --git a/win/Leocad.cpp b/win/Leocad.cpp
index fb409bd..9f921b5 100644
--- a/win/Leocad.cpp
+++ b/win/Leocad.cpp
@@ -17,6 +17,7 @@
#include "mainwnd.h"
#include "library.h"
#include "keyboard.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -88,7 +89,7 @@ static void CheckForUpdates(void* Data)
else
str = "You are using the latest version of LeoCAD.\n";
- if (lib > project->GetPiecesLibrary ()->GetPieceCount ())
+ if (lib > lcGetPiecesLibrary()->GetPieceCount ())
{
str += "There are new pieces available.\n\n";
Update = true;
@@ -175,8 +176,17 @@ BOOL CCADApp::InitInstance()
InitKeyboardShortcuts();
- if (!GL_Initialize (NULL))
- return FALSE;
+ char app[LC_MAXPATH], *ptr;
+ GetModuleFileName (NULL, app, LC_MAXPATH);
+ ptr = strrchr(app,'\\');
+ if (ptr)
+ *(++ptr) = 0;
+
+ g_App = new lcApplication();
+ main_window = new MainWnd();
+
+ if (!g_App->Initialize(__argc, __targv, app))
+ return false;
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
@@ -191,29 +201,18 @@ BOOL CCADApp::InitInstance()
EnableShellOpen();
RegisterShellFileTypes(TRUE);
- main_window = new MainWnd ();
- project = new Project;
-
UINT cmdshow = m_nCmdShow;
m_nCmdShow = SW_HIDE;
pDocTemplate->OpenDocumentFile(NULL);
- char app[LC_MAXPATH], *ptr;
- GetModuleFileName (NULL, app, LC_MAXPATH);
- ptr = strrchr(app,'\\');
- if (ptr)
- *(++ptr) = 0;
-
- if (!project->Initialize(__argc, __targv, app, NULL))
- return false;
-
// Show something in the piece preview window.
- PieceInfo* Info = project->GetPiecesLibrary()->FindPieceInfo("3005");
+ PieceInfo* Info = lcGetPiecesLibrary()->FindPieceInfo("3005");
if (!Info)
- Info = project->GetPiecesLibrary()->GetPieceInfo(0);
+ Info = lcGetPiecesLibrary()->GetPieceInfo(0);
+
if (Info)
{
- project->SetCurrentPiece(Info);
+ lcGetActiveProject()->SetCurrentPiece(Info);
((CMainFrame*)(AfxGetMainWnd()))->m_wndPiecesBar.m_wndPiecePreview.SetPieceInfo(Info);
((CMainFrame*)(AfxGetMainWnd()))->m_wndPiecesBar.m_wndPiecePreview.PostMessage(WM_PAINT);
}
@@ -260,14 +259,15 @@ BOOL CCADApp::InitInstance()
else
m_pMainWnd->ShowWindow(cmdshow);
m_pMainWnd->UpdateWindow();
- project->HandleNotify(LC_ACTIVATE, 1);
+ lcGetActiveProject()->HandleNotify(LC_ACTIVATE, 1);
+ lcGetActiveProject()->UpdateInterface();
main_window->UpdateMRU ();
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
- project->UpdateAllViews (NULL);
+ lcGetActiveProject()->UpdateAllViews (NULL);
if (AfxGetApp()->GetProfileInt("Settings", "CheckUpdates", 1))
_beginthread(CheckForUpdates, 0, NULL);
@@ -280,17 +280,13 @@ int CCADApp::ExitInstance()
if (m_hMutex != NULL)
ReleaseMutex(m_hMutex);
- if (project)
- {
- project->HandleNotify(LC_ACTIVATE, 0);
- delete project;
- project = NULL;
- }
+ delete main_window;
+ main_window = NULL;
- delete main_window;
- main_window = NULL;
+ g_App->Shutdown();
- GL_Shutdown ();
+ delete g_App;
+ g_App = NULL;
#ifdef _DEBUG
if (__hStdOut != NULL)
diff --git a/win/Libdlg.cpp b/win/Libdlg.cpp
index 8b59319..7fb05b3 100644
--- a/win/Libdlg.cpp
+++ b/win/Libdlg.cpp
@@ -14,6 +14,7 @@
#include "globals.h"
#include "system.h"
#include "library.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -142,20 +143,20 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
case ID_LIBDLG_FILE_OPEN:
{
- project->GetPiecesLibrary()->LoadCategories(NULL);
+ lcGetPiecesLibrary()->LoadCategories(NULL);
UpdateTree();
return TRUE;
}
case ID_LIBDLG_FILE_SAVE:
{
- project->GetPiecesLibrary()->DoSaveCategories(false);
+ lcGetPiecesLibrary()->DoSaveCategories(false);
return TRUE;
}
case ID_LIBDLG_FILE_SAVEAS:
{
- project->GetPiecesLibrary()->DoSaveCategories(true);
+ lcGetPiecesLibrary()->DoSaveCategories(true);
return TRUE;
}
@@ -178,7 +179,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (SystemDoDialog(LC_DLG_FILE_OPEN, &opts))
{
- project->GetPiecesLibrary()->LoadUpdate((char*)opts.filenames);
+ lcGetPiecesLibrary()->LoadUpdate((char*)opts.filenames);
free(opts.filenames);
@@ -199,7 +200,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
for (int i = 0; i < opts.numfiles; i++)
{
- project->GetPiecesLibrary ()->ImportLDrawPiece (opts.filenames[i]);
+ lcGetPiecesLibrary ()->ImportLDrawPiece (opts.filenames[i]);
free (opts.filenames[i]);
}
@@ -222,7 +223,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (SystemDoMessageBox("Are you sure you want to reset the categories?", LC_MB_YESNO | LC_MB_ICONQUESTION) == LC_YES)
{
- project->GetPiecesLibrary()->ResetCategories();
+ lcGetPiecesLibrary()->ResetCategories();
UpdateList();
UpdateTree();
@@ -239,8 +240,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (SystemDoDialog(LC_DLG_EDITCATEGORY, &Opts))
{
- PiecesLibrary* Lib = project->GetPiecesLibrary();
- Lib->AddCategory(Opts.Name, Opts.Keywords);
+ lcGetPiecesLibrary()->AddCategory(Opts.Name, Opts.Keywords);
}
UpdateTree();
@@ -255,7 +255,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (Item == NULL)
break;
- PiecesLibrary* Lib = project->GetPiecesLibrary();
+ PiecesLibrary* Lib = lcGetPiecesLibrary();
CString CategoryName = m_Tree.GetItemText(Item);
int Index = Lib->FindCategoryIndex((const char*)CategoryName);
@@ -283,7 +283,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (Item == NULL)
break;
- PiecesLibrary* Lib = project->GetPiecesLibrary();
+ PiecesLibrary* Lib = lcGetPiecesLibrary();
CString CategoryName = m_Tree.GetItemText(Item);
int Index = Lib->FindCategoryIndex((const char*)CategoryName);
@@ -331,7 +331,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (SystemDoMessageBox ("Are you sure you want to permanently delete the selected pieces?", LC_MB_YESNO|LC_MB_ICONQUESTION) != LC_YES)
return TRUE;
- project->GetPiecesLibrary()->DeletePieces(Pieces);
+ lcGetPiecesLibrary()->DeletePieces(Pieces);
UpdateList();
@@ -347,7 +347,7 @@ void CLibraryDlg::UpdateList()
m_List.DeleteAllItems();
m_List.SetRedraw(FALSE);
- PiecesLibrary *Lib = project->GetPiecesLibrary();
+ PiecesLibrary *Lib = lcGetPiecesLibrary();
HTREEITEM CategoryItem = m_Tree.GetSelectedItem();
CString CategoryName = m_Tree.GetItemText(CategoryItem);
@@ -433,7 +433,7 @@ void CLibraryDlg::UpdateTree()
HTREEITEM Root = m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT, "Pieces", 0, 1, 0, 0, 0, TVI_ROOT, TVI_SORT);
- PiecesLibrary *Lib = project->GetPiecesLibrary();
+ PiecesLibrary *Lib = lcGetPiecesLibrary();
for (int i = 0; i < Lib->GetNumCategories(); i++)
m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT, Lib->GetCategoryName(i), 0, 1, 0, 0, 0, Root, TVI_SORT);
@@ -454,7 +454,7 @@ void CLibraryDlg::OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult)
void CLibraryDlg::OnCancel()
{
// Check if it's ok to close the dialog
- if (!project->GetPiecesLibrary()->SaveCategories())
+ if (!lcGetPiecesLibrary()->SaveCategories())
return;
CDialog::OnCancel();
@@ -463,7 +463,7 @@ void CLibraryDlg::OnCancel()
void CLibraryDlg::OnOK()
{
// Check if it's ok to close the dialog
- if (!project->GetPiecesLibrary()->SaveCategories())
+ if (!lcGetPiecesLibrary()->SaveCategories())
return;
CDialog::OnOK();
diff --git a/win/Mainfrm.cpp b/win/Mainfrm.cpp
index ca4d5e4..0761390 100644
--- a/win/Mainfrm.cpp
+++ b/win/Mainfrm.cpp
@@ -16,7 +16,7 @@
#include "keyboard.h"
#include "system.h"
#include "library.h"
-
+#include "lc_application.h"
#include "Print.h"
#ifdef _DEBUG
@@ -418,7 +418,7 @@ LONG CMainFrame::OnUpdateInfo(UINT lParam, LONG wParam)
char str[128];
float pos[3];
- project->GetFocusPosition(pos);
+ lcGetActiveProject()->GetFocusPosition(pos);
sprintf (str, "X: %.2f Y: %.2f Z: %.2f", pos[0], pos[1], pos[2]);
SetStatusBarPane(ID_INDICATOR_POSITION, str);
@@ -475,7 +475,7 @@ void CMainFrame::OnClose()
if (m_lpfnCloseProc != NULL && !(*m_lpfnCloseProc)(this))
return;
- if (!project->SaveModified())
+ if (!lcGetActiveProject()->SaveModified())
return;
if (GetStyle() & WS_VISIBLE)
@@ -629,7 +629,7 @@ void CMainFrame::GetMessageString(UINT nID, CString& rMessage) const
{
if (nID >= ID_CAMERA_FIRST && nID <= ID_CAMERA_LAST)
{
- Camera* pCamera = project->GetCamera(nID-ID_CAMERA_FIRST);
+ Camera* pCamera = lcGetActiveProject()->GetCamera(nID-ID_CAMERA_FIRST);
rMessage = "Use the camera \"";
rMessage += pCamera->GetName();
rMessage += "\"";
@@ -646,6 +646,7 @@ void CMainFrame::OnFilePrintPieceList()
// Pass all commands to the project.
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
+ Project* project = lcGetActiveProject();
int nID = LOWORD(wParam);
if (nID >= ID_SNAP_0 && nID <= ID_SNAP_9)
@@ -966,7 +967,7 @@ BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
if (Item == NULL)
break;
- PiecesLibrary* Lib = project->GetPiecesLibrary();
+ PiecesLibrary* Lib = lcGetPiecesLibrary();
CString CategoryName = m_wndPiecesBar.m_PiecesTree.GetItemText(Item);
int Index = Lib->FindCategoryIndex((const char*)CategoryName);
@@ -994,7 +995,7 @@ BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
if (SystemDoDialog(LC_DLG_EDITCATEGORY, &Opts))
{
- PiecesLibrary* Lib = project->GetPiecesLibrary();
+ PiecesLibrary* Lib = lcGetPiecesLibrary();
Lib->AddCategory(Opts.Name, Opts.Keywords);
m_wndPiecesBar.UpdatePiecesTree(NULL, Opts.Name);
}
@@ -1008,7 +1009,7 @@ BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
if (Item == NULL)
break;
- PiecesLibrary* Lib = project->GetPiecesLibrary();
+ PiecesLibrary* Lib = lcGetPiecesLibrary();
CString CategoryName = m_wndPiecesBar.m_PiecesTree.GetItemText(Item);
int Index = Lib->FindCategoryIndex((const char*)CategoryName);
@@ -1040,7 +1041,12 @@ void CMainFrame::OnActivateApp(BOOL bActive, ACTIVATEAPPPARAM hTask)
// Don't notify if we loose focus while on print preview
if (m_lpfnCloseProc == NULL)
- project->HandleNotify(LC_ACTIVATE, bActive ? 1 : 0);
+ {
+ Project* project = lcGetActiveProject();
+
+ if (project)
+ project->HandleNotify(LC_ACTIVATE, bActive ? 1 : 0);
+ }
}
LRESULT CMainFrame::OnSetMessageString(WPARAM wParam, LPARAM lParam)
@@ -1115,7 +1121,7 @@ void CMainFrame::OnViewNewView()
AfxThrowResourceException();
}
- View *view = new View (project, NULL);
+ View *view = new View (lcGetActiveProject(), NULL);
CreateWindowEx (0, FLOATING_CLASSNAME, "LeoCAD",
WS_VISIBLE | WS_POPUPWINDOW | WS_OVERLAPPEDWINDOW,
@@ -1205,7 +1211,7 @@ BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
}
}
- project->HandleCommand(Cmd.ID, 0);
+ lcGetActiveProject()->HandleCommand(Cmd.ID, 0);
return true;
}
}
@@ -1223,7 +1229,7 @@ BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
}
}
- project->HandleCommand(Cmd.ID, 0);
+ lcGetActiveProject()->HandleCommand(Cmd.ID, 0);
return true;
}
}
@@ -1394,7 +1400,7 @@ void CMainFrame::OnDropFiles(HDROP hDropInfo)
TCHAR szFileName[_MAX_PATH];
::DragQueryFile(hDropInfo, 0, szFileName, _MAX_PATH);
- project->OpenProject(szFileName);
+ lcGetActiveProject()->OpenProject(szFileName);
}
::DragFinish(hDropInfo);
}
diff --git a/win/Moddlg.cpp b/win/Moddlg.cpp
index c9035f8..b81ec37 100644
--- a/win/Moddlg.cpp
+++ b/win/Moddlg.cpp
@@ -13,6 +13,7 @@
#include "camera.h"
#include "light.h"
#include "matrix.h"
+#include "lc_application.h"
#ifdef _DEBUG
#undef THIS_FILE
@@ -143,7 +144,7 @@ void CModifyDialog::UpdateInfo(Object* pObject)
return;
if (pObject == NULL)
- pObject = project->GetFocusObject();
+ pObject = lcGetActiveProject()->GetFocusObject();
m_pObject = pObject;
@@ -171,7 +172,7 @@ void CModifyDialog::UpdateInfo(Object* pObject)
Matrix mat(rot, pos);
mat.ToEulerAngles(rot);
- if ((project->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
+ if ((lcGetActiveProject()->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
{
pos[0] /= 0.08f;
pos[1] /= 0.08f;
@@ -185,7 +186,7 @@ void CModifyDialog::UpdateInfo(Object* pObject)
m_fRotY = rot[1];
m_fRotZ = rot[2];
- if (project->IsAnimation())
+ if (lcGetActiveProject()->IsAnimation())
{
m_nFrom = pPiece->GetFrameShow();
m_nTo = pPiece->GetFrameHide();
@@ -213,7 +214,7 @@ void CModifyDialog::UpdateInfo(Object* pObject)
pCamera = ((CameraTarget*)m_pObject)->GetParent();
pCamera->GetEyePos(tmp);
- if ((project->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
+ if ((lcGetActiveProject()->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
{
tmp[0] /= 0.08f;
tmp[1] /= 0.08f;
@@ -224,7 +225,7 @@ void CModifyDialog::UpdateInfo(Object* pObject)
m_fPosZ = tmp[2];
pCamera->GetTargetPos(tmp);
- if ((project->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
+ if ((lcGetActiveProject()->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
{
tmp[0] /= 0.08f;
tmp[1] /= 0.08f;
@@ -235,7 +236,7 @@ void CModifyDialog::UpdateInfo(Object* pObject)
m_fRotZ = tmp[2];
pCamera->GetUpVec(tmp);
- if ((project->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
+ if ((lcGetActiveProject()->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
{
tmp[0] /= 0.08f;
tmp[1] /= 0.08f;
@@ -372,7 +373,7 @@ void CModifyDialog::OnModdlgApply()
mod.pos[0] = m_fPosX;
mod.pos[1] = m_fPosY;
mod.pos[2] = m_fPosZ;
- if ((project->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
+ if ((lcGetActiveProject()->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
{
mod.pos[0] *= 0.08f;
mod.pos[1] *= 0.08f;
@@ -387,7 +388,7 @@ void CModifyDialog::OnModdlgApply()
mod.color = m_ctlColor.GetColorIndex();
strcpy(mod.name, m_strName);
- project->HandleNotify(LC_PIECE_MODIFIED, (unsigned long)&mod);
+ lcGetActiveProject()->HandleNotify(LC_PIECE_MODIFIED, (unsigned long)&mod);
} break;
case LC_OBJECT_CAMERA: case LC_OBJECT_CAMERA_TARGET:
@@ -405,7 +406,7 @@ void CModifyDialog::OnModdlgApply()
mod.up[0] = m_fUpX;
mod.up[1] = m_fUpY;
mod.up[2] = m_fUpZ;
- if ((project->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
+ if ((lcGetActiveProject()->GetSnapFlags() & LC_DRAW_CM_UNITS) == 0)
{
mod.eye[0] *= 0.08f;
mod.eye[1] *= 0.08f;
@@ -421,7 +422,7 @@ void CModifyDialog::OnModdlgApply()
mod.znear = m_fNear;
mod.zfar = m_fFar;
- project->HandleNotify(LC_CAMERA_MODIFIED, (unsigned long)&mod);
+ lcGetActiveProject()->HandleNotify(LC_CAMERA_MODIFIED, (unsigned long)&mod);
} break;
case LC_OBJECT_LIGHT: case LC_OBJECT_LIGHT_TARGET:
@@ -446,7 +447,7 @@ void CModifyDialog::OnDropdownModdlgList()
Light* pLight;
int i;
- project->GetArrays(&pPiece, &pCamera, &pLight);
+ lcGetActiveProject()->GetArrays(&pPiece, &pCamera, &pLight);
m_ctlCombo.ResetContent();
diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp
index 3ec1cdb..f66cd2d 100644
--- a/win/Piecebar.cpp
+++ b/win/Piecebar.cpp
@@ -9,6 +9,7 @@
#include "pieceinf.h"
#include "project.h"
#include "globals.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -737,7 +738,7 @@ void CPiecesBar::OnSelChangeColor()
if (i == LB_ERR)
return;
- project->HandleNotify(LC_COLOR_CHANGED, (i % 2 == 0) ? (i/2) : (((i-1)/2)+14));
+ lcGetActiveProject()->HandleNotify(LC_COLOR_CHANGED, (i % 2 == 0) ? (i/2) : (((i-1)/2)+14));
m_wndPiecePreview.PostMessage (WM_PAINT);
}
@@ -778,7 +779,7 @@ void CPiecesBar::OnContextMenu(CWnd* pWnd, CPoint point)
if (Item != NULL)
{
- PiecesLibrary *Lib = project->GetPiecesLibrary();
+ PiecesLibrary *Lib = lcGetPiecesLibrary();
CString CategoryName = m_PiecesTree.GetItemText(Item);
int CategoryIndex = Lib->FindCategoryIndex((const char*)CategoryName);
@@ -833,7 +834,7 @@ void CPiecesBar::SelectPiece(const char* Category, PieceInfo* Info)
strcpy(ParentName, Info->m_strName);
*strchr(ParentName, 'P') = '\0';
- Parent = project->GetPiecesLibrary()->FindPieceInfo(ParentName);
+ Parent = lcGetPiecesLibrary()->FindPieceInfo(ParentName);
if (Parent)
{
@@ -933,7 +934,7 @@ void CPiecesBar::UpdatePiecesTree(const char* OldCategory, const char* NewCatego
void CPiecesBar::UpdatePiecesTree(bool SearchOnly)
{
- PiecesLibrary *Lib = project->GetPiecesLibrary();
+ PiecesLibrary *Lib = lcGetPiecesLibrary();
if (SearchOnly)
{
@@ -1006,7 +1007,7 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
if (Info != NULL)
{
- project->SetCurrentPiece(Info);
+ lcGetActiveProject()->SetCurrentPiece(Info);
m_wndPiecePreview.SetPieceInfo(Info);
m_wndPiecePreview.PostMessage(WM_PAINT);
}
@@ -1015,7 +1016,7 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
if (Notify->action == TVE_EXPAND)
{
- PiecesLibrary *Lib = project->GetPiecesLibrary();
+ PiecesLibrary *Lib = lcGetPiecesLibrary();
// Check if we're expanding a category item.
if (Notify->itemNew.lParam == NULL)
diff --git a/win/Piececmb.cpp b/win/Piececmb.cpp
index ecefb8d..f1f3e29 100644
--- a/win/Piececmb.cpp
+++ b/win/Piececmb.cpp
@@ -9,6 +9,7 @@
#include "project.h"
#include "globals.h"
#include "library.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -45,7 +46,7 @@ void CPiecesCombo::OnEditupdate()
return;
char str[66];
- PiecesLibrary *pLib = project->GetPiecesLibrary ();
+ PiecesLibrary *pLib = lcGetPiecesLibrary();
CPiecesBar* pBar = (CPiecesBar*)GetParent();
PieceInfo* pInfo;
@@ -105,7 +106,7 @@ BOOL CPiecesCombo::PreTranslateMessage(MSG* pMsg)
}
else if (nVirtKey == VK_RETURN)
{
- PiecesLibrary* Lib = project->GetPiecesLibrary();
+ PiecesLibrary* Lib = lcGetPiecesLibrary();
CString str;
GetWindowText(str);
@@ -126,7 +127,7 @@ void CPiecesCombo::OnSelchange()
{
char str[66];
CPiecesBar* pBar = (CPiecesBar*)GetParent();
- PiecesLibrary *pLib = project->GetPiecesLibrary();
+ PiecesLibrary *pLib = lcGetPiecesLibrary();
if (!GetLBText (GetCurSel(), str))
return;
@@ -142,7 +143,7 @@ void CPiecesCombo::OnSelchange()
void CPiecesCombo::SelectPiece(PieceInfo* Info)
{
- PiecesLibrary *Lib = project->GetPiecesLibrary();
+ PiecesLibrary *Lib = lcGetPiecesLibrary();
CPiecesBar* Bar = (CPiecesBar*)GetParent();
int Index = Lib->GetFirstCategory(Info);
diff --git a/win/Print.cpp b/win/Print.cpp
index 80c96b2..6f693f8 100644
--- a/win/Print.cpp
+++ b/win/Print.cpp
@@ -13,12 +13,13 @@
#include "Tools.h"
#include "Piece.h"
#include "library.h"
+#include "lc_application.h"
static void PrintCatalogThread (CWnd* pParent, CFrameWnd* pMainFrame)
{
CCADView* pView = (CCADView*)pMainFrame->GetActiveView();
CPrintDialog* PD = new CPrintDialog(FALSE, PD_ALLPAGES|PD_USEDEVMODECOPIES|PD_NOSELECTION|PD_ENABLEPRINTHOOK, pParent);
- PiecesLibrary *pLib = project->GetPiecesLibrary ();
+ PiecesLibrary *pLib = lcGetPiecesLibrary();
int bricks = 0;
for (int j = 0; j < pLib->GetPieceCount (); j++)
@@ -288,7 +289,7 @@ static void PrintCatalogThread (CWnd* pParent, CFrameWnd* pMainFrame)
glDisable (GL_DITHER);
glShadeModel (GL_FLAT);
- glColor3ubv(FlatColorArray[project->GetCurrentColor()]);
+ glColor3ubv(FlatColorArray[lcGetActiveProject()->GetCurrentColor()]);
// dlgPrintStatus.SetDlgItemText(AFX_IDC_PRINT_DOCNAME, node->name);
node = node->next;
@@ -305,7 +306,7 @@ static void PrintCatalogThread (CWnd* pParent, CFrameWnd* pMainFrame)
FillRect(pMemDC->m_hDC, CRect(0,h,w,0), (HBRUSH)GetStockObject(WHITE_BRUSH));
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- pInfo->RenderPiece(project->GetCurrentColor());
+ pInfo->RenderPiece(lcGetActiveProject()->GetCurrentColor());
glFlush();
TextOut (pMemDC->m_hDC, 5, 5, pInfo->m_strDescription, strlen(pInfo->m_strDescription));
@@ -411,7 +412,8 @@ static void PrintPiecesThread(void* pv)
CFrameWnd* pFrame = (CFrameWnd*)pv;
CView* pView = pFrame->GetActiveView();
CPrintDialog* PD = new CPrintDialog(FALSE, PD_ALLPAGES|PD_USEDEVMODECOPIES|PD_NOPAGENUMS|PD_NOSELECTION, pFrame);
- PiecesLibrary *pLib = project->GetPiecesLibrary ();
+ PiecesLibrary *pLib = lcGetPiecesLibrary();
+ Project* project = lcGetActiveProject();
UINT *pieces = (UINT*)malloc(pLib->GetPieceCount ()*28*sizeof(UINT));
int col[28];
diff --git a/win/Steppop.cpp b/win/Steppop.cpp
index eff6447..3314763 100644
--- a/win/Steppop.cpp
+++ b/win/Steppop.cpp
@@ -6,6 +6,7 @@
#include "StepPop.h"
#include "project.h"
#include "globals.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -32,7 +33,7 @@ CStepPopup::CStepPopup(CPoint pt, CWnd* pParentWnd)
m_Slider.Create (WS_CHILD|WS_VISIBLE|TBS_BOTH|TBS_HORZ|TBS_NOTICKS, CRect(5,10,90,30), this, 1000);
int from, to;
- project->GetTimeRange(&from, &to);
+ lcGetActiveProject()->GetTimeRange(&from, &to);
m_Slider.SetRange(1, to);
m_Slider.SetPos(from);
}
@@ -82,7 +83,7 @@ void CStepPopup::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
int pos = m_Slider.GetPos();
if (pos > 0)
- project->HandleCommand(LC_VIEW_STEP_SET, pos);
+ lcGetActiveProject()->HandleCommand(LC_VIEW_STEP_SET, pos);
CWnd::OnHScroll(nSBCode, nPos, pScrollBar);
}
diff --git a/win/System.cpp b/win/System.cpp
index b8000e9..0e2cb92 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -32,6 +32,7 @@
#include "mainfrm.h"
#include "project.h"
#include "globals.h"
+#include "lc_application.h"
bool lcAssert(const char* FileName, int Line, const char* Expression, const char* Description)
{
@@ -447,7 +448,10 @@ void SystemInit()
// Viewport menu.
void SystemUpdateViewport(int nNew, int nOld)
{
- CMenu* pMenu = GetMainMenu(2)->GetSubMenu(12);
+ CMenu* pMenu = GetMainMenu(2);
+ if (!pMenu)
+ return;
+ pMenu = pMenu->GetSubMenu(12);
pMenu->CheckMenuItem(nOld + ID_VIEWPORT01, MF_BYCOMMAND | MF_UNCHECKED);
pMenu->CheckMenuItem(nNew + ID_VIEWPORT01, MF_BYCOMMAND | MF_CHECKED);
}
@@ -456,6 +460,8 @@ void SystemUpdateViewport(int nNew, int nOld)
void SystemUpdateAction(int nNew, int nOld)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(ID_VIEW_TOOLS_BAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
CView* pView = pFrame->GetActiveView();
@@ -474,12 +480,15 @@ void SystemUpdateAction(int nNew, int nOld)
// Current color in the listbox;
void SystemUpdateColorList(int nNew)
{
- AfxGetMainWnd()->PostMessage (WM_LC_UPDATE_LIST, 0, nNew+1);
+ if (AfxGetMainWnd())
+ AfxGetMainWnd()->PostMessage (WM_LC_UPDATE_LIST, 0, nNew+1);
}
void SystemUpdateRenderingMode(bool bBackground, bool bFast)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(AFX_IDW_TOOLBAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
@@ -500,6 +509,8 @@ void SystemUpdateRenderingMode(bool bBackground, bool bFast)
void SystemUpdateUndoRedo(char* undo, char* redo)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(AFX_IDW_TOOLBAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
CMenu* pMenu = GetMainMenu(1);
@@ -542,6 +553,8 @@ void SystemUpdateUndoRedo(char* undo, char* redo)
void SystemUpdateSnap(const unsigned long nSnap)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(AFX_IDW_TOOLBAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
pCtrl->CheckButton(ID_SNAP_ANGLE, (nSnap & LC_DRAW_SNAP_A) != 0);
@@ -577,6 +590,8 @@ void SystemUpdateSelected(unsigned long flags)
{
CMenu* pMenu;
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(AFX_IDW_TOOLBAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
@@ -647,6 +662,8 @@ void SystemUpdateTime(bool bAnimation, int nTime, int nTotal)
{
// Toolbar
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(ID_VIEW_ANIMATION_BAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
@@ -687,11 +704,12 @@ void SystemUpdateSnap(unsigned short MoveSnap, unsigned short RotateSnap)
{
char Text[256], xy[32], z[32];
- project->GetSnapDistanceText(xy, z);
+ lcGetActiveProject()->GetSnapDistanceText(xy, z);
sprintf(Text, " M: %s %s R: %d ", xy, z, RotateSnap);
- ((CMainFrame*)AfxGetMainWnd())->SetStatusBarPane(ID_INDICATOR_SNAP, Text);
+ if (AfxGetMainWnd())
+ ((CMainFrame*)AfxGetMainWnd())->SetStatusBarPane(ID_INDICATOR_SNAP, Text);
}
void SystemUpdatePaste(bool enable)
@@ -722,6 +740,8 @@ void SystemUpdateAnimation(bool bAnimation, bool bAddKeys)
{
// Toolbar
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(ID_VIEW_ANIMATION_BAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
@@ -747,7 +767,10 @@ void SystemUpdateAnimation(bool bAnimation, bool bAddKeys)
void SystemUpdateCurrentCamera(Camera* pOld, Camera* pNew, Camera* pCamera)
{
- CBMPMenu* pMainMenu = (CBMPMenu*)GetMainMenu(2)->GetSubMenu(13);
+ CMenu* Menu = GetMainMenu(2);
+ if (!Menu)
+ return;
+ CBMPMenu* pMainMenu = (CBMPMenu*)Menu->GetSubMenu(13);
CMenu* pPopupMenu = menuPopups.GetSubMenu(1)->GetSubMenu(3);
int i;
@@ -772,7 +795,10 @@ void SystemUpdateCurrentCamera(Camera* pOld, Camera* pNew, Camera* pCamera)
// Update the list of cameras
void SystemUpdateCameraMenu(Camera* pCamera)
{
- CBMPMenu* pMainMenu = (CBMPMenu*)GetMainMenu(2)->GetSubMenu(13);
+ CMenu* Menu = GetMainMenu(2);
+ if (!Menu)
+ return;
+ CBMPMenu* pMainMenu = (CBMPMenu*)Menu->GetSubMenu(13);
CMenu* pPopupMenu = menuPopups.GetSubMenu(1)->GetSubMenu(3);
Camera* pFirst = pCamera;
int i;
@@ -817,6 +843,10 @@ void SystemUpdateCameraMenu(Camera* pCamera)
void SystemUpdateCategories(bool SearchOnly)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+
+ if (!pFrame)
+ return;
+
CPiecesBar* pBar = (CPiecesBar*)pFrame->GetControlBar(ID_VIEW_PIECES_BAR);
pBar->UpdatePiecesTree(SearchOnly);
}
@@ -970,6 +1000,8 @@ static BOOL GetDisplayName(char* filename, CString& strName, LPCTSTR lpszCurDir,
void SystemUpdateRecentMenu(char names[4][LC_MAXPATH])
{
CBMPMenu* pMenu = (CBMPMenu*)GetMainMenu(0);
+ if (!pMenu)
+ return;
UINT nState;
pMenu->DeleteMenu(ID_FILE_MRU_FILE2, MF_BYCOMMAND);
@@ -1061,6 +1093,9 @@ extern void AFXAPI AfxSetWindowText(HWND, LPCTSTR);
void SystemSetWindowCaption(char* caption)
{
+ if (!AfxGetMainWnd())
+ return;
+
AfxSetWindowText(AfxGetMainWnd()->m_hWnd, caption);
}
@@ -1724,6 +1759,8 @@ long SystemGetTicks()
void SystemStartProgressBar(int nLower, int nUpper, int nStep, const char* Text)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CCADStatusBar* pStatusBar = (CCADStatusBar*)pFrame->GetControlBar(AFX_IDW_STATUS_BAR);
pStatusBar->ShowProgressBar(TRUE);
@@ -1738,6 +1775,8 @@ void SystemStartProgressBar(int nLower, int nUpper, int nStep, const char* Text)
void SytemEndProgressBar()
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CCADStatusBar* pStatusBar = (CCADStatusBar*)pFrame->GetControlBar(AFX_IDW_STATUS_BAR);
pStatusBar->ShowProgressBar(FALSE);
@@ -1749,6 +1788,8 @@ void SytemEndProgressBar()
void SytemStepProgressBar()
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ if (!pFrame)
+ return;
CCADStatusBar* pStatusBar = (CCADStatusBar*)pFrame->GetControlBar(AFX_IDW_STATUS_BAR);
pStatusBar->StepProgressBar();
diff --git a/win/Tools.cpp b/win/Tools.cpp
index b39c0e4..cdf49a4 100644
--- a/win/Tools.cpp
+++ b/win/Tools.cpp
@@ -5,6 +5,7 @@
#include "Tools.h"
#include "resource.h"
#include "PrefSht.h"
+#include "lc_application.h"
#include <math.h>
#include <shlobj.h>
@@ -255,6 +256,8 @@ void Export3DStudio()
if (dlg.DoModal() != IDOK)
return;
+ Project* project = lcGetActiveProject();
+
ClearErrList3ds();
file3ds *file = OpenFile3ds(dlg.GetPathName(), "w");
database3ds *db = NULL;
diff --git a/win/texdlg.cpp b/win/texdlg.cpp
index 3b09d21..1bafd02 100644
--- a/win/texdlg.cpp
+++ b/win/texdlg.cpp
@@ -8,6 +8,7 @@
#include "project.h"
#include "globals.h"
#include "texture.h"
+#include "lc_application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -68,7 +69,7 @@ void CTexturesDlg::OnLibtexAdd()
if (dlg.DoModal() == IDOK)
{
- project->GetPiecesLibrary ()->ImportTexture (dlg.GetPathName());
+ lcGetPiecesLibrary()->ImportTexture(dlg.GetPathName());
UpdateList();
}
}
@@ -96,7 +97,7 @@ void CTexturesDlg::OnLibtexRemove()
}
}
- project->GetPiecesLibrary ()->DeleteTextures (names, selected);
+ lcGetPiecesLibrary()->DeleteTextures(names, selected);
free (names);
@@ -105,13 +106,13 @@ void CTexturesDlg::OnLibtexRemove()
void CTexturesDlg::UpdateList()
{
- PiecesLibrary *pLib = project->GetPiecesLibrary ();
+ PiecesLibrary *pLib = lcGetPiecesLibrary();
- m_List.ResetContent ();
+ m_List.ResetContent();
- for (int i = 0; i < pLib->GetTextureCount (); i++)
+ for (int i = 0; i < pLib->GetTextureCount(); i++)
{
int index = m_List.AddString (pLib->GetTexture(i)->m_strName);
- m_List.SetItemDataPtr (index, pLib->GetTexture(i)->m_strName);
+ m_List.SetItemDataPtr(index, pLib->GetTexture(i)->m_strName);
}
}