From 15eab3074ed1dc476c19b48da66e82dea27399b5 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 9 Oct 2012 18:52:43 +0200 Subject: [PATCH] Add -trueColors option --- args.h | 1 + common.h | 1 + dialogs.c | 1 + draw.c | 2 +- 4 files changed, 4 insertions(+), 1 deletions(-) diff --git a/args.h b/args.h index d4f8683..b91608d 100644 --- a/args.h +++ b/args.h @@ -215,6 +215,7 @@ ArgDescriptor argDescriptors[] = { { "png", ArgFilename, (void *) &appData.pngDirectory, FALSE, INVALID }, { "svgDirectory", ArgFilename, (void *) &appData.svgDirectory, XBOARD, (ArgIniType) "" }, { "svg", ArgFilename, (void *) &appData.svgDirectory, FALSE, INVALID }, + { "trueColors", ArgBoolean, (void *) &appData.trueColors, TRUE, (ArgIniType) FALSE }, { "soundDirectory", ArgFilename, (void *) &appData.soundDirectory, XBOARD, (ArgIniType) "" }, { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, { "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE }, diff --git a/common.h b/common.h index 2044c03..68749f3 100644 --- a/common.h +++ b/common.h @@ -415,6 +415,7 @@ typedef struct { char *remoteUser; float timeDelay; char *timeControl; + Boolean trueColors; Boolean icsActive; char *icsHost; char *icsPort; diff --git a/dialogs.c b/dialogs.c index 42e6379..c27fdfe 100644 --- a/dialogs.c +++ b/dialogs.c @@ -813,6 +813,7 @@ static Option boardOptions[] = { { 0, 0, 0, NULL, (void*) &appData.useBitmaps, "", NULL, CheckBox, N_("Use Board Textures") }, { 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".xpm", NULL, FileName, N_("Light-Squares Texture File:") }, { 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".xpm", NULL, FileName, N_("Dark-Squares Texture File:") }, +{ 0, 0, 0, NULL, (void*) &appData.trueColors, "", NULL, CheckBox, N_("Use external piece bitmaps with their own colors") }, { 0, 0, 0, NULL, (void*) &appData.pngDirectory, "", NULL, PathName, N_("Directory with PNG Pieces:") }, { 0, 0, 0, NULL, (void*) &appData.svgDirectory, "", NULL, PathName, N_("Directory with SVG Pieces:") }, { 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" } diff --git a/draw.c b/draw.c index da0c4d2..ab9b693 100644 --- a/draw.c +++ b/draw.c @@ -316,7 +316,7 @@ ScaleOnePiece (char *name, int color, int piece) cairo_paint (cr); cairo_destroy (cr); - { // operate on bitmap to color it (king-size hack...) + if(!appData.trueColors || !*appData.pngDirectory && !appData.svgDirectory) { // operate on bitmap to color it (king-size hack...) int stride = cairo_image_surface_get_stride(cs)/4; int *buf = (int *) cairo_image_surface_get_data(cs); int i, j, p; -- 1.7.0.4