Skip to content

Commit

Permalink
2.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsankamrani committed Jun 6, 2023
1 parent e14c8a0 commit 847ef4b
Show file tree
Hide file tree
Showing 50 changed files with 239 additions and 41 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.4.4
Vanda Engine 2.4.5
Copyright (C) 2023 Ehsan Kamrani

www.vanda3d.org
Expand Down
15 changes: 14 additions & 1 deletion Vanda Engine Editor/VandaEngineEditor/AddLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,20 @@ void CAddLight::OnOK()
}
}
}
// TODO: Add your specialized code here and/or call the base class

if (!m_strLightName.IsEmpty())
{
CChar name[MAX_NAME_SIZE];
Cpy(name, (LPCSTR)m_strLightName);
StringToUpper(name);

if (Cmp(name, "THIS"))
{
MessageBox("'this' is a reserved name. Please select another name!", "Vanda Engine Error", MB_OK | MB_ICONERROR);
return;
}
}

switch ( m_lightType )
{
case eLIGHTTYPE_POINT:
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Vanda Engine Editor/VandaEngineEditor/AudioEngine/3DSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ CVoid C3DSound::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -190,6 +191,7 @@ CVoid C3DSound::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ CVoid CAmbientSound::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -149,6 +150,7 @@ CVoid CAmbientSound::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
6 changes: 6 additions & 0 deletions Vanda Engine Editor/VandaEngineEditor/Common/Prefab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ CVoid CInstancePrefab::InitScript(CBool reset)
{
g_currentInstancePrefab = this;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -126,6 +127,7 @@ CVoid CInstancePrefab::UpdateScript()
{
g_currentInstancePrefab = this;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand All @@ -143,6 +145,7 @@ CVoid CInstancePrefab::OnTriggerEnterScript(CChar *otherActorName)
{
g_currentInstancePrefab = this;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnTriggerEnter");
if (lua_isfunction(m_lua, -1))
Expand All @@ -162,6 +165,7 @@ CVoid CInstancePrefab::OnTriggerStayScript(CChar *otherActorName)
{
g_currentInstancePrefab = this;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnTriggerStay");
if (lua_isfunction(m_lua, -1))
Expand All @@ -180,6 +184,7 @@ CVoid CInstancePrefab::OnTriggerExitScript(CChar *otherActorName)
{
g_currentInstancePrefab = this;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnTriggerExit");
if (lua_isfunction(m_lua, -1))
Expand All @@ -198,6 +203,7 @@ CVoid CInstancePrefab::OnSelectScript()
{
g_currentInstancePrefab = this;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnSelect");
if (lua_isfunction(m_lua, -1))
Expand Down
2 changes: 2 additions & 0 deletions Vanda Engine Editor/VandaEngineEditor/Common/VSceneScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CVoid CVSceneScript::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -53,6 +54,7 @@ CVoid CVSceneScript::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
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.4.4 (", newProjectName, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", 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.4.4 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", newProject->m_name, " - ", m_currentVSceneNameWithoutDot, ")");
ex_pVandaEngineDlg->SetWindowTextA(temp);

//create new directory
Expand Down
3 changes: 3 additions & 0 deletions Vanda Engine Editor/VandaEngineEditor/GUIEngine/GUIButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ CVoid CGUIButton::OnSelectMouseLButtonDownScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnSelectMouseLButtonDown");
if (lua_isfunction(m_lua, -1))
Expand All @@ -414,6 +415,7 @@ CVoid CGUIButton::OnSelectMouseRButtonDownScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnSelectMouseRButtonDown");
if (lua_isfunction(m_lua, -1))
Expand All @@ -431,6 +433,7 @@ CVoid CGUIButton::OnSelectMouseEnterScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "OnSelectMouseEnter");
if (lua_isfunction(m_lua, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ CVoid CInstanceCamera::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -240,6 +241,7 @@ CVoid CInstanceCamera::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ CVoid CLight::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = this;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -672,6 +673,7 @@ CVoid CLight::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = this;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7219,6 +7219,20 @@ CInt SetLightAmbient(lua_State* L)
return 0;
}

if (Cmp(luaToString, "THIS"))
{
if (g_currentLight)
{
g_currentLight->SetAmbient(Color);
}
else
{
PrintInfo("\nSetLightAmbient Error: Couldn't find current light", COLOR_RED);
}

return 0;
}

for (CUInt i = 0; i < g_engineLights.size(); i++)
{
CChar lightName[MAX_NAME_SIZE];
Expand Down Expand Up @@ -7312,6 +7326,20 @@ CInt SetLightDiffuse(lua_State* L)
return 0;
}

if (Cmp(luaToString, "THIS"))
{
if (g_currentLight)
{
g_currentLight->SetDiffuse(Color);
}
else
{
PrintInfo("\nSetLightDiffuse Error: Couldn't find current light", COLOR_RED);
}

return 0;
}

for (CUInt i = 0; i < g_engineLights.size(); i++)
{
CChar lightName[MAX_NAME_SIZE];
Expand Down Expand Up @@ -7405,6 +7433,20 @@ CInt SetLightSpecular(lua_State* L)
return 0;
}

if (Cmp(luaToString, "THIS"))
{
if (g_currentLight)
{
g_currentLight->SetSpecular(Color);
}
else
{
PrintInfo("\nSetLightSpecular Error: Couldn't find current light", COLOR_RED);
}

return 0;
}

for (CUInt i = 0; i < g_engineLights.size(); i++)
{
CChar lightName[MAX_NAME_SIZE];
Expand Down Expand Up @@ -7473,6 +7515,20 @@ CInt SetLightShininess(lua_State* L)
return 0;
}

if (Cmp(luaToString, "THIS"))
{
if (g_currentLight)
{
g_currentLight->SetShininess(shininess);
}
else
{
PrintInfo("\nSetLightShininess Error: Couldn't find current light", COLOR_RED);
}

return 0;
}

for (CUInt i = 0; i < g_engineLights.size(); i++)
{
CChar lightName[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.4.4");
zipClose(zipOpen, "Vanda Engine 2.4.5");
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.4.4");
//zipClose(zf, "Vanda Engine 2.4.5");
//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.4.4");
zipClose(zf, "Vanda Engine 2.4.5");
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.4.4");
zipClose(zf, "Vanda Engine 2.4.5");
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.4.4");
zipClose(zf,"Vanda Engine 2.4.5");
free(buf);
return 1;
}
Expand Down
2 changes: 2 additions & 0 deletions Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Sky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ CVoid CSkyDome::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -316,6 +317,7 @@ CVoid CSkyDome::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ CVoid CWater::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = this;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -940,6 +941,7 @@ CVoid CWater::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = this;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ CVoid CTerrain::InitScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Init");
if (lua_isfunction(m_lua, -1))
Expand All @@ -174,6 +175,7 @@ CVoid CTerrain::UpdateScript()
{
g_currentInstancePrefab = NULL;
g_currentWater = NULL;
g_currentLight = NULL;

lua_getglobal(m_lua, "Update");
if (lua_isfunction(m_lua, -1))
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.4.4 (", szBuffer, " - ", m_currentVSceneNameWithoutDot, ")");
sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", 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.
Loading

0 comments on commit 847ef4b

Please sign in to comment.