Search found 147 matches

by Deeem2031
Fri May 03, 2013 11:48 am
Forum: Coding Questions
Topic: Pb 5.11 bug or not ? (ok no bug)
Replies: 5
Views: 979

Re: Pb 5.11 bug or not ?

Code: Select all

read.i a
while a<>0
  ad$=ad$+chr(a)
  read.i a
wend
should do the trick
by Deeem2031
Sun Feb 24, 2013 11:40 am
Forum: Announcement
Topic: New Syntax Extension: (Structure pointer as return value)
Replies: 3
Views: 3520

Re: New Syntax Extension: (Structure pointer as return value

I like the idea, but there are 2 flaws I noticed:

1. Your regular expressions search until they find "(" or " ". This fails for example with this: "*x = *y.*foo|*z.*bar" (there are probably better examples out there)
You should include characters a identifier for a structure can have instead of ...
by Deeem2031
Tue Sep 07, 2010 11:51 am
Forum: The PureBasic Editor
Topic: Editing Data Breakpoints
Replies: 0
Views: 1471

Editing Data Breakpoints

They are pretty nice but it's pretty annoying to rewrite the whole expression again and again instead of editing existing breakpoints.
Via double click would be the most intuitive and fast way imho.
by Deeem2031
Thu Mar 18, 2010 8:27 pm
Forum: Coding Questions
Topic: [DONE] Swap 2 bits in an integer
Replies: 21
Views: 2798

Re: Reverse a single bit in an integer

I don't see why you don't use the binary XOR operator:

#bit2 = 4
#bit0 = 1

Macro FlipBits_0_and_2(number)
number ! #bit2

number ! #bit0
EndMacro

number = %000

FlipBits_0_and_2(number)

Debug RSet(Bin(number),3,"0")

FlipBits_0_and_2(number)

Debug RSet(Bin(number),3,"0")
by Deeem2031
Mon Mar 01, 2010 6:03 pm
Forum: Off Topic
Topic: This Company Sucks..
Replies: 60
Views: 10330

Re: This Company Sucks..

Yes, but if you're doing 150 mph would it still slow you down so quickly? I doubt it. More like the wheel would shred the brake due to the high revolutions.
It doesn't need to slow you down quickly, it just needs to slow you down and it can stop you. Brakes (pads or shoes) are meant to be used and ...
by Deeem2031
Tue Nov 10, 2009 6:01 pm
Forum: Coding Questions
Topic: PNG Decoder reads RGBA(0,0,0,$FF) as 0
Replies: 3
Views: 1393

Re: [4.40b6x86] PNG Decoder reads RGBA(0,0,0,$FF) as 0

c4s wrote:[OFFTOPIC]
Is this a screenshot from Conspiracy's "Beyond"?
...Oh I love this demo!
[/OFFTOPIC]
Yes. (The next version of eirstt will use screenshots of this demo as background images.)
by Deeem2031
Tue Nov 10, 2009 1:54 pm
Forum: Coding Questions
Topic: PNG Decoder reads RGBA(0,0,0,$FF) as 0
Replies: 3
Views: 1393

PNG Decoder reads RGBA(0,0,0,$FF) as 0

InitSprite()
InitSprite3D()
OpenWindowedScreen(OpenWindow(0,0,0,800,600,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered), 0,0,800,600,0,0,0)

UsePNGImageDecoder()
LoadSprite(0, "bg_00.png", #PB_Sprite_Texture)
CreateSprite3D(0, 0)
LoadSprite(1, "bg_01.png", #PB_Sprite_Texture)
CreateSprite3D(1 ...
by Deeem2031
Sun Sep 27, 2009 12:57 pm
Forum: Feature Requests and Wishlists
Topic: SizeOf() in Asm directives
Replies: 1
Views: 1376

SizeOf() in Asm directives

Would be nice if is works:

Code: Select all

EnableASM
  PUSH SizeOf(POINT)
by Deeem2031
Wed Sep 23, 2009 3:26 am
Forum: Coding Questions
Topic: You can rotate an array {solved 2 ways}
Replies: 6
Views: 2067

Re: Can you rotate an array?

Not exactly what you asked for, but "rotating" an array is faster by simply calculating the indexes differently:

; Define piece arrays
Global Dim piece.b(4,4)
Global r

Macro piece_0(x,y)
piece(x,y)
EndMacro

Macro piece_90(x,y)
piece(y,4-x)
EndMacro

Macro piece_180(x,y)
piece(4-x,4-y ...
by Deeem2031
Sat Sep 19, 2009 10:44 pm
Forum: Feature Requests and Wishlists
Topic: Size of elements of an array
Replies: 0
Views: 915

Size of elements of an array

It would be great if it would be possible to get the size of the elements of an array.

Code: Select all

Structure x
  l.l
  e.w[2]
EndStructure

Debug SizeOf(x)
Debug SizeOf(x\e)
;Debug SizeOf(x\e[])
by Deeem2031
Thu Sep 03, 2009 9:09 am
Forum: Feature Requests and Wishlists
Topic: Optional Width and Height parameter for DisplaySprite
Replies: 3
Views: 1195

1. wouldn't you need TWO pairs of X/Y, one for the display point and one for the clipstart?

2. istn't that exactly the use what the native command ClipSprite() is for?


PS:
or is it about stretching?

then ZoomSprite3D() is the native Command you're looking for.

Yea sure it's about stretching ...
by Deeem2031
Thu Sep 03, 2009 8:43 am
Forum: Feature Requests and Wishlists
Topic: Optional Width and Height parameter for DisplaySprite
Replies: 3
Views: 1195

Optional Width and Height parameter for DisplaySprite

I doubt adding optional Width and Height parameter for DisplaySprite() is a big problem in any of the subsystems (I'm not sure for SDL but at least in OpenGL, DX7 and DX9 it should be possible) even though it would help alot for many cases of 2D graphic programming.



Until now I helped me out with ...
by Deeem2031
Thu Jul 02, 2009 10:56 pm
Forum: Feature Requests and Wishlists
Topic: Move the tabs in the editor?
Replies: 14
Views: 2864

Yea it would be usefull, but if we have with this http://www.purebasic.fr/english/viewtop ... highlight= we won't need it ;)
by Deeem2031
Sat May 23, 2009 9:22 am
Forum: Off Topic
Topic: New BOX PHYSICS game!
Replies: 5
Views: 1421

None is impossible ;)
by Deeem2031
Fri May 15, 2009 8:49 pm
Forum: Tricks 'n' Tips
Topic: Dobro_replace() question for Fred in last message
Replies: 27
Views: 9156

But it should work this way, this looks like a bug because all regex-tools i tried did it as expected (try for example: http://www.fileformat.info/tool/regex.htm). Only PB does not do it right.