diff --git a/Vanda Engine Editor/Debug/Assets/Engine/Publish-Debug/publish-debug.exe b/Vanda Engine Editor/Debug/Assets/Engine/Publish-Debug/publish-debug.exe index 7c7a76be..43ce7326 100644 Binary files a/Vanda Engine Editor/Debug/Assets/Engine/Publish-Debug/publish-debug.exe and b/Vanda Engine Editor/Debug/Assets/Engine/Publish-Debug/publish-debug.exe differ diff --git a/Vanda Engine Editor/Debug/Assets/Engine/Publish/publish.exe b/Vanda Engine Editor/Debug/Assets/Engine/Publish/publish.exe index 7ec6989d..5ff9be1d 100644 Binary files a/Vanda Engine Editor/Debug/Assets/Engine/Publish/publish.exe and b/Vanda Engine Editor/Debug/Assets/Engine/Publish/publish.exe differ diff --git a/Vanda Engine Editor/Debug/Readme.txt b/Vanda Engine Editor/Debug/Readme.txt index 54d38858..ec39eba6 100644 --- a/Vanda Engine Editor/Debug/Readme.txt +++ b/Vanda Engine Editor/Debug/Readme.txt @@ -1,4 +1,4 @@ -Vanda Engine 2.4.4 +Vanda Engine 2.4.5 Copyright (C) 2023 Ehsan Kamrani www.vanda3d.org diff --git a/Vanda Engine Editor/VandaEngineEditor/AddLight.cpp b/Vanda Engine Editor/VandaEngineEditor/AddLight.cpp index 30017f5a..20ebb0ec 100644 --- a/Vanda Engine Editor/VandaEngineEditor/AddLight.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/AddLight.cpp @@ -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: diff --git a/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish-Debug/publish-debug.exe b/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish-Debug/publish-debug.exe index 7c7a76be..43ce7326 100644 Binary files a/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish-Debug/publish-debug.exe and b/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish-Debug/publish-debug.exe differ diff --git a/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish/publish.exe b/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish/publish.exe index 7ec6989d..5ff9be1d 100644 Binary files a/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish/publish.exe and b/Vanda Engine Editor/VandaEngineEditor/Assets/Engine/Publish/publish.exe differ diff --git a/Vanda Engine Editor/VandaEngineEditor/AudioEngine/3DSound.cpp b/Vanda Engine Editor/VandaEngineEditor/AudioEngine/3DSound.cpp index a92121f1..50374a41 100644 --- a/Vanda Engine Editor/VandaEngineEditor/AudioEngine/3DSound.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/AudioEngine/3DSound.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/AudioEngine/AmbientSound.cpp b/Vanda Engine Editor/VandaEngineEditor/AudioEngine/AmbientSound.cpp index 51f4b941..86165a17 100644 --- a/Vanda Engine Editor/VandaEngineEditor/AudioEngine/AmbientSound.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/AudioEngine/AmbientSound.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/Common/Prefab.cpp b/Vanda Engine Editor/VandaEngineEditor/Common/Prefab.cpp index a8e06d21..29763eaa 100644 --- a/Vanda Engine Editor/VandaEngineEditor/Common/Prefab.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/Common/Prefab.cpp @@ -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)) @@ -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)) @@ -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)) @@ -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)) @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/Common/VSceneScript.cpp b/Vanda Engine Editor/VandaEngineEditor/Common/VSceneScript.cpp index 43df7733..0acbb79f 100644 --- a/Vanda Engine Editor/VandaEngineEditor/Common/VSceneScript.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/Common/VSceneScript.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/EditProjectProperties.cpp b/Vanda Engine Editor/VandaEngineEditor/EditProjectProperties.cpp index 0a52c1f4..f4f37651 100644 --- a/Vanda Engine Editor/VandaEngineEditor/EditProjectProperties.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/EditProjectProperties.cpp @@ -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 @@ -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 diff --git a/Vanda Engine Editor/VandaEngineEditor/GUIEngine/GUIButton.cpp b/Vanda Engine Editor/VandaEngineEditor/GUIEngine/GUIButton.cpp index 5627cdb8..8d98e818 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GUIEngine/GUIButton.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GUIEngine/GUIButton.cpp @@ -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)) @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Camera.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Camera.cpp index d26647dc..087ee637 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Camera.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Camera.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Light.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Light.cpp index 797858f0..cee58894 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Light.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Light.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/PerspectiveWindow.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/PerspectiveWindow.cpp index 9e5763c4..feb95f82 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/PerspectiveWindow.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/PerspectiveWindow.cpp @@ -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]; @@ -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]; @@ -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]; @@ -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]; diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Scene.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Scene.cpp index 7f6d5a53..08ff0f66 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Scene.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Scene.cpp @@ -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; } @@ -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; // } @@ -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; } @@ -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; } @@ -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; } diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Sky.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Sky.cpp index a208e22a..347206e3 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Sky.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Sky.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Water.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Water.cpp index dd1b240f..2fe6acb4 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Water.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/Water.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/terrain.cpp b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/terrain.cpp index bf73b75d..89d771ad 100644 --- a/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/terrain.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/GraphicsEngine/terrain.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Editor/VandaEngineEditor/SetCurrentProject.cpp b/Vanda Engine Editor/VandaEngineEditor/SetCurrentProject.cpp index 6545ea44..131a5211 100644 --- a/Vanda Engine Editor/VandaEngineEditor/SetCurrentProject.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/SetCurrentProject.cpp @@ -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; diff --git a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.aps b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.aps index 35d1b95a..aac5693c 100644 Binary files a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.aps and b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.aps differ diff --git a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.rc b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.rc index 3d0567ca..10c92bdc 100644 --- a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.rc +++ b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditor.rc @@ -2877,7 +2877,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.4.4",IDC_STATIC,7,33,60,8 + LTEXT "Version 2.4.5",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 @@ -3037,7 +3037,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.4.4",IDC_STATIC,103,7,123,8,SS_NOPREFIX + LTEXT "VandaEngine Version 2.4.5",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 @@ -3609,12 +3609,12 @@ BEGIN BEGIN VALUE "CompanyName", "Ehsan Kamrani " VALUE "FileDescription", "Vanda Engine" - VALUE "FileVersion", "2.4.4" + VALUE "FileVersion", "2.4.5" VALUE "internalName", "VandaEngine.exe" VALUE "LegalCopyright", "(c) 2015 Ehsan Kamrani . All rights reserved." VALUE "OriginalFilename", "VandaEngine.exe" VALUE "ProductName", " Vanda Engine" - VALUE "ProductVersion", "2.4.4" + VALUE "ProductVersion", "2.4.5" END END BLOCK "VarFileInfo" diff --git a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.cpp b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.cpp index da76f335..522bbdf5 100644 --- a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.cpp @@ -27,7 +27,7 @@ #endif //Version = Max.Min.BugFixes; -CInt g_version = 244; +CInt g_version = 245; CChar g_edition[MAX_NAME_SIZE]; CBool g_useOriginalPathOfDAETextures = CFalse; @@ -45,7 +45,7 @@ CChar g_currentProjectPath[MAX_NAME_SIZE]; CScene* g_currentScene = NULL; CInstancePrefab* g_currentInstancePrefab = NULL; CWater* g_currentWater = NULL; -CInstanceLight* g_currentLight = NULL; +CLight* g_currentLight = NULL; C3DSound* g_current3DSound = NULL; CAmbientSound* g_currentAmbientSound = NULL; CTrigger* g_currentTrigger = NULL; @@ -1484,7 +1484,7 @@ BOOL CVandaEngineDlg::OnInitDialog() SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon - SetWindowText(_T("Vanda Engine 2.4.4")); + SetWindowText(_T("Vanda Engine 2.4.5")); // TODO: Add extra initialization here ShowWindow( SW_SHOWMAXIMIZED ); @@ -3066,7 +3066,7 @@ BOOL CVandaEngineDlg::OnInitDialog() } CChar temp[256]; - sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.4 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); + sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); break; @@ -3127,7 +3127,7 @@ BOOL CVandaEngineDlg::OnInitDialog() PrintInfo("\nFatal Error(s) Occured. Go To View > Report", COLOR_RED); } else - PrintInfo( "\nVersion 2.4.4 initialized successfully" ); + PrintInfo( "\nVersion 2.4.5 initialized successfully" ); //CAboutDlg dlgAbout; //dlgAbout.DoModal(); ReleaseCapture(); @@ -3316,7 +3316,7 @@ BOOL CVandaEngineDlg::OnCommand(WPARAM wParam, LPARAM lParam) } CChar temp[256]; - sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.4 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); + sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); break; } @@ -3402,7 +3402,7 @@ BOOL CVandaEngineDlg::OnCommand(WPARAM wParam, LPARAM lParam) g_shareGeometriesBetweenScenes = CFalse; CChar temp[256]; - sprintf(temp, "%s", "Vanda Engine 2.4.4 : Prefab Mode (Untitled)"); + sprintf(temp, "%s", "Vanda Engine 2.4.5 : Prefab Mode (Untitled)"); ex_pVandaEngineDlg->SetWindowTextA(temp); if (g_multipleView->IsPlayGameMode()) @@ -3476,7 +3476,7 @@ BOOL CVandaEngineDlg::OnCommand(WPARAM wParam, LPARAM lParam) SortButtons(); CChar temp[256]; - sprintf(temp, "%s", "Vanda Engine 2.4.4 : GUI Mode (Untitled)"); + sprintf(temp, "%s", "Vanda Engine 2.4.5 : GUI Mode (Untitled)"); ex_pVandaEngineDlg->SetWindowTextA(temp); if (g_multipleView->IsPlayGameMode()) @@ -7809,7 +7809,7 @@ CBool CVandaEngineDlg::OnMenuClickedNew( CBool askQuestion ) PrintInfo("\nScene cleared successfully"); CChar temp[256]; - sprintf(temp, "%s", "Vanda Engine 2.4.4 : GUI Mode (Untitled)"); + sprintf(temp, "%s", "Vanda Engine 2.4.5 : GUI Mode (Untitled)"); ex_pVandaEngineDlg->SetWindowTextA(temp); return CTrue; @@ -8255,7 +8255,7 @@ CBool CVandaEngineDlg::OnMenuClickedNew( CBool askQuestion ) if (g_projects[i]->m_isActive) { CChar temp[256]; - sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.4 (", g_projects[i]->m_name, " - ", "Untitled", ")"); + sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", g_projects[i]->m_name, " - ", "Untitled", ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); break; } @@ -8264,7 +8264,7 @@ CBool CVandaEngineDlg::OnMenuClickedNew( CBool askQuestion ) else if (g_editorMode == eMODE_PREFAB) { CChar temp[256]; - sprintf(temp, "%s", "Vanda Engine 2.4.4 : Prefab Mode (Untitled)"); + sprintf(temp, "%s", "Vanda Engine 2.4.5 : Prefab Mode (Untitled)"); ex_pVandaEngineDlg->SetWindowTextA(temp); } @@ -10017,7 +10017,7 @@ CVoid CVandaEngineDlg::OnMenuClickedSaveGUIAs(CBool askQuestion) g_multipleView->RenderWindow(); //to save screenshot CChar temp[256]; - sprintf(temp, "%s%s%s", "Vanda Engine 2.4.4 : GUI Mode (", g_currentPackageAndGUIName, ")"); + sprintf(temp, "%s%s%s", "Vanda Engine 2.4.5 : GUI Mode (", g_currentPackageAndGUIName, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); if (m_dlgSaveGUIs) @@ -10859,7 +10859,7 @@ CVoid CVandaEngineDlg::OnMenuClickedSavePrefabAs(CBool askQuestion) g_multipleView->RenderWindow(); //to save screenshot CChar temp[256]; - sprintf(temp, "%s%s%s", "Vanda Engine 2.4.4 : Prefab Mode (", g_currentPackageAndPrefabName, ")"); + sprintf(temp, "%s%s%s", "Vanda Engine 2.4.5 : Prefab Mode (", g_currentPackageAndPrefabName, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); if (m_dlgSavePrefabs) @@ -14178,7 +14178,7 @@ CVoid CVandaEngineDlg::OnMenuClickedSaveAs(CBool askQuestion) } CChar temp[256]; - sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.4 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); + sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); break; @@ -15361,7 +15361,7 @@ CBool CVandaEngineDlg::OnMenuClickedOpenGUI() ReleaseCapture(); CChar temp[256]; - sprintf(temp, "%s%s%s", "Vanda Engine 2.4.4 : GUI Mode (", guiAndPackageName, ")"); + sprintf(temp, "%s%s%s", "Vanda Engine 2.4.5 : GUI Mode (", guiAndPackageName, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); } @@ -17127,7 +17127,7 @@ CBool CVandaEngineDlg::OnMenuClickedOpenPrefab() } g_updateOctree = CTrue; CChar temp[256]; - sprintf(temp, "%s%s%s", "Vanda Engine 2.4.4 : Prefab Mode (", prefabAndPackageName, ")"); + sprintf(temp, "%s%s%s", "Vanda Engine 2.4.5 : Prefab Mode (", prefabAndPackageName, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); fclose(filePtr); @@ -19159,7 +19159,7 @@ CBool CVandaEngineDlg::OnMenuClickedOpenVScene(CBool askQuestion) } CChar temp[256]; - sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.4 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); + sprintf(temp, "%s%s%s%s%s", "Vanda Engine 2.4.5 (", g_projects[i]->m_name, " - ", m_currentVSceneNameWithoutDot, ")"); ex_pVandaEngineDlg->SetWindowTextA(temp); break; diff --git a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.h b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.h index a5723646..a9f88850 100644 --- a/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.h +++ b/Vanda Engine Editor/VandaEngineEditor/VandaEngineEditorDlg.h @@ -1147,7 +1147,7 @@ extern CBool g_openNewGUIFromList; extern CScene* g_currentScene; //current scene that we are working on it. extern CInstancePrefab* g_currentInstancePrefab; extern CWater* g_currentWater; -extern CInstanceLight* g_currentLight; +extern CLight* g_currentLight; extern C3DSound* g_current3DSound; extern CAmbientSound* g_currentAmbientSound; extern CTrigger* g_currentTrigger; diff --git a/Vanda Engine Editor/VandaEngineEditor/VideoEngine/Video.cpp b/Vanda Engine Editor/VandaEngineEditor/VideoEngine/Video.cpp index 2c7bf670..023662ee 100644 --- a/Vanda Engine Editor/VandaEngineEditor/VideoEngine/Video.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/VideoEngine/Video.cpp @@ -1274,6 +1274,7 @@ CVoid CVideo::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -1291,6 +1292,7 @@ CVoid CVideo::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) @@ -1318,6 +1320,7 @@ CVoid CVideo::OnExitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnExit"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Editor/VandaEngineEditor/physXEngine/MainCharacter.cpp b/Vanda Engine Editor/VandaEngineEditor/physXEngine/MainCharacter.cpp index 4d3c4394..0bdea130 100644 --- a/Vanda Engine Editor/VandaEngineEditor/physXEngine/MainCharacter.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/physXEngine/MainCharacter.cpp @@ -400,6 +400,7 @@ CVoid CMainCharacter::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -417,6 +418,7 @@ CVoid CMainCharacter::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) @@ -434,6 +436,7 @@ CVoid CMainCharacter::OnTriggerEnterScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerEnter"); if (lua_isfunction(m_lua, -1)) @@ -452,6 +455,7 @@ CVoid CMainCharacter::OnTriggerStayScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerStay"); if (lua_isfunction(m_lua, -1)) @@ -470,6 +474,7 @@ CVoid CMainCharacter::OnTriggerExitScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerExit"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Editor/VandaEngineEditor/physXEngine/Trigger.cpp b/Vanda Engine Editor/VandaEngineEditor/physXEngine/Trigger.cpp index 9e9dbbcc..b03db198 100644 --- a/Vanda Engine Editor/VandaEngineEditor/physXEngine/Trigger.cpp +++ b/Vanda Engine Editor/VandaEngineEditor/physXEngine/Trigger.cpp @@ -168,6 +168,7 @@ CVoid CTrigger::OnTriggerEnterScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerEnter"); if (lua_isfunction(m_lua, -1)) @@ -186,6 +187,7 @@ CVoid CTrigger::OnTriggerStayScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerStay"); if (lua_isfunction(m_lua, -1)) @@ -204,6 +206,7 @@ CVoid CTrigger::OnTriggerExitScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerExit"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Editor/release/Assets/Engine/Publish-Debug/publish-debug.exe b/Vanda Engine Editor/release/Assets/Engine/Publish-Debug/publish-debug.exe index 7c7a76be..43ce7326 100644 Binary files a/Vanda Engine Editor/release/Assets/Engine/Publish-Debug/publish-debug.exe and b/Vanda Engine Editor/release/Assets/Engine/Publish-Debug/publish-debug.exe differ diff --git a/Vanda Engine Editor/release/Assets/Engine/Publish/publish.exe b/Vanda Engine Editor/release/Assets/Engine/Publish/publish.exe index 7ec6989d..5ff9be1d 100644 Binary files a/Vanda Engine Editor/release/Assets/Engine/Publish/publish.exe and b/Vanda Engine Editor/release/Assets/Engine/Publish/publish.exe differ diff --git a/Vanda Engine Editor/release/Readme.txt b/Vanda Engine Editor/release/Readme.txt index 54d38858..ec39eba6 100644 --- a/Vanda Engine Editor/release/Readme.txt +++ b/Vanda Engine Editor/release/Readme.txt @@ -1,4 +1,4 @@ -Vanda Engine 2.4.4 +Vanda Engine 2.4.5 Copyright (C) 2023 Ehsan Kamrani www.vanda3d.org diff --git a/Vanda Engine Win32/Debug/Readme.txt b/Vanda Engine Win32/Debug/Readme.txt index 54d38858..ec39eba6 100644 --- a/Vanda Engine Win32/Debug/Readme.txt +++ b/Vanda Engine Win32/Debug/Readme.txt @@ -1,4 +1,4 @@ -Vanda Engine 2.4.4 +Vanda Engine 2.4.5 Copyright (C) 2023 Ehsan Kamrani www.vanda3d.org diff --git a/Vanda Engine Win32/VandaEngineWin32/AudioEngine/3DSound.cpp b/Vanda Engine Win32/VandaEngineWin32/AudioEngine/3DSound.cpp index 3a461754..6829f1cf 100644 --- a/Vanda Engine Win32/VandaEngineWin32/AudioEngine/3DSound.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/AudioEngine/3DSound.cpp @@ -142,6 +142,7 @@ CVoid C3DSound::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -159,6 +160,7 @@ CVoid C3DSound::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/AudioEngine/AmbientSound.cpp b/Vanda Engine Win32/VandaEngineWin32/AudioEngine/AmbientSound.cpp index 3592b42a..27274a8a 100644 --- a/Vanda Engine Win32/VandaEngineWin32/AudioEngine/AmbientSound.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/AudioEngine/AmbientSound.cpp @@ -131,6 +131,7 @@ CVoid CAmbientSound::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -148,6 +149,7 @@ CVoid CAmbientSound::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/Common/Prefab.cpp b/Vanda Engine Win32/VandaEngineWin32/Common/Prefab.cpp index 0b070c1c..eb087235 100644 --- a/Vanda Engine Win32/VandaEngineWin32/Common/Prefab.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/Common/Prefab.cpp @@ -151,6 +151,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)) @@ -169,6 +170,7 @@ CVoid CInstancePrefab::UpdateScript() { g_currentInstancePrefab = this; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) @@ -186,6 +188,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)) @@ -204,6 +207,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)) @@ -222,6 +226,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)) @@ -240,6 +245,7 @@ CVoid CInstancePrefab::OnSelectScript() { g_currentInstancePrefab = this; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnSelect"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/Common/VSceneScript.cpp b/Vanda Engine Win32/VandaEngineWin32/Common/VSceneScript.cpp index 3119c933..4048a25d 100644 --- a/Vanda Engine Win32/VandaEngineWin32/Common/VSceneScript.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/Common/VSceneScript.cpp @@ -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)) @@ -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)) diff --git a/Vanda Engine Win32/VandaEngineWin32/GUIEngine/GUIButton.cpp b/Vanda Engine Win32/VandaEngineWin32/GUIEngine/GUIButton.cpp index 0eb8da19..c5583d91 100644 --- a/Vanda Engine Win32/VandaEngineWin32/GUIEngine/GUIButton.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/GUIEngine/GUIButton.cpp @@ -288,6 +288,7 @@ CVoid CGUIButton::OnSelectMouseLButtonDownScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnSelectMouseLButtonDown"); if (lua_isfunction(m_lua, -1)) @@ -305,6 +306,7 @@ CVoid CGUIButton::OnSelectMouseRButtonDownScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnSelectMouseRButtonDown"); if (lua_isfunction(m_lua, -1)) @@ -322,6 +324,7 @@ CVoid CGUIButton::OnSelectMouseEnterScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnSelectMouseEnter"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Camera.cpp b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Camera.cpp index 41270804..0d7f06e4 100644 --- a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Camera.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Camera.cpp @@ -151,6 +151,7 @@ CVoid CInstanceCamera::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -168,6 +169,7 @@ CVoid CInstanceCamera::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Light.cpp b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Light.cpp index 7c6d5435..a31fe514 100644 --- a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Light.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Light.cpp @@ -467,6 +467,7 @@ CVoid CLight::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = this; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -484,6 +485,7 @@ CVoid CLight::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = this; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Sky.cpp b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Sky.cpp index 78ff9c59..dd800b6c 100644 --- a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Sky.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Sky.cpp @@ -253,6 +253,7 @@ CVoid CSkyDome::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -270,6 +271,7 @@ CVoid CSkyDome::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Water.cpp b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Water.cpp index ac5d28cd..e3bbd331 100644 --- a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Water.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/Water.cpp @@ -775,6 +775,7 @@ CVoid CWater::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = this; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -792,6 +793,7 @@ CVoid CWater::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = this; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/terrain.cpp b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/terrain.cpp index a79240e6..5b98eb9c 100644 --- a/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/terrain.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/GraphicsEngine/terrain.cpp @@ -156,6 +156,7 @@ CVoid CTerrain::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -173,6 +174,7 @@ CVoid CTerrain::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/Main.cpp b/Vanda Engine Win32/VandaEngineWin32/Main.cpp index 2d110c56..48392061 100644 --- a/Vanda Engine Win32/VandaEngineWin32/Main.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/Main.cpp @@ -4831,6 +4831,20 @@ CInt SetLightAmbient(lua_State* L) CFloat Color[4] = { R, G, B, 1.0f }; + 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]; @@ -4890,6 +4904,20 @@ CInt SetLightDiffuse(lua_State* L) CFloat Color[4] = { R, G, B, 1.0f }; + 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]; @@ -4949,6 +4977,20 @@ CInt SetLightSpecular(lua_State* L) CFloat Color[4] = { R, G, B, 1.0f }; + 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]; @@ -4983,6 +5025,20 @@ CInt SetLightShininess(lua_State* L) CFloat shininess = (CFloat)lua_tonumber(L, 2); + 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]; diff --git a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.aps b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.aps index 91ffcd24..7b6f6e11 100644 Binary files a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.aps and b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.aps differ diff --git a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.cpp b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.cpp index cb7aad78..2237fc2e 100644 --- a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.cpp @@ -22,12 +22,12 @@ class COpenALSoundBuffer; //Edition.MaxVersion.MinVersion.BugFixes; -CInt g_version = 244; +CInt g_version = 245; CChar g_edition[MAX_NAME_SIZE]; CScene* g_currentScene = NULL; CInstancePrefab* g_currentInstancePrefab = NULL; CWater* g_currentWater = NULL; -CInstanceLight* g_currentLight = NULL; +CLight* g_currentLight = NULL; C3DSound* g_current3DSound = NULL; CAmbientSound* g_currentAmbientSound = NULL; CTrigger* g_currentTrigger = NULL; diff --git a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.h b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.h index 5fe29601..9b10bf58 100644 --- a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.h +++ b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.h @@ -35,6 +35,7 @@ #include class CInstanceLight; +class CLight; class CWater; class C3DSound; class CScene; @@ -58,7 +59,7 @@ extern CChar g_edition[MAX_NAME_SIZE]; extern CScene* g_currentScene; //current scene that we are working on it. extern CInstancePrefab* g_currentInstancePrefab; extern CWater* g_currentWater; -extern CInstanceLight* g_currentLight; +extern CLight* g_currentLight; extern C3DSound* g_current3DSound; extern CAmbientSound* g_currentAmbientSound; extern CTrigger* g_currentTrigger; diff --git a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.rc b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.rc index 5d3b72c8..567d395a 100644 --- a/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.rc +++ b/Vanda Engine Win32/VandaEngineWin32/VandaEngineWin32.rc @@ -75,12 +75,12 @@ BEGIN BEGIN VALUE "CompanyName", "Ehsan Kamrani " VALUE "FileDescription", "Vanda Engine" - VALUE "FileVersion", "2.4.4" + VALUE "FileVersion", "2.4.5" VALUE "internalName", "VandaEngine.exe" VALUE "LegalCopyright", "(c) 2023 Vanda Engine. All rights reserved." VALUE "OriginalFilename", "VandaEngine.exe" VALUE "ProductName", " Vanda Engine" - VALUE "ProductVersion", "2.4.4" + VALUE "ProductVersion", "2.4.5" END END BLOCK "VarFileInfo" @@ -101,7 +101,7 @@ CAPTION "About" FONT 8, "System" BEGIN ICON 107,IDC_MYICON,14,9,16,16 - LTEXT "VandaEngine Version 2.4.4",IDC_STATIC,49,10,119,8,SS_NOPREFIX + LTEXT "VandaEngine Version 2.4.5",IDC_STATIC,49,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2023",IDC_STATIC,49,20,119,8 DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP END diff --git a/Vanda Engine Win32/VandaEngineWin32/VideoEngine/Video.cpp b/Vanda Engine Win32/VandaEngineWin32/VideoEngine/Video.cpp index 74cce447..37d5da63 100644 --- a/Vanda Engine Win32/VandaEngineWin32/VideoEngine/Video.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/VideoEngine/Video.cpp @@ -1273,6 +1273,7 @@ CVoid CVideo::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -1290,6 +1291,7 @@ CVoid CVideo::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) @@ -1317,6 +1319,7 @@ CVoid CVideo::OnExitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnExit"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/physXEngine/MainCharacter.cpp b/Vanda Engine Win32/VandaEngineWin32/physXEngine/MainCharacter.cpp index 730e9824..5dc5f966 100644 --- a/Vanda Engine Win32/VandaEngineWin32/physXEngine/MainCharacter.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/physXEngine/MainCharacter.cpp @@ -400,6 +400,7 @@ CVoid CMainCharacter::InitScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Init"); if (lua_isfunction(m_lua, -1)) @@ -417,6 +418,7 @@ CVoid CMainCharacter::UpdateScript() { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "Update"); if (lua_isfunction(m_lua, -1)) @@ -435,6 +437,7 @@ CVoid CMainCharacter::OnTriggerEnterScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerEnter"); if (lua_isfunction(m_lua, -1)) @@ -453,6 +456,7 @@ CVoid CMainCharacter::OnTriggerStayScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerStay"); if (lua_isfunction(m_lua, -1)) @@ -471,6 +475,7 @@ CVoid CMainCharacter::OnTriggerExitScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerExit"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/VandaEngineWin32/physXEngine/Trigger.cpp b/Vanda Engine Win32/VandaEngineWin32/physXEngine/Trigger.cpp index 58e06b8e..04972ea7 100644 --- a/Vanda Engine Win32/VandaEngineWin32/physXEngine/Trigger.cpp +++ b/Vanda Engine Win32/VandaEngineWin32/physXEngine/Trigger.cpp @@ -149,6 +149,7 @@ CVoid CTrigger::OnTriggerEnterScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerEnter"); if (lua_isfunction(m_lua, -1)) @@ -167,6 +168,7 @@ CVoid CTrigger::OnTriggerStayScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerStay"); if (lua_isfunction(m_lua, -1)) @@ -185,6 +187,7 @@ CVoid CTrigger::OnTriggerExitScript(CChar *otherActorName) { g_currentInstancePrefab = NULL; g_currentWater = NULL; + g_currentLight = NULL; lua_getglobal(m_lua, "OnTriggerExit"); if (lua_isfunction(m_lua, -1)) diff --git a/Vanda Engine Win32/release/Readme.txt b/Vanda Engine Win32/release/Readme.txt index 54d38858..ec39eba6 100644 --- a/Vanda Engine Win32/release/Readme.txt +++ b/Vanda Engine Win32/release/Readme.txt @@ -1,4 +1,4 @@ -Vanda Engine 2.4.4 +Vanda Engine 2.4.5 Copyright (C) 2023 Ehsan Kamrani www.vanda3d.org