Search found 113 matches

by benubi
Wed Apr 10, 2024 4:38 pm
Forum: Bugs - Documentation
Topic: Where can I find the documentation for: New skeleton library?
Replies: 2
Views: 116

Re: Where can I find the documentation for: New skeleton library?

Cool! I didn't know that :) I press F1 and get (english) help. Then under Engine3D there's the Skeleton Library (between Particle and Sound3D libraries). AddSkeletonAnimationKeyFrame CreateBone CreateSkeleton CreateSkeletonAnimation FinishBoneAssignment VertexBoneAssignment I have to check that out :D
by benubi
Fri Apr 05, 2024 2:00 pm
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 71
Views: 4137

Re: atomic web server threads

Very nice "example" piece of work :) The multi-threaded webserver project I abandoned grew in 16,000-20,000 lines, had many features but ultimately it grew too complex and I shot myself in the foot. It could even read .htaccess files to some degree and the other user/group configuration fi...
by benubi
Wed Mar 20, 2024 12:34 pm
Forum: 3D Programming
Topic: Should 'Attach' like commands move the attached object?
Replies: 9
Views: 438

Re: Should 'Attach' like commands move the attached object?

There was a bug with it in 5.22 - 5.73 when I tested and perhaps still exists. When you attach a resized entity the scale modificators will be ignored. I tried to attach the rusty barrel to the robot in that code. When it did, the barrel shrunk in size (to the original size), but it would also remai...
by benubi
Wed Feb 07, 2024 4:44 pm
Forum: Coding Questions
Topic: PB6.10 b5 Created Image fails being recognized.
Replies: 6
Views: 331

PB6.10 b5 Created Image fails being recognized.

I can't reproduce the error in a short code; the code I use is approx. 1500 lines long (an incomplete terminal emulator). Img=CreateImage(-1,100,100) Debug img ; returns a number Debug IsImage(img) ; returns zero StartDrawing(ImageOutput(Img)) ; fails / IMA The image is apparently created, the first...
by benubi
Wed Jan 31, 2024 2:30 pm
Forum: Tricks 'n' Tips
Topic: Use "& operator" instead of modulo on power of 2 divisors
Replies: 5
Views: 628

Re: Use "& operator" instead of modulo on power of 2 divisors

My CPU, copy & paste from the device manager Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz 2.90 GHz It seems when comparing the results, some compilers (e.g. Mac) will use that & operator optimization, while others won't but will use some other technique. I've seen somewhere there are sophistica...
by benubi
Mon Jan 29, 2024 10:00 pm
Forum: Tricks 'n' Tips
Topic: Use "& operator" instead of modulo on power of 2 divisors
Replies: 5
Views: 628

Use "& operator" instead of modulo on power of 2 divisors

Hello this code is a nothingburger, not as fast as I hoped for, but still around 2x to 3x faster than using modulo % operator. When you have a divisor of power of 2, you can use an & operation with a mask. Modulo is said to be a slow operation, but it's not that slow as I imagined (at least in t...
by benubi
Tue Jan 16, 2024 4:32 pm
Forum: Coding Questions
Topic: Two compiled files have different hash sums
Replies: 7
Views: 772

Re: Two compiled files have different hash sums

That will necessarily happen when you have compiled them seconds apart. But I don't know what that unexpected randomness means. These could be counters/constants like the build count or version numbering but these should only be compiled exactly where they are used (correct me if I'm wrong). Did you...
by benubi
Mon Jan 01, 2024 4:30 pm
Forum: Feature Requests and Wishlists
Topic: SetSoundFrequency() for Mac and Linux
Replies: 4
Views: 588

Re: SetSoundFrequency() for Mac and Linux

It would be also nice if there was an audio recording function, perhaps some "custom audio callbacks" for life sound generation (or recording/encoding/streaming in or out).
by benubi
Mon Jan 01, 2024 3:38 pm
Forum: Off Topic
Topic: Happy New Year 2024 !
Replies: 23
Views: 2902

Re: Happy New Year 2024 !

Happy New Year! Thank you very much Fred & everybody from Team PureBasic for all you are doing. Thank you to all forum members for their contributions small and big, from simple to genius level. May you and your loved ones be blessed. May you be protected from the arguments, angers & worries...
by benubi
Fri Dec 08, 2023 4:42 pm
Forum: Coding Questions
Topic: Which one is faster
Replies: 24
Views: 1720

Re: Which one is faster

Procedure.a Limit1(x.w) If x<0 ProcedureReturn 0 ElseIf x>255 ProcedureReturn 255 Else ProcedureReturn x EndIf EndProcedure Debug Limit1(-1) I suggest also testing with a shorter return type (.a) but it may result in a handicap. And if the limit of x is in .w word range I would try to use .w for pa...
by benubi
Fri Dec 08, 2023 4:18 pm
Forum: 3D Programming
Topic: Demo 3D - Shoal of fish V2
Replies: 35
Views: 3777

Re: Demo 3D - Shoal of fish V2

Wow! That's a triple AAA demo code it even has Boids and the fishies look sooo beautiful :)
"That's a keeper."
by benubi
Fri Oct 06, 2023 6:28 pm
Forum: Coding Questions
Topic: Help me understand maps
Replies: 45
Views: 4046

Re: Help me understand maps

I stand corrected then, it's not how I imagined it :oops:
by benubi
Fri Oct 06, 2023 4:44 pm
Forum: Tricks 'n' Tips
Topic: Getting information about an IP address from PB
Replies: 6
Views: 598

Re: Getting information about an IP address from PB

Better keep an eye on the limitations (for free access users). Max. 45 request per minute, and only HTTP - which may not be good because it send the IP information in plain text (JSON). You can get SSL for paying a monthly fee. In any case you probably want to cache the IP results to speed up and mi...
by benubi
Fri Oct 06, 2023 4:32 pm
Forum: Coding Questions
Topic: Help me understand maps
Replies: 45
Views: 4046

Re: Help me understand maps

You have a collision when both strings Key$'s have the same hash value. The better the hashing algorithm the lesser collisions become probable. We could use a fake CRC32 function to make a hash for a string key, like this: Procedure.l FakeCRC32(text$) Protected result.l = $14141414 Protected i Prote...
by benubi
Fri Oct 06, 2023 3:51 pm
Forum: Tricks 'n' Tips
Topic: Speed up division by instead using inverse and multiply
Replies: 14
Views: 1206

Re: Speed up division by instead using inverse and multiply

Try defining width and height as float. Or putting the 0.5 first. I can't test it right now. In that "special" case it won't work because modulo operations are performed on those variables, and modulos aren't allowed on floats. They represent pixel coordinates of a texture/image/2D height...