Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Open Source Projects
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Open Source Projects The place to discuss Basic4ppc open source applications.


Pocket Burning Sand (Open Source)


Reply
 
LinkBack Thread Tools Display Modes
  #101 (permalink)  
Old 12-10-2007, 05:04 PM
Senior Member
 
Join Date: Oct 2007
Posts: 147
Default

Is it possible to change the square shaped pen to a circlular one?

Also yes I see the cyellow thing and deleted that comment about five minutes ago when I saw it.
Reply With Quote
  #102 (permalink)  
Old 12-10-2007, 05:07 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default colours!

Great addition with the colours, will integrate that library into the BS code now so it can use the colour functionality

RE librarys/dlls. SO Express c# can do libraries, but ppc apps cant use libraries?
What do u use to create these dlls, is it many steps on top of writing the code to get it as a dll?
Reply With Quote
  #103 (permalink)  
Old 12-10-2007, 05:22 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,336
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by colin9876 View Post
RE librarys/dlls. SO Express c# can do libraries, but ppc apps cant use libraries??
Let me try to explain.

Devices run the Compact Framework (CF) which is a (mostly) compatible subset of the full .NET Framework. Desktops run the full .NET Framework (NF).

Code compiled for the CF can run on the NF. Code compiled for the NF will NOT run on the CF. This is how you can usually use the same library in B4PPC on the device and the desktop, they are compiled for the device. There are some B4PPC libraries that have different versions for the desktop and device due to differences between the two environments. Some B4PPC libraries are available only for the desktop (e.g my FormExDesktop) because the device does not include that functionality.

The Express versions can only compile for the NF even if the code itself is perfectly capable of running on the CF. This is a marketing decison by Microsoft not a fundamental limitation of the Express versions.

Dlls are actually p**s easy to do. You just tell Visual Studio or SharpDevelop what you want, dll, Windows exe or console app and it makes it. Your code has to suit that use of course.
Reply With Quote
  #104 (permalink)  
Old 12-10-2007, 05:57 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,336
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Sorry guys - just noticed a stupid oversight in the colour handling (or lack of). Fixed now.
Attached Files
File Type: zip BitMapHandlerDll.zip (3.2 KB, 9 views)
Reply With Quote
  #105 (permalink)  
Old 12-10-2007, 06:18 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

ok, well Im just reorganising the BSinterface because it needs to be done more logically to go fast. It was drawing pens on the foreground all the time, e.g. in black when a colour wasnt selected

I can implement everything Neil wants from Basic if I have two more things passed to the the library,

Firstly a ELEMENTS() array defining the color, spread
attributes of particles 0 to MAXELMENTS

A rules table rules(MAXELEMENTS,MAXELEMENTS)
which has arguments saying what happens when two colored particles meet
ChangetoElement, dx, dy is all it will need

Ill map out the C# lines in anticipation of Neil working out how to do dlls
Ive got a french exam tomorrow so must go and revise now but will catch up with this later. A Bientot!

Update- what does that FromArgb( col[i]) change do?
Does C# store colours as doubles? Does .Net have a RGB function?

Last edited by colin9876 : 12-10-2007 at 06:27 PM.
Reply With Quote
  #106 (permalink)  
Old 12-10-2007, 06:29 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,336
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by colin9876 View Post
Firstly a ELEMENTS() array defining the color, spread attributes of particles 0 to MAXELMENTS
Already got colour, need an additional array for spread - easy.

Quote:
A rules table rules(MAXELEMENTS,MAXELEMENTS)
which has arguments saying what happens when two colored particles meet
ChangetoElement, dx, dy is all it will need
I don't think you realise the implications of this. At present each particle is treated individually. The only way they can "meet" at the moment is when they ovelap due to spreading. There is no provision for static "objects" for particles and the library fiddles with the array and moves particles around to keep the array compacted. I could go on ... but I'll be interested to see your C# "psuedo code" in case you've got some ideas that I haven't thought of.
Reply With Quote
  #107 (permalink)  
