Skip to content

Commit

Permalink
2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsankamrani committed Jul 16, 2023
1 parent 5ddafde commit 9bd3e6c
Show file tree
Hide file tree
Showing 28 changed files with 457 additions and 37 deletions.
Binary file not shown.
Binary file modified Vanda Engine Editor/Debug/Assets/Engine/Publish/publish.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Vanda Engine Editor/Debug/Readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Vanda Engine 2.5.0
Vanda Engine 2.6.0
Copyright (C) 2023 Ehsan Kamrani

www.vanda3d.org
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void CEditProjectProperties::OnOK()
}

CChar temp[256];
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.5.0 (", newProjectName, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.6.0 (", newProjectName, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngineDlg->SetWindowTextA(temp);

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

CChar temp[256];
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.5.0 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.6.0 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngineDlg->SetWindowTextA(temp);

//create new directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30223,6 +30223,198 @@ CInt ResumeUpdateEventOfEngineCamera(lua_State* L)
return 0;
}

CInt SetTerrainAmbient(lua_State* L)
{
if (g_testScript)
return 0;

int argc = lua_gettop(L);
if (argc < 3)
{
PrintInfo("\nPlease specify 3 arguments for SetTerrainAmbient()", COLOR_RED);
return 0;
}

CBool foundColorError = CFalse;
CFloat R = (CFloat)lua_tonumber(L, 1);
if (R < 0.0f || R > 1.0f)
{
PrintInfo("\nFirst argument of SetTerrainAmbient() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

CFloat G = (CFloat)lua_tonumber(L, 2);
if (G < 0.0f || G > 1.0f)
{
PrintInfo("\nSecond argument of SetTerrainAmbient() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

CFloat B = (CFloat)lua_tonumber(L, 3);
if (B < 0.0f || B > 1.0f)
{
PrintInfo("\nThird argument of SetTerrainAmbient() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

if (foundColorError)
return 0;

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
CChar message[MAX_URI_SIZE];
sprintf(message, "\nSetTerrainAmbient(%.2f, %.2f, %.2f) will be executed for terrain object", R, G, B);
PrintInfo(message, COLOR_GREEN);
return 0;
}

CFloat Color[4] = { R, G, B, 1.0f };

if (g_terrain)
g_terrain->SetAmbientColor(Color);

return 0;
}

CInt SetTerrainDiffuse(lua_State* L)
{
if (g_testScript)
return 0;

int argc = lua_gettop(L);
if (argc < 3)
{
PrintInfo("\nPlease specify 3 arguments for SetTerrainDiffuse()", COLOR_RED);
return 0;
}

CBool foundColorError = CFalse;
CFloat R = (CFloat)lua_tonumber(L, 1);
if (R < 0.0f || R > 1.0f)
{
PrintInfo("\nFirst argument of SetTerrainDiffuse() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

CFloat G = (CFloat)lua_tonumber(L, 2);
if (G < 0.0f || G > 1.0f)
{
PrintInfo("\nSecond argument of SetTerrainDiffuse() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

CFloat B = (CFloat)lua_tonumber(L, 3);
if (B < 0.0f || B > 1.0f)
{
PrintInfo("\nThird argument of SetTerrainDiffuse() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

if (foundColorError)
return 0;

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
CChar message[MAX_URI_SIZE];
sprintf(message, "\nSetTerrainDiffuse(%.2f, %.2f, %.2f) will be executed for terrain object", R, G, B);
PrintInfo(message, COLOR_GREEN);
return 0;
}

CFloat Color[4] = { R, G, B, 1.0f };

if (g_terrain)
g_terrain->SetDiffuseColor(Color);

return 0;
}

CInt SetTerrainSpecular(lua_State* L)
{
if (g_testScript)
return 0;

int argc = lua_gettop(L);
if (argc < 3)
{
PrintInfo("\nPlease specify 3 arguments for SetTerrainSpecular()", COLOR_RED);
return 0;
}

CBool foundColorError = CFalse;
CFloat R = (CFloat)lua_tonumber(L, 1);
if (R < 0.0f || R > 1.0f)
{
PrintInfo("\nFirst argument of SetTerrainSpecular() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

CFloat G = (CFloat)lua_tonumber(L, 2);
if (G < 0.0f || G > 1.0f)
{
PrintInfo("\nSecond argument of SetTerrainSpecular() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

CFloat B = (CFloat)lua_tonumber(L, 3);
if (B < 0.0f || B > 1.0f)
{
PrintInfo("\nThird argument of SetTerrainSpecular() must be between 0.0 and 1.0", COLOR_RED);
foundColorError = CTrue;
}

if (foundColorError)
return 0;

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
CChar message[MAX_URI_SIZE];
sprintf(message, "\nSetTerrainSpecular(%.2f, %.2f, %.2f) will be executed for terrain object", R, G, B);
PrintInfo(message, COLOR_GREEN);
return 0;
}

CFloat Color[4] = { R, G, B, 1.0f };

if (g_terrain)
g_terrain->SetSpecularColor(Color);

return 0;
}

CInt SetTerrainShininess(lua_State* L)
{
if (g_testScript)
return 0;

int argc = lua_gettop(L);
if (argc < 1)
{
PrintInfo("\nPlease specify 1 argument for SetTerrainShininess()", COLOR_RED);
return 0;
}

CFloat shininess = (CFloat)lua_tonumber(L, 1);
if (shininess < 0.0f)
{
PrintInfo("\nSetTerrainShininess Error: shininess must be greater than 0.0", COLOR_RED);
return 0;
}

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
CChar message[MAX_URI_SIZE];
sprintf(message, "\nSetTerrainShininess(%.2f) will be executed for terrain object", shininess);
PrintInfo(message, COLOR_GREEN);
return 0;
}

if (g_terrain)
g_terrain->SetShininess(shininess);

return 0;
}

CBool CMultipleWindows::firstIdle = CTrue;
CChar CMultipleWindows::currentIdleName[MAX_NAME_SIZE];

Expand Down
10 changes: 5 additions & 5 deletions Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ CInt CScene::WriteZipFile(CChar* zipFileName, CChar* fileInZipName, CChar* fileI
CChar temp[MAX_NAME_SIZE];
sprintf(temp, "\n%s %s %s", "Error in opening",fileInZipPath, "in zipfile");
zipCloseFileInZip(zf);
zipClose(zipOpen, "Vanda Engine 2.5.0");
zipClose(zipOpen, "Vanda Engine 2.6.0");
free(buf);
return -1;
}
Expand All @@ -157,7 +157,7 @@ CInt CScene::WriteZipFile(CChar* zipFileName, CChar* fileInZipName, CChar* fileI
//sprintf(temp, "\n%s %s %s", "Error in opening",fileInZipPath, "for reading");
//PrintInfo( temp, COLOR_RED );
//zipCloseFileInZip(zf);
//zipClose(zf, "Vanda Engine 2.5.0");
//zipClose(zf, "Vanda Engine 2.6.0");
//free(buf);
//return -1;
// }
Expand All @@ -173,7 +173,7 @@ CInt CScene::WriteZipFile(CChar* zipFileName, CChar* fileInZipName, CChar* fileI
CChar temp[MAX_NAME_SIZE];
sprintf(temp, "\n%s%s", "Error in reading ",fileInZipPath);
zipCloseFileInZip(zf);
zipClose(zf, "Vanda Engine 2.5.0");
zipClose(zf, "Vanda Engine 2.6.0");
free(buf);
return -1;
}
Expand All @@ -188,7 +188,7 @@ CInt CScene::WriteZipFile(CChar* zipFileName, CChar* fileInZipName, CChar* fileI

sprintf( temp, "\n%s%s%s", "Error in writing ", fileInZipPath, " in the zipfile");
zipCloseFileInZip(zf);
zipClose(zf, "Vanda Engine 2.5.0");
zipClose(zf, "Vanda Engine 2.6.0");
free(buf);
return -1;
}
Expand All @@ -198,7 +198,7 @@ CInt CScene::WriteZipFile(CChar* zipFileName, CChar* fileInZipName, CChar* fileI
if (fin)
fclose(fin);
zipCloseFileInZip(zf);
zipClose(zf,"Vanda Engine 2.5.0");
zipClose(zf,"Vanda Engine 2.6.0");
free(buf);
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ CScriptEditorAddFunction::CScriptEditorAddFunction(CWnd* pParent /*=NULL*/)
Cpy(ResumeUpdateEventOf3DSound, "ResumeUpdateEventOf3DSound(string 3DSoundName)");
Cpy(ResumeUpdateEventOfAmbientSound, "ResumeUpdateEventOfAmbientSound(string ambientSoundName)");
Cpy(ResumeUpdateEventOfEngineCamera, "ResumeUpdateEventOfEngineCamera(string engineCameraName)");

//Terrain
Cpy(SetTerrainAmbient, "SetTerrainAmbient(float red, float green, float blue)");
Cpy(SetTerrainDiffuse, "SetTerrainDiffuse(float red, float green, float blue)");
Cpy(SetTerrainSpecular, "SetTerrainSpecular(float red, float green, float blue)");
Cpy(SetTerrainShininess, "SetTerrainShininess(float shininess)");

}

CScriptEditorAddFunction::~CScriptEditorAddFunction()
Expand Down Expand Up @@ -2101,7 +2108,22 @@ void CScriptEditorAddFunction::OnLvnItemchangedListFunctions(NMHDR *pNMHDR, LRES
{
m_richFunctionName.SetWindowTextA(ResumeUpdateEventOfEngineCamera);
}

else if (Cmp(szBuffer, "SetTerrainAmbient"))
{
m_richFunctionName.SetWindowTextA(SetTerrainAmbient);
}
else if (Cmp(szBuffer, "SetTerrainDiffuse"))
{
m_richFunctionName.SetWindowTextA(SetTerrainDiffuse);
}
else if (Cmp(szBuffer, "SetTerrainSpecular"))
{
m_richFunctionName.SetWindowTextA(SetTerrainSpecular);
}
else if (Cmp(szBuffer, "SetTerrainShininess"))
{
m_richFunctionName.SetWindowTextA(SetTerrainShininess);
}

CInt end = m_richFunctionName.GetWindowTextLengthA();
m_richFunctionName.SetSel(0, end);
Expand Down Expand Up @@ -2594,6 +2616,12 @@ BOOL CScriptEditorAddFunction::OnInitDialog()
InsertItem("ResumeUpdateEventOfAmbientSound");
InsertItem("ResumeUpdateEventOfEngineCamera");

//terrain
InsertItem("SetTerrainAmbient");
InsertItem("SetTerrainDiffuse");
InsertItem("SetTerrainSpecular");
InsertItem("SetTerrainShininess");

m_listFunctions.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
m_listFunctions.SetSelectionMark(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,11 @@ class CScriptEditorAddFunction : public CDialog
CChar ResumeUpdateEventOfAmbientSound[MAX_URI_SIZE];
CChar ResumeUpdateEventOfEngineCamera[MAX_URI_SIZE];

CChar SetTerrainAmbient[MAX_URI_SIZE];
CChar SetTerrainDiffuse[MAX_URI_SIZE];
CChar SetTerrainSpecular[MAX_URI_SIZE];
CChar SetTerrainShininess[MAX_URI_SIZE];

CImageList m_image;

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,4 +540,9 @@ static void LuaRegisterFunctions(lua_State* L)
lua_register(L, "ResumeUpdateEventOf3DSound", ResumeUpdateEventOf3DSound);
lua_register(L, "ResumeUpdateEventOfAmbientSound", ResumeUpdateEventOfAmbientSound);
lua_register(L, "ResumeUpdateEventOfEngineCamera", ResumeUpdateEventOfEngineCamera);

lua_register(L, "SetTerrainAmbient", SetTerrainAmbient);
lua_register(L, "SetTerrainDiffuse", SetTerrainDiffuse);
lua_register(L, "SetTerrainSpecular", SetTerrainSpecular);
lua_register(L, "SetTerrainShininess", SetTerrainShininess);
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void CSetCurrentProject::OnOK()
}

CChar temp[256];
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.5.0 (", szBuffer, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.6.0 (", szBuffer, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngineDlg->SetWindowTextA(temp);
//save the changes to projects.dat
FILE *ProjectsFilePtr;
Expand Down
Binary file modified Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.aps
Binary file not shown.
8 changes: 4 additions & 4 deletions Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2882,7 +2882,7 @@ BEGIN
LTEXT "Do not show this dialog at startup",IDC_STATIC,20,151,155,10
CONTROL "Tick",IDC_WELCOME_BUTTON_UNCHECK,"Button",BS_OWNERDRAW | WS_TABSTOP,5,149,12,12
CONTROL IDB_BITMAP7,IDC_STATIC,"Static",SS_BITMAP,2,3,77,19
LTEXT "Version 2.5.0",IDC_STATIC,7,33,60,8
LTEXT "Version 2.6.0",IDC_STATIC,7,33,60,8
LTEXT "� 2023 Ehsan Kamrani",IDC_STATIC,7,50,126,9
CONTROL "Tutorials",IDDONATE,"Button",BS_OWNERDRAW | WS_TABSTOP,15,91,52,16
LTEXT "To see the demo, please go to File | Open menu.",IDC_STATIC,9,69,167,9
Expand Down Expand Up @@ -3042,7 +3042,7 @@ CAPTION "About Vanda Engine"
FONT 9, "Century Gothic", 400, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,241,114,50,16,WS_GROUP
LTEXT "VandaEngine Version 2.5.0",IDC_STATIC,103,7,123,8,SS_NOPREFIX
LTEXT "VandaEngine Version 2.6.0",IDC_STATIC,103,7,123,8,SS_NOPREFIX
CONTROL IDB_BITMAP_SCENE_LIST,IDC_STATIC,"Static",SS_BITMAP,21,79,59,17
CONTROL IDB_BITMAP1,IDC_STATIC,"Static",SS_BITMAP,83,79,67,17
CONTROL IDB_BITMAP_OPENAL_LOGO,IDC_STATIC,"Static",SS_BITMAP,153,73,59,27
Expand Down Expand Up @@ -3614,12 +3614,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Ehsan Kamrani "
VALUE "FileDescription", "Vanda Engine"
VALUE "FileVersion", "2.5.0"
VALUE "FileVersion", "2.6.0"
VALUE "internalName", "VandaEngine.exe"
VALUE "LegalCopyright", "(c) 2015 Ehsan Kamrani . All rights reserved."
VALUE "OriginalFilename", "VandaEngine.exe"
VALUE "ProductName", " Vanda Engine"
VALUE "ProductVersion", "2.5.0"
VALUE "ProductVersion", "2.6.0"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading

0 comments on commit 9bd3e6c

Please sign in to comment.