Skip to content

Commit

Permalink
1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsankamrani committed Dec 22, 2020
1 parent bec12e5 commit 7dad29f
Show file tree
Hide file tree
Showing 251 changed files with 36,767 additions and 352 deletions.
Binary file modified editor/VandaEngine1.v12.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions editor/VandaEngine1/AddMainCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ void CAddMainCharacter::OnBnClickedOk()

NxExtendedVec3 pos;
pos.x = g_arrowPosition.x;
pos.y = g_arrowPosition.y + g_physXProperties.m_fCapsuleHeight * 0.5f;
pos.y = g_arrowPosition.y + (g_physXProperties.m_fCapsuleHeight * 0.5f) + g_physXProperties.m_fCapsuleRadius + g_physXProperties.m_fCharacterSkinWidth;
pos.z = g_arrowPosition.z;

g_multipleView->m_nx->gControllers->setPosition(pos);
Expand Down Expand Up @@ -1215,7 +1215,7 @@ void CAddMainCharacter::OnBnClickedCancel()

NxExtendedVec3 pos;
pos.x = g_arrowPosition.x;
pos.y = g_arrowPosition.y + g_physXProperties.m_fCapsuleHeight * 0.5f;
pos.y = g_arrowPosition.y + (g_physXProperties.m_fCapsuleHeight * 0.5f) + g_physXProperties.m_fCapsuleRadius + g_physXProperties.m_fCharacterSkinWidth;
pos.z = g_arrowPosition.z;

g_multipleView->m_nx->gControllers->setPosition(pos);
Expand Down
99 changes: 99 additions & 0 deletions editor/VandaEngine1/BackupAllProjects.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// BackupAllProjects.cpp : implementation file
//

#include "stdafx.h"
#include "VandaEngine1.h"
#include "BackupAllProjects.h"
#include "afxdialogex.h"


// CBackupAllProjects dialog

IMPLEMENT_DYNAMIC(CBackupAllProjects, CDialog)

CBackupAllProjects::CBackupAllProjects(CWnd* pParent /*=NULL*/)
: CDialog(CBackupAllProjects::IDD, pParent)
{

}

CBackupAllProjects::~CBackupAllProjects()
{
}

void CBackupAllProjects::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT_DESTINATION, m_editBoxDestination);
}


BEGIN_MESSAGE_MAP(CBackupAllProjects, CDialog)
ON_BN_CLICKED(IDC_BUTTON_DESTINATION, &CBackupAllProjects::OnBnClickedButtonDestination)
ON_BN_CLICKED(IDOK, &CBackupAllProjects::OnBnClickedOk)
END_MESSAGE_MAP()


// CBackupAllProjects message handlers


void CBackupAllProjects::OnBnClickedButtonDestination()
{
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(bi));
TCHAR szDisplayName[MAX_PATH];
szDisplayName[0] = _T('S');

bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = szDisplayName;
bi.lpszTitle = _T("Please select a folder");
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lParam = NULL;
bi.iImage = 0;

LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
TCHAR szPathName[MAX_PATH];
if (NULL != pidl)
{
BOOL bRet = SHGetPathFromIDList(pidl, szPathName);
if (FALSE == bRet)
return;
m_strDestination = (CString)szPathName;
m_editBoxDestination.SetWindowTextA(m_strDestination);
}
}

CChar* CBackupAllProjects::GetSrcPath()
{
return m_srcPath;
}

CChar* CBackupAllProjects::GetDstPath()
{
return m_dstPath;
}

void CBackupAllProjects::OnBnClickedOk()
{
if (m_strDestination.IsEmpty())
{
MessageBox("Please select destination path", "Error", MB_OK | MB_ICONERROR);
return;
}

CChar docPath[MAX_URI_SIZE];
HRESULT result = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, docPath);
if (result != S_OK)
{
PrintInfo("\nCouldn't get the documents folder", COLOR_RED);
return;
}
sprintf(m_srcPath, "%s%s", docPath, "/Vanda/");