Old 12-10-2007, 06:45 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

Yep have a brill way of making it all work simply

the elements array maps the RGB colours to a simple int 0 to MAX

u know what color u are(say 5), then u look at the colour pixel ur going to on the screen(say 6) and look up rule(5,6) say
then add dx to px, dy to py, and change element type if a different element is specified.

Ive got it running in basic, it can react to all fixed objects and all other moving pixels without slowing it down
I actually could get rid of the spread parameter by combining it in a rule - but Neil wanted it

all the boundry checking can be done by adding a rule in the array too to say e.g. yellow pixels change to black space if they hit a white border

codes not long - just not sure about arrays in C#- whats the best way to pass a 2 dimentional array that has 3 arguments
rule(m,m)=int,int,int etc

Last edited by colin9876 : 12-10-2007 at 07:23 PM.
Reply With Quote
  #108 (permalink)  
Old 12-10-2007, 07:58 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,336
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by colin9876 View Post
just not sure about arrays in C#- whats the best way to pass a 2 dimentional array that has 3 arguments
rule(m,m)=int,int,int etc
Sorry Colin but I don't get this. Arrays don't HAVE arguments. What do you really mean?

Also multiple arbitrary rules per colour may have a bigger performance hit than you assume. If you have some code that works then post it and I will have a look at coding it.
Reply With Quote
  #109 (permalink)  
Old 12-10-2007, 08:37 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

Yes sorry arguments wasnt the right word ... how do u say for each rule(1,2) it looks up a few things (sort of like DIM rule(64,64) Type colchange,dy) ... maybe structure is the right word

u only look up one rule, doesnt matter how many there are in the list- only look up the one relevant to the color u are, and the color of the pixel ur going to.
Heres a rough guide - Ill give u the exact code next week when Ive got it exactly right

bithandler(px(),py(),pcolor(),pspread(),n,rules(,) )
for i=0 to n
plot(px(i),py(i),cBlack)
newpx=px(i) + our random spreadline
newpy=py(i)+1

tocolor=getpixelcolor(newpx,newpy)

if tocolor<>cblack
thisrule=rule(condense(pcolor(i)) , condense(tocolor))
newpy=py(i) + thisrule.dy
pcolor(i)= thisrule.colchange

if getpixel(newpx,newpy)<>cBlack then
newpx=px(i)
newpy=py(i)
end

end

px(i)=newpx
py(i)=newpy
plot(px(i),py(i),pcolor(i))
Next

N.B the condense function just reduces the distinction of the colors so it doesnt need a 64000x64000 rule table. Then I dont need the element look up table either

Condense(R,G,B)=((R Mod64)+1)x((G Mod64)+1)x((R Mod64)+1)
e.g condense(200,100,0)=4*3*1=12
so 4*4*4 distinct colors, rule table is rules(64x64)

Last edited by colin9876 : 12-10-2007 at 09:27 PM.
Reply With Quote
  #110 (permalink)  
Old 12-10-2007, 09:31 PM
Senior Member
 
Join Date: Oct 2007
Posts: 147
Default

That coding goes right through me. I looked through almost every help thing in the help database and I don't think I understood any of that.

I knew that the way that I had created the program was very glitchy and am glad you are willing to sort it.

I find it quite amusing that some members of this forum said that this program couldn't be done.

Youz certainly should them!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pocket Chess Database JamesC Share Your Creations 3 07-27-2008 04:07 AM
Pocket Burning Sand neilnapier Questions & Help Needed 2 11-05-2007 07:53 PM
print class for pocket pc tanrikuluahmet Basic4ppc Wishlist 1 10-01-2007 09:10 AM
dzSpy - Spy and Task Manager App - Open Source dzt Share Your Creations 3 07-15-2007 05:21 AM
Pocket Outlook Object Modell sloopa Basic4ppc Wishlist 12 06-02-2007 08:05 AM


All times are GMT. The time now is 06:55 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0