Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

778 Good

1 Follower

About wqking

  • Rank

Personal Information

  • Interests


  • Github

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. You are reinventing the wheels. And your solution is not easy to use by requiring inheritance. There are quite some C++ event dispatcher libraries out of there. I develop my eventpp library which can be used for general purpose.
  2. You mixed too much duties to collision system. The collision system should only do one thing: check if the player is blocked, send the event "block" (not "landed"). The FSM handles the event, and check if the blocker is ground, and the player was not on the ground, put the player to "stand" or what ever. One system only does one thing.
  3. wqking

    How to do incremental parsing

    You'd better forget about lines (compilers usually don't care much of lines too). Just process text token by token. You need a state stack, and let me use "output" to indicate you change the token color for syntax highlighting. An "output" is not a state. So assume you have the code if(a == 1 /* comment */) { } Your process may look like, 1. Output "if". 2. State stack: ( 3. Output "a". Note if you want to give different color according to the context (such as a == 1 is different with a > 1), you need to add "a" to state stack too. 4. Output "==", "1", etc 5, State stack: (, /* 6, Output anything until "*/" since the stack top is "/*". 7. Get "*/"? Then pop the "/*“。 8. Get ")"? Pop the top "(". If the stack top is not "(", syntax error. Same of "{" and "}". You got a basic lexical parser.
  4. Github: https://github.com/wqking/eventjs Facts and features Powerful Supports synchronous event dispatching and asynchronous event queue. Supports event filter via mixins. Configurable and extensible. Robust Supports nested event. During the process of handling an event, a listener can safely dispatch event and append/prepend/insert/remove other listeners. Doesn't depend on HTML DOM. eventjs works for non-browser environment. Well tested. Backed by unit tests. Fast Much faster than HTML DOM event listener system. The EventQueue can process 5M events in 1 second (5K events per millisecond, when there are 100 event in the queue). The CallbackList can invoke 1M callbacks in 1 second (1000 callbacks per millisecond). For detailed introduction, source code, documentations, please visit github
  5. The code is on Github, https://github.com/wqking/markdownutil Your feedback and contributes are welcome. The scripts addtoc2md.pl Adds table of contents to Github flavored Markdown files. Features Use <a> anchor tag as the TOC target. It doesn't depend on Github auto anchor feature. Can selectively generate TOC for lengthy article with enough headings. (The --min-headings option) Repeating the command on the same file will replace the previous TOC instead of adding more TOC. Code blocks can be handled correctly, the code lines start with '#' won't be treated as headings. doku2md.pl Converts Dokuwiki page files to Github flavored Markdown files. Features Support basic heading and format syntax. Support URL link syntax. Support image syntax. Customizable.
  6. It's because that your game engine code and your game code are inconsistent with the including path scheme. My favorite scheme is, in your game engine project, create folder "include/engine", then put all game engine related headers in "include/engine" and it's sub folder such as "include/engine/audio", "include/engine/ecs", etc. Than in any projects, include the game engine itself, that are using the game engine, set the include path to "include", and the include code is same in all projects include the game engine, which is #include "engine/a.h" #include "engine/audio/b.h"
  7. +1 for Qt Creator. It's my second favorite IDE/Debugger after Visual Studio. It's cross platform. Though it's originated with Qt, it can be used with non-Qt project.
  8. You need to make Collection template template parameter. template <typename T, template <typename> class Collection> string join(const Collection<const T> &data){ ... }
  9. I would suggest unit testing and code review may be your friends, if you didn't use them yet. If you are talking about how to handle the system (Windows, DX) API failure, then you should determine how to do it before you code it rather than debug after the failure happens. So, 1, If the failure should not happen (such as failed to allocate the memory), display some error message and quit the program. 2, If the failure is allowed to happen, deal with it. For example, if you fails to open a config file, then create it and reopen it. This is more about your program logical to handle they API failures rather than debugging it.
  10. Dynamically load the DLL using LoadLibrary and get the function address using GetProcAddress
  11. Nested components can only make your system unnecessary complicated and adds nothing else, think about the worst nested components hierarchy can be another non-ECS inheritance tree. So avoid it. In you example, fist is just an entity, not a component.
  12. What's wrong? The below code compiles fine in VS 2017. struct A { virtual ~A() {} }; struct B : public A { ~B() override {} };
  13. My Gincu game engine supports both SFML and Allegro, you may be inspired from it. The game application doesn't know the underlying engine (SFML or Allego), so it's quite what you want.
  14. class __declspec(dllexport) A {}; How about google "VC export class"? It gives you https://msdn.microsoft.com/en-us/library/81h27t8c.aspx
  15. pInt belongs to B::function() . That's to say, its scope is limited in B::function() . Though it's a pointer to member of A.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!