Skip to content

Commit

Permalink
2.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsankamrani committed Dec 21, 2023
1 parent 269c6f9 commit f972f97
Show file tree
Hide file tree
Showing 31 changed files with 479 additions and 37 deletions.
Binary file not shown.
Binary file not shown.
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.9.5
Vanda Engine 2.9.6
Copyright (C) 2023 Ehsan Kamrani

www.vanda3d.org
Expand Down
Binary file not shown.
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.9.5 (", newProjectName, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.9.6 (", 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.9.5 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.9.6 (", 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 @@ -7638,6 +7638,216 @@ CInt SetDirectionalShadowLight(lua_State* L)
return 0;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowAlgorithm() will be executed", COLOR_GREEN);
return 0;
}

CChar algorithm[MAX_NAME_SIZE];

if (g_shadowProperties.m_shadowType == eSHADOW_SINGLE_HL)
{
Cpy(algorithm, "SHADOW_SINGLE_HL");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_SINGLE)
{
Cpy(algorithm, "SHADOW_SINGLE");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_MULTI_LEAK)
{
Cpy(algorithm, "SHADOW_MULTI_LEAK");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_MULTI_NOLEAK)
{
Cpy(algorithm, "SHADOW_MULTI_NOLEAK");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_PCF)
{
Cpy(algorithm, "SHADOW_PCF");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_PCF_TRILIN)
{
Cpy(algorithm, "SHADOW_PCF_TRILIN");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_PCF_4TAP)
{
Cpy(algorithm, "SHADOW_PCF_4TAP");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_PCF_8TAP)
{
Cpy(algorithm, "SHADOW_PCF_8TAP");
}
else if (g_shadowProperties.m_shadowType == eSHADOW_PCF_GAUSSIAN)
{
Cpy(algorithm, "SHADOW_PCF_GAUSSIAN");
}

lua_pushstring(L, algorithm);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowNumberOfSplits() will be executed", COLOR_GREEN);
return 0;
}

CInt splits = 0;

if (g_shadowProperties.m_shadowSplits == eSHADOW_1_SPLIT)
{
splits = 1;
}
else if (g_shadowProperties.m_shadowSplits == eSHADOW_2_SPLITS)
{
splits = 2;
}
else if (g_shadowProperties.m_shadowSplits == eSHADOW_3_SPLITS)
{
splits = 3;
}
else if (g_shadowProperties.m_shadowSplits == eSHADOW_4_SPLITS)
{
splits = 4;
}

lua_pushinteger(L, splits);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowWeightOfSplits() will be executed", COLOR_GREEN);
return 0;
}

CFloat value = g_shadowProperties.m_shadowSplitWeight;

lua_pushnumber(L, value);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowNearClipPlane() will be executed", COLOR_GREEN);
return 0;
}

CFloat value = g_shadowProperties.m_shadowNearClipPlane;

lua_pushnumber(L, value);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowFarClipPlane() will be executed", COLOR_GREEN);
return 0;
}

CFloat value = g_shadowProperties.m_shadowFarClipPlane;

lua_pushnumber(L, value);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowNumberOfSplits() will be executed", COLOR_GREEN);
return 0;
}

CInt resolution = 0;

if (g_shadowProperties.m_shadowResolution == eSHADOW_1024)
{
resolution = 1024;
}
else if (g_shadowProperties.m_shadowResolution == eSHADOW_2048)
{
resolution = 2048;
}
else if (g_shadowProperties.m_shadowResolution == eSHADOW_4096)
{
resolution = 4096;
}

lua_pushinteger(L, resolution);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowIntensity() will be executed", COLOR_GREEN);
return 0;
}

CFloat value = g_shadowProperties.m_intensity;

lua_pushnumber(L, value);

return 1;
}

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

if (g_editorMode == eMODE_PREFAB || g_editorMode == eMODE_GUI)
{
PrintInfo("\nGetDirectionalShadowLight() will be executed", COLOR_GREEN);
return 0;
}

lua_pushstring(L, g_shadowProperties.m_directionalLightName);

return 1;
}


