Library Update
Moderator: Moderators
Library Update
hi,
i recently remembered that zge sports a library from which you can add useful templates. it currently contains a number of awesome meshes & two bitmaps; i was thinking about adding more things from the 'tips & tricks' section of the board (and already started doing so), especially reoccuring things like input handling.
i just wanted to hear back if all involved parties think that is a good idea (maybe nobody uses the library anyway, or people don't want their tricks in there...). what do you think?
i recently remembered that zge sports a library from which you can add useful templates. it currently contains a number of awesome meshes & two bitmaps; i was thinking about adding more things from the 'tips & tricks' section of the board (and already started doing so), especially reoccuring things like input handling.
i just wanted to hear back if all involved parties think that is a good idea (maybe nobody uses the library anyway, or people don't want their tricks in there...). what do you think?
attached is the library ... i resolved the double names, but for some reason some of the examples don't run - they mostly claim that some array is not an array, although it clearly is. appears to be a naming problem; ZGE also bugs out hard when trying to rename the array in question :P
- Attachments
-
- Library.zip
- (21.24 KiB) Downloaded 1460 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
BASSMOD.dll
I hacked your setup for bass.dll to work with BASSMOD.dll [ http://www.un4seen.com/bassmod.html ] it is a subset of the sound functions, so only mod playing and it is 1/3 smaller at 33kb. Only had to change the function names and amend some parameters.
I am interested in getting data out of the dll from the playing mod, however I am a bit confused by these things,. DWORD, HIWORD, LOWWORD,. . I get that it is just a way to store a couple values packed into a larger one,. it is just the way to access them, and use them, that is confusing. Anyone like to try a simple explination/crib sheet for me??
Also, when getting values back as int you use these lines;
I see Kjell posted a similar tip here; viewtopic.php?p=3403#3403
interesting
I am interested in getting data out of the dll from the playing mod, however I am a bit confused by these things,. DWORD, HIWORD, LOWWORD,. . I get that it is just a way to store a couple values packed into a larger one,. it is just the way to access them, and use them, that is confusing. Anyone like to try a simple explination/crib sheet for me??
so how would I set HIWORD=0 and LOWORD=3, and HIWORD=1 and LOWORD=2 say?Parameters
chanins The channel or instrument to retrieve the volume of... if the HIWORD is 0, then the LOWORD is a channel number (0 = 1st channel), else the LOWORD is an instrument number (0 = 1st instument).
Also, when getting values back as int you use these lines;
Many thanks in advance for any help.int left=level >> 16; // this is a Binary Shift but why?
int right=level & 0xffff; // and this is a Binary AND also why?
Rbeams1.Length = (left/32768.0) * 20; // why these values?
I see Kjell posted a similar tip here; viewtopic.php?p=3403#3403
interesting
- Attachments
-
- BASSMOD_test2.zgeproj
- .zgeproj setup for BASSMOD.dll
- (1.98 KiB) Downloaded 1351 times
iterationGAMES.com
Aha, I did not know about that trimmed down version of the dll. Looks good, and it should work for Mac/Linux as well.
When two 16-bit values are packed in a 32-bit value you need bit-shifting to split the value:
int hiword=level >> 16;
int loword=level & 0xffff;
When you shift the value 16 bits to the right then the lowest 16 bits are removed.
The AND-operation makes it only keep the lowest 16 bits. If you've wanted to keep the high bits you would have used 0xffff0000 instead.
To pack them back together to a 32-bit value you do this (untested):
level = (hiword << 16) | loword;
It takes some time to get used to bit-shifting but it is really useful sometimes
http://en.wikipedia.org/wiki/Bitwise_operation
When two 16-bit values are packed in a 32-bit value you need bit-shifting to split the value:
int hiword=level >> 16;
int loword=level & 0xffff;
When you shift the value 16 bits to the right then the lowest 16 bits are removed.
The AND-operation makes it only keep the lowest 16 bits. If you've wanted to keep the high bits you would have used 0xffff0000 instead.
To pack them back together to a 32-bit value you do this (untested):
level = (hiword << 16) | loword;
It takes some time to get used to bit-shifting but it is really useful sometimes
http://en.wikipedia.org/wiki/Bitwise_operation
@jph
GLSL supports bit-shifting as well, but to keep things easier to read for novice users, I only use "normal" operations ( like * and / ) in examples. But when you know what you're doing you'd write "<<16" instead of "*65536" and ">>8" instead of "/256" obviously
+ Not exactly sure why you posted this here though .. this thread is about the Library, not ZExternalLibrary ( neither ZLibrary ). But I can understand the confusion ( Library = Resources, ZLibrary = Functions, ZExternalLibrary = Extensions )
K
GLSL supports bit-shifting as well, but to keep things easier to read for novice users, I only use "normal" operations ( like * and / ) in examples. But when you know what you're doing you'd write "<<16" instead of "*65536" and ">>8" instead of "/256" obviously
+ Not exactly sure why you posted this here though .. this thread is about the Library, not ZExternalLibrary ( neither ZLibrary ). But I can understand the confusion ( Library = Resources, ZLibrary = Functions, ZExternalLibrary = Extensions )
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
the BASSMOD.dll mapping may be usefull to ppl that just want mod playback in games,. . although I still want to figure out how to get some level/pattern info back out,. for game event triggering. I also noticed when looking at the docs for the dlls that bass.dll has many more sound functions, realtime effects, streaming audio, and 3d sound,. cool.I'm updating the Library with some external libraries. So far I've got bass, opengl and dikis Box2d. If you make a mapping to a dll then please post it here for inclusion in the library.
My question should probably have been posted in a new tread through.
iterationGAMES.com
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
I just put the .dll in the folder I'm saving my .proj and generating my .exe in. i.e. I do not use the main zge folder for that stuff,. so I would just drag them to the distribution zip. However you make a good point; with GameMaker there is a mechanism to 'include files' and any files added to that list are self extracted by the exe when you run it,. (and destroyed after, or not, as an option if i recall?) wunder if one of our compresion options could have an include external files setting?? Would give a nice single file distribution,. although, having a few files with an .exe in folder is not a bad setup, and very common anyway.
iterationGAMES.com
That's not what I meant .. but what you mention is another thing to consider indeed. Perhaps it is possible to include a dll using the File Component, and simply deploy the dll when it has not been found .. haven't tried this though.
Anyway, what I meant was that when you're using ZGE, and you add a ZExternalLibrary using the "Add From Library" option, the functions you've just added won't work unless you have the required dll in your project folder ( or installed on your system ).
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Ah yes, I see what you are on about. I almost forgot we get access to all the dlls in the system too,. . I will have to have a look at what is in the standard xp setup,. . Ha! there are only >1500 dll files in my win32 folder,. lol. Guess I will never know what they all do. opengl32.dll has 368 functions,. . fun fun.
iterationGAMES.com