This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Recording mousemovements


Recording mousemovements

Postby kaiton » Jan 3, 2004 @ 5:51pm

Hi!

Ive created a little game(Kai-Bong):
http://www.pocketmatrix.com/forums/view ... 9&start=15

Now, some people would like a replay function.
What's the best way to record the mouse/pen- movements?
I had this in my mind:
a C-struct:

t=struct{
TIME t
POINT p
}

And onmousemove a new variable of this struct
in an linked list.

Is that a good idea?
kaiton
pm Member
 
Posts: 116
Joined: Jan 15, 2002 @ 11:34am


Postby StephC » Jan 3, 2004 @ 6:27pm

Why a linked list ?
Stephane Cocquereaumont / Game Developer at <a href=http://int13.net>int13 production</a> (code monkey)
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby BIGBEN » Jan 5, 2004 @ 6:58pm

User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby wyrd » Jan 5, 2004 @ 8:07pm

wyrd
pm Member
 
Posts: 125
Joined: Jan 2, 2004 @ 10:19pm


Postby Presto » Jan 5, 2004 @ 9:51pm

The vector doesn't have to grow every time you add an item. You can allocate it in blocks, if I'm not mistaken. So you could allocate room for 100 records, and when that fills up, it'll automatically free space for up 100 more, etc. I haven't tried this myself, but I've read about it... Having to rebuild the list every time would most definitely be terrible for performance.
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Postby mlepage » Jan 5, 2004 @ 9:55pm

Vector has exactly the same order of operations for growing as linked list. Anyone using the STL should know this. If you are using the STL and you do not, then you need to take a minute to brush up on the performance guarantees of the various operations on the various containers. If you are not using the STL, and particularly if you labour under the misconception that some containers and operations are slower than they actually are, then you need to start using the STL.
www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby wyrd » Jan 5, 2004 @ 10:41pm

wyrd
pm Member
 
Posts: 125
Joined: Jan 2, 2004 @ 10:19pm


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron