Question about poking into the b3d dx lights

Blitz3D Forums/Blitz3D Programming/Question about poking into the b3d dx lights

RifRaf(Posted 2011) [#1]
i can use the B3d_plus dll to hack the dx lights some .. but was wondering if anyone knows if you can just poke some values in instead of using an entire dll for the following

BP_SetLightMaxRange( dxlight(i),dxl\range# )
BP_SetLightAtten0(dxlight(i),.001)
BP_SetLightAtten1( dxlight(i),0 )


Thanks in advance.


Yasha(Posted 2011) [#2]
just poke some values in


...how were you going to do that without using a DLL? Remember Blitz3D doesn't have pointers or peek/poke to arbitrary locations.

You can build arbitrary peek/poke on top of a combination of the regular bank operations and RtlMoveMemory (imported from Kernel32.dll, so it at least saves you having to actually ship a second DLL with your application), but it will be fairly slow by comparison. Not that that's likely to be important for one-off operations like updating lights.

Assuming you don't have it, the source for those three functions is as follows:


(B3D_Plus was originally distributed with source. Can forward it to you if you like.)

So yeah, you could easily just rewrite those in Blitz3D using a memory poke function, but you still need to get that memory poke function from somewhere, because one doesn't form part of the language.

What's your objection to using a DLL? What alternatives are acceptable?


RifRaf(Posted 2011) [#3]
Yasha, yes I meant using system DLLs instead of 3rd party indie DLL so that I dont have to include another DLL in my game distribution

So , the acceptable alternative is what you mentioned.. Im not dead sent against using the dll, but if I can avoid another file in the updater and installer I would like to.

Oh , I didnt know it had source. Yeah I would love to have a look at that. You can email me if you like

GameMaker04@...

Thanks so much.

Last edited 2011


Yasha(Posted 2011) [#4]
Sent.


Kryzon(Posted 2011) [#5]
Does the B3D_Plus license prevents you from sharing it publically? if not, could you please host it somewhere so everyone can take a look?

(if you need a place, 4Shared or MediaFire work great.)


Yasha(Posted 2011) [#6]
Here's the original thread, which... doesn't say anything about redistribution actually, but I feel compelled to link it to the discussion: http://www.blitzbasic.com/Community/posts.php?topic=75711#957569

The link at the end of that one is actually still alive, but here's my own upload anyway: https://sites.google.com/site/nangdongseng/downloads/Blitz3dplus.zip?attredirects=0&d=1

And here's a post that basically answers the original question by demonstrating how to use RtlMoveMemory to port those address hacks to B3D proper: http://www.blitzbasic.com/Community/posts.php?topic=66397#741912

Last edited 2011


Kryzon(Posted 2011) [#7]
Thanks Yasha!