summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/project.cpp120
-rw-r--r--common/project.h4
-rw-r--r--common/texfont.cpp123
-rw-r--r--common/texfont.h32
-rw-r--r--common/texture.h2
-rw-r--r--docs/CHANGES.txt12
-rw-r--r--win/LeoCAD.dsp455
-rw-r--r--win/Leocad.dsw12
8 files changed, 571 insertions, 189 deletions
diff --git a/common/project.cpp b/common/project.cpp
index 497e9ad..c2c8c4f 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -69,14 +69,6 @@ static LC_VIEWPORT viewports[14] = {
{ 4, {{ 0.0f, 0.0f, 0.5f, 0.5f }, { 0.5f, 0.0f, 0.5f, 0.5f },
{ 0.0f, 0.5f, 0.5f, 0.5f }, { 0.5f, 0.5f, 0.5f, 0.5f } }}};// 4
-typedef struct
-{
- unsigned char width;
- float left, right, top, bottom;
-} LC_TXFVERT;
-
-static LC_TXFVERT glyphs[93];
-
/////////////////////////////////////////////////////////////////////////////
// Project construction/destruction
@@ -119,40 +111,6 @@ Project::Project()
for (i = 0; i < 10; i++)
m_pClipboard[i] = NULL;
-
- // Create font table
- float inv = 1.0f/128;
- char *charlines[16] = {
- "abcdefghijklmn", "opqrstuvwxyz0", "123456789ABC", "DEFGHIJKLMN",
- "OPQRSTUVWX", "YZ,.!;:<>/?{}@$%", "&*()-+=_[] #" };
- unsigned char lefts[7][17] = {
- { 1, 11, 21, 30, 40, 50, 56, 66, 76, 80, 84, 93, 97, 111, 121 },
- { 1, 11, 21, 31, 38, 47, 53, 63, 72, 86, 94, 103, 111, 120 },
- { 1, 10, 19, 28, 37, 46, 55, 64, 73, 82, 94, 106, 118, },
- { 1, 13, 24, 34, 47, 59, 64, 73, 84, 94, 108, 120 },
- { 1, 14, 25, 38, 50, 61, 71, 83, 94, 109, 120 },
- { 1, 12, 22, 26, 30, 35, 39, 43, 52, 61, 65, 75, 81, 87, 103, 112, 125 },
- { 3, 14, 23, 28, 33, 38, 47, 56, 65, 70, 75, 79, 88 } };
- // tops = 1 20 39 58 77 96 112 (+16)
- memset(glyphs, 0, sizeof(glyphs));
-
- // ASCII 32-125
- for (i = 32; i < 126; i++)
- for (int x = 0; x < 7; x++)
- for (int y = 0; charlines[x][y]; y++)
- if (charlines[x][y] == i)
- {
- glyphs[i-32].width = lefts[x][y+1] - lefts[x][y];
- glyphs[i-32].left = (float)lefts[x][y]*inv;
- glyphs[i-32].right = (float)(lefts[x][y+1])*inv;
- if (x != 6)
- glyphs[i-32].top = (float)(1 + 19*x);
- else
- glyphs[i-32].top = 112;
- glyphs[i-32].bottom = glyphs[i-32].top + 16;
- glyphs[i-32].top *= inv;
- glyphs[i-32].bottom *= inv;
- }
}
Project::~Project()
@@ -2101,53 +2059,27 @@ void Project::RenderScene(bool bShaded, bool bDrawViewports)
glEnable(GL_TEXTURE_2D);
glEnable(GL_ALPHA_TEST);
- LC_TXFVERT* glyph;
-
- glPushMatrix();
+ glPushMatrix();
glTranslatef(1.4f*ds, 0, 0);
glMultMatrixf(m.m);
- glyph = &glyphs['X'-32];
glBegin(GL_QUADS);
- glTexCoord2f(glyph->left, glyph->top);
- glVertex2f(0, 0.4f*ds);
- glTexCoord2f(glyph->left, glyph->bottom);
- glVertex2f(0, -0.4f*ds);
- glTexCoord2f(glyph->right, glyph->bottom);
- glVertex2f(glyph->width*ds/20, -0.4f*ds);
- glTexCoord2f(glyph->right, glyph->top);
- glVertex2f(glyph->width*ds/20, 0.4f*ds);
+ m_ScreenFont.PrintCharScaled (0.025f * ds, 'X');
glEnd();
glPopMatrix();
glPushMatrix();
glTranslatef(0, 1.4f*ds, 0);
glMultMatrixf(m.m);
- glyph = &glyphs['Y'-32];
glBegin(GL_QUADS);
- glTexCoord2f(glyph->left, glyph->top);
- glVertex2f(0, 0.4f*ds);
- glTexCoord2f(glyph->left, glyph->bottom);
- glVertex2f(0, -0.4f*ds);
- glTexCoord2f(glyph->right, glyph->bottom);
- glVertex2f(glyph->width*ds/20, -0.4f*ds);
- glTexCoord2f(glyph->right, glyph->top);
- glVertex2f(glyph->width*ds/20, 0.4f*ds);
+ m_ScreenFont.PrintCharScaled (0.025f * ds, 'Y');
glEnd();
glPopMatrix();
glPushMatrix();
glTranslatef(0, 0, 1.4f*ds);
glMultMatrixf(m.m);
- glyph = &glyphs['Z'-32];
glBegin(GL_QUADS);
- glTexCoord2f(glyph->left, glyph->top);
- glVertex2f(0, 0.4f*ds);
- glTexCoord2f(glyph->left, glyph->bottom);
- glVertex2f(0, -0.4f*ds);
- glTexCoord2f(glyph->right, glyph->bottom);
- glVertex2f(glyph->width*ds/20, -0.4f*ds);
- glTexCoord2f(glyph->right, glyph->top);
- glVertex2f(glyph->width*ds/20, 0.4f*ds);
+ m_ScreenFont.PrintCharScaled (0.025f * ds, 'Z');
glEnd();
glPopMatrix();
@@ -2521,24 +2453,7 @@ void Project::RenderViewports(bool bBackground, bool bLines)
w = viewports[m_nViewportMode].dim[vp][2] * (float)(m_nViewX - 1);
h = viewports[m_nViewportMode].dim[vp][3] * (float)(m_nViewY - 1);
- float l = x+3, t = y+h-6;
- for (const char* p = m_pViewCameras[vp]->GetName(); *p; p++)
- {
- if (*p < 32 || *p > 125)
- continue;
- if (glyphs[*p-32].width == 0)
- continue;
-
- glTexCoord2f(glyphs[*p-32].left, glyphs[*p-32].top);
- glVertex2f(l, t);
- glTexCoord2f(glyphs[*p-32].left, glyphs[*p-32].bottom);
- glVertex2f(l, t-16);
- glTexCoord2f(glyphs[*p-32].right, glyphs[*p-32].bottom);
- glVertex2f(l + glyphs[*p-32].width, t-16);
- glTexCoord2f(glyphs[*p-32].right, glyphs[*p-32].top);
- glVertex2f(l + glyphs[*p-32].width, t);
- l += glyphs[*p-32].width;
- }
+ m_ScreenFont.PrintText (x + 3, y + h - 6, m_pViewCameras[vp]->GetName ());
}
glEnd();
@@ -2676,8 +2591,19 @@ void Project::RenderInitialize()
else
glDisable (GL_FOG);
- // Load font (always the first texture)
- m_pTextures[0].Load(false);
+ // Load font
+ if (!m_ScreenFont.IsLoaded ())
+ {
+ char filename[LC_MAXPATH];
+ FileDisk file;
+
+ strcpy (filename, m_LibraryPath);
+ strcat (filename, "sysfont.txf");
+
+ if (file.Open (filename, "rb"))
+ m_ScreenFont.FileLoad (file);
+ }
+
glAlphaFunc(GL_GREATER, 0.0625);
if (m_nScene & LC_SCENE_FLOOR)
@@ -5985,13 +5911,13 @@ void Project::GetFocusPosition(float* pos)
pos[0] = pos[1] = pos[2] = 0.0f;
}
-Texture* Project::FindTexture(char* name)
+Texture* Project::FindTexture (const char* name)
{
- for (int i = 0; i < m_nTextureCount; i++)
- if (!strcmp (name, m_pTextures[i].m_strName))
- return &m_pTextures[i];
+ for (int i = 0; i < m_nTextureCount; i++)
+ if (!strcmp (name, m_pTextures[i].m_strName))
+ return &m_pTextures[i];
- return NULL;
+ return NULL;
}
// Remeber to make 'name' uppercase.
diff --git a/common/project.h b/common/project.h
index 60a3021..a9bb1e8 100644
--- a/common/project.h
+++ b/common/project.h
@@ -5,6 +5,7 @@
#include "defines.h"
#include "typedefs.h"
#include "opengl.h"
+#include "texfont.h"
#include "array.h"
typedef enum
@@ -94,7 +95,7 @@ public:
void Render(bool bToMemory);
void SetViewSize(int cx, int cy);
- Texture* FindTexture(char* name);
+ Texture* FindTexture (const char* name);
PieceInfo* FindPieceInfo (const char* name) const;
void CheckAutoSave();
void GetFocusPosition(float* pos);
@@ -124,6 +125,7 @@ protected:
PieceInfo* m_pPieceIdx; // index
int m_nTextureCount;
Texture* m_pTextures;
+ TexFont m_ScreenFont;
char* m_pMovedReference;
int m_nMovedCount;
diff --git a/common/texfont.cpp b/common/texfont.cpp
new file mode 100644
index 0000000..252b72b
--- /dev/null
+++ b/common/texfont.cpp
@@ -0,0 +1,123 @@
+//
+// Texture Font
+//
+
+#include "globals.h"
+#include "project.h"
+#include "texfont.h"
+#include "texture.h"
+#include "file.h"
+
+#define LC_TEXFONT_FILE_VERSION 1 // LeoCAD 0.74
+#define LC_TEXFONT_FILE_HEADER "LeoCAD Texture Font\0\0\0\0\0\0\0\0\0\0\0\0"
+
+// ============================================================================
+
+TexFont::TexFont ()
+{
+ m_bLoaded = false;
+ m_pTexture = NULL;
+
+ memset (&m_Glyphs, 0, sizeof (m_Glyphs));
+}
+
+TexFont::~TexFont ()
+{
+ if (m_pTexture != NULL)
+ m_pTexture->DeRef ();
+}
+
+bool TexFont::FileLoad (File& file)
+{
+ unsigned char version;
+ char buf[64];
+
+ if (m_bLoaded)
+ {
+ console.PrintError ("Texture font already loaded.\n");
+ return false;
+ }
+
+ file.Read (buf, 32);
+ if (strncmp (buf, LC_TEXFONT_FILE_HEADER, 32) != 0)
+ {
+ console.PrintError ("Texture font file header mismatch.\n");
+ return false;
+ }
+
+ file.ReadByte (&version, 1);
+ if (version > LC_TEXFONT_FILE_VERSION)
+ {
+ console.PrintError ("Wrong version of texture font file.\n");
+ return false;
+ }
+
+ memset (buf, 0, 32);
+ file.Read (buf, 8);
+
+ m_pTexture = project->FindTexture (buf);
+ if (m_pTexture == NULL)
+ {
+ console.PrintError ("Cannot find texture for font %s.\n", buf);
+ return false;
+ }
+ m_pTexture->AddRef (false);
+
+ file.ReadByte (&m_nFontHeight, 1);
+
+ for (;;)
+ {
+ unsigned char glyph;
+
+ file.ReadByte (&glyph, 1);
+
+ if (glyph == 0)
+ break;
+
+ file.ReadByte (&m_Glyphs[glyph].width, 1);
+ file.ReadFloat (&m_Glyphs[glyph].left, 1);
+ file.ReadFloat (&m_Glyphs[glyph].right, 1);
+ file.ReadFloat (&m_Glyphs[glyph].top, 1);
+ file.ReadFloat (&m_Glyphs[glyph].bottom, 1);
+
+ m_Glyphs[glyph].left /= m_pTexture->m_nWidth;
+ m_Glyphs[glyph].right /= m_pTexture->m_nWidth;
+ m_Glyphs[glyph].top /= m_pTexture->m_nHeight;
+ m_Glyphs[glyph].bottom /= m_pTexture->m_nHeight;
+ }
+
+ m_bLoaded = true;
+
+ return true;
+}
+
+void TexFont::PrintText (float left, float top, const char* text) const
+{
+ while (*text != 0)
+ {
+ glTexCoord2f (m_Glyphs[*text].left, m_Glyphs[*text].top);
+ glVertex2f (left, top);
+ glTexCoord2f (m_Glyphs[*text].left, m_Glyphs[*text].bottom);
+ glVertex2f (left, top - m_nFontHeight);
+ glTexCoord2f (m_Glyphs[*text].right, m_Glyphs[*text].bottom);
+ glVertex2f (left + m_Glyphs[*text].width, top - m_nFontHeight);
+ glTexCoord2f (m_Glyphs[*text].right, m_Glyphs[*text].top);
+ glVertex2f (left + m_Glyphs[*text].width, top);
+
+ left += m_Glyphs[*text].width;
+ text++;
+ }
+}
+
+// Temporary function to draw the axis icon text
+void TexFont::PrintCharScaled (float scale, char ch) const
+{
+ glTexCoord2f (m_Glyphs[ch].left, m_Glyphs[ch].top);
+ glVertex2f (-scale * m_Glyphs[ch].width, scale * m_nFontHeight);
+ glTexCoord2f (m_Glyphs[ch].left, m_Glyphs[ch].bottom);
+ glVertex2f (-scale * m_Glyphs[ch].width, -scale * m_nFontHeight);
+ glTexCoord2f (m_Glyphs[ch].right, m_Glyphs[ch].bottom);
+ glVertex2f (scale * m_Glyphs[ch].width, -scale * m_nFontHeight);
+ glTexCoord2f (m_Glyphs[ch].right, m_Glyphs[ch].top);
+ glVertex2f (scale * m_Glyphs[ch].width, scale * m_nFontHeight);
+}
diff --git a/common/texfont.h b/common/texfont.h
new file mode 100644
index 0000000..e3dc185
--- /dev/null
+++ b/common/texfont.h
@@ -0,0 +1,32 @@
+#ifndef _TEXFONT_H_
+#define _TEXFONT_H_
+
+class File;
+class Texture;
+
+class TexFont
+{
+public:
+ TexFont ();
+ ~TexFont ();
+
+ bool IsLoaded () const
+ { return m_bLoaded; }
+
+ bool FileLoad (File& file);
+ void PrintText (float left, float top, const char* text) const;
+ void PrintCharScaled (float scale, char ch) const;
+
+protected:
+ struct
+ {
+ unsigned char width;
+ float left, right, top, bottom;
+ } m_Glyphs[256];
+
+ Texture* m_pTexture;
+ unsigned char m_nFontHeight;
+ bool m_bLoaded;
+};
+
+#endif // _TEXFONT_H_
diff --git a/common/texture.h b/common/texture.h
index 52c223b..82eaf2e 100644
--- a/common/texture.h
+++ b/common/texture.h
@@ -7,6 +7,8 @@
class File;
+#include "opengl.h"
+
typedef enum { LC_INTENSITY, LC_RGB, LC_RGBA } LC_TEXTURE_TYPES;
class Texture
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index f6828af..c6dfc95 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,5 +1,17 @@
This is a changelog for developers only, not for ordinary users.
+09/03/2002
+ - Moved the texture font to a class to allow support for multiple fonts.
+
+08/03/2002
+ - Fixed a crash in the Edit Groups Dialog.
+
+03/12/2001
+ - Added a console window for text messages.
+
+30/07/2001
+ - Fixed a small memory leak and improved the default mouse sensitivity.
+
16/05/2001
- Fixed the way pieces are moved/rotated with the side cameras.
diff --git a/win/LeoCAD.dsp b/win/LeoCAD.dsp
index 61cbe11..a86782a 100644
--- a/win/LeoCAD.dsp
+++ b/win/LeoCAD.dsp
@@ -963,9 +963,9 @@ SOURCE=.\hlp\ScMenu.bmp
SOURCE=.\hlp\Scmin.bmp
# End Source File
# End Group
-# Begin Group "Common Files"
+# Begin Group "Common Header Files"
-# PROP Default_Filter ""
+# PROP Default_Filter "h"
# Begin Source File
SOURCE=..\common\array.h
@@ -976,180 +976,260 @@ SOURCE=..\common\basewnd.h
# End Source File
# Begin Source File
-SOURCE=..\Common\camera.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\camera.h
# End Source File
# Begin Source File
-SOURCE=..\Common\camera.h
+SOURCE=..\common\console.h
# End Source File
# Begin Source File
-SOURCE=..\common\console.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
+SOURCE=..\common\curve.h
+# End Source File
+# Begin Source File
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+SOURCE=..\Common\defines.h
+# End Source File
+# Begin Source File
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\file.h
+# End Source File
+# Begin Source File
-!ENDIF
+SOURCE=..\Common\globals.h
+# End Source File
+# Begin Source File
+SOURCE=..\common\glwindow.h
# End Source File
# Begin Source File
-SOURCE=..\common\console.h
+SOURCE=..\Common\group.h
# End Source File
# Begin Source File
-SOURCE=..\common\curve.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\image.h
# End Source File
# Begin Source File
-SOURCE=..\common\curve.h
+SOURCE=..\common\library.h
# End Source File
# Begin Source File
-SOURCE=..\Common\defines.h
+SOURCE=..\Common\light.h
# End Source File
# Begin Source File
-SOURCE=..\Common\file.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\common\mainwnd.h
# End Source File
# Begin Source File
-SOURCE=..\Common\file.h
+SOURCE=..\Common\matrix.h
# End Source File
# Begin Source File
-SOURCE=..\Common\globals.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\common\message.h
# End Source File
# Begin Source File
-SOURCE=..\Common\globals.h
+SOURCE=..\common\minifig.h
# End Source File
# Begin Source File
-SOURCE=..\common\glwindow.h
+SOURCE=..\common\object.h
# End Source File
# Begin Source File
-SOURCE=..\Common\group.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\common\opengl.h
# End Source File
# Begin Source File
-SOURCE=..\Common\group.h
+SOURCE=..\Common\piece.h
# End Source File
# Begin Source File
-SOURCE=..\common\im_bmp.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\pieceinf.h
# End Source File
# Begin Source File
-SOURCE=..\common\im_gif.cpp
-# ADD CPP /I "./jpeglib"
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\project.h
# End Source File
# Begin Source File
-SOURCE=..\common\im_jpg.cpp
-# ADD CPP /I "./jpeglib"
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\quant.h
# End Source File
# Begin Source File
-SOURCE=..\common\im_png.cpp
-# ADD CPP /I "./libpng" /I "./zlib"
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\common\str.h
# End Source File
# Begin Source File
-SOURCE=..\Common\image.cpp
-# ADD CPP /I "./jpeglib"
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\common\system.h
# End Source File
# Begin Source File
-SOURCE=..\Common\image.h
+SOURCE=..\Common\terrain.h
# End Source File
# Begin Source File
-SOURCE=..\common\library.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\common\texfont.h
# End Source File
# Begin Source File
-SOURCE=..\common\library.h
+SOURCE=..\Common\texture.h
# End Source File
# Begin Source File
-SOURCE=..\Common\light.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\Tr.h
# End Source File
# Begin Source File
-SOURCE=..\Common\light.h
+SOURCE=..\Common\typedefs.h
# End Source File
# Begin Source File
-SOURCE=..\common\mainwnd.cpp
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\Common\vector.h
# End Source File
# Begin Source File
-SOURCE=..\common\mainwnd.h
+SOURCE=..\common\view.h
# End Source File
+# End Group
+# Begin Group "Common Source Files"
+
+# PROP Default_Filter "c;cpp"
# Begin Source File
-SOURCE=..\Common\matrix.cpp
+SOURCE=..\Common\camera.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\matrix.h
+SOURCE=..\common\console.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\message.cpp
+SOURCE=..\common\curve.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\message.h
+SOURCE=..\Common\file.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\minifig.cpp
+SOURCE=..\Common\globals.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\minifig.h
+SOURCE=..\Common\group.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\object.cpp
+SOURCE=..\common\im_bmp.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\object.h
+SOURCE=..\common\im_gif.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# ADD CPP /I "./jpeglib"
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# ADD CPP /I "./jpeglib"
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\opengl.cpp
+SOURCE=..\common\im_jpg.cpp
!IF "$(CFG)" == "LeoCAD - Win32 Release"
-# ADD CPP /YX
+# ADD CPP /I "./jpeglib"
+# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+# ADD CPP /I "./jpeglib"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
@@ -1157,105 +1237,310 @@ SOURCE=..\common\opengl.cpp
# End Source File
# Begin Source File
-SOURCE=..\common\opengl.h
+SOURCE=..\common\im_png.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# ADD CPP /I "./libpng" /I "./zlib"
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# ADD CPP /I "./libpng" /I "./zlib"
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\piece.cpp
+SOURCE=..\Common\image.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# ADD CPP /I "./jpeglib"
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# ADD CPP /I "./jpeglib"
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\piece.h
+SOURCE=..\common\library.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\pieceinf.cpp
+SOURCE=..\Common\light.cpp
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
-SOURCE=..\Common\pieceinf.h
+SOURCE=..\common\mainwnd.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\project.cpp
+SOURCE=..\Common\matrix.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\project.h
+SOURCE=..\common\message.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\quant.cpp
+SOURCE=..\common\minifig.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\quant.h
+SOURCE=..\common\object.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\str.cpp
+SOURCE=..\common\opengl.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# ADD CPP /YX
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\str.h
+SOURCE=..\Common\piece.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\common\system.h
+SOURCE=..\Common\pieceinf.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\terrain.cpp
+SOURCE=..\Common\project.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\terrain.h
+SOURCE=..\Common\quant.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\texture.cpp
+SOURCE=..\common\str.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\texture.h
+SOURCE=..\Common\terrain.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\Tr.cpp
+SOURCE=..\common\texfont.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\Tr.h
+SOURCE=..\Common\texture.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
-SOURCE=..\Common\typedefs.h
+SOURCE=..\Common\Tr.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
SOURCE=..\Common\vector.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-SOURCE=..\Common\vector.h
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# Begin Source File
SOURCE=..\common\view.cpp
+
+!IF "$(CFG)" == "LeoCAD - Win32 Release"
+
# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-SOURCE=..\common\view.h
+!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
# End Source File
# End Group
# Begin Source File
diff --git a/win/Leocad.dsw b/win/Leocad.dsw
index af2b189..fab946a 100644
--- a/win/Leocad.dsw
+++ b/win/Leocad.dsw
@@ -1,9 +1,9 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
+Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
-Project: "3dsftk"=.\3dsftk\3dsftk.dsp - Package Owner=<4>
+Project: "3dsftk"=".\3dsftk\3dsftk.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -15,7 +15,7 @@ Package=<4>
###############################################################################
-Project: "LeoCAD"=.\LeoCAD.dsp - Package Owner=<4>
+Project: "LeoCAD"=".\LeoCAD.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -39,7 +39,7 @@ Package=<4>
###############################################################################
-Project: "jpeglib"=.\jpeglib\jpeglib.dsp - Package Owner=<4>
+Project: "jpeglib"=".\jpeglib\jpeglib.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -51,7 +51,7 @@ Package=<4>
###############################################################################
-Project: "libpng"=.\libpng\libpng.dsp - Package Owner=<4>
+Project: "libpng"=".\libpng\libpng.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -63,7 +63,7 @@ Package=<4>
###############################################################################
-Project: "zlib"=.\zlib\zlib.dsp - Package Owner=<4>
+Project: "zlib"=".\zlib\zlib.dsp" - Package Owner=<4>
Package=<5>
{{{