summaryrefslogtreecommitdiffstats
path: root/pnmshow.c
diff options
context:
space:
mode:
authordscho <dscho>2001-09-26 21:20:27 +0000
committerdscho <dscho>2001-09-26 21:20:27 +0000
commit5c3eae92371309d94a5edd4e35caa71a2e481ab9 (patch)
treefa4389c90f5c4fcade0554568a458c087f5c13e8 /pnmshow.c
parentd6082b694129df97fcbe027d30655d2f0225fdca (diff)
downloadlibvncserver-5c3eae92371309d94a5edd4e35caa71a2e481ab9.zip
libvncserver-5c3eae92371309d94a5edd4e35caa71a2e481ab9.tar.gz
API corrections
Diffstat (limited to 'pnmshow.c')
-rw-r--r--pnmshow.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pnmshow.c b/pnmshow.c
index 15644e7..8f4ceed 100644
--- a/pnmshow.c
+++ b/pnmshow.c
@@ -45,7 +45,7 @@ int main(int argc,char** argv)
paddedWidth+=4-(width&3);
/* initialize data for vnc server */
- rfbScreen = rfbDefaultScreenInit(argc,argv,width,height,8,3,4);
+ rfbScreen = rfbGetScreen(argc,argv,paddedWidth,height,8,3,4);
if(argc>1)
rfbScreen->desktopName = argv[1];
else
@@ -57,19 +57,25 @@ int main(int argc,char** argv)
rfbScreen->httpDir = "./classes";
/* allocate picture and read it */
- rfbScreen->frameBuffer = (char*)calloc(paddedWidth*4,height);
+ rfbScreen->frameBuffer = (char*)malloc(paddedWidth*4*height);
fread(rfbScreen->frameBuffer,width*3,height,in);
fclose(in);
/* correct the format to 4 bytes instead of 3 (and pad to paddedWidth) */
- for(j=height-1;j>=0;j--)
+ for(j=height-1;j>=0;j--) {
for(i=width-1;i>=0;i--)
for(k=2;k>=0;k--)
rfbScreen->frameBuffer[(j*paddedWidth+i)*4+k]=
rfbScreen->frameBuffer[(j*width+i)*3+k];
+ for(i=width*4;i<paddedWidth*4;i++)
+ rfbScreen->frameBuffer[j*paddedWidth*4+i]=0;
+ }
+
+ /* initialize server */
+ rfbInitServer(rfbScreen);
/* run event loop */
- runEventLoop(rfbScreen,40000,FALSE);
+ rfbRunEventLoop(rfbScreen,40000,FALSE);
return(0);
}
OpenPOWER on IntegriCloud