-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.cpp
More file actions
49 lines (42 loc) · 1.08 KB
/
Copy pathplatform.cpp
File metadata and controls
49 lines (42 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "splashkit.h"
#include "platform.h"
#define PLATFORM_HEIGHT 50
platform_data new_platform(double x, double y, platform_size size)
{
platform_data result;
result.x = x;
result.y = y;
result.width = 0;
result.height = PLATFORM_HEIGHT;
result.size = size;
return result;
}
bitmap platform_bitmap(platform_data &platform)
{
string bitmap_name;
bitmap_name = "platform";
switch (platform.size)
{
case EXTRA_SMALL:
bitmap_name += "-xs";
platform.width = platform.x + 65;
break;
case MEDIUM:
bitmap_name += "-m";
platform.width = platform.x + 240;
break;
case LARGE:
bitmap_name += "-l";
platform.width = platform.x + 350;
break;
case EXTRA_LARGE:
bitmap_name += "-xl";
platform.width = platform.x + 425;
break;
case SMALL:
default:
bitmap_name += "-s";
platform.width = platform.x + 120;
}
return bitmap_named(bitmap_name);
}