-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templated version of sourcehook.h #134
Comments
If you'd like to submit PR with a working prototype I'd be happy to review it. The macros cannot be completely obsoleted but I think there's a strong chance the easy cases could be more modern. |
The implementation is half-ready. I had to get rid of all the static stuff and now faced a problem that the |
Very cool, thanks for looking into this. Feel free to share patches and I can take a look. Note that we have to stay ABI and API compatible but new additions should be no problem, the interfacs are versioned. One solution to HookManagerPubFunc would be to add a new interface method to take in a virtual object, with a DeleteThis method if SH will own the pointer. Unfortunately due to linkage restrictions we can't malloc/free or share stl structures across library boundaries so std::function won't work. |
I have some progress on the task: The structure is initially empty, no data members. Is this a sort of hack or am I missing something? |
@dvander Could you please have a look at the current version. It compiles without errors, but the metamod doesn't start and shows this error: "You must change the map to activate Metamod:Source." |
Is that error when using |
It shows when I type "meta" and even after changing the level. If I revert my changes, metamod loads and works without errors. UPD: I've just checked the wrapper "HookManagerPubFunc" If I change it back to function pointer, metamod works. Don't see what is wrong with the wrapper though |
Add CConcreteEntityList, CEntityComponent, CScriptComponent, CGameEntitySystem, rewrite IHandleEntity to use CEntityHandle instead of CBaseHandle, update NUM_SERIAL_NUM_BITS, comment out old CBaseEntity, obsolete basehandle.h
Hello, I'm using sourcehook in my extensions and would like to propose that it should be changed.
I see several drawbacks in the current implementation:
One templated class could replace all the SH_DECL_* macros and solve these problems.
The text was updated successfully, but these errors were encountered: