| View previous topic :: View next topic |
| Author |
Message |
royonimusha
Joined: 26 Jun 2005 Posts: 2
|
Posted: Mon Jun 27, 2005 7:03 pm Post subject: Can't compiled the pg.c.....HELP ME |
|
|
I add a function which name is pgPixel to pg.c and I also add it to pg.h,but when I load the "mk.bat",can't be compiled the pg.c.who'd love to help me?much thanks!
| Code: |
void pgPixel(unsigned long x,unsigned long y,unsigned long color)
{
unsigned char *vptr0;
vptr0=pgGetVramAddr(0,0);
*(unsigned short *)(vptr0+x*2+y*1024)=color;
}
|
The window of MS-DOS send the error information following:
| Code: |
pg.c:in function pgPixel:
pg.c :121: stray:'\241' in program
.........
|
|
|
| Back to top |
|
 |
Knox
Joined: 15 May 2005 Posts: 13 Location: Yorkshire, England
|
Posted: Mon Jun 27, 2005 8:02 pm Post subject: |
|
|
This is what I use:
| Code: | void pgPutPixel(unsigned long x,unsigned long y,unsigned short color)
{
unsigned char *vptr;
vptr=pgGetVramAddr(x,y);
*(unsigned short *)vptr=color;
} |
|
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Mon Jun 27, 2005 11:37 pm Post subject: Re: Can't compiled the pg.c.....HELP ME |
|
|
| royonimusha wrote: | The window of MS-DOS send the error information following:
| Code: |
pg.c:in function pgPixel:
pg.c :121: stray:'\241' in program
.........
|
|
This means you have a special character in line 121. Delete this line and enter it again.
But if you use nem's pgGetVramAddr, you should use the x and y parameter, like royonimusha posted, then you don't need to calculate the offset yourself. |
|
| Back to top |
|
 |
|