CInt SetLightAmbient(lua_State* L)
{
if (g_testScript)
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.9.5");
zipClose(zipOpen, "Vanda Engine 2.9.6");
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.9.5");
//zipClose(zf, "Vanda Engine 2.9.6");
//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.9.5");
zipClose(zf, "Vanda Engine 2.9.6");
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.9.5");
zipClose(zf, "Vanda Engine 2.9.6");
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.9.5");
zipClose(zf,"Vanda Engine 2.9.6");
free(buf);
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ CScriptEditorAddFunction::CScriptEditorAddFunction(CWnd* pParent /*=NULL*/)
Cpy(SetDirectionalShadowIntensity, "SetDirectionalShadowIntensity(float shadowIntensity)");
Cpy(SetDirectionalShadowLight, "SetDirectionalShadowLight(string directionalLightName)");

Cpy(GetDirectionalShadowAlgorithm, "string GetDirectionalShadowAlgorithm()");
Cpy(GetDirectionalShadowNumberOfSplits, "int GetDirectionalShadowNumberOfSplits()");
Cpy(GetDirectionalShadowWeightOfSplits, "double GetDirectionalShadowWeightOfSplits()");
Cpy(GetDirectionalShadowNearClipPlane, "double GetDirectionalShadowNearClipPlane()");
Cpy(GetDirectionalShadowFarClipPlane, "double GetDirectionalShadowFarClipPlane()");
Cpy(GetDirectionalShadowResolution, "int GetDirectionalShadowResolution()");
Cpy(GetDirectionalShadowIntensity, "double GetDirectionalShadowIntensity()");
Cpy(GetDirectionalShadowLight, "string GetDirectionalShadowLight()");

Cpy(SetLightAmbient, "SetLightAmbient(string lightObjectName, float red, float green, float blue)");
Cpy(SetLightDiffuse, "SetLightDiffuse(string lightObjectName, float red, float green, float blue)");
Cpy(SetLightSpecular, "SetLightSpecular(string lightObjectName, float red, float green, float blue)");
Expand Down Expand Up @@ -2582,7 +2591,38 @@ void CScriptEditorAddFunction::OnLvnItemchangedListFunctions(NMHDR *pNMHDR, LRES
{
m_richFunctionName.SetWindowTextA(GetCharacterControllerJumpPower);
}

else if (Cmp(szBuffer, "GetDirectionalShadowAlgorithm"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowAlgorithm);
}
else if (Cmp(szBuffer, "GetDirectionalShadowNumberOfSplits"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowNumberOfSplits);
}
else if (Cmp(szBuffer, "GetDirectionalShadowWeightOfSplits"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowWeightOfSplits);
}
else if (Cmp(szBuffer, "GetDirectionalShadowNearClipPlane"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowNearClipPlane);
}
else if (Cmp(szBuffer, "GetDirectionalShadowFarClipPlane"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowFarClipPlane);
}
else if (Cmp(szBuffer, "GetDirectionalShadowResolution"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowResolution);
}
else if (Cmp(szBuffer, "GetDirectionalShadowIntensity"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowIntensity);
}
else if (Cmp(szBuffer, "GetDirectionalShadowLight"))
{
m_richFunctionName.SetWindowTextA(GetDirectionalShadowLight);
}

CInt end = m_richFunctionName.GetWindowTextLengthA();
m_richFunctionName.SetSel(0, end);
Expand Down Expand Up @@ -2728,6 +2768,15 @@ BOOL CScriptEditorAddFunction::OnInitDialog()
InsertItem("SetDirectionalShadowIntensity");
InsertItem("SetDirectionalShadowLight");

InsertItem("GetDirectionalShadowAlgorithm");
InsertItem("GetDirectionalShadowNumberOfSplits");
InsertItem("GetDirectionalShadowWeightOfSplits");
InsertItem("GetDirectionalShadowNearClipPlane");
InsertItem("GetDirectionalShadowFarClipPlane");
InsertItem("GetDirectionalShadowResolution");
InsertItem("GetDirectionalShadowIntensity");
InsertItem("GetDirectionalShadowLight");

InsertItem("SetLightAmbient");
InsertItem("SetLightDiffuse");
InsertItem("SetLightSpecular");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ class CScriptEditorAddFunction : public CDialog
CChar SetDirectionalShadowIntensity[MAX_URI_SIZE];
CChar SetDirectionalShadowLight[MAX_URI_SIZE];

CChar GetDirectionalShadowAlgorithm[MAX_URI_SIZE];
CChar GetDirectionalShadowNumberOfSplits[MAX_URI_SIZE];
CChar GetDirectionalShadowWeightOfSplits[MAX_URI_SIZE];
CChar GetDirectionalShadowNearClipPlane[MAX_URI_SIZE];
CChar GetDirectionalShadowFarClipPlane[MAX_URI_SIZE];
CChar GetDirectionalShadowResolution[MAX_URI_SIZE];
CChar GetDirectionalShadowIntensity[MAX_URI_SIZE];
CChar GetDirectionalShadowLight[MAX_URI_SIZE];

CChar SetLightAmbient[MAX_URI_SIZE];
CChar SetLightDiffuse[MAX_URI_SIZE];
CChar SetLightSpecular[MAX_URI_SIZE];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ static void LuaRegisterFunctions(lua_State* L)
lua_register(L, "SetDirectionalShadowIntensity", SetDirectionalShadowIntensity);
lua_register(L, "SetDirectionalShadowLight", SetDirectionalShadowLight);

lua_register(L, "GetDirectionalShadowAlgorithm", GetDirectionalShadowAlgorithm);
lua_register(L, "GetDirectionalShadowNumberOfSplits", GetDirectionalShadowNumberOfSplits);
lua_register(L, "GetDirectionalShadowWeightOfSplits", GetDirectionalShadowWeightOfSplits);
lua_register(L, "GetDirectionalShadowNearClipPlane", GetDirectionalShadowNearClipPlane);
lua_register(L, "GetDirectionalShadowFarClipPlane", GetDirectionalShadowFarClipPlane);
lua_register(L, "GetDirectionalShadowResolution", GetDirectionalShadowResolution);
lua_register(L, "GetDirectionalShadowIntensity", GetDirectionalShadowIntensity);
lua_register(L, "GetDirectionalShadowLight", GetDirectionalShadowLight);

lua_register(L, "SetLightAmbient", SetLightAmbient);
lua_register(L, "SetLightDiffuse", SetLightDiffuse);
lua_register(L, "SetLightSpecular", SetLightSpecular);
Expand Down
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.9.5 (", szBuffer, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.9.6 (", szBuffer, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngineDlg->SetWindowTextA(temp);
//save the changes to projects.dat
FILE *ProjectsFilePtr;
Expand Down
Loading

0 comments on commit f972f97

Please sign in to comment.