Changeset 169


Ignore:
Timestamp:
03/10/08 19:55:50 (5 years ago)
Author:
guyru
Message:

remove the initial work on dice themes support

Location:
trunk/src
Files:
5 deleted
3 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/MainFrame.cpp

    r168 r169  
    3232#include "ObjectsID.h" 
    3333#include "highscores_dialog.h" 
    34 #include "dice_theme_dialog.h" 
    3534#include "About.h" 
    3635#include "UtilityFunctions.h" 
     
    4241#include <wx/version.h> 
    4342#include <wx/filename.h> 
     43 
     44 //include the images for the dice        
     45 namespace dice { 
     46 #include "one.xpm" 
     47 #include "two.xpm" 
     48 #include "three.xpm" 
     49 #include "four.xpm" 
     50 #include "five.xpm" 
     51 #include "six.xpm" 
     52 } // namespace dice 
    4453 
    4554//include the icon file 
     
    94103        m_evt_handler = new MainFrameEvtHandler(this); 
    95104         
    96         //bitmap_dices[0] = new wxBitmap(one_xpm); 
    97         //bitmap_dices[1] = new wxBitmap(two_xpm); 
    98         //bitmap_dices[2] = new wxBitmap(three_xpm); 
    99         //bitmap_dices[3] = new wxBitmap(four_xpm); 
    100         //bitmap_dices[4] = new wxBitmap(five_xpm); 
    101         //bitmap_dices[5] = new wxBitmap(six_xpm); 
     105        bitmap_dice[0] = new wxBitmap(dice::one_xpm); 
     106        bitmap_dice[1] = new wxBitmap(dice::two_xpm); 
     107        bitmap_dice[2] = new wxBitmap(dice::three_xpm); 
     108        bitmap_dice[3] = new wxBitmap(dice::four_xpm); 
     109        bitmap_dice[4] = new wxBitmap(dice::five_xpm); 
     110        bitmap_dice[5] = new wxBitmap(dice::six_xpm); 
    102111         
    103112        //randomize the random-number generator based on the time 
     
    152161        gameMenu->Append(ID_SHOWHIGHSCORE,wxT("High &Scores"),wxT("Show high-scores table")); 
    153162        gameMenu->Append(ID_SETTINGS,wxT("Settings"),wxT("Show settings dialog")); 
    154         gameMenu->Append(ID_THEMES,wxT("Dice Theme..."),wxT("Select a dice theme")); 
    155163        gameMenu->Append(wxID_EXIT); 
    156164         
     
    273281        if (m_config->get("horizontal-layout")=="True") { 
    274282                diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE1, 
    275                         m_dice_graphics.GetDice(1)), 0, wxALL, DICE_SPACE); 
     283                        bitmap_dice[0]), 0, wxALL, DICE_SPACE); 
    276284                diceSizer->Add(new wxDynamicBitmap(panel, 
    277                         ID_DICE2, m_dice_graphics.GetDice(2)), 0, wxALL, DICE_SPACE); 
     285                        ID_DICE2, bitmap_dice[1]), 0, wxALL, DICE_SPACE); 
    278286                diceSizer->Add(new wxDynamicBitmap(panel, 
    279                         ID_DICE3, m_dice_graphics.GetDice(3)), 0, wxALL,DICE_SPACE); 
     287                        ID_DICE3, bitmap_dice[2]), 0, wxALL,DICE_SPACE); 
    280288                diceSizer->Add(new wxDynamicBitmap(panel, 
    281                         ID_DICE4, m_dice_graphics.GetDice(4)), 0, wxALL,DICE_SPACE); 
     289                        ID_DICE4, bitmap_dice[3]), 0, wxALL,DICE_SPACE); 
    282290                diceSizer->Add(new wxDynamicBitmap(panel, 
    283                         ID_DICE5, m_dice_graphics.GetDice(5)), 0, wxALL,DICE_SPACE); 
     291                        ID_DICE5, bitmap_dice[4]), 0, wxALL,DICE_SPACE); 
    284292                diceSizer->Add(new wxButton(panel, ID_ROLL, wxT("Roll!"), 
    285293                        wxDefaultPosition, wxSize(64,64)), 0, wxALL,DICE_SPACE); 
     
    296304        } else { 
    297305                diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE1, 
    298                         m_dice_graphics.GetDice(1)), 0, wxALL, DICE_SPACE); 
     306                        bitmap_dice[0]), 0, wxALL, DICE_SPACE); 
    299307                diceSizer->Add(new wxCheckBox(panel, ID_DICE1KEEP, 
    300308                        wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 
    301309                diceSizer->AddSpacer(VER_DICE_SPACER); 
    302310                diceSizer->Add(new wxDynamicBitmap(panel,ID_DICE2, 
    303                         m_dice_graphics.GetDice(2)), 0, wxALL, DICE_SPACE); 
     311                        bitmap_dice[1]), 0, wxALL, DICE_SPACE); 
    304312                diceSizer->Add(new wxCheckBox(panel, ID_DICE2KEEP, 
    305313                        wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 
    306314                diceSizer->AddSpacer(VER_DICE_SPACER); 
    307315                diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE3, 
    308                         m_dice_graphics.GetDice(3)), 0, wxALL, DICE_SPACE); 
     316                        bitmap_dice[2]), 0, wxALL, DICE_SPACE); 
    309317                diceSizer->Add(new wxCheckBox(panel, ID_DICE3KEEP, 
    310318                        wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 
    311319                diceSizer->AddSpacer(VER_DICE_SPACER); 
    312320                diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE4, 
    313                         m_dice_graphics.GetDice(4)), 0, wxALL, DICE_SPACE); 
     321                        bitmap_dice[3]), 0, wxALL, DICE_SPACE); 
    314322                diceSizer->Add(new wxCheckBox(panel, ID_DICE4KEEP, 
    315323                        wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 
    316324                diceSizer->AddSpacer(VER_DICE_SPACER); 
    317325                diceSizer->Add(new wxDynamicBitmap(panel, ID_DICE5,  
    318                         m_dice_graphics.GetDice(5)), 0, wxALL, DICE_SPACE); 
     326                        bitmap_dice[4]), 0, wxALL, DICE_SPACE); 
    319327                diceSizer->Add(new wxCheckBox(panel, ID_DICE5KEEP, 
    320328                        wxT("Keep")), 0, wxLEFT, KEEP_SPACE); 
     
    349357        Connect(ID_SHOWHIGHSCORE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnShowHighscore)); 
    350358        Connect(ID_SETTINGS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnSettings)); 
    351         Connect(ID_THEMES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDiceTheme)); 
    352359        //END connecting the menu items' events 
    353360 
     
    552559 
    553560        delete settings_dialog; 
    554 } 
    555  
    556 /** 
    557  * Shows the dice theme selection dialog. This event-handler is connected to 
    558  * Game->Dice Theme menu item. 
    559  * \param event  
    560  */ 
    561 void MainFrame::OnDiceTheme( wxCommandEvent& event) 
    562 { 
    563         DiceThemeDialog *dialog = new DiceThemeDialog(this,wxID_ANY); 
    564  
    565         if(dialog->ShowModal()!=wxID_OK) 
    566                 return; 
    567  
    568561} 
    569562 
     
    609602                                        ((wxDynamicBitmap*) FindWindow(i +  
    610603                                                ID_DICE1)) -> SetBitmap( 
    611                                                 m_dice_graphics.GetDice(dice[i])); 
     604                                                bitmap_dice[dice[i]-1]); 
    612605                                } 
    613606                        } 
     
    619612                                dice[i] = (int)(6.0*rand()/RAND_MAX)+1; 
    620613                                ((wxDynamicBitmap*) FindWindow(i + ID_DICE1))-> 
    621                                         SetBitmap(m_dice_graphics.GetDice(dice[i])); 
     614                                        SetBitmap(bitmap_dice[dice[i]-1]); 
    622615                        } 
    623616                } 
  • trunk/src/MainFrame.h

    r166 r169  
    2626 
    2727#include "ScoreDice.h" 
    28 #include "dice_graphics.h" 
    2928#include "configuration.h" 
    3029#ifndef MAINFRAME_INC 
     
    5251        void OnShowHighscore (wxCommandEvent& event); 
    5352        void OnSettings (wxCommandEvent& event); 
    54         void OnDiceTheme( wxCommandEvent& event); 
    5553        void OnCheckForUpdates (wxCommandEvent& event); 
    5654        void OnSendComment (wxCommandEvent& event); 
     
    9694 
    9795        //pointers to hold bitmap data for the dices 
    98         wxBitmap *bitmap_dices[6]; 
    99         DiceGraphics m_dice_graphics; 
     96        wxBitmap *bitmap_dice[6]; 
    10097 
    10198        short int m_rolls;      //holds how many rolls left 
  • trunk/src/Makefile.am

    r166 r169  
    55        configuration.h \ 
    66        DBwrapper.cpp \ 
    7         dice_graphics.cpp \ 
    8         dice_theme_dialog.cpp \ 
    97        MainFrame.cpp \ 
    108        highscores_dialog.cpp \ 
     
    1715        ScoreDice.cpp \ 
    1816        UtilityFunctions.cpp \ 
    19         wxDynamicBitmap.cpp 
     17        wxDynamicBitmap.cpp \ 
     18        one.xpm \ 
     19        two.xpm \ 
     20        three.xpm \ 
     21        four.xpm \ 
     22        five.xpm \ 
     23        six.xpm  
    2024 
    2125# set the include path found by configure 
     
    2428# the library search path. 
    2529 
    26 dice_graphics =  \ 
    27         dice/theme1/one.xpm \ 
    28         dice/theme1/two.xpm \ 
    29         dice/theme1/three.xpm \ 
    30         dice/theme1/four.xpm \ 
    31         dice/theme1/five.xpm \ 
    32         dice/theme1/six.xpm \ 
    33         dice/theme2/one.xpm \ 
    34         dice/theme2/two.xpm \ 
    35         dice/theme2/three.xpm \ 
    36         dice/theme2/four.xpm \ 
    37         dice/theme2/five.xpm \ 
    38         dice/theme2/six.xpm \ 
    39         dice/theme3/1.xpm \ 
    40         dice/theme3/2.xpm \ 
    41         dice/theme3/3.xpm \ 
    42         dice/theme3/4.xpm \ 
    43         dice/theme3/5.xpm \ 
    44         dice/theme3/6.xpm 
    45  
    4630noinst_HEADERS = \ 
    4731        About.h \ 
    4832        DBwrapper.h \ 
    49         dice_graphics.h \ 
    50         dice_theme_dialog.h \ 
    5133        Icon.h \ 
    5234        icon32.ico \ 
     
    5537        ScoreDice.h \ 
    5638        UtilityFunctions.h \ 
    57         wxDynamicBitmap.h \ 
    58         $(dice_graphics) 
     39        wxDynamicBitmap.h 
    5940 
    6041AM_CXXFLAGS = `wx-config --cxxflags` 
Note: See TracChangeset for help on using the changeset viewer.