summaryrefslogtreecommitdiff
path: root/tools/checkwps
diff options
context:
space:
mode:
Diffstat (limited to 'tools/checkwps')
-rw-r--r--tools/checkwps/checkwps.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index b074457de7..596082a798 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -231,6 +231,23 @@ void screen_clear_area(struct screen * display, int xstart, int ystart,
231} 231}
232#endif 232#endif
233 233
234/* reimplement some simple stuff from viewport.c which doesnt change the skins
235 validity even if the values are not correct */
236void viewport_set_fullscreen(struct viewport *vp,
237 const enum screen_type screen)
238{
239 vp->x = 0;
240 vp->y = 0;
241 vp->width = screens[screen].lcdwidth;
242 vp->height = screens[screen].lcdheight;
243}
244
245void viewport_set_defaults(struct viewport *vp,
246 const enum screen_type screen)
247{
248 viewport_set_fullscreen(vp, screen);
249}
250
234 251
235int main(int argc, char **argv) 252int main(int argc, char **argv)
236{ 253{
@@ -238,9 +255,8 @@ int main(int argc, char **argv)
238 int filearg = 1; 255 int filearg = 1;
239 256
240 struct wps_data wps; 257 struct wps_data wps;
241#ifdef HAVE_REMOTE_LCD 258 enum screen_type screen = SCREEN_MAIN;
242 struct screen* wps_screen = &screens[SCREEN_MAIN]; 259 struct screen* wps_screen;
243#endif
244 260
245 /* No arguments -> print the help text 261 /* No arguments -> print the help text
246 * Also print the help text upon -h or --help */ 262 * Also print the help text upon -h or --help */
@@ -275,17 +291,18 @@ int main(int argc, char **argv)
275#ifdef HAVE_REMOTE_LCD 291#ifdef HAVE_REMOTE_LCD
276 if(strcmp(&argv[filearg][strlen(argv[filearg])-4], "rwps") == 0) 292 if(strcmp(&argv[filearg][strlen(argv[filearg])-4], "rwps") == 0)
277 { 293 {
278 wps_screen = &screens[SCREEN_REMOTE]; 294 screen = SCREEN_REMOTE;
279 wps.remote_wps = true; 295 wps.remote_wps = true;
280 } 296 }
281 else 297 else
282 { 298 {
283 wps_screen = &screens[SCREEN_MAIN]; 299 screen = SCREEN_MAIN;
284 wps.remote_wps = false; 300 wps.remote_wps = false;
285 } 301 }
286#endif 302#endif
303 wps_screen = &screens[screen];
287 304
288 res = skin_data_load(&wps, argv[filearg], true); 305 res = skin_data_load(screen, &wps, argv[filearg], true);
289 306
290 if (!res) { 307 if (!res) {
291 printf("WPS parsing failure\n"); 308 printf("WPS parsing failure\n");