pointers, pointers, pointers... 
Author Message
 pointers, pointers, pointers...

I have attached 3 files in the next post in the next post under this one
(gtst4.pas, gtst5.pas and carsm.pcx).

gtst4.pas
is a program that loads the pcx file Carssm.pcx and displays it to the
screen.  Then, it takes the schoolbus, and puts it in an array called car1.
Then car1 is displayed moving across the screen.

gtst5.pas
does the same thing except instead of putting the schoolbus in an array, it
uses a pointer which to an array or bytes.  The pointer is called CarScr^ .
My problem is that when I do it this way, the moving schoolbus does not look
right (some wired pixels at the front of it).  Also, when the schoolbus
reaches the end of the screen and comes back from the other side, it becomes
messed (black lines running through the bus).

I know I don't have to use a pointer for an array that is only100x100 bytes,
but I am going to have 20-30 cars and that will take up alot of the 64k, so
I must use pointers.

If you are going to look at this program put Carsm.pcx somewhere on your
drive.  You also need to change line 443 in gtst4, and line 461 in gtst5, to
the picture's location.

I know the program is messy, but it is because I am experimenting

for i:=1 to 1,000,000 do
   writeln('Thank you for helping me!');
:)

Nick



Wed, 18 Jun 1902 08:00:00 GMT  
 pointers, pointers, pointers...
guess this place doesn't support attachments..  well, you can get the files
from:
www.yesic.com/~iandreas/gtst4.pas
www.yesic.com/~iandreas/gtst5.pas
www.yesic.com/~iandreas/carsm.pcx


Quote:
> I have attached 3 files in the next post in the next post under this one
> (gtst4.pas, gtst5.pas and carsm.pcx).

> gtst4.pas
> is a program that loads the pcx file Carssm.pcx and displays it to the
> screen.  Then, it takes the schoolbus, and puts it in an array called
car1.
> Then car1 is displayed moving across the screen.

> gtst5.pas
> does the same thing except instead of putting the schoolbus in an array,
it
> uses a pointer which to an array or bytes.  The pointer is called CarScr^
.
> My problem is that when I do it this way, the moving schoolbus does not
look
> right (some wired pixels at the front of it).  Also, when the schoolbus
> reaches the end of the screen and comes back from the other side, it
becomes
> messed (black lines running through the bus).

> I know I don't have to use a pointer for an array that is only100x100
bytes,
> but I am going to have 20-30 cars and that will take up alot of the 64k,
so
> I must use pointers.

> If you are going to look at this program put Carsm.pcx somewhere on your
> drive.  You also need to change line 443 in gtst4, and line 461 in gtst5,
to
> the picture's location.

> I know the program is messy, but it is because I am experimenting

> for i:=1 to 1,000,000 do
>    writeln('Thank you for helping me!');
> :)

> Nick



Wed, 18 Jun 1902 08:00:00 GMT  
 pointers, pointers, pointers...
k. forget it.... I think I figured it out...........


Quote:
> guess this place doesn't support attachments..  well, you can get the
files
> from:
> www.yesic.com/~iandreas/gtst4.pas
> www.yesic.com/~iandreas/gtst5.pas
> www.yesic.com/~iandreas/carsm.pcx



> > I have attached 3 files in the next post in the next post under this one
> > (gtst4.pas, gtst5.pas and carsm.pcx).

> > gtst4.pas
> > is a program that loads the pcx file Carssm.pcx and displays it to the
> > screen.  Then, it takes the schoolbus, and puts it in an array called
> car1.
> > Then car1 is displayed moving across the screen.

> > gtst5.pas
> > does the same thing except instead of putting the schoolbus in an array,
> it
> > uses a pointer which to an array or bytes.  The pointer is called
CarScr^
> .
> > My problem is that when I do it this way, the moving schoolbus does not
> look
> > right (some wired pixels at the front of it).  Also, when the schoolbus
> > reaches the end of the screen and comes back from the other side, it
> becomes
> > messed (black lines running through the bus).

> > I know I don't have to use a pointer for an array that is only100x100
> bytes,
> > but I am going to have 20-30 cars and that will take up alot of the 64k,
> so
> > I must use pointers.

> > If you are going to look at this program put Carsm.pcx somewhere on your
> > drive.  You also need to change line 443 in gtst4, and line 461 in
gtst5,
> to
> > the picture's location.

> > I know the program is messy, but it is because I am experimenting

> > for i:=1 to 1,000,000 do
> >    writeln('Thank you for helping me!');
> > :)

> > Nick



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pointers Pointers Pointers

2. Pointers to pointers

3. Beginner needs some pointers with pointers!

4. POINTERS POINTERS...

5. Declaring Far pointers in Pascal, i.e. pointers that point to mem outside of stack!

6. Pointer Arithmetic in TP7.0?

7. test being initialised of pointers and objects

8. pointer to function

9. Turbo Pascal Frequently Asked Questions, a monthly pointer

10. question: BP pointer NEW

11. need pointer to information please

12. FAQ Pointer?

 

 
Powered by phpBB® Forum Software