diff options
| author | Japa Illo | 2012-02-22 08:26:47 +0530 |
|---|---|---|
| committer | Japa Illo | 2012-02-22 08:26:47 +0530 |
| commit | 6a2241742561931aa6347c3d72529d976a82ee4d (patch) | |
| tree | 0037edc47bc147de2168210a446d4048955ed0ec /GUI.cpp | |
| parent | ce5ec6c3f87fe5d0fb2bf5c50f097057e58aa039 (diff) | |
| download | stonesense-6a2241742561931aa6347c3d72529d976a82ee4d.tar.gz stonesense-6a2241742561931aa6347c3d72529d976a82ee4d.tar.bz2 stonesense-6a2241742561931aa6347c3d72529d976a82ee4d.tar.xz | |
Made the function that follows the DF window actually follow using the center of the view, instead of the center of the worldsegment, which is more useful.
Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'GUI.cpp')
| -rw-r--r-- | GUI.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -173,18 +173,19 @@ ALLEGRO_COLOR getDayShade(int hour, int tick) void ScreenToPoint(int x,int y,int &x1, int &y1, int &z1)
{ //assume z of 0
- x-=al_get_bitmap_width(al_get_target_bitmap()) / 2;
- y-=al_get_bitmap_height(al_get_target_bitmap()) / 2;
+ x-=config.screenWidth / 2;
+ y-=config.screenHeight / 2;
x/=config.scale;
y/=config.scale;
- x+=al_get_bitmap_width(al_get_target_bitmap()) / 2;
- y+=al_get_bitmap_height(al_get_target_bitmap()) / 2; x-=TILEWIDTH/2;
+ x+=config.screenWidth / 2;
+ y+=config.screenHeight / 2;
+ x-=TILEWIDTH/2;
y+=TILEWIDTH/2;
z1 = -3;
y+= z1*BLOCKHEIGHT/2;
//y-=BLOCKHEIGHT;
x+=TILEWIDTH>>1;
- int offx = al_get_bitmap_width(al_get_target_bitmap()) /2;
+ int offx = config.screenWidth /2;
int offy = (-20)-(BLOCKHEIGHT * config.lift_segment_offscreen);
y-=offy;
x-=offx;
@@ -1331,8 +1332,8 @@ void draw_particle_cloud(int count, float centerX, float centerY, float rangeX, {
for(int i = 0;i < count;i++)
{
- float drawx = centerX + ((((float)rand() / RAND_MAX) - 0.5) * rangeX);
- float drawy = centerY + ((((float)rand() / RAND_MAX) - 0.5) * rangeY);
+ float drawx = centerX + ((((float)rand() / RAND_MAX) - 0.5) * rangeX * config.scale);
+ float drawy = centerY + ((((float)rand() / RAND_MAX) - 0.5) * rangeY * config.scale);
al_draw_tinted_bitmap(sprite, tint, drawx, drawy, 0);
}
}
|
