I needed different behavior from AESNDLIB that would let me re-use a used voice, so I’ve tweaked my own AESND_AllocateNextFreeVoice function, with a trivial change. My function works more like the other sound lib's ASND_GetFirstUnusedVoice, if like me you dynamically assigned sound. ( yes. . . you can use a callback, but why expose you side of the code to all that unnecessary work) voby Titmouse - Coding
Ok it’s there if you ever need it, looks like it’s called ‘Short-circuit evaluation’. (Can help things like box collision detection.) http://en.wikipedia.org/wiki/Short-circuit_evaluationby Titmouse - Coding
Not sure if I get you, are saying you never you use '&&', and yes breaking the last post example into two line is what I do, those one-liners give me the willies. if ((x < Rx + Rect.w) && (x >= Rx ) && (y < Ry + Rect.h) && (y >= Ry )) // standard way, (x < Rx + Rect.w) == false then it knows the answer if ((x < Rx + Rect.w) & (x >= Rx ) & (y < Ry + Rby Titmouse - Coding
No this is not true, what exactly is your game – you keep trying to twist what I say? You know full well why I got this working; it was a purely academic exercise just to see if it was possible, we might not all be at your level of knowledge so we have to learn and improve ourselves by trying things out. In this tread I said: “… I've already stripped all the hacky stuff from my versionby Titmouse - Coding
This method does go against the grain, but it does appear to be safe. Techniques like this do come in handy from time to time; it's outright stupid dismissing this technique from every single future design. I’m amazed you even said that! I would be more than happy to hold up my hand I say, yes I’ve use that technique giving a justification for its use. I'm not sure if this is whatby Titmouse - Coding
I must say I kind of agree with the way you work, gives results. As for '&&' and '&' - You tend to use '&' for bit logic "A single ampersand always evaluates both arguments (a & b) whereas the double ampersand will only evaluate the second argument if the first argument is true (a && b)." If (a & b & c & d) // everything is always evaluated, kind of like thby Titmouse - Coding
I really like this effect; I also like the square effect when you up the stars to silly amounts. It’s a very slick Algorithm. If you’re open for a bit of constructive criticism, don’t want to hit you with all this on the first post. This is a difficult thing to do correctly - But always try to keep your logic away from your display code. (demo or not) I was going to write all about why thisby Titmouse - Coding
Well spotted – No idea what I was thinking at the time of the post as my original test code used ZERO. Probably stuck the named #define in at the last minute picking the wrong one from the web - oh well. But anyway I’ve proved it does work the way I said it would even though you said it can’t. The “devkitPro\examples\wii\audio\oggplayer\source\oggplayer.c” code is just old and I don’t likby Titmouse - Coding
Looks like your only changing Z pos, stardust[][2] So just test Z pos and just zero Z pos too. i.e. just use if ( stardust[2]==0 ) { ... stardust[2]+=d/2, think divides are slow use multiply, i.e. stardust[2]+=d*0.5f; The opimiser may do that anyway. You are using lots stack space, also not sure why you have use [4] (just read your note about direction, but its not used in the demo), Iby Titmouse - Coding
Owen, I just took peek at your star field code – looks good. If you ever needed a speed boost you could pre calculate a large star field in a traveling loop (pre calculated scene), and then move the camera through it, this world remove the need to update the star movement – it would require a bit of memory and the rest of your world (not needed for demo) would need to fit in with it. Using GX_Cby Titmouse - Coding
G_man, sorry no. I even go as far as saying it will never fail as long as the Ogg header is of that type. I was shocked how reliable it would be. (I’ve used the word never - I can feel the flames already) Don’t forget we are passing a complete Ogg buffer. The Ogg buffer is complete with header information of “4f67” in network order (i.e. the first two letters in the header are ox4f=’O’, oby Titmouse - Coding
Owen, this is just for information only I know you have moved on, I think this one ups the amount (If someone could confirm that without flaming), no idea if there is a limit on this (I would not think so) apart from memory limits. ( or use a calculation to batch it into smaller groups that fit ) #define DEFAULT_GX_FIFO_SIZE ( (4*256) * ONE_KILOBYTE) // my amount bigger than I need ifby Titmouse - Coding
Go for it, could be a good subject for a mass peer review!by Titmouse - Coding
Drum roll please... It’s now fixed, it will play from file & buffer. Yes I’ve made a mistake, here’s a quick fix from what I can remember as I no longer have that code since I've already stripped all the hacky stuff from my version of oggplayer also removing the unused buffers and some silly logic that can be done once at setup. I don’t need this or like it but it does work, I purby Titmouse - Coding
Finally had a chance to test this code - works fine >>>Amendment<<< In my haste I posted the original code changing it from memory I made a few bads & looked things up (badly!), I never kept the fixed version since I didn’t want to use it. But it looks safe for the wii platform for the foreseeable future; at the very worst it will just not play anything. Hopeful this is allby Titmouse - Coding
Yes I agreed with the essence of what you say, when a first posted this I did not realize just the interface would scrutinized. I know that both of us know what possible code wise is, all this is getting silly and it was probably a mistake to post up the FILE code as it gives the wrong impressing of what I’m asking as it was a loaded question and has deflected the direction of this thread. Iby Titmouse - Coding
Look the function takes void*, again this is why it makes no sense to use void*, it suggests big time the interface takes more than one flavor. Why else would anyone use a void*? At the time of my first post I was thinking, the void* was for that reason, now I'm sure it was for fd or pointer. Off the top here are a few ways to work out what a void* is; - Looking at the incoming fd (i.eby Titmouse - Coding
My first post is using allocate memory it works fine. Now because it uses a void* that suggests it can take many flavors, not just a raw memory pointer as you suggest, think about it.Void* is just for situations like this when you either need to pass a file descriptor or a pointer to some memory. The code has a magic 0x666 logic around file or memory access, the code knows if its incomingby Titmouse - Coding
tueidj, when exactly did I say Polymorphism? I said void* is polymorphic and it is (look it up), you can use the word polymorphic without encroaching on the object orientated world. Your second post is just not true since in C you can pretty much cast anything to anything. char* ptr = (char*) pOggFile; // here pOggFile is a FILE* FILE* ptr2= (FILE*)ptr; But this is all silly and goinby Titmouse - Coding
Thanks tueidj, but a void pointer is polymorphic. The first thing PlayOgg does is cast the void* to something usefull. int PlayOgg(const void *buffer, s32 len, int time_pos, int mode) { StopOgg(); private_ogg.fd = mem_open((char *)buffer, len); ...by Titmouse - Coding
Thanks for the idea Owen - but the 3rd parameter lets you set the time position, I'm using 0 so it should play from the start. Once run the interface provides a "void SetTimeOgg(s32 time_pos)" that sets seek, but the setup also sets seek from the 3rd pram, so no luck looking there. Anyone made this work directly from file? All this is not really a problem as I'm loading oggs intoby Titmouse - Coding
I'm confused to why the 2nd section of code works just fine, but 1st section does not. (the player does look to support a FILE descriptor, forget about WiiFile it's just a simple wrapper) REF: \devkitPro\examples\wii\audio\oggplayer string FullFileName = Util::GetGamePath() + "Indidginus.ogg"; FILE* pOggFile( WiiFile::FileOpenForRead( FullFileName.c_str() ) ); u32 OggSizeby Titmouse - Coding
That's freaky, some time back I tried to find the best value myself. For 16:9 I found 678 was 'best fit' (no pun intended) for all types of TV. Leaving non 16:9 to what ever the VIDEO_GetPreferredMode set worked well. (the above 672 for non 16:9 will probably work very well, might just use that value myself)by Titmouse - Coding
Owen why do you hate Java? As for Javascript, now that I can understand you hating - it's pure undiluted evil. (thanks for the link - keep em coming)by Titmouse - Coding
Question is - what is the total download per month via wii ware? How big is that pie? (I imagine it’s still holding on through luck more than judgment) Someone with an approved secure office, staff, and money in the bank wanted to become a wii ware developer would Nintendo let them look at the stats to see if it was worth their while - possibly not.by Titmouse - Coding
Is it just me or is activity in the wiibrew development slowing down. Silly question; but does anyone have any idea how many more years the Wii has left as a coding base? Obviously homebrew can go on forever but I prefer to write things that are going to be seen, homebrew exists as the average Joe is (was!) using it to play homebrew.by Titmouse - Coding
Just money - but that not a problem for us homebrew folk. Still is nice to reduce download size wherever possible, obviously using things like oggs & jpgs when possible are going to help, but by the nature of homwbrew you get what you get. I tent to find the smaller wiibrew downloads are better quality as more often than not care is taken for the whole product including size, but this is juby Titmouse - Coding
Christ, I had no idea WiiWare was that unforgiving to the developer from reading that article Owen linked. So a wiiware games need to hit a unit quota which depends on the games size within a time limit or no money! A 6Mb game is given a smaller quota scale in units than a 40Mb game, so more 40Mb games must be sold before any money is handed over. Developers reach their unit quota sooner witby Titmouse - Coding
Same thing here with lighting, if I turn lights of it works, but that kind of defeats the whole point of having the normals. This code with lighting does not show the GX_VA_CLR0 part. // later on each call to a vertex attribute must match the order: Position, normal, color, texcoord. GX_SetVtxAttrFmt (GX_VTXFMT4, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); GX_SetVtxAttrFmt (GX_VTXFMT4, GX_VA_by Titmouse - Coding
Yes as you say, if don't need lighting don't use normals. Just send GX_VA_POS & GX_VA_CLR0 and setup GX_VTXFMTn to match. You found lighting looks odd without normals, not tried this myself, so you will still need to turn off lighting as stated above in the other post.by Titmouse - Coding