mirror of
https://github.com/leozide/leocad
synced 2025-01-18 22:26:44 +01:00
Misc cleanup.
This commit is contained in:
parent
1a5b152f6c
commit
e0f22e2e70
9 changed files with 47 additions and 65 deletions
|
@ -6,12 +6,12 @@
|
|||
|
||||
#define LC_MAX_DEBUG_LINES 100
|
||||
|
||||
typedef struct
|
||||
struct LC_DEBUG_LINE
|
||||
{
|
||||
Vector3 pt1;
|
||||
Vector3 pt2;
|
||||
Vector3 color;
|
||||
} LC_DEBUG_LINE;
|
||||
lcVector3 pt1;
|
||||
lcVector3 pt2;
|
||||
lcVector3 color;
|
||||
};
|
||||
|
||||
static LC_DEBUG_LINE DebugLines[LC_MAX_DEBUG_LINES];
|
||||
static int NumDebugLines;
|
||||
|
@ -21,7 +21,7 @@ void ClearDebugLines()
|
|||
NumDebugLines = 0;
|
||||
}
|
||||
|
||||
void AddDebugLine(const Vector3& pt1, const Vector3& pt2, const Vector3& Color)
|
||||
void AddDebugLine(const lcVector3& pt1, const lcVector3& pt2, const lcVector3& Color)
|
||||
{
|
||||
if (NumDebugLines == LC_MAX_DEBUG_LINES-1)
|
||||
return;
|
||||
|
@ -34,14 +34,14 @@ void AddDebugLine(const Vector3& pt1, const Vector3& pt2, const Vector3& Color)
|
|||
|
||||
#define LC_MAX_DEBUG_QUADS 100
|
||||
|
||||
typedef struct
|
||||
struct LC_DEBUG_QUAD
|
||||
{
|
||||
Vector3 pt1;
|
||||
Vector3 pt2;
|
||||
Vector3 pt3;
|
||||
Vector3 pt4;
|
||||
Vector4 color;
|
||||
} LC_DEBUG_QUAD;
|
||||
lcVector3 pt1;
|
||||
lcVector3 pt2;
|
||||
lcVector3 pt3;
|
||||
lcVector3 pt4;
|
||||
lcVector4 color;
|
||||
};
|
||||
|
||||
static LC_DEBUG_QUAD DebugQuads[LC_MAX_DEBUG_QUADS];
|
||||
static int NumDebugQuads;
|
||||
|
@ -51,7 +51,7 @@ void ClearDebugQuads()
|
|||
NumDebugQuads = 0;
|
||||
}
|
||||
|
||||
void AddDebugQuad(const Vector3& pt1, const Vector3& pt2, const Vector3& pt3, const Vector3& pt4, const Vector4& Color)
|
||||
void AddDebugQuad(const lcVector3& pt1, const lcVector3& pt2, const lcVector3& pt3, const lcVector3& pt4, const lcVector4& Color)
|
||||
{
|
||||
if (NumDebugQuads == LC_MAX_DEBUG_QUADS-1)
|
||||
return;
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
#ifndef _DEBUG_H_
|
||||
#define _DEBUG_H_
|
||||
|
||||
#ifdef LC_DEBUG
|
||||
|
||||
#include "algebra.h"
|
||||
#include "lc_math.h"
|
||||
|
||||
void RenderDebugPrimitives();
|
||||
|
||||
void AddDebugLine(const Vector3& pt1, const Vector3& pt2, const Vector3& Color);
|
||||
void AddDebugLine(const lcVector3& pt1, const lcVector3& pt2, const lcVector3& Color);
|
||||
void ClearDebugLines();
|
||||
|
||||
void AddDebugQuad(const Vector3& pt1, const Vector3& pt2, const Vector3& pt3, const Vector3& pt4, const Vector4& Color);
|
||||
void AddDebugQuad(const lcVector3& pt1, const lcVector3& pt2, const lcVector3& pt3, const lcVector3& pt4, const lcVector4& Color);
|
||||
void ClearDebugQuads();
|
||||
|
||||
|
||||
#endif // LC_DEBUG
|
||||
|
||||
#endif // _DEBUG_H_
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
MAJOR := 0
|
||||
MINOR := 76
|
||||
PATCHLVL := 2
|
||||
MINOR := 77
|
||||
PATCHLVL := 0
|
||||
VERSIONTAG :=
|
||||
VERSION := $(MAJOR).$(MINOR).$(PATCHLVL)
|
||||
|
|
|
@ -16,10 +16,8 @@ static char THIS_FILE[] = __FILE__;
|
|||
CColorPicker::CColorPicker()
|
||||
{
|
||||
m_bActive = FALSE;
|
||||
m_bDefaultText = FALSE;
|
||||
m_bCustomText = FALSE;
|
||||
m_crColor = GetSysColor(COLOR_3DFACE);
|
||||
SetColorIndex (-1);
|
||||
m_nColor = -1;
|
||||
SetColorIndex(-1);
|
||||
}
|
||||
|
||||
CColorPicker::~CColorPicker()
|
||||
|
@ -110,7 +108,16 @@ void CColorPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
|||
// Fill remaining area with colour
|
||||
rect.right -= m_ArrowRect.Width()-1;
|
||||
|
||||
CBrush brush(((state & ODS_DISABLED) || m_crColor == CLR_DEFAULT) ? ::GetSysColor(COLOR_3DFACE) : m_crColor);
|
||||
COLORREF brushColor;
|
||||
if ((state & ODS_DISABLED) || m_nColor == -1)
|
||||
brushColor = ::GetSysColor(COLOR_3DFACE);
|
||||
else
|
||||
{
|
||||
float* Value = gColorList[m_nColor].Value;
|
||||
brushColor = RGB(Value[0] * 255.0f, Value[1] * 255.0f, Value[2] * 255.0f);
|
||||
}
|
||||
|
||||
CBrush brush(brushColor);
|
||||
CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
|
||||
pDC->SelectStockObject(NULL_PEN);
|
||||
pDC->Rectangle(rect);
|
||||
|
@ -156,12 +163,6 @@ int CColorPicker::GetColorIndex()
|
|||
|
||||
void CColorPicker::SetColorIndex(int nColor)
|
||||
{
|
||||
if (nColor != -1)
|
||||
{
|
||||
float* Value = gColorList[nColor].Value;
|
||||
m_crColor = RGB(Value[0] * 255.0f, Value[1] * 255.0f, Value[2] * 255.0f);
|
||||
}
|
||||
|
||||
if (m_nColor != nColor)
|
||||
{
|
||||
m_nColor = nColor;
|
||||
|
|
|
@ -253,7 +253,6 @@ BOOL FolderBrowse(CString *strFolder, LPCSTR lpszTitle, HWND hWndOwner)
|
|||
#ifdef LC_HAVE_3DSFTK
|
||||
|
||||
#include "3dsftk\inc\3dsftk.h"
|
||||
#include "globals.h"
|
||||
#include "project.h"
|
||||
#include "piece.h"
|
||||
#include "pieceinf.h"
|
||||
|
|
|
@ -1,20 +1,8 @@
|
|||
#if !defined(AFX_COLOURPICKER_H__D0B75901_9830_11D1_9C0F_00A0243D1382__INCLUDED_)
|
||||
#define AFX_COLOURPICKER_H__D0B75901_9830_11D1_9C0F_00A0243D1382__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// ColorPicker.h : header file
|
||||
//
|
||||
#ifndef _CLRPICK_H_
|
||||
#define _CLRPICK_H_
|
||||
|
||||
#include "ClrPopup.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPicker window
|
||||
|
||||
//void AFXAPI DDX_ColorPicker(CDataExchange *pDX, int nIDC, COLORREF& crColor);
|
||||
|
||||
class CColorPicker : public CButton
|
||||
{
|
||||
// Construction
|
||||
|
@ -26,8 +14,6 @@ public:
|
|||
public:
|
||||
int GetColorIndex();
|
||||
void SetColorIndex(int nColor);
|
||||
BOOL m_bDefaultText;
|
||||
BOOL m_bCustomText;
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
@ -53,7 +39,6 @@ protected:
|
|||
BOOL m_bActive; // Is the dropdown active?
|
||||
CRect m_ArrowRect;
|
||||
int m_nColor;
|
||||
COLORREF m_crColor;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
|
@ -67,9 +52,4 @@ protected:
|
|||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_COLOURPICKER_H__D0B75901_9830_11D1_9C0F_00A0243D1382__INCLUDED_)
|
||||
#endif // _CLRPICK_H_
|
||||
|
|
|
@ -58,9 +58,7 @@ protected:
|
|||
int m_nBoxSize, m_nMargin;
|
||||
int m_nCurrentSel;
|
||||
int m_nChosenColorSel;
|
||||
BOOL m_bDefaultText;
|
||||
BOOL m_bCustomText;
|
||||
CRect m_CustomTextRect, m_DefaultTextRect, m_WindowRect;
|
||||
CRect m_WindowRect;
|
||||
CFont m_Font;
|
||||
CPalette m_Palette;
|
||||
int m_nInitialColor, m_nColor;
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
//
|
||||
// LeoCAD configuration
|
||||
//
|
||||
// Auto-generated file, DO NOT EDIT
|
||||
//
|
||||
|
||||
#ifndef _CONFIG_H_
|
||||
#define _CONFIG_H_
|
||||
|
||||
#define LC_VERSION_MAJOR 0
|
||||
#define LC_VERSION_MINOR 76
|
||||
#define LC_VERSION_PATCH 2
|
||||
#define LC_VERSION_MINOR 77
|
||||
#define LC_VERSION_PATCH 0
|
||||
#define LC_VERSION_OSNAME "Windows"
|
||||
#define LC_VERSION_TEXT "0.76.2"
|
||||
#define LC_VERSION_TEXT "0.77"
|
||||
#define LC_VERSION_TAG ""
|
||||
#define LC_INSTALL_PREFIX "C:\\leocad"
|
||||
#define LC_POINTER_TO_INT(p) ((lcint32)(p))
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
#ifndef _PRINT_H_
|
||||
#define _PRINT_H_
|
||||
|
||||
BOOL CALLBACK _AfxAbortProc(HDC, int);
|
||||
UINT AFXAPI AfxGetFileTitle(LPCTSTR lpszPathName, LPTSTR lpszTitle, UINT nMax);
|
||||
|
||||
#define AFX_IDD_PRINTDLG 30722
|
||||
|
||||
typedef struct {
|
||||
struct PRINT_PARAMS
|
||||
{
|
||||
CWnd* pParent;
|
||||
CFrameWndEx* pMainFrame;
|
||||
} PRINT_PARAMS;
|
||||
};
|
||||
|
||||
class CPrintingDialog : public CDialog
|
||||
{
|
||||
|
@ -24,3 +28,4 @@ public:
|
|||
UINT PrintCatalogFunction (LPVOID pv);
|
||||
UINT PrintPiecesFunction (LPVOID pv);
|
||||
|
||||
#endif // _PRINT_H_
|
||||
|
|
Loading…
Reference in a new issue