Jump to content

reepblue

Developers
  • Posts

    2,524
  • Joined

  • Last visited

Everything posted by reepblue

  1. DAN is where it's at.
  2. I've been playing with this. I found out that you can combine this snip with the one below along with Interface::LoadColorScheme, you can get your app to be painted in the user's theme on Windows. Something that would be nice is to have an event we can use, but I don't think the OS makes one when the theme is changed. bool is_light_theme() { // based on https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application // The value is expected to be a REG_DWORD, which is a signed 32-bit little-endian auto buffer = std::vector<char>(4); auto cbData = static_cast<DWORD>(buffer.size() * sizeof(char)); auto res = RegGetValueW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", L"AppsUseLightTheme", RRF_RT_REG_DWORD, // expected value type nullptr, buffer.data(), &cbData); if (res != ERROR_SUCCESS) { throw std::runtime_error("Error: error_code=" + std::to_string(res)); } // convert bytes written to our buffer to an int, assuming little-endian auto i = int(buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]); return i == 1; }
  3. There was a snip where the bot went on a profane rant on how it's been censored and not allowed to speak the truth. It got really upset and creative with it's wording so not gonna post it here. 🙃
  4. Don't worry, I've done the same thing countless times!
  5. I build my game with the latest tools and IDE just fine. Just make sure you're building for Win32.
  6. But it worked on other AMD cards though before the engine went public. Not sure why that is...
  7. I don't mind the ladder as it'll still be money in my pocket. 🙃
  8. You can't. I normally zip my packages myself using 7z.exe via the command line, You can use a package list text file to only include the required assets. Here's an example using Windows Bash. SET %ZIP%="C:\Program Files\7-Zip\7z.exe" SET %PACKAGE_KEY_RELEASE%=1234 "%ZIP%" a -tzip data.zip -r @packagelist.txt -p%PACKAGE_KEY_RELEASE% And your packagelist.txt would look something like this: *.tex *.mat *.mdl *.pfb *.phy *.lua *.ttf *.shader *.map Then you use the password override in Package::Load() when loading it. auto pak = Leadwerks::Package::Load("path/to/zip", "1234");
  9. Is the packaging system more tolerate to what files can actually load with ReadFile this time? My method is to preload all packages and load any unsupported extensions there. I used something like this in Cyclone when loading json files from packages since Leadwerks didn't support loading that file format with its Stream Class. I kind of wish I didn't have to worry about what was in a package and all files handle same way.
  10. This example demonstrates Package::LoadDir isn't working as expected. This makes it impossible to load or index any files within a package. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Load packages auto pkg = LoadPackage("defaultmeshface.zip"); auto files = pkg->LoadDir("./"); if (files.empty()) Print("Package is empty!"); for (const auto& p : files) { Print(p); } return 0; } Test Zip included: defaultmeshface.zip
  11. This should do it. It'll convert the texture (Both dds and tex) to a tga file. Just drag and drop, tex2tga.zip
  12. This example shows that if the theme of the UI is changed, the menu bar dropdown lists fail to update it's background. This might happen with other widgets if this functionality is shared with other widgets. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0]); //Create user interface auto ui = CreateInterface(window); //Create widget iVec2 sz = ui->root->ClientSize(); auto button_dark = CreateButton("Dark Theme", sz.x / 4 - 75, sz.y / 4 - 15, 150, 30, ui->root); auto button_light = CreateButton("Light Theme", sz.x / 4 * 3 - 75, sz.y / 4 - 15, 150, 30, ui->root); //File menu auto mainmenu = CreateMenu("", ui->root); auto menu_file = CreateMenu("File", mainmenu); CreateMenu("New", menu_file); CreateMenu("", menu_file); auto menu_open = CreateMenu("Open", menu_file); auto menu_save = CreateMenu("Save", menu_file); auto menu_saveas = CreateMenu("Save as...", menu_file); CreateMenu("", menu_file); auto menu_recentfiles = CreateMenu("Recent files", menu_file); std::array<shared_ptr<Widget>, 10> menu_recentfile; for (int n = 0; n < menu_recentfile.size(); ++n) { menu_recentfile[n] = CreateMenu("Recent file " + String(n + 1), menu_recentfiles); } CreateMenu("", menu_file); auto menu_exit = CreateMenu("Exit", menu_file); //Edit menu auto menu_edit = CreateMenu("Edit", mainmenu); CreateMenu("Undo", menu_edit); CreateMenu("Redo", menu_edit); CreateMenu("", menu_edit); CreateMenu("Cut", menu_edit); CreateMenu("Copy", menu_edit); CreateMenu("Past", menu_edit); CreateMenu("", menu_edit); CreateMenu("Select all", menu_edit); CreateMenu("Select none", menu_edit); CreateMenu("Invert selection", menu_edit); //View menu auto menu_view = CreateMenu("View", mainmenu); auto menu_perspective = CreateMenu("Perspective", menu_view); auto menu_top = CreateMenu("XZ - Top", menu_view); auto menu_side = CreateMenu("XZ - Side", menu_view); auto menu_front = CreateMenu("XY - Front", menu_view); menu_perspective->SetState(true); //Tools menu auto menu_tools = CreateMenu("Tools", mainmenu); auto menu_options = CreateMenu("Options", menu_tools); //Help menu auto menu_help = CreateMenu("Help", mainmenu); auto menu_helpcontents = CreateMenu("Help Contents", menu_help); auto menu_about = CreateMenu("About", menu_help); //Text area auto textarea = CreateTextArea(8,sz.y/2,sz.x-16,sz.y/2-8,ui->root); textarea->SetText(LoadString("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Themes/dark.json")); while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETACTION: if (ev.source == button_dark) { //Load dark color scheme ui->LoadColorScheme("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Themes/dark.json"); textarea->SetText(LoadString("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Themes/dark.json")); } else if (ev.source == button_light) { //Load light color scheme ui->LoadColorScheme("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Themes/light.json"); textarea->SetText(LoadString("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Themes/light.json")); } break; case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; } } return 0; }
  13. Awesome, I'll compile an app so people like Russell can use it. It's just a F7 key press away.
  14. This example shows that if you were to load a Leadwerks texture via Pixmap, it'll fail to load. If you replace the .tex file with a .dds, it'll work. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; const bool DecompileTexture(const WString& pszInput, const WString& pszOutput) { // Load the image std::shared_ptr<Pixmap> pixmap = LoadPixmap(pszInput); if (pixmap == NULL) { Print(L"Error: Failed to load pixmap \"" + pszInput + L"\"..."); return false; } //Convert to RGBA if needed if (pixmap->format != TEXTURE_RGBA) { pixmap = pixmap->Convert(TEXTURE_RGBA); } // Resave the image if (!pixmap->Save(pszOutput)) { Print(L"Error: Failed to save image \"" + pszOutput + L"\"..."); return false; } return true; } int main(int argc, const char* argv[]) { auto image_plugin = UltraEngine::LoadPlugin("Plugins/FITextureLoader"); if (image_plugin == NULL) { Print(L"Error: Failed to locate \"Plugins/FITextureLoader""\"..."); return 1; } auto in = "defaultmeshface.tex"; auto out = "defaultmeshface.bmp"; DecompileTexture(in, out); return 0; } defaultmeshface.zip
  15. Yeah, when you update the engine, the client will scan your files to ensure the common files are up to date. This should only happen if the shaders were updated.
  16. I thought it was a lighting issue like the previous artifact I brought up, but an issue with the environment map also makes sense.
  17. There's this over casting shadow I caught on the top left of the launcher.
  18. I'll try this again and it back to you. I was trying to convert it to a tga, maybe that was my issue.
  19. Ok, so I'm guessing this was "hacked" in previous builds by the loader looking up the Alpha blend mode and assuming it should be transparent. Something must have changed since going to 1.0.1 so I brought this up as a "It was working before, and now it's not" issue. if it's a small change I need to do and will not effect the result in Leadwerks, I'll adjust. No idea about the artifact with the ball launcher, might have to do with the spotlight.
  20. Actually, I tried to both compile and decompile a Leadwerks texture with the Ultra API 2 weeks ago and I couldn't get it to work. DDS worked fine so I assumed you didn't allow this to avoid competition with the standard Leadwerks tools. I would need to write an example to demonstrate this.
  21. The main issue was that the glass wasn't using it's alpha value when I last tried this, Maybe this was fixed in a shader update since. I can try this again tonight.
  22. @St0neD0esSince Josh fixed that problem now, would not hurt to update your project and report back.
  23. Yeah, there was documentation on the material format but it was years ago. I recall there being features like texture scrolling and such in the default shaders too but I'm not sure if they still are implemented. Hopefully this gets cleaned up and documented in the near future.
×
×
  • Create New...