sprintf(m_dstPath, "%s%s", (LPCSTR)m_strDestination, "/Vanda/");

CreateWindowsDirectory(m_dstPath);

CDialog::OnOK();
}
35 changes: 35 additions & 0 deletions editor/VandaEngine1/BackupAllProjects.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#pragma once
#include "afxcmn.h"


// CBackupAllProjects dialog

class CBackupAllProjects : public CDialog
{
DECLARE_DYNAMIC(CBackupAllProjects)

public:
CBackupAllProjects(CWnd* pParent = NULL); // standard constructor
virtual ~CBackupAllProjects();

// Dialog Data
enum { IDD = IDD_DIALOG_BACKUP_ALL_PROJECTS };

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

DECLARE_MESSAGE_MAP()

private:
CChar m_srcPath[MAX_URI_SIZE];
CChar m_dstPath[MAX_URI_SIZE];

public:
afx_msg void OnBnClickedButtonDestination();
CRichEditCtrl m_editBoxDestination;
CString m_strDestination;
afx_msg void OnBnClickedOk();

CChar* GetSrcPath();
CChar* GetDstPath();
};
16 changes: 14 additions & 2 deletions editor/VandaEngine1/Common/Prefab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ CInstancePrefab::CInstancePrefab()
m_isSceneVisible[1] = CFalse;
m_isSceneVisible[2] = CFalse;
m_water = NULL;
for (CUInt i = 0; i < 3; i++)
m_scene[i] = NULL;
memset(m_scene, 0, sizeof(m_scene));
m_hasCollider = CFalse;
m_minAABB.x = m_minAABB.y = m_minAABB.z = 100000000.0f;
m_maxAABB.x = m_maxAABB.y = m_maxAABB.z = -100000000.0f;

Expand Down Expand Up @@ -823,6 +823,17 @@ CVoid CInstancePrefab::UpdateBoundingBox(CBool init)
}
}
}
if (GetHasCollider())
{
CScene* scene = GetScene(3);
if (scene)
{
scene->m_sceneRoot->SetLocalMatrix(&m_instanceMatrix);
scene->Update(0.00001);
}
}


CPrefab* prefab = GetPrefab();
CScene* scene = NULL;
if (prefab && prefab->GetHasLod(0))
Expand Down Expand Up @@ -934,6 +945,7 @@ CVoid CInstancePrefab::UpdateBoundingBox(CBool init)

}
}

if (m_water)
UpdateBoundingBoxForWater(m_water->GetHeight());
geo_physx.clear();
Expand Down
12 changes: 11 additions & 1 deletion editor/VandaEngine1/Common/Prefab.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class CInstancePrefab
CVec3f m_scale;
CBool m_isVisible;
CBool m_isSceneVisible[3];
CScene* m_scene[3]; //Up to 3 LODs
CScene* m_scene[4]; //Up to 3 LODs, one PhysX collider
CBool m_hasCollider;
CUInt m_nameIndex;
CVec3f m_minAABB;
CVec3f m_maxAABB;
Expand Down Expand Up @@ -139,6 +140,15 @@ class CInstancePrefab
CChar* GetTempScriptPath() { return m_tempScriptPath; }
CChar* GetTempCurrentScriptPath() { return m_tempCurrentScriptPath; }

CVoid SetHasCollider(CBool set) { m_hasCollider = set; }
CBool GetHasCollider() { return m_hasCollider; }

CVoid SetIsControlledByPhysX(CBool set) { m_isControlledByPhysX = set; }
CVoid SetIsAnimated(CBool set) { m_isAnimated = set; }
CVoid SetIsStatic(CBool set) { m_isStatic = set; }
CVoid SetTotalLights(CBool set) { m_totalLights = set; }
CVoid SetCastShadow(CBool set) { m_castShadow = set; }

};

class CPrefab
Expand Down
11 changes: 11 additions & 0 deletions editor/VandaEngine1/Common/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,28 @@ inline CVoid Cpy( CChar * dest, const CChar * src )

