diff options
author | Thomas Günther <tom@toms-cafe.de> | 2007-09-25 00:29:48 +0200 |
---|---|---|
committer | Thomas Günther <tom@toms-cafe.de> | 2007-09-25 00:29:48 +0200 |
commit | db35a6286cbbebdb39396466628f2292cb63b975 (patch) | |
tree | 8dc5789274dcc1e627e83a24ddfbb466291e68d1 | |
parent | 473eff38fb6c5ef87b218b3a66c1789e0be784e0 (diff) | |
download | vdr-plugin-spider-db35a6286cbbebdb39396466628f2292cb63b975.tar.gz vdr-plugin-spider-db35a6286cbbebdb39396466628f2292cb63b975.tar.bz2 |
Resume the last game.
Customizable width and height.
OSD error compensation (shrink width/height or reduce colors).
Added setup option to hide the top row.
Set normal variation (two decks and 10 piles) as standard, together with "shrink height" and "hide top row".
Added user-defined variations.
Improved key handling.
-rw-r--r-- | README | 105 | ||||
-rw-r--r-- | game.cpp | 226 | ||||
-rw-r--r-- | game.h | 24 | ||||
-rw-r--r-- | po/de_DE.po | 2 | ||||
-rw-r--r-- | po/es_ES.po | 2 | ||||
-rw-r--r-- | setup.cpp | 97 | ||||
-rw-r--r-- | setup.h | 23 | ||||
-rw-r--r-- | spider.cpp | 9 |
8 files changed, 373 insertions, 115 deletions
@@ -1,12 +1,25 @@ -This is a "plugin" for the Video Disk Recorder (VDR). +Spider-Arachnid: A plug-in for the Video Disk Recorder +------------------------------------------------------ -Written by: Thomas Günther <tom@toms-cafe.de> +Copyright (C) 2005-2007, Thomas Günther <tom@toms-cafe.de> -Project's homepage: http://toms-cafe.de/vdr/spider +Project's homepage: http://toms-cafe.de/vdr/spider -Latest version available at: http://toms-cafe.de/vdr/spider +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. -See the file COPYING for license information. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +See the file COPYING for the full license information. Requirements: @@ -58,37 +71,73 @@ cards that become exposed are turned face-up. Empty piles can be filled by any card or sequence. When there are no empty piles you can deal new cards from the pack one card into each pile. +You can suspend a game by pressing the Back key and resume it later (as long as +the VDR isn't stopped). + Setup: ------ -In the setup page one of two variations can be choosed: - -- Mini With one deck and 7 piles -- Normal With two decks and 10 piles - -Cause of the limited OSD space the 'Mini' variation is the standard. - - -Usage: ------- +- Variation One of three variations could be chosen. + Values: Mini, Normal, Custom. Default: Normal. + Mini Variation with one deck and 7 piles. + Normal Variation with two decks and 10 piles. + Custom Variation with user defined deck, pile and deal + counts. +- Deck count Number of decks in the custom variation. + Values: 1-4. Default: 2. +- Pile count Number of piles on the tableau in the custom + variation. + Values: 1-20. Default: 10. +- Deal count Number of deals from the pack in the custom + variation. Each deal places one more card into each + pile. + Values: 1-10. Default: 5. +- OSD position left The left offset of the OSD. + Values: 0-720. Default: 48. +- OSD position top The top offset of the OSD. + Values: 0-576. Default: 45. +- OSD width The width of the OSD. This must be a multiple of 4. + Otherwise it will be aligned. + Values: 100-720. Default: 624. +- OSD height The height of the OSD. + Values: 100-576. Default is 486. +- OSD error compensation Method of compensation if the OSD memory limit is + exceeded. + Values: Shrink height, Shrink width, Shrink width and + height, Reduce colors. Default: Shrink height. + Shrink height Shrink the height of the OSD. + Shrink width Shrink the width of the OSD. + Shrink width and height Shrink the width and the height of the OSD. + Reduce colors Reduce the number of colors of the OSD to 4 colors. + Some colors of the card images will be wrong. +- Hide top row Hide the top row of the tableau. It will be shown if + you move the cursor to the pack. + Values: yes/no. Default: yes. + +With the "Reset" button you can reset all parameters to the default values. + + +Keys: +----- Global keys: -- Back Quit the plug-in -- Blue Start a new game +- Green Take back one move. +- Yellow Redo one move. +- Blue Start a new game. +- Menu/Back Quit the plug-in. Cursor in pile: -- Left/Right Move the cursor to the left/right pile -- Up Move the cursor to the pack -- Ok Select all matching cards in the pile -- Green Take back one move -- Yellow Redo one move +- Left/Right Move the cursor to the left/right pile. +- Up Move the cursor to the pack. +- Ok Select all matching cards in the pile. -Selected pile (yellow cursor): -- Left/Right Move selected cards to the next matching pile left/right -- Up/Down Select one more/less card -- Up Remove a complete suit +Selected pile (yellow cursor if colors not reduced): +- Left/Right Move selected cards to the next matching pile + left/right. +- Up/Down Select one more/less card. +- Up Remove a complete suit. Cursor on pack: -- Down Move to the first pile -- Ok Deal one card into each pile +- Left/Right/Down Move the cursor to the current pile. +- Ok Deal one card into each pile. @@ -17,7 +17,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * $Id: game.cpp 95 2007-09-21 23:01:10Z tom $ + * $Id: game.cpp 97 2007-09-24 22:29:48Z tom $ */ #include "game.h" @@ -58,30 +58,41 @@ Bitmap* cards[suitCount][rankCount]; //--- class SpiderPlugin::Game ------------------------------------------------- +const Game::Colors Game::full_colors = +{ + clrGray50, // background 50% gray + clrRed, // osd_frame red + clrWhite, // card_frame white + clrGray50, // card_frame_bg 50% gray + clrBlue, // inactive_cursor blue + clrYellow // active_cursor yellow +}; +const Game::Colors Game::reduced_colors = +{ + 0xFF0000FF, // background blue + 0xFFFF0000, // osd_frame red + 0xFFFFFFFF, // card_frame white + 0xFF000000, // card_frame_bg black + 0xFF0000FF, // inactive_cursor blue + 0xFF0000FF // active_cursor blue +}; + /** Constructor */ -Game::Game(const SetupData& setup, const char* confdir) : - cOsdObject(true), setup(setup), confdir(confdir) +Game::Game(const SetupData& setup, const char* confdir, + Deck*& deck, Tableau*& tableau) : + cOsdObject(true), setup(setup), confdir(confdir), deck(deck), tableau(tableau) { - width = 504; - height = 360; - xPos = (720 - width) / 2; - yPos = (576 - height) / 2; - xDist = 1; - yDist = cardHeight / 6; osd = NULL; - deck = NULL; - tableau = NULL; currentPile = 0; status = cursorOnPile; - info = new Bitmap(width * 2 / 3, 60); + info = new Bitmap(360, 60); infoText = NULL; + colors = full_colors; } /** Destructor */ Game::~Game() { - delete deck; - delete tableau; delete info; delete osd; for (int s = 0; s < suitCount; ++s) @@ -99,9 +110,64 @@ void Game::Show() osd = cOsdProvider::NewOsd(0, 0); if (osd) { - tArea area = { xPos, yPos, xPos + width - 1, yPos + height - 1, 4 }; + tArea area = { setup.osd_left, + setup.osd_top, + setup.osd_left + (setup.osd_width & ~0x03) - 1, + setup.osd_top + setup.osd_height - 1, + 4 }; + eOsdError err = osd->CanHandleAreas(&area, 1); + if (err == oeOutOfMemory && + setup.osd_error_compensation == SetupData::ReduceColors) + { + // Reduce colors + area.bpp = 2; + err = osd->CanHandleAreas(&area, 1); + } + while (err == oeOutOfMemory) + { + if (setup.osd_error_compensation != SetupData::ShrinkWidth) + { + // Shrink height + area.y1 += 2; + area.y2 -= 2; + } + if (setup.osd_error_compensation == SetupData::ShrinkWidth || + setup.osd_error_compensation == SetupData::ShrinkWidthHeight) + { + // Shrink width + area.x1 += 2; + area.x2 -= 2; + } + err = osd->CanHandleAreas(&area, 1); + } + + // Before setting the osd area - check if we are near the osd memory limit - + // then we use an workaround for driver error (no output near memory limit) + // I hope an extra shrink of 12 lines height is enough to avoid the error + area.y2 += 12; + err = osd->CanHandleAreas(&area, 1); + area.y2 -= 12; + if (err == oeOutOfMemory) + { + area.y1 += 6; + area.y2 -= 6; + } osd->SetAreas(&area, 1); - start(); + if (area.bpp <= 2) + colors = reduced_colors; + + // Load bitmaps + cursor = new Bitmap(cursorWidth, cursorHeight, confdir, cursorName); + back = new Bitmap(cardWidth, cardHeight, confdir, coverName); + frame = new Bitmap(cardWidth, cardHeight, colors.card_frame, + colors.card_frame_bg); + for (int s = 0; s < suitCount; ++s) + for (int r = 0; r < rankCount; ++r) + cards[s][r] = new Bitmap(cardWidth, cardHeight, confdir, + suitNames[s], rankNames[r]); + + if (deck == NULL || tableau == NULL) + start(); paint(); } } @@ -199,6 +265,16 @@ eOSState Game::ProcessKey(eKeys key) tableau->unselect(); status = cursorOnPile; break; + case kGreen: + tableau->unselect(); + tableau->backward(); + status = cursorOnPile; + break; + case kYellow: + tableau->unselect(); + tableau->forward(); + status = cursorOnPile; + break; default: return osContinue; } @@ -207,9 +283,10 @@ eOSState Game::ProcessKey(eKeys key) { switch (key) { + case kLeft: + case kRight: case kDown: status = cursorOnPile; - currentPile = 0; break; case kOk: if (tableau->pack->empty()) @@ -219,6 +296,12 @@ eOSState Game::ProcessKey(eKeys key) else tableau->deal(); break; + case kGreen: + tableau->backward(); + break; + case kYellow: + tableau->forward(); + break; default: return osContinue; } @@ -237,19 +320,6 @@ eOSState Game::ProcessKey(eKeys key) /** Start a new game */ void Game::start() { - // Load bitmaps - if (cursor == NULL) - { - cursor = new Bitmap(cursorWidth, cursorHeight, confdir, cursorName); - back = new Bitmap(cardWidth, cardHeight, confdir, coverName); - frame = new Bitmap(cardWidth, cardHeight, clrWhite, clrGray50); - - for (int s = 0; s < suitCount; ++s) - for (int r = 0; r < rankCount; ++r) - cards[s][r] = new Bitmap(cardWidth, cardHeight, confdir, - suitNames[s], rankNames[r]); - } - delete deck; delete tableau; deck = NULL; @@ -263,12 +333,17 @@ void Game::start() dealCount = 4; pileCount = 7; } - else // normal variation + else if (setup.variation == SetupData::Normal) { deckCount = 2; dealCount = 5; pileCount = 10; - xDist = -23; + } + else // SetupData::Custom: custom variation + { + deckCount = setup.deck_count; + dealCount = setup.deal_count; + pileCount = setup.pile_count; } if (pileCount > rankCount * suitCount * deckCount) @@ -281,44 +356,48 @@ void Game::start() /** Paint all pieces of the game */ void Game::paint() { - int x1 = xPos; - int x2 = xPos + width - 1; - int y1 = yPos; - int y2 = yPos + height - 1; + const cBitmap* bm = osd->GetBitmap(0); + int x1 = bm->X0(); + int x2 = bm->X0() + bm->Width() - 1; + int y1 = bm->Y0(); + int y2 = bm->Y0() + bm->Height() - 1; // Save and restore palette to reduce flickering - cPalette savePalette(*osd->GetBitmap(0)); - osd->DrawRectangle(x1, y1, x2, y2, clrGray50); + cPalette savePalette(*bm); + osd->DrawRectangle(x1, y1, x2, y2, colors.background); osd->SetPalette(savePalette, 0); // Paint red frame - osd->DrawRectangle(x1, y1, x2, y1 + 1, clrRed); - osd->DrawRectangle(x1, y1, x1 + 1, y2, clrRed); - osd->DrawRectangle(x1, y2 - 1, x2, y2, clrRed); - osd->DrawRectangle(x2 - 1, y1, x2, y2, clrRed); - - paintPack(); - - unsigned int f; - for (f = 0; f < tableau->finals.size(); ++f) - if (tableau->finals[f]->empty()) - break; - unsigned int count = f; - for (f = tableau->finals.size(); f-- > count;) - paintFinal(f); - for (f = 0; f < count; ++f) - paintFinal(f); + osd->DrawRectangle(x1, y1, x2, y1 + 1, colors.osd_frame); + osd->DrawRectangle(x1, y1, x1 + 1, y2, colors.osd_frame); + osd->DrawRectangle(x1, y2 - 1, x2, y2, colors.osd_frame); + osd->DrawRectangle(x2 - 1, y1, x2, y2, colors.osd_frame); + + if (!setup.hide_toprow || status == cursorOnPack) + { + paintPack(); + + unsigned int f; + for (f = 0; f < tableau->finals.size(); ++f) + if (tableau->finals[f]->empty()) + paintFinal(f); + for (f = 0; f < tableau->finals.size(); ++f) + if (!tableau->finals[f]->empty()) + paintFinal(f); + } unsigned int p; - for (p = tableau->piles.size(); p-- > currentPile + 1;) - paintPile(p); - for (p = 0; p <= currentPile; ++p) - paintPile(p); + for (p = 0; p < tableau->piles.size(); ++p) + if (tableau->piles[p]->empty()) + paintPile(p); + for (p = 0; p < tableau->piles.size(); ++p) + if (!tableau->piles[p]->empty()) + paintPile(p); if (infoText) { info->text(infoText); - osd->DrawBitmap(xPos + (width - info->Width()) / 2, yPos + 10, *info); + osd->DrawBitmap(x1 + (x2 - x1 + 1 - info->Width()) / 2, y1 + 10, *info); infoText = NULL; } osd->Flush(); @@ -327,8 +406,9 @@ void Game::paint() /** Paint the pack */ void Game::paintPack() { - int packX = xPos + 1; - int packY = yPos + 1; + const cBitmap* bm = osd->GetBitmap(0); + int packX = bm->X0() + 1; + int packY = bm->Y0() + 1; if (tableau->pack->empty()) paintFrame(packX, packY); else @@ -340,9 +420,11 @@ void Game::paintPack() /** Paint a final heap */ void Game::paintFinal(unsigned int f) { + const cBitmap* bm = osd->GetBitmap(0); int offset = tableau->piles.size() - tableau->finals.size(); - int finalX = xPos + 1 + (f + offset) * (cardWidth + xDist); - int finalY = yPos + 1; + int finalX = bm->X0() + 1 + ((f + offset) * (bm->Width() - 1 - cardWidth)) / + (tableau->piles.size() - 1); + int finalY = bm->Y0() + 1; if (tableau->finals[f]->empty()) paintFrame(finalX, finalY); else @@ -352,16 +434,20 @@ void Game::paintFinal(unsigned int f) /** Paint a pile */ void Game::paintPile(unsigned int p) { - int pileX = xPos + 1 + p * (cardWidth + xDist); - int pileY = yPos + 1 + cardHeight + 1; + const cBitmap* bm = osd->GetBitmap(0); + int pileX = bm->X0() + 1 + (p * (bm->Width() - 1 - cardWidth)) / + (tableau->piles.size() - 1); + int pileY = bm->Y0() + 1; + if (!setup.hide_toprow || status == cursorOnPack) + pileY += cardHeight + 1; paintFrame(pileX, pileY); int count = tableau->piles[p]->count(); int closed = count - tableau->piles[p]->open(); int unselected = count - tableau->piles[p]->selected(); - int dist = yDist; - if (pileY + (count + 1) * dist > yPos + height) - dist = (yPos + height - pileY) / (count + 1); + int dist = cardHeight / 6; + if (pileY + (count + 1) * dist > bm->Y0() + bm->Height()) + dist = (bm->Y0() + bm->Height() - pileY) / (count + 1); for (int c = 0; c < count; ++c, pileY += dist) { @@ -383,9 +469,9 @@ void Game::paintCursor(int x, int y) { int x0 = x + (cardWidth - cursorWidth) / 2; int y0 = y + (cardHeight - cursorHeight) / 2; - tColor color = clrBlue; + tColor color = colors.inactive_cursor; if (status == selectedPile) - color = clrYellow; + color = colors.active_cursor; for (x = 0; x < cursorWidth; ++x) for (y = 0; y < cursorHeight; ++y) if (cursor->Color(*cursor->Data(x, y)) != clrTransparent) @@ -17,7 +17,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * $Id: game.h 95 2007-09-21 23:01:10Z tom $ + * $Id: game.h 97 2007-09-24 22:29:48Z tom $ */ #ifndef VDR_SPIDER_GAME_H @@ -43,21 +43,31 @@ namespace SpiderPlugin { const SetupData& setup; const char* confdir; - int width, height; - int xPos, yPos; - int xDist, yDist; cOsd* osd; Bitmap* info; const char* infoText; - Spider::Deck* deck; - Spider::Tableau* tableau; + Spider::Deck*& deck; + Spider::Tableau*& tableau; unsigned int currentPile; enum { cursorOnPile, selectedPile, cursorOnPack, gameOver } status; + struct Colors + { + tColor background; + tColor osd_frame; + tColor card_frame; + tColor card_frame_bg; + tColor inactive_cursor; + tColor active_cursor; + }; + Colors colors; + static const Colors full_colors; + static const Colors reduced_colors; public: /** Constructor */ - Game(const SetupData& setup, const char* confdir); + Game(const SetupData& setup, const char* confdir, + Spider::Deck*& deck, Spider::Tableau*& tableau); /** Destructor */ virtual ~Game(); diff --git a/po/de_DE.po b/po/de_DE.po index 22f4053..d251b8f 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the vdr-spider package. # Thomas Günther <tom@toms-cafe.de>, 2005. # -# $Id$ +# $Id: de_DE.po 97 2007-09-24 22:29:48Z tom $ # msgid "" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 3f1ea29..e99ed10 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the vdr-spider package. # bittor from open7x0.org, 2007. # -# $Id$ +# $Id: es_ES.po 97 2007-09-24 22:29:48Z tom $ # msgid "" msgstr "" @@ -17,7 +17,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * $Id: setup.cpp 95 2007-09-21 23:01:10Z tom $ + * $Id: setup.cpp 97 2007-09-24 22:29:48Z tom $ */ #include "setup.h" @@ -35,7 +35,16 @@ using namespace SpiderPlugin; */ SetupData::SetupData() { - variation = Mini; + variation = Normal; + deck_count = 2; + pile_count = 10; + deal_count = 5; + osd_left = 48; + osd_top = 45; + osd_width = 624; + osd_height = 486; + osd_error_compensation = ShrinkHeight; + hide_toprow = 1; } /** Parse the setup parameters of the plugin. @@ -47,6 +56,24 @@ bool SetupData::parse(const char* name, const char* value) { if (!strcasecmp(name, "Variation")) variation = atoi(value); + else if (!strcasecmp(name, "CustomDeckCount")) + deck_count = atoi(value); + else if (!strcasecmp(name, "CustomPileCount")) + pile_count = atoi(value); + else if (!strcasecmp(name, "CustomDealCount")) + deal_count = atoi(value); + else if (!strcasecmp(name, "OSDLeft")) + osd_left = atoi(value); + else if (!strcasecmp(name, "OSDTop")) + osd_top = atoi(value); + else if (!strcasecmp(name, "OSDWidth")) + osd_width = atoi(value); + else if (!strcasecmp(name, "OSDHeight")) + osd_height = atoi(value); + else if (!strcasecmp(name, "OSDErrorCompensation")) + osd_error_compensation = atoi(value); + else if (!strcasecmp(name, "HideToprow")) + hide_toprow = atoi(value); else return false; return true; @@ -61,8 +88,63 @@ SetupPage::SetupPage(SetupData& setup) : { variationTexts[0] = tr("Mini (one deck)"); variationTexts[1] = tr("Normal"); + variationTexts[2] = tr("Custom"); + compensationTexts[0] = tr("Shrink height"); + compensationTexts[1] = tr("Shrink width"); + compensationTexts[2] = tr("Shrink width and height"); + compensationTexts[3] = tr("Reduce colors"); + SetHelp(tr("Reset")); + Setup(); +} + +/** Set values into the menu page */ +void SetupPage::Setup() +{ + int current = Current(); + Clear(); + Add(new cMenuEditStraItem(tr("Variation"), &data.variation, - 2, variationTexts)); + 3, variationTexts)); + + if (data.variation == SetupData::Custom) + { + // TRANSLATORS: note the leading blank! + Add(new cMenuEditIntItem(tr(" Deck count"), &data.deck_count, 1, 4)); + // TRANSLATORS: note the leading blank! + Add(new cMenuEditIntItem(tr(" Pile count"), &data.pile_count, 1, 20)); + // TRANSLATORS: note the leading blank! + Add(new cMenuEditIntItem(tr(" Deal count"), &data.deal_count, 1, 10)); + } + + Add(new cMenuEditIntItem(tr("OSD position left"), &data.osd_left, 0, 720)); + Add(new cMenuEditIntItem(tr("OSD position top"), &data.osd_top, 0, 576)); + Add(new cMenuEditIntItem(tr("OSD width"), &data.osd_width, 100, 720)); + Add(new cMenuEditIntItem(tr("OSD height"), &data.osd_height, 100, 576)); + Add(new cMenuEditStraItem(tr("OSD error compensation"), + &data.osd_error_compensation, + 4, compensationTexts)); + Add(new cMenuEditBoolItem(tr("Hide top row"), &data.hide_toprow)); + + SetCurrent(Get(current)); + Display(); +} + +/** Process user events */ +eOSState SetupPage::ProcessKey(eKeys Key) +{ + int custom = (data.variation == SetupData::Custom); + eOSState state = cMenuSetupPage::ProcessKey(Key); + + if (Key != kNone && custom != (data.variation == SetupData::Custom)) + Setup(); + + if (state == osUnknown && Key == kRed) + { + data = SetupData(); + Setup(); + state = osContinue; + } + return state; } /** Store the setup parameters of the plugin. @@ -74,4 +156,13 @@ void SetupPage::Store() { setup = data; SetupStore("Variation", setup.variation); + SetupStore("CustomDeckCount", setup.deck_count); + SetupStore("CustomPileCount", setup.pile_count); + SetupStore("CustomDealCount", setup.deal_count); + SetupStore("OSDLeft", setup.osd_left); + SetupStore("OSDTop", setup.osd_top); + SetupStore("OSDWidth", setup.osd_width); + SetupStore("OSDHeight", setup.osd_height); + SetupStore("OSDErrorCompensation", setup.osd_error_compensation); + SetupStore("HideToprow", setup.hide_toprow); } @@ -17,7 +17,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * $Id: setup.h 95 2007-09-21 23:01:10Z tom $ + * $Id: setup.h 97 2007-09-24 22:29:48Z tom $ */ #ifndef VDR_SPIDER_SETUP_H @@ -36,8 +36,18 @@ namespace SpiderPlugin class SetupData { public: - typedef enum { Mini, Normal } Variations; + enum { Mini, Normal, Custom }; int variation; + int deck_count; + int pile_count; + int deal_count; + int osd_left; + int osd_top; + int osd_width; + int osd_height; + enum { ShrinkHeight, ShrinkWidth, ShrinkWidthHeight, ReduceColors }; + int osd_error_compensation; + int hide_toprow; /** Constructor */ SetupData(); @@ -52,7 +62,8 @@ namespace SpiderPlugin /** Setup menu page to adjust the setup parameters of the plugin */ class SetupPage : public cMenuSetupPage { - const char* variationTexts[2]; + const char* variationTexts[3]; + const char* compensationTexts[4]; SetupData& setup; SetupData data; @@ -61,6 +72,12 @@ namespace SpiderPlugin /** Constructor */ SetupPage(SetupData& setup); + /** Set values into the menu page */ + void Setup(); + + /** Process user events */ + virtual eOSState ProcessKey(eKeys key); + protected: /** Store the setup parameters of the plugin. */ @@ -17,10 +17,11 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * $Id: spider.cpp 96 2007-09-23 13:18:41Z tom $ + * $Id: spider.cpp 97 2007-09-24 22:29:48Z tom $ */ #include "spider.h" +namespace Spider { class Deck; class Tableau; } #include "game.h" #include "setup.h" #include "i18n.h" @@ -49,6 +50,8 @@ namespace SpiderPlugin class Plugin : public cPlugin { SetupData setup; + Spider::Deck* deck; + Spider::Tableau* tableau; public: @@ -91,6 +94,8 @@ bool Plugin::Start() #if VDRVERSNUM < 10507 RegisterI18n(Phrases); #endif + deck = NULL; + tableau = NULL; return true; } @@ -100,7 +105,7 @@ bool Plugin::Start() */ cOsdObject* Plugin::MainMenuAction() { - return new Game(setup, ConfigDirectory(Name())); + return new Game(setup, ConfigDirectory(Name()), deck, tableau); } /** Setup menu page to adjust the setup parameters of the plugin |