Search found 1443 matches

by STARGÅTE
Tue Oct 19, 2021 11:25 am
Forum: Game Programming
Topic: OpenWindowedScreen glitchy mouse movement
Replies: 2
Views: 30

Re: OpenWindowedScreen glitchy mouse movement

What is the actual frame rate of your scene? If you have a lot of sprite or calculations this frame rate can drop rapidly.
by STARGÅTE
Mon Oct 18, 2021 8:59 pm
Forum: Tricks 'n' Tips
Topic: Memory List for Strings & Numbers
Replies: 7
Views: 237

Re: Memory List for Begginers

Thanks! PB didn't report any errors. You have to enable the purifier in the compiler settings. The purifier has a stronger memory overflow detection: Included debugging tools (last item) If this is not so beginner, should I just remove it? I would recommend to change the title to something like &qu...
by STARGÅTE
Mon Oct 18, 2021 8:12 pm
Forum: Tricks 'n' Tips
Topic: Memory List for Strings & Numbers
Replies: 7
Views: 237

Re: Memory List for Begginers

Your code gives a "Overflow in a dynamically allocated memory block" in Line 12. StringByteLength() gives the length of the string without null-character at the end but PokeS() writes an additional null-character. You have to use either PokeS() with #PB_String_NoZero or allocate 2 more byt...
by STARGÅTE
Sun Oct 17, 2021 11:28 am
Forum: Off Topic
Topic: Logic problem
Replies: 2
Views: 146

Re: Logic problem

I tried to replace letters with numbers, such as A with 10 and B with 8.5 (A covers 9 and 10, B covers 7 and 8 ), and turn the average number to letter with something like that: If A covers 9 and 10 and B covers 7 and 8, than A = 9.5 and B = 7.5. If you then have A, B, B --> 9.5+7.5+7.5 = 24.5 --> ...
by STARGÅTE
Tue Oct 12, 2021 9:20 pm
Forum: Coding Questions
Topic: Smoother FillArea routine
Replies: 7
Views: 644

Re: Smoother FillArea routine

Here is an example algorithm which uses a color distance to blend the filling color with the pixel. Use the left mouse click to fill areas with blue color and see the result. Enumeration #Window #Gadget #Image EndEnumeration Structure Vector X.i Y.i EndStructure ; Calculate the distance between two ...
by STARGÅTE
Tue Oct 12, 2021 7:48 am
Forum: Tricks 'n' Tips
Topic: Alpha Blend 32 bit Images w PB
Replies: 3
Views: 382

Re: Alpha Blend 32 bit Images w PB

I see messy distributes circles.
What is the purpose of this code?

Especially, why you calculate c11 and c22? They are the same as c1 and c2, respectively.

Code: Select all

c1 = $12345678
c11 = Alpha(c1) << 24 + Blue(c1) << 16 + Green(c1) << 8 + Red(c1)
Debug Hex(c1)
Debug Hex(c11)
by STARGÅTE
Mon Oct 11, 2021 8:25 am
Forum: Coding Questions
Topic: Combining Red, Green and Blue parts of an image in PB.
Replies: 6
Views: 547

Re: Combining Red, Green and Blue parts of an image in PB.

You can use the CustomFilterCallback() for this drawing. In your custom filter callback you can extract the color channel (R, G, B) from the source image and insert them in the final result as you can see in the example in the documentation. Procedure FilterCallback(x, y, SourceColor, TargetColor) ;...
by STARGÅTE
Fri Oct 08, 2021 5:39 pm
Forum: General Discussion
Topic: Work order for Bind-Commands
Replies: 6
Views: 601

Re: Work order for Bind-Commands

As an important info I have to say, that the call order of multiple bound events is from the last to the first. Enumeration #Window #Button EndEnumeration Procedure Event1() Debug "Event1 called" EndProcedure Procedure Event2() Debug "Event2 called" EndProcedure Procedure Event3(...
by STARGÅTE
Thu Oct 07, 2021 10:57 pm
Forum: Bugs - C backend
Topic: PB6.0 Alpha 5 - Left shift over 32
Replies: 2
Views: 661

Re: PB6.0 Alpha 5 - Left shift over 32

It seems like "%11" is handled as long, with a variable it works. Procedure shift(left.i) Protected cnst.i = %11 ProcedureReturn cnst << left ; ProcedureReturn %11 << left EndProcedure Define value.i value = shift(32) Debug "should be: 1100000000000000000000000000000000" Debug &q...
by STARGÅTE
Thu Oct 07, 2021 6:19 pm
Forum: Feature Requests and Wishlists
Topic: Return sizes on the PB help
Replies: 5
Views: 695

Re: Return sizes on the PB help

Variables and Types
By default, when a data type is not indicated, the data is an integer.
by STARGÅTE
Fri Oct 01, 2021 3:12 pm
Forum: Coding Questions
Topic: Did ASM syntax changed for PB 6.00 alfa?
Replies: 27
Views: 4475

Re: Did ASM syntax changed for PB 6.00 alfa?

Previous versions of PB do not have problem with it. This doesn't mean that it was correct (or allowed) in the previous versions. The best example is the "problem" with some codes using long instead of integers and now give errors in PB 6.0 while handing with IDs or addresses: Bug with .l...
by STARGÅTE
Thu Sep 30, 2021 10:15 pm
Forum: Coding Questions
Topic: Did ASM syntax changed for PB 6.00 alfa?
Replies: 27
Views: 4475

Re: Did ASM syntax changed for PB 6.00 alfa?

Have you saved edi before you overwrite it? edi is no volatile register, just rax, rcx, rdx, r8 and r9.
In the C-backend, no ASM code is allowed.
by STARGÅTE
Wed Sep 29, 2021 5:41 pm
Forum: Bugs - C backend
Topic: [Done] PB6.0 Alpha 4 - IMA due to procedure size limit?
Replies: 6
Views: 2139

Re: [PB6.0 Alpha 4] - IMA due to procedure size limit?

No crash here.
Windows 10 Pro 20H2
Tested with PB 6.00 Alpha5, x64, x86, ASM, C, with & w/o optimizer
by STARGÅTE
Sun Sep 26, 2021 10:23 pm
Forum: Assembly Programming
Topic: [SOLVED] Trying to make AbsInt()
Replies: 15
Views: 1948

Re: [SOLVED] Trying to make AbsInt()

That function is for floats and doubles. It is not made for ints. But I just did it with an integer? My dummy variable was not of double or float type. Interesting. Also the large Quads are handled correctly. But it wasn't always like that. And is dosn't work in the new c-backend Define Quad.q = -9...
by STARGÅTE
Sun Sep 26, 2021 4:52 pm
Forum: Assembly Programming
Topic: [SOLVED] Trying to make AbsInt()
Replies: 15
Views: 1948

Re: Trying to make AbsInt()

Such macro in combination with ASM would work like you expected. ... Thanks for the reply. Now im even more confused, did the macro work for you? It fails on the !cmp line for me and i cant figure out why. Result is still -42 You have to compare with signed-values (JGE) instead of unsigned values (...