inline CBool ICmp( const CChar * s1, const CChar * s2 )
{
if (!s1 || !s2)
return false;

if ( _stricmp( s1, s2 ) == 0 )
return CTrue;
return CFalse;
}

inline CBool Cmp( const CChar * s1, const CChar * s2 )
{
if (!s1 || !s2)
return false;
if ( strcmp( s1, s2 ) == 0 )
return true;
return false;
}

inline CBool Cmp2( CChar * s1, CChar * s2 )
{
if (!s1 || !s2)
return false;

if ( strcmp( s1, s2 ) == 0 )
return true;
return false;
Expand All @@ -258,6 +266,9 @@ inline CVoid Cpy( CChar * dest, const CChar * src, const CChar endChar )

inline CBool CmpIn( const CChar * s1, const CChar * s2 )
{
if (!s1 || !s2)
return CFalse;

if ( strstr( s1, s2 ) != NULL )
return CTrue;
return CFalse;
Expand Down
9 changes: 9 additions & 0 deletions editor/VandaEngine1/EditMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,15 @@ BOOL CEditMaterial::OnInitDialog()
}

}
else if (m_polyGroup)
{
sprintf(ambientText, "R: %.2f, G: %.2f, B: %.2f", m_polyGroup->GetAmbient()[0], m_polyGroup->GetAmbient()[1], m_polyGroup->GetAmbient()[2]);
sprintf(diffuseText, "R: %.2f, G: %.2f, B: %.2f", m_polyGroup->GetDiffuse()[0], m_polyGroup->GetDiffuse()[1], m_polyGroup->GetDiffuse()[2]);
sprintf(specularText, "R: %.2f, G: %.2f, B: %.2f", m_polyGroup->GetSpecular()[0], m_polyGroup->GetSpecular()[1], m_polyGroup->GetSpecular()[2]);
sprintf(emissionText, "R: %.2f, G: %.2f, B: %.2f", m_polyGroup->GetEmission()[0], m_polyGroup->GetEmission()[1], m_polyGroup->GetEmission()[2]);

}

if (!foundAmbientDifference)
{
m_ambientColor = RGB((CInt)(m_fAmbientColor[0] * 255), (CInt)(m_fAmbientColor[1] * 255), (CInt)(m_fAmbientColor[2] * 255));
Expand Down
4 changes: 2 additions & 2 deletions editor/VandaEngine1/EditProjectProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void CEditProjectProperties::OnOK()
}

CChar temp[256];
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 1.7.0 (", newProjectName, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 1.7.1 (", newProjectName, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngine1Dlg->SetWindowTextA(temp);

//save changes to projects.dat
Expand Down Expand Up @@ -227,7 +227,7 @@ void CEditProjectProperties::OnOK()
}

CChar temp[256];
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 1.7.0 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 1.7.1 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngine1Dlg->SetWindowTextA(temp);

//create new directory
Expand Down
63 changes: 54 additions & 9 deletions editor/VandaEngine1/EditProjectVScenes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,38 @@ void CEditProjectVScenes::OnBnClickedDelete()
m_listVScenes.DeleteItem(nItem);
}


CBitmap* cBmpMask = NULL;

m_VSceneImage.DeleteImageList();
m_VSceneImage.Create((CInt)((CFloat)g_width / 6.0f), (CInt)((CFloat)g_height / 6.0f), ILC_COLOR24, 1, g_VSceneNamesOfCurrentProject.size());

for (CUInt i = 0; i < g_VSceneNamesOfCurrentProject.size(); i++)
{
CChar VScene_str[MAX_NAME_SIZE];
Cpy(VScene_str, g_VSceneNamesOfCurrentProject[i].c_str());
GetWithoutDot(VScene_str);

CChar BitmapPath[MAX_NAME_SIZE];
sprintf(BitmapPath, "%s%s%s%s%s", g_currentProjectPath, VScene_str, "/", VScene_str, ".bmp");

HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), BitmapPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if (hBmp != NULL)
{
CBitmap* cBmp = CBitmap::FromHandle(hBmp);
if (cBmp != NULL)
m_VSceneImage.Add(cBmp, cBmpMask);
cBmp->DeleteObject();
}
}

