Jump to content

MCP

Members
  • Posts

    22
  • Joined

  • Last visited

Posts posted by MCP

  1. Apologies xtreampb, the code example was meant for Admin because the error is within LE3 source code not your code. The reason you're getting a runtime error now is because a function pointer for all intense purposes is not compatible with a void pointer so your code is trying to call a function at an invalid memory address.

  2. What data type would you suggest, and exactly what kind of errors are you describing? I don't see anything wrong with casting to a void*, it's just a pointer that takes either 32 or 64 bits of data.

    ..and what makes you think function pointers are?

     

    I've already given you an example of how to fix your code in this thread (post #4)...

    http://www.leadwerks.com/werkspace/topic/6321-le3updatephysicshook/

     

    If you want a more detailed explanation of what you can or can't do with function pointers refer this thread for a better insight...

    http://stackoverflow.com/questions/559581/casting-a-function-pointer-to-another-type

  3. It's generally bad practice to cast a function pointer to anything let alone a void pointer which is why your compilers are complaining. They either don't allow it or if they do it can lead to all kinds of instability errors. The error is in the function declaration of AddHook(...) which wrongly expects you to pass a function pointer as a void pointer. It's a bug and there's nothing anyone can do until Josh fixes the issue.

  4. ERROR:

    IntelliSense: argument of type "void (App::*)(Leadwerks::Entity *entity)" is incompatible with parameter of type "void *"

    Your compiler is rightfully complaining that your function pointer isn't of the correct type ie "void *".

     

    The error lies within the declaration of System::AddHook() which has "void *" as the second parameter. AddHook should expect a function pointer of type void NOT a void pointer as they are in fact two completely different things and this should be classified as a typo bug.

     

    The correct declaration for System::AddHook() should have been this....

    typdef void (*vFunc)(Leadwerks::Entity *);
    
    AddHook(int hookid, vFunc hook) {
    ...
    }
    

    As a temporary measure you call cast all your function pointers to void pointers but generally speaking this is considered dangerous in the C++ world and some compilers may not allow you even to do that. In a case were compilation has been successful you will often run into instability issues, memory address violations or other runtime errors... Avoid!

     

    See this discussion on the subject...

     

    http://stackoverflow...er-as-parameter

  5. @xstreampb: Have to tried removing the prototype altogether? The problem maybe that your prototypes have not been declared with the correct namespace hence the error that you are getting (Re thread aggror supplied). Also you don't need a '*' before your Break function parameter in the AddHook function call.

  6. To answer your original question Rick. I faced the same problems when I developed my first Android game which I published roughly two years ago. Depending on your game's graphical requirements it's best to design your game to the absolute smallest screen you think it will be comfortably played on. You can then rescale your graphics to fit larger screen sizes and/or reference higher resolution bitmaps to fit. Remember to preserve the aspect ratio of your original screen size then centre the game area on the larger screen and you should be fine.

  7. Big fail for me. The editor goes through it's startup process, loads resources for the Darkness awaits, briefly displays a "Welcome" dialog before being dumped straight back to desktop.

     

    Win7pro (32bit) 4Gb ram NVidia 9600GT 512mb (latest drivers!)

     

    *EDIT* Just checked the editor log which reports OpenAL: AL_INVALID_OPERATION.

     

    **EDIT** Never mind... Updating OpenAL solved the problem! Everything works fine now.

  8. There's always the annual paid subscription model Josh could implement. That way you could use the software today, get upgrades as they become available for lifetime of your subscription, and Josh gets an annual income for the lifetime of the product.

    What's people's thoughts on this?

×
×
  • Create New...