Changeset 331 for trunk


Ignore:
Timestamp:
Feb 1, 2011, 11:07:19 PM (11 years ago)
Author:
sam
Message:

Add an Interface class that displays the general interface.

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/Makefile.am

    r321 r331  
    33
    44monsterz_SOURCES = \
    5     monsterz.cpp monsterz.h title.cpp title.h \
     5    monsterz.cpp monsterz.h title.cpp title.h interface.cpp interface.h \
    66    board.cpp board.h piece.cpp piece.h mash.cpp mash.h
    77monsterz_CXXFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
  • trunk/monsterz/board.cpp

    r330 r331  
    3535    int2 dim;
    3636    int npieces;
    37     int screen, board, tiles, icons;
     37    int board, tiles, icons;
    3838    int click, whip;
    3939
     
    7878    data->dim = dim;
    7979    data->npieces = npieces;
    80     data->screen = Tiler::Register(PNG_BACKGROUND, 640, 480, 1.0f);
    8180    data->board = Tiler::Register(PNG_BOARD, 384, 384, 1.0f);
    8281    data->tiles = Tiler::Register(PNG_TILES, 48, 48, 1.0f);
     
    105104
    106105    data->scoretext = new Text(NULL, "monsterz/gfx/font2.png");
     106    data->scoretext->SetAlign(Text::ALIGN_RIGHT);
    107107    data->scoretext->SetPos(int3(624, 432, 1));
    108     data->scoretext->SetAlign(Text::ALIGN_RIGHT);
    109108    Ticker::Ref(data->scoretext);
    110109    data->score = 0;
     
    224223    Entity::TickDraw(deltams);
    225224
    226     Scene::GetDefault()->AddTile((data->screen << 16) | 0, 0, 0, 10, 0);
    227     Scene::GetDefault()->AddTile((data->board << 16) | 0, 24, 72, 1, 0);
     225    Scene::GetDefault()->AddTile((data->board << 16) | 0,
     226                                 position.x, position.y, 1, 0);
    228227
    229228    /* Mini monsterz */
     
    232231        int2 p = int2(444, 380 - 28 * n);
    233232        Scene::GetDefault()->AddTile((data->icons << 16) | n, p.x, p.y, 11, 0);
    234     }
    235 
    236     /* Mouse pointer */
    237     if (data->oldmouse.x >= 0 && data->oldmouse.y >= 0)
    238     {
    239         int2 m = data->oldmouse + (int2)(float2)position + int2(-6, 6 - 48);
    240         Scene::GetDefault()->AddTile((data->tiles << 16) | 22, m.x, m.y, 20, 0);
    241233    }
    242234}
     
    550542    Ticker::Unref(data->emitter);
    551543    Tiler::Deregister(data->board);
    552     Tiler::Deregister(data->screen);
    553544    Tiler::Deregister(data->tiles);
    554545    Tiler::Deregister(data->icons);
  • trunk/monsterz/monsterz.cpp

    r323 r331  
    2525#include "title.h"
    2626#include "board.h"
     27#include "interface.h"
    2728
    2829#include "debugfps.h"
     
    6566    new Board(int2(8, 8), 9);
    6667    //new Title();
     68    new Interface();
    6769    new DebugFps(460, 20);
    6870
  • trunk/monsterz/title.cpp

    r322 r331  
    3131
    3232private:
    33     int screen, title, logo;
     33    int title, logo;
    3434    int anim[6];
    3535    int event[7];
    3636
    37     enum 
     37    enum
    3838    {
    3939        IDLE,
     
    6565    srand(rand() ^ time(NULL));
    6666
    67     data->screen = Tiler::Register(PNG_BACKGROUND, 640, 480, 1.0f);
    6867    data->logo = Tiler::Register(PNG_LOGO, 380, 181, 1.0f);
    6968    data->title = Tiler::Register(PNG_TITLE, 384, 384, 1.0f);
     
    204203    }
    205204
    206     Scene::GetDefault()->AddTile((data->screen << 16) | 0, 0, 0, 0, 0);
    207205    Scene::GetDefault()->AddTile((tiler << 16) | id, 24, 72, 1, 0);
    208206    Scene::GetDefault()->AddTile((data->logo << 16) | 0, 26, 250, 2, 0);
     
    211209Title::~Title()
    212210{
    213     Tiler::Deregister(data->screen);
    214211    Tiler::Deregister(data->logo);
    215212    Tiler::Deregister(data->title);
  • trunk/win32/monsterz.vcxproj

    r327 r331  
    1313  <ItemGroup>
    1414    <ClInclude Include="..\monsterz\board.h" />
     15    <ClInclude Include="..\monsterz\interface.h" />
    1516    <ClInclude Include="..\monsterz\mash.h" />
    1617    <ClInclude Include="..\monsterz\monsterz.h" />
     
    5051  <ItemGroup>
    5152    <ClCompile Include="..\monsterz\board.cpp" />
     53    <ClCompile Include="..\monsterz\interface.cpp" />
    5254    <ClCompile Include="..\monsterz\mash.cpp" />
    5355    <ClCompile Include="..\monsterz\monsterz.cpp" />
  • trunk/win32/monsterz.vcxproj.filters

    r321 r331  
    8989    </ClInclude>
    9090    <ClInclude Include="..\monsterz\board.h" />
     91    <ClInclude Include="..\monsterz\interface.h" />
    9192    <ClInclude Include="..\monsterz\piece.h" />
    9293    <ClInclude Include="..\monsterz\title.h" />
     
    174175    </ClCompile>
    175176    <ClCompile Include="..\monsterz\board.cpp" />
     177    <ClCompile Include="..\monsterz\interface.cpp" />
    176178    <ClCompile Include="..\monsterz\monsterz.cpp" />
    177179    <ClCompile Include="..\monsterz\piece.cpp" />
Note: See TracChangeset for help on using the changeset viewer.