Jump to content

Josh

Staff
  • Posts

    23,163
  • Joined

  • Last visited

Everything posted by Josh

  1. I don't think it will make any noticeable difference in speed one way or another, but it definitely simplifies the code. If we can get the same thing done in less code that makes the engine more adaptable.
  2. Updated 1.0.2 Package file now name does not count as part of the file path files are loaded from. If you have a Zip file named "data.zip" in your project directory that contains a file "box.gltf" you would load it by calling LoadModel(world, "box.gltf")
  3. Do Windows virtual machines support Vulkan graphics at all?
  4. Shit, I think you are right and the way it was before was better.
  5. Good question. It seemed ridiculous to me to see this in the asset browser tree: Models.zip Models box.gltf I am guessing you are thinking about splitting files up among a lot of arbitrary Zip files for distribution, in which case the file name Models.zip could only be used once...
  6. Added two Lua extensions in 1.0.2: ZenMode.lua adds an option in the View menu to switch to a fullscreen view StartupTime will print the time it takes for the program to start to the console
  7. Updated 1.0.2 Fixed window size bug Fixed ziplib bug Improved behavior of zip package saving Added WINDOW_ACCEPTFILES and EVENT_WINDOWACCEPT Model files now load correctly from a package, with materials and textures Added function RelativePath() An important change was made to the way package paths work. The name of the package file will now be considered a folder. So if you have a package called "Models.zip" and it contains a file called "box.gltf" you can load the model with the path "Models/box.gltf". After seeing the zip files in the new editor, it was very clear to me this is the way it should work.
  8. Updated asset browser and named it "Editor.exe". You can delete the previous EXEs I uploaded. This is pretty close to finished. The tree view and asset panel drag-and-drop functionality is all worked out now. Models and material files will load correctly from ZIP packages, with materials and textures intact. Mouse wheel Z-movement without right-click is temporarily disabled. All thumbnails other than the ones Windows generates are temporarily disabled.
  9. The Quake people are telling me they use the 3D editing mode in TrenchBroom exclusively, and the 2D viewports are just an afterthought. These people are the most intense CSG mappers in the world so I think I need to listen to them.
  10. Yeah. it's not good because there is a long delay when exiting the program, as it has to rewrite any zip file that changed.
  11. This is so cool. If you open an asset from a zip file, when you save the file it gets saved back into the Zip package just as if it was a folder. You can do all your development in your game's final ZIP files, if you wanted to, although there may be some issues with scaling as the content gets bigger.
  12. Josh

    Ziplib bug

    Replace this code: void ZipFile::Save(ZipArchive::Ptr zipArchive, const std::string& zipPath) { ZipFile::SaveAndClose(zipArchive, zipPath); zipArchive = ZipFile::Open(zipPath); } With this: void ZipFile::Save(ZipArchive::Ptr& zipArchive, const std::string& zipPath) { ZipFile::SaveAndClose(zipArchive, zipPath); zipArchive = ZipFile::Open(zipPath); } The & makes is to the value of the shared pointer passed to the argument gets assigned to the new object.
  13. I'm using 125% scaling, so everything looks 25% bigger when I post a screenshot.
  14. Okay, I think I fixed. This is how it's supposed to appear, correct?
  15. Fixed, sorry about that.
  16. Updated 1.0.2 Fixed menu hover bug in submenus EVENT_ZOOM now stores an integer in event.data and moves 100 units for every unit that EVENT_MOUSEWHEEL changes by Fixed alphabetical sorting when TREEVIEW_SORT style is in use Fixed TreeView::GetNodeAtPoint bug Drag and drop treeviews will now automatically expand a node when you drag over them Fixed widget cursor not working
  17. I tried this and it seems to work perfectly in Ultra Engine 1.0.2.
  18. Here is a function that will check if an app is open and if it is, it will send some data to the other application: bool CheckIfOpen(shared_ptr<Window> source, const WString& appid, const WString& apptitle, shared_ptr<Buffer> data) { const int DATA_ID = 345934;// whatever... auto m_singleInstanceMutex = CreateMutexW(NULL, TRUE, appid.c_str()); if (m_singleInstanceMutex == NULL or GetLastError() == ERROR_ALREADY_EXISTS) { HWND hwnd = FindWindowW(0, apptitle.c_str()); if (hwnd and data) { COPYDATASTRUCT copydata; copydata.dwData = DATA_ID; copydata.cbData = data->GetSize(); copydata.lpData = data->Data(); LPARAM srchwnd = 0L; if (source) srchwnd = (LPARAM) source->GetHandle(); SendNotifyMessageW(hwnd, WM_COPYDATA, srchwnd, (LPARAM) &copydata); } return false; // Exit the app. For MFC, return false from InitInstance } return true; }
  19. There is a bug in the current version of the client app that will write a null-terminated when syncing text-based files. CameraControls.hpp will not open in Visual Studio, but if you open it in Notepad and remove the NULL character at the end of the file, then save, it will work.
  20. I did a lot of work on sliders and I think they are 100% working in Ultra Engine 1.0.2.
  21. Updated 1.0.2 Fixed a lot of bugs with scrollbar sliders and improved their behavior when combined with treeviews and other scrolling widgets. Widget::SetRange now accepts a third parameter for the increments value. This allows you to create a smooth scrollbar slider that doesn't just move one pixel when the user clicks on the little arrows. The mouse wheel will move three times the increments. Window::GetMouseAxis now returns a Vec3 with the smooth mouse wheel / trackpad Z value EVENT_MOUSEWHEEL works as before, but EVENT_ZOOM will provide a high-resolution Z value for smooth trackpad scolling. Use IntBitsToFloat to convert event.data to a float value, otherwise it works just the same as EVENT_MOUSEWHEEL. Menus will now emit an action event for the top-most menu and an event for themselves, so two events go out and you can choose either. Added MENU_BORDER menu style (adds a 1-pixel line across the bottom of the menu) Added TABBER_MINIMAL tabber style
  22. I put together the first editor extension using a Lua module. LuaModule.zip Your main.c file needs one important function. The name of the module is "LuaZenMode", so the DLL needs to be called "LuaZenMode.dll" and the function needs to be called "luaopen_LuaZenMode". You will get an error if you call both the script and the module the same thing, because Lua will think the script is trying to load itself. __declspec(dllexport) int luaopen_LuaZenMode(lua_State* L) { lua_pushcfunction(L, SetWindowZenMode); return 1; } In this case I am just assigning a function to the return value, but in most cases you probably want to create a table and add the function pointers to the table. Here is our one function the lib uses: static int SetWindowZenMode(lua_State* L) { HWND hwnd = (HWND)luaL_checkinteger(L, 1); int state = luaL_checkint(L, 2); if (state == 1) { SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME)); } else { SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) | WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME); } return 0; } It's okay to treat the HWND as a Lua number because even 64-bit Windows uses 32-bit window handles. https://learn.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication?redirectedfrom=MSDN Here is how I load it in my script named ZenMode.lua: local extension = {} extension.func = require "LuaZenMode" The Lua code then creates a menu divider and a new menu item: local menu = program.menu:FindChild("View", false) if menu == nil then Print("Error: ZenMode extension cannot find View menu") return end --Add divider CreateMenu("", menu) --Add menu item extension.menu = CreateMenu("Zen Mode", menu) And then it declares a function and uses that as an event listener. Note that the extension table is being passed in the extra function parameter: function extension.ProcessEvent(event, extra) Print("Calling ProcessEvent...") local hwnd = program.window:GetHandle() if extra.menu:GetState() == 0 then Print("Enabling Zen mode...") extra.menu:SetState(1) extra.windowposition = {} extra.windowsize = {} extra.windowposition.x = program.window.position.x extra.windowposition.y = program.window.position.y extra.windowsize.x = program.window.size.x extra.windowsize.y = program.window.size.y program.window:SetShape(program.window.display.position.x, program.window.display.position.y, program.window.display.size.x, program.window.display.size.y) extra.func(hwnd, 1) Print("Zen mode enabled") else Print("Disabling Zen mode...") extra.menu:SetState(0) extra.func(hwnd, 0) program.window:SetShape(extra.windowposition.x, extra.windowposition.y, extra.windowsize.x, extra.windowsize.y) Print("Zen mode disabled") end end ListenEvent(EVENT_WIDGETACTION, extension.menu, extension.ProcessEvent, extension) And now the program has new functionality added entirely by the extension.
×
×
  • Create New...