| 10 | { |
| 11 | |
| 12 | ApocCursor::ApocCursor(sp<Palette> pal) : cursorPos{0, 0} |
| 13 | { |
| 14 | auto f = fw().data->fs.open("xcom3/tacdata/mouse.dat"); |
| 15 | if (!f) |
| 16 | { |
| 17 | LogError("Failed to open xcom3/tacdata/mouse.dat"); |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | auto cursorCount = f.size() / 576; |
| 22 | |
| 23 | while (images.size() < cursorCount) |
| 24 | { |
| 25 | auto palImg = mksp<PaletteImage>(Vec2<int>{24, 24}); |
| 26 | PaletteImageLock l(palImg, ImageLockUse::Write); |
| 27 | for (int y = 0; y < 24; y++) |
| 28 | { |
| 29 | for (int x = 0; x < 24; x++) |
| 30 | { |
| 31 | char palidx; |
| 32 | f.read(&palidx, 1); |
| 33 | l.set(Vec2<int>{x, y}, palidx); |
| 34 | } |
| 35 | } |
| 36 | images.push_back(palImg->toRGBImage(pal)); |
| 37 | } |
| 38 | |
| 39 | CurrentType = CursorType::Normal; |
| 40 | } |
| 41 | |
| 42 | ApocCursor::~ApocCursor() = default; |
| 43 |
nothing calls this directly
no test coverage detected