Ignore:
Timestamp:
Jan 26, 2011, 5:48:40 PM (11 years ago)
Author:
sam
Message:

Fix a few warnings here and there, and try to use the vector classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/debugsprite.cpp

    r294 r295  
    2525    Game *game;
    2626    int tiler;
    27     float x, y, z;
     27    float3 pos;
    2828};
    2929
     
    3939    data->tiler = Tiler::Register("art/test/character-dress.png",
    4040                                  32, 32, sqrtf(2));
    41     data->x = 320;
    42     data->y = 206;
    43     data->z = 0;
     41    data->pos = float3(320, 206, 0);
    4442}
    4543
     
    4846    Entity::TickGame(deltams);
    4947
    50     float2 axis = Input::GetAxis(0);
    51     data->x += 0.1f * sqrtf(2.0f) * deltams * axis.x;
    52     data->y += 0.1f * deltams * axis.y;
     48    float3 move = deltams * 0.1f * (float3)Input::GetAxis(0);
     49    data->pos = data->pos + move * float3(sqrtf(2.0f), 1.0f, 1.0f);
    5350}
    5451
     
    5754    Entity::TickDraw(deltams);
    5855
    59     int x = data->x;
    60     int y = data->y;
    61     int z = data->z;
     56    int3 pos = (int3)data->pos;
    6257
    6358    Scene::GetDefault()->AddTile((data->tiler << 16) | 31,
    64                                  x - 16, y, z, 1);
     59                                 pos.x - 16, pos.y, pos.z, 1);
    6560    Scene::GetDefault()->AddTile((data->tiler << 16) | 15,
    66                                  x - 16, y, z + 32, 1);
     61                                 pos.x - 16, pos.y, pos.z + 32, 1);
    6762}
    6863
Note: See TracChangeset for help on using the changeset viewer.