diff options
author | dscho <dscho> | 2006-04-28 11:19:54 +0000 |
---|---|---|
committer | dscho <dscho> | 2006-04-28 11:19:54 +0000 |
commit | 9b51d63d49bca0bd5a2f9efbb6e02532c0672371 (patch) | |
tree | 1790cff903f642e2e3918d9c66d8af4235fd8362 | |
parent | 21b1fd476fb9a3e3bc52097af6ea21fda0e09a46 (diff) | |
download | libtdevnc-9b51d63d49bca0bd5a2f9efbb6e02532c0672371.tar.gz libtdevnc-9b51d63d49bca0bd5a2f9efbb6e02532c0672371.zip |
fix SDLvncviewer for widths which are not divisible by 8
-rw-r--r-- | client_examples/SDLvncviewer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client_examples/SDLvncviewer.c b/client_examples/SDLvncviewer.c index 2e33b09..5695481 100644 --- a/client_examples/SDLvncviewer.c +++ b/client_examples/SDLvncviewer.c @@ -24,6 +24,7 @@ static rfbBool resize(rfbClient* client) { if(okay) { SDL_Surface* sdl=SDL_SetVideoMode(width,height,depth,flags); rfbClientSetClientData(client, SDL_Init, sdl); + client->width = sdl->pitch / (depth / 8); client->frameBuffer=sdl->pixels; if(first || depth!=client->format.bitsPerPixel) { first=FALSE; @@ -41,7 +42,7 @@ static rfbBool resize(rfbClient* client) { rfbClientLog("Could not set resolution %dx%d!\n", client->width,client->height); if(sdl) { - client->width=sdl->w; + client->width=sdl->pitch / (depth / 8); client->height=sdl->h; } else { client->width=0; |