Changeset 234


Ignore:
Timestamp:
Jan 19, 2011, 1:34:35 PM (10 years ago)
Author:
sam
Message:

Add our custom mouse pointer. Switch framerate to 60 fps so that the mouse
movement doesn't appear sluggish.

Location:
trunk/monsterz
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/board.cpp

    r231 r234  
    3232private:
    3333    Game *game;
    34     int screen, board;
     34    int screen, board, tiles;
    3535    Piece *pieces[8][8];
    3636    float nextblink;
     
    4848    data->screen = Tiler::Register(PNG_BACKGROUND, 640, 480, 1.0f);
    4949    data->board = Tiler::Register(PNG_BOARD, 384, 384, 1.0f);
     50    data->tiles = Tiler::Register(PNG_TILES, 48, 48, 1.0f);
    5051
    5152    for (int j = 0; j < 8; j++)
     
    7677    data->game->GetScene()->AddTile((data->screen << 16) | 0, 0, 1050, 0, 0);
    7778    data->game->GetScene()->AddTile((data->board << 16) | 0, 24, 912, 1, 0);
     79
     80    Int2 tmp = Input::GetMousePos();
     81    if (tmp.x >= 0 && tmp.y >= 0)
     82        data->game->GetScene()->AddTile((data->tiles << 16) | 4, tmp.x, 536 - tmp.y, 10, 0);
    7883}
    7984
     
    8691    Tiler::Deregister(data->board);
    8792    Tiler::Deregister(data->screen);
     93    Tiler::Deregister(data->tiles);
    8894    delete data;
    8995}
  • trunk/monsterz/monsterz.cpp

    r227 r234  
    2828#include "debugfps.h"
    2929
    30 static float const FPS = 30.0f;
     30static float const FPS = 60.0f;
    3131
    3232int main(int argc, char **argv)
     
    5050
    5151    SDL_WM_SetCaption("Monsterz", NULL);
     52    SDL_ShowCursor(0);
    5253
    5354    /* Initialise OpenGL */
Note: See TracChangeset for help on using the changeset viewer.