Added cursors

This commit is contained in:
Clownacy 2019-02-10 16:35:23 +00:00
parent 37a6c1a7ab
commit 6265f81b14
9 changed files with 104 additions and 0 deletions

View file

@ -129,6 +129,8 @@ RESOURCES = \
BITMAP/CREDIT16.bmp \
BITMAP/CREDIT17.bmp \
BITMAP/CREDIT18.bmp \
CURSOR/CURSOR_IKA.bmp \
CURSOR/CURSOR_NORMAL.bmp \
ICON/4.bmp \
ORG/ACCESS \
ORG/ANZEN \

BIN
res/CURSOR/CURSOR_IKA.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

BIN
res/CURSOR/CURSOR_IKA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

View file

@ -204,7 +204,29 @@ int main(int argc, char *argv[])
}
RECT unused_rect = {0, 0, 320, 240};
//Load cursor
SDL_RWops *fp = FindResource("CURSOR_NORMAL");
if (fp)
{
SDL_Surface *cursor_surface = SDL_LoadBMP_RW(fp, 1);
SDL_SetColorKey(cursor_surface, SDL_TRUE, SDL_MapRGB(cursor_surface->format, 0xFF, 0, 0xFF)); // Pink regions are transparent
SDL_Cursor *cursor = SDL_CreateColorCursor(cursor_surface, 0, 0); // Don't worry, the hotspots are accurate to the original files
if (cursor)
SDL_SetCursor(cursor);
else
printf("Failed to load cursor");
SDL_FreeSurface(cursor_surface);
}
else
{
printf("Failed to load cursor");
}
//Get window dimensions and colour depth
int colourDepth = 16;

View file

@ -70,6 +70,8 @@
#include "Resource/BITMAP/PIXEL.bmp.h"
#endif
#include "Resource/ICON/4.bmp.h"
#include "Resource/CURSOR/CURSOR_IKA.bmp.h"
#include "Resource/CURSOR/CURSOR_NORMAL.bmp.h"
const unsigned char* GetResource(const char *name, size_t *size)
{
@ -395,6 +397,18 @@ const unsigned char* GetResource(const char *name, size_t *size)
*size = sizeof(r4);
return r4;
}
//CURSOR
if (!strcmp(name, "CURSOR_NORMAL"))
{
*size = sizeof(rCURSOR_NORMAL);
return rCURSOR_NORMAL;
}
if (!strcmp(name, "CURSOR_IKA"))
{
*size = sizeof(rCURSOR_IKA);
return rCURSOR_IKA;
}
return NULL;
}

View file

@ -0,0 +1,45 @@
#pragma once
const unsigned char rCURSOR_IKA[0x28E] = {
0x42, 0x4D, 0x8E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x6C, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x05, 0x00,
0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
0xFF, 0x00, 0x80, 0x80, 0x80, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x04, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x04, 0x40, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x03, 0x40, 0x04, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x10, 0x00, 0x30, 0x44, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x03, 0x30, 0x00, 0x34, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x04, 0x44, 0x00, 0x03, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x10, 0x44, 0x44, 0x40, 0x00, 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x01,
0x11, 0x04, 0x44, 0x04, 0x44, 0x00, 0x03, 0x44, 0x40, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00,
0x10, 0x34, 0x40, 0x44, 0x44, 0x40, 0x00, 0x34, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x00, 0x34, 0x04, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x40, 0x04, 0x44, 0x44, 0x44, 0x44, 0x40, 0x03, 0x44, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x03, 0x44, 0x44, 0x44, 0x44, 0x44, 0x00, 0x34, 0x40, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x30, 0x44, 0x44, 0x44, 0x40, 0x44, 0x40, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x42, 0x04, 0x44, 0x44, 0x04, 0x44, 0x43, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x44, 0x00, 0x44, 0x40, 0x44, 0x42, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x44, 0x40, 0x04, 0x44, 0x44, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x44, 0x44, 0x00, 0x34, 0x30, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x44, 0x44, 0x42, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x44, 0x44, 0x44, 0x30, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04,
0x44, 0x44, 0x44, 0x44, 0x43, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
};

View file

@ -0,0 +1,21 @@
#pragma once
const unsigned char rCURSOR_NORMAL[0x102] = {
0x42, 0x4D, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x6C, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xF0,
0x00, 0x00, 0x10, 0xF0, 0x00, 0x00, 0x19, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x1F, 0xC0,
0x00, 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x1F, 0xE0,
0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1E, 0x00,
0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};