m_listVScenes.SetImageList(&m_VSceneImage, LVSIL_NORMAL);

for (CUInt i = 0; i < g_VSceneNamesOfCurrentProject.size(); i++)
{
CChar str[MAX_NAME_SIZE];
Cpy(str, g_VSceneNamesOfCurrentProject[i].c_str());
InsertItemToVSceneList(str);
InsertItemToVSceneList(str, i);
}

PrintInfo("\nVScene removed successfully.");
Expand Down Expand Up @@ -323,13 +350,30 @@ BOOL CEditProjectVScenes::OnInitDialog()
RECT tempRect;
m_listVScenes.GetClientRect(&tempRect);

CBitmap cBmp;

CBitmap* cBmpMask = NULL;
m_VSceneImage.Create(80, 80, ILC_COLOR24, 1, 1);

cBmp.LoadBitmap(IDB_BITMAP_DEFAULT_VIN);
m_VSceneImage.Add(&cBmp, cBmpMask);
cBmp.DeleteObject();
m_VSceneImage.DeleteImageList();
m_VSceneImage.Create((CInt)((CFloat)g_width / 6.0f), (CInt)((CFloat)g_height / 6.0f), ILC_COLOR24, 1, g_VSceneNamesOfCurrentProject.size());

for (CUInt i = 0; i < g_VSceneNamesOfCurrentProject.size(); i++)
{
CChar VScene_str[MAX_NAME_SIZE];
Cpy(VScene_str, g_VSceneNamesOfCurrentProject[i].c_str());
GetWithoutDot(VScene_str);

CChar BitmapPath[MAX_NAME_SIZE];
sprintf(BitmapPath, "%s%s%s%s%s", g_currentProjectPath, VScene_str, "/", VScene_str, ".bmp");

HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), BitmapPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if (hBmp != NULL)
{
CBitmap* cBmp = CBitmap::FromHandle(hBmp);
if (cBmp != NULL)
m_VSceneImage.Add(cBmp, cBmpMask);
cBmp->DeleteObject();
}
}

m_listVScenes.SetImageList(&m_VSceneImage, LVSIL_NORMAL);

Expand All @@ -345,19 +389,20 @@ BOOL CEditProjectVScenes::OnInitDialog()
{
CChar str[MAX_NAME_SIZE];
Cpy(str, g_VSceneNamesOfCurrentProject[i].c_str());
InsertItemToVSceneList(str);
InsertItemToVSceneList(str, i);
}

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

CVoid CEditProjectVScenes::InsertItemToVSceneList(CChar* vsceneName)
CVoid CEditProjectVScenes::InsertItemToVSceneList(CChar* vsceneName, CUInt imgIndex)
{
m_VSceneIndex++;
int index = m_VSceneIndex;
LVITEM lvItem;
lvItem.mask = LVIF_TEXT;
lvItem.mask = LVIF_TEXT | LVIF_IMAGE;
lvItem.iImage = imgIndex;
lvItem.iItem = index;
lvItem.iSubItem = 0;
lvItem.pszText = vsceneName;
Expand Down
2 changes: 1 addition & 1 deletion editor/VandaEngine1/EditProjectVScenes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CEditProjectVScenes : public CDialog
public:
afx_msg void OnBnClickedDelete();
afx_msg void OnBnClickedRename();
CVoid InsertItemToVSceneList(CChar* vsceneName);
CVoid InsertItemToVSceneList(CChar* vsceneName, CUInt imgIndex = -1);
void SetState(CBool open);
CBool m_open;
CListCtrl m_listVScenes;
Expand Down
Loading

0 comments on commit 7dad29f

Please sign in to comment.