
Ma-Shell
Members-
Posts
371 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Ma-Shell
-
@reepblue: Source: So it's planned for LW 5
-
Object reference count error & Crashes
Ma-Shell replied to Phodex Games's topic in General Discussion
I think, the engine should call addref before calling a hook in a script and release afterwards. This way this could never lead to a problem like this and there would be no harm in doing so, since in this event the world would first release its reference and after the object was done with its current hook it would be deleted. -
Sounds awesome but seriously: There is really no need to go higher... With Full HD, that would mean, that would leave about 15x15 pixel for each zombie... This is should be enough... (unless you are trying to create another Ultimate Epic Battle Simulater )
-
It seems the SetColor-Overloads that take Integers as arguments are broken and always pass the same alpha value that was passed as the last. Using either a float-overload or the Vec4-overload yields the expected results: #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } Buffer* buffer; bool App::Start() { window = Window::Create("Test"); window->Show(); context = Context::Create(window); world = World::Create(); camera = Camera::Create(); buffer = Buffer::Create(1024, 768, 1, 0); return true; } bool App::Loop() { if (window->KeyHit(Key::Escape) == true) { return false; } world->Update(); world->Render(); context->SetBlendMode(Blend::Solid); buffer->Enable(); //buffer->SetColor(Vec4(10, 1, 0, 0)); buffer->SetColor(10.0f, 1.0f, 0.0f, 0.0f); buffer->Clear(Buffer::Color); //context->SetColor(Vec4(1, 0, 0, 1)); context->SetColor(1.0f, 0.0f, 0.0f, 1.0f); static int x = 0; context->DrawRect(x++ % 200, 50, 100, 100); context->SetBlendMode(Blend::Alpha); context->Enable(); context->SetColor(1.0f, 1.0f, 1.0f, 1.0f); context->DrawRect(10, 10, 100, 100); context->DrawImage(buffer->GetColorTexture(), 0, 0); context->SetBlendMode(Blend::Solid); context->Sync(); return true; } (I made the red rectangle move by using the static x-variable, so you can see that the buffer is indeed cleared). @Josh Should I file a bug-report for this?
-
Model visibly reloading on fast camera movement
Ma-Shell replied to Phodex Games's topic in General Discussion
Why would that be considered correct? Is the culling performed asynchronously to the rendering or only every other frame? Otherwise this behavior makes no sense to me... -
As far as I know, VS code is not directly built on top of Atom. Both, however, depend on the Electron framework (https://electronjs.org/) for rendering and thus are mainly written in JS. From my experience, both are quite good editors but both are quite heavyweight. Compared to Sublime Text (which is clearly what the devs took as their inspiration, but which unfortunately is not free), they lack somewhat in responsiveness. This comes from both being JS-applications, while Sublime Text is a native application. This also reflects in the sizes with 300 MB and 200 MB vs 30 MB. With that being said, I would go for VS code, since it seems more responsive than Atom and does weight less. In terms of features, both should be pretty equal and both are cross platform and open source.
-
Yes, you need the professional DLC. The standard edition only features LUA.
-
I would prefer the OOP-way since you can easily get information about what can and what cannot be made with an object... This especially applies to auto-completion, like intelli-sense. It is far more convenient to only see the functions that apply to the given object. But why don't you do both? You can also create the procedural functions as wrapper-functions that merely call the OOP-functions or vice versa.
-
OwnCloud does versioning on its own! In the web interface you can right click the corresponding file and choose to view previous versions
-
You probably can't reinstall it because bitdefender is blocking the file so you can not do anything to it, unless you tell bitdefender to unblock it. See https://www.bitdefender.com/consumer/support/answer/2121/ for how to unblock it.
-
There shouldn't be any problem with permissions but to rule that out, test it with netcat: On the server run: nc -l -p 1337 -u This will open up a simple listening UDP server on port 1337, that prints everything it receives Then on the client try to connect by typing nc leadwerks.com 1337 -u Then type some stuff into the client's terminal and see, if the same stuff pops up on the server's terminal as well (after you press enter). Of course, being UDP, it is possible that some packets are lost, but overall you should see at least some of the packets arriving. After the server received anything from the client, you should also be able to send stuff from the server to the client, as well. If that works, you can rule out an issue with permissions.
-
There is another option: If your custom version of glibc is compatible with the kernel (and the loader I suppose), it is possible to use that specific version for your process only, while leaving the rest of the system untouched. You can do so by setting the LD_PRELOAD-environment-variable for your process to the path of the .so-file (make sure to only set it for that process, though!). I'm not saying, I would recommend doing this, since you might run into trouble when the kernel is updated but if you absolutely need your version of glibc then you could do that.
-
Yeah, that's why I said to put it in a secured area
-
I don't know about WHM but you are able to upload custom php-Skripts, right? If so, you could upload a webshell (basically a script, which just executes system($_GET["C"]) ). That might be a bit uncomfortable since you always have to reload the page for each command but it should work. Be sure to put it in some secured area, so that it is not publicly available (e.g. by using .htaccess)
-
You might want to consider supporting cmake. cmake is able to generate projects for different IDEs. So you only have to support the cmake-files and by that you gain support for various IDEs. cmake can e.g. generate Make-files, as well as CodeBlocks-, CodeLite-, Eclipse-, or Sublime-Projects. Though I really don't know much about it, it looks like something worth looking into!
-
I have a vive and will test this later. The last time I tried it, the camera was always stuck at 0,0,0 with no way to move it. Is there some way of moving the camera while having the tracking relative to the movement implemented?
-
A memory leak won't cause access violations! A memory leak is when you allocate space on the heap, by using malloc or new and then simply abandon it without ever releasing it with free or delete. Smart pointers should do that sort of management for you and even if you were to do that wrong, it would simply cause the memory used by your program to rise steadily. An access violation occurs, when you are trying to access memory in a way you're not supposed to. This means, it is either not in an allocated state (never allocated or allocated and then freed) or it has protections active. In most cases, this happens, when you freed some object but did not set all pointers to null. This sort of problem can cause very weird types of errors. In the worst case, the memory you freed is reallocated for a different purpose and the next time you write to it, you modify some completely different structure
-
It might be a good idea to allow us to register a callback before the context-sync is executed, so we can put other drawing stuff there.
-
Is it a C++ or a LUA-project? In the case of LUA, I think, you don't have to do anything (except maybe e.g. if you hardcoded paths somewhere, you might need to change them to use forward slashes instead of backward slashes). In the case of C++ it depends on the additional includes you are using. The Leadwerks-API-functions should work without modifications, just like most standardlib-funcitons. Unfortunately there are some functions existent in the standardlib, that are not present on the linux-version and vice versa. However, if you didn't do any "exotic" includes, you should be fine.
-
You're right, at the moment this is working but what Josh is asking is about the future with smart-pointers. The question is, if the user should have to maintain these source-references for them to keep playing or if the engine should do that for you. (At least that's how I interpreted the question)
-
Yeah, holding the sound is one thing but holding the sources played from that sound is another thing: If you have a gun, which you can fire quite fast, you will play the sound everytime you pull the trigger. However, you would expect there to be sometimes 3-4 sources of the same sound playing at the same time if you're trigger-happy. This would mean, you'll have to keep a list of all sources emitted around and periodically check, whether you can release the individual sources. So: It's reasonable to always have a reference to the Sound, but not to all the Sources. To sum up the design I would prefer with a clear differentiation between Sound and Source: - Source has a smart-pointer to the Sound, which gets nullified when the source gets deleted. - Engine has a list of smart-pointers to all currently playing Sources. As soon as a Source is Stopped/Paused, this smart-pointer is nullified. The reasoning behind this, is that if the user plans to Resume/Restart the Source, they need to have their own smart-pointer anyway (otherwise they have no means of calling Resume()/Play()), which by itself prevents it from getting deleted. (This replaces what I previously stated as the source having a smart-pointer to itself) Bonus: The Sound::Play()-function should return a smart-pointer to the emitted Source-object!
-
Correct, if the user wishes to stop the source, they have to keep a pointer to it themselves. If the user only wants to play the source once, without planning on stopping/resuming it, I see no reason, why you would want to force them to keep their own pointer around and continually check, whether the sound is done playing, so they can release it. The way I described it above, the user can choose whether to keep a pointer to it or not. Basically: Whenever the sound is playing, the engine makes sure that it is not deleted, while whenever the sound is not playing, it can be deleted. If you go down the other route of always forcing the user to keep the pointer, I can already see a new thread coming up every other week complaining about their sounds not playing. I'm pretty sure that for most users, playing a sound is a "fire-and-forget" kind-of-thing. PS.: What I forgot to mention above is, that if the user calls Play() after they called Stop(), the pointer needs to be populated again, of course
-
I think, it's most reasonable to have the source maintain a smart pointer to itself. When the sound is finished playing or the user calls Stop(), this smart pointer is set to NULL. This would mean: - If the user keeps his own smart-pointer, there will be two smart pointers to the source and it will not be released until it is done playing and the user releases their own one. - If the user does not keep his own smart-pointer, the source is deleted once it is finished playing.
-
Regarding Performance:
-
3 Ideas You Must Understand to Use C++11 Shared Pointers in Leadwerks Game Engine 5
Ma-Shell commented on Josh's blog entry in Leadwerks News
The problem you're describing in the end can be solved with by deriving from "std::enable_shared_from_this" (http://en.cppreference.com/w/cpp/memory/enable_shared_from_this). This basically does what you planned with the weak_ptr-stuff but without additional overhead on your side. Translating your code-example, this would be: #include <memory> #include <iostream> using namespace std; class Thing : public enable_shared_from_this<Thing> { public: shared_ptr<Thing> GetSelf(); }; shared_ptr<Thing> Thing::GetSelf() { return shared_from_this(); } int main(int argc, const char *argv[]) { shared_ptr<Thing> p1 = make_shared<Thing>(); shared_ptr<Thing> p2 = p1->GetSelf(); } EDIT: It is important to derive publicly! In the example of the cppreference-link, they are using a struct, which derives publicly by default. For classes, you have to explicitly write ": public". I edited the code above