Merge branch '#345' into tic_0.47.0

This commit is contained in:
BADIM-PC\Vadim committed 2017-10-20 12:25:13 +03:00
commit 5bb9e8e05d
20 files changed
+322 -333

No files matched your search

+1 -1
View File
@@ -1 +1 @@
0x78, 0xda, 0xed, 0x59, 0x4d, 0x6c, 0x1b, 0x45, 0x14, 0x1e, 0x37, 0x29, 0xd4, 0x6e, 0xc8, 0xc4, 0x12, 0xaa, 0xf8, 0x29, 0xd4, 0x32, 0x3d, 0xf4, 0x90, 0x8a, 0x34, 0x4e, 0x7f, 0x88, 0x64, 0x84, 0x1b, 0x6f, 0x13, 0xd3, 0xc4, 0xb6, 0x9c, 0xb8, 0xa5, 0xaa, 0xd4, 0x10, 0xda, 0x2c, 0x42, 0xa2, 0xb5, 0x68, 0x28, 0x1c, 0x50, 0xa4, 0xaa, 0x52, 0x25, 0x73, 0x0a, 0x87, 0x20, 0xe1, 0x93, 0x8b, 0x7a, 0x33, 0x17, 0x2e, 0xb9, 0xe0, 0x43, 0x04, 0xc7, 0x4a, 0x20, 0x54, 0x21, 0x0e, 0x08, 0x71, 0x41, 0x5c, 0x37, 0xef, 0x14, 0x11, 0x55, 0xea, 0x30, 0x33, 0x3b, 0x6b, 0xcf, 0xce, 0xbe, 0x71, 0x82, 0x54, 0x40, 0x42, 0x9e, 0xe9, 0xcb, 0xdb, 0x99, 0xb7, 0xef, 0xcd, 0xcf, 0xf7, 0xde, 0xcc, 0x3e, 0x37, 0x76, 0xef, 0x29, 0xf2, 0x98, 0xf1, 0x92, 0x4e, 0xa7, 0xd7, 0xea, 0xf5, 0xfa, 0x9a, 0xe0, 0xbc, 0xb9, 0xc6, 0xa0, 0x43, 0x8c, 0x6d, 0x79, 0xe9, 0x34, 0xf3, 0xea, 0x75, 0xf0, 0xd2, 0x77, 0xc0, 0x63, 0x6b, 0xc0, 0x60, 0x0d, 0x20, 0x20, 0xa9, 0x9f, 0x4c, 0x26, 0x6b, 0xae, 0xeb, 0xd6, 0x04, 0xe7, 0xcd, 0x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0xfa, 0x9d, 0xfe, 0x10, 0x9c, 0x84, 0xdc, 0xd8, 0x73, 0x6a, 0xff, 0x6d, 0x79, 0x02, 0x5f, 0x03, 0x1b, 0x05, 0x0e, 0xb8, 0xb1, 0xa7, 0x7c, 0x20, 0xa6, 0x47, 0xf8, 0x0e, 0x18, 0xeb, 0x27, 0xe3, 0x57, 0Line truncated
BIN
View File
Binary file not shown.
+16 -14
View File
@@ -46,7 +46,7 @@ static void history(Code* code)
static void drawStatus(Code* code)
{
const s32 Height = TIC_FONT_HEIGHT + 1;
code->tic->api.rect(code->tic, 0, TIC80_HEIGHT - Height, TIC80_WIDTH, Height, systemColor(tic_color_white));
code->tic->api.rect(code->tic, 0, TIC80_HEIGHT - Height, TIC80_WIDTH, Height, (tic_color_white));
code->tic->api.fixed_text(code->tic, code->status, 0, TIC80_HEIGHT - TIC_FONT_HEIGHT, getConfig()->theme.code.bg);
}
@@ -1408,12 +1408,14 @@ static void textEditTick(Code* code)
static void drawPopupBar(Code* code, const char* title)
{
code->tic->api.rect(code->tic, 0, TOOLBAR_SIZE-1, TIC80_WIDTH, TIC_FONT_HEIGHT + 1, systemColor(tic_color_blue));
code->tic->api.fixed_text(code->tic, title, 0, TOOLBAR_SIZE, systemColor(tic_color_white));
enum {TextY = TOOLBAR_SIZE + 1};
code->tic->api.fixed_text(code->tic, code->popup.text, (s32)strlen(title)*TIC_FONT_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
code->tic->api.rect(code->tic, 0, TOOLBAR_SIZE, TIC80_WIDTH, TIC_FONT_HEIGHT + 1, (tic_color_blue));
code->tic->api.fixed_text(code->tic, title, 0, TextY, (tic_color_white));
drawCursor(code, (s32)(strlen(title) + strlen(code->popup.text)) * TIC_FONT_WIDTH, TOOLBAR_SIZE, ' ');
code->tic->api.fixed_text(code->tic, code->popup.text, (s32)strlen(title)*TIC_FONT_WIDTH, TextY, (tic_color_white));
drawCursor(code, (s32)(strlen(title) + strlen(code->popup.text)) * TIC_FONT_WIDTH, TextY, ' ');
}
static void updateFindCode(Code* code, char* pos)
@@ -1574,7 +1576,7 @@ static void textGoToTick(Code* code)
code->tic->api.clear(code->tic, getConfig()->theme.code.bg);
if(code->jump.line >= 0)
code->tic->api.rect(code->tic, 0, (code->jump.line - code->scroll.y) * TIC_FONT_HEIGHT + TOOLBAR_SIZE-1,
code->tic->api.rect(code->tic, 0, (code->jump.line - code->scroll.y) * TIC_FONT_HEIGHT + TOOLBAR_SIZE + 1,
TIC80_WIDTH, TIC_FONT_HEIGHT+1, getConfig()->theme.code.select);
drawCode(code, false);
@@ -1607,7 +1609,7 @@ static void drawOutlineBar(Code* code, s32 x, s32 y)
}
}
code->tic->api.rect(code->tic, rect.x-1, rect.y, rect.w+1, rect.h, systemColor(tic_color_blue));
code->tic->api.rect(code->tic, rect.x-1, rect.y, rect.w+1, rect.h, (tic_color_blue));
OutlineItem* ptr = code->outline.items;
@@ -1616,15 +1618,15 @@ static void drawOutlineBar(Code* code, s32 x, s32 y)
if(ptr->pos)
{
code->tic->api.rect(code->tic, rect.x - 1, rect.y + code->outline.index*STUDIO_TEXT_HEIGHT,
rect.w + 1, TIC_FONT_HEIGHT + 1, systemColor(tic_color_red));
rect.w + 1, TIC_FONT_HEIGHT + 1, (tic_color_red));
while(ptr->pos)
{
code->tic->api.fixed_text(code->tic, ptr->name, x, y, systemColor(tic_color_white));
code->tic->api.fixed_text(code->tic, ptr->name, x, y, (tic_color_white));
ptr++;
y += STUDIO_TEXT_HEIGHT;
}
}
else code->tic->api.fixed_text(code->tic, "(empty)", x, y, systemColor(tic_color_white));
else code->tic->api.fixed_text(code->tic, "(empty)", x, y, (tic_color_white));
}
static void textOutlineTick(Code* code)
@@ -1689,7 +1691,7 @@ static void textOutlineTick(Code* code)
static void drawCodeToolbar(Code* code)
{
code->tic->api.rect(code->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE-1, systemColor(tic_color_white));
code->tic->api.rect(code->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white));
static const u8 Icons[] =
{
@@ -1766,9 +1768,9 @@ static void drawCodeToolbar(Code* code)
bool active = i == code->mode - TEXT_EDIT_MODE && i != 0;
if(active)
code->tic->api.rect(code->tic, rect.x, rect.y, Size, Size, systemColor(tic_color_blue));
code->tic->api.rect(code->tic, rect.x, rect.y, Size, Size, (tic_color_blue));
drawBitIcon(rect.x, rect.y, Icons + i*BITS_IN_BYTE, active ? systemColor(tic_color_white) : (over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue)));
drawBitIcon(rect.x, rect.y, Icons + i*BITS_IN_BYTE, active ? (tic_color_white) : (over ? (tic_color_dark_gray) : (tic_color_light_blue)));
}
drawToolbar(code->tic, getConfig()->theme.code.bg, false);
@@ -1836,7 +1838,7 @@ void initCode(Code* code, tic_mem* tic)
.tick = tick,
.escape = escape,
.cursor = {{tic->cart.code.data, NULL, 0, 0}, NULL, 0},
.rect = {0, TOOLBAR_SIZE, TIC80_WIDTH, TIC80_HEIGHT - TOOLBAR_SIZE - TIC_FONT_HEIGHT - 1},
.rect = {0, TOOLBAR_SIZE + 1, TIC80_WIDTH, TIC80_HEIGHT - TOOLBAR_SIZE - TIC_FONT_HEIGHT - 1},
.scroll = {0, 0, {0, 0}, false},
.tickCounter = 0,
.history = NULL,
-18
View File
@@ -85,23 +85,6 @@ static void readCursorTheme(Config* config, lua_State* lua)
lua_pop(lua, 1);
}
static void readPaletteMapTheme(Config* config, lua_State* lua)
{
lua_getfield(lua, -1, "PALMAP");
if(lua_isstring(lua, -1))
{
const char* val = lua_tostring(lua, -1);
s32 size = (s32)strlen(val);
if(size == TIC_PALETTE_SIZE)
for(s32 i = 0; i < size; i++)
config->data.theme.palmap.data[i] = val[i] - (val[i] >= '0' && val[i] <= '9' ? '0' : 'a' - 10);
}
lua_pop(lua, 1);
}
static void readCodeTheme(Config* config, lua_State* lua)
{
lua_getfield(lua, -1, "CODE");
@@ -154,7 +137,6 @@ static void readTheme(Config* config, lua_State* lua)
if(lua_type(lua, -1) == LUA_TTABLE)
{
readPaletteMapTheme(config, lua);
readCursorTheme(config, lua);
readCodeTheme(config, lua);
readGamepadTheme(config, lua);
+10 -15
View File
@@ -29,10 +29,10 @@
#include <zlib.h>
#define CONSOLE_CURSOR_COLOR (systemColor(tic_color_red))
#define CONSOLE_BACK_TEXT_COLOR (systemColor(tic_color_dark_gray))
#define CONSOLE_FRONT_TEXT_COLOR (systemColor(tic_color_white))
#define CONSOLE_ERROR_TEXT_COLOR (systemColor(tic_color_red))
#define CONSOLE_CURSOR_COLOR ((tic_color_red))
#define CONSOLE_BACK_TEXT_COLOR ((tic_color_dark_gray))
#define CONSOLE_FRONT_TEXT_COLOR ((tic_color_white))
#define CONSOLE_ERROR_TEXT_COLOR ((tic_color_red))
#define CONSOLE_CURSOR_BLINK_PERIOD (TIC_FRAMERATE)
#define CONSOLE_CURSOR_DELAY (TIC_FRAMERATE / 2)
#define CONSOLE_BUFFER_WIDTH (STUDIO_TEXT_BUFFER_WIDTH)
@@ -963,9 +963,6 @@ static void onImportSprites(const char* name, const void* buffer, size_t size, v
{
Console* console = (Console*)data;
tic_palette pal;
memcpy(&pal, console->tic->ram.vram.palette.data, sizeof(tic_palette));
if(name)
{
static const char GifExt[] = ".gif";
@@ -993,7 +990,7 @@ static void onImportSprites(const char* name, const void* buffer, size_t size, v
u8 src = image->buffer[x + y * image->width];
const gif_color* c = &image->palette[src];
tic_rgb rgb = {c->r, c->g, c->b};
u8 color = tic_tool_find_closest_color(console->tic->ram.vram.palette.colors, &rgb);
u8 color = tic_tool_find_closest_color(console->tic->cart.palette.colors, &rgb);
setSpritePixel(console->tic->cart.gfx.tiles, x, y, color);
}
@@ -1010,8 +1007,6 @@ static void onImportSprites(const char* name, const void* buffer, size_t size, v
}
else printBack(console, "\nfile not imported :|");
memcpy(console->tic->ram.vram.palette.data, &pal, sizeof(tic_palette));
commandDone(console);
}
@@ -1729,10 +1724,10 @@ static void printTable(Console* console, const char* text)
case '+':
case '|':
case '-':
color = systemColor(tic_color_gray);
color = (tic_color_gray);
break;
default:
color = systemColor(tic_color_white);
color = (tic_color_white);
}
*(console->colorBuffer + offset) = color;
@@ -2070,7 +2065,7 @@ static void processConsoleCommand(Console* console)
static void error(Console* console, const char* info)
{
consolePrint(console, info ? info : "unknown error", systemColor(tic_color_red));
consolePrint(console, info ? info : "unknown error", (tic_color_red));
commandDone(console);
}
@@ -2123,7 +2118,7 @@ static void checkNewVersion(Console* console)
{
char msg[FILENAME_MAX] = {0};
sprintf(msg, "\n A new version %i.%i.%i is available.\n", version.major, version.minor, version.patch);
consolePrint(console, msg, systemColor(tic_color_light_green));
consolePrint(console, msg, (tic_color_light_green));
}
}
}
@@ -2320,7 +2315,7 @@ static void cmdInjectCode(Console* console, const char* param, const char* name)
bool watch = strcmp(param, "-code-watch") == 0;
if(watch || strcmp(param, "-code") == 0)
{
bool loaded = loadFileIntoBuffer(console, &embed.file.code.data, name);
bool loaded = loadFileIntoBuffer(console, embed.file.code.data, name);
if(loaded)
{
+17 -17
View File
@@ -49,12 +49,12 @@ static void drawButton(Dialog* dlg, const char* label, s32 x, s32 y, u8 color, u
if(down)
{
tic->api.rect(tic, rect.x, rect.y+1, rect.w, rect.h, systemColor(tic_color_white));
tic->api.rect(tic, rect.x, rect.y+1, rect.w, rect.h, (tic_color_white));
}
else
{
tic->api.rect(tic, rect.x, rect.y+1, rect.w, rect.h, systemColor(tic_color_black));
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_white));
tic->api.rect(tic, rect.x, rect.y+1, rect.w, rect.h, (tic_color_black));
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, (tic_color_white));
}
s32 size = tic->api.text(tic, label, 0, -TIC_FONT_HEIGHT, 0);
@@ -74,8 +74,8 @@ static void drawButton(Dialog* dlg, const char* label, s32 x, s32 y, u8 color, u
0b00000000,
};
drawBitIcon(rect.x-5, rect.y+3, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x-5, rect.y+2, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x-5, rect.y+3, Icon, (tic_color_black));
drawBitIcon(rect.x-5, rect.y+2, Icon, (tic_color_white));
}
}
@@ -117,7 +117,7 @@ static void processKeydown(Dialog* dlg, SDL_Keysym* keysum)
static void drawDialog(Dialog* dlg)
{
enum {Width = TIC80_WIDTH/2, Height = TIC80_HEIGHT/2-TOOLBAR_SIZE-1};
enum {Width = TIC80_WIDTH/2, Height = TIC80_HEIGHT/2-TOOLBAR_SIZE};
tic_mem* tic = dlg->tic;
@@ -126,7 +126,7 @@ static void drawDialog(Dialog* dlg)
rect.x -= dlg->pos.x;
rect.y -= dlg->pos.y;
SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE-2), rect.w, TOOLBAR_SIZE-1};
SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE-1), rect.w, TOOLBAR_SIZE};
if(checkMousePos(&header))
{
@@ -156,16 +156,16 @@ static void drawDialog(Dialog* dlg)
dlg->drag.active = false;
}
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_blue));
tic->api.rect_border(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_white));
tic->api.line(tic, rect.x, rect.y+Height, rect.x+Width-1, rect.y+Height, systemColor(tic_color_black));
tic->api.rect(tic, rect.x, rect.y-(TOOLBAR_SIZE-3), rect.w, TOOLBAR_SIZE-3, systemColor(tic_color_white));
tic->api.line(tic, rect.x+1, rect.y-(TOOLBAR_SIZE-2), rect.x+Width-2, rect.y-(TOOLBAR_SIZE-2), systemColor(tic_color_white));
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, (tic_color_blue));
tic->api.rect_border(tic, rect.x, rect.y, rect.w, rect.h, (tic_color_white));
tic->api.line(tic, rect.x, rect.y+Height, rect.x+Width-1, rect.y+Height, (tic_color_black));
tic->api.rect(tic, rect.x, rect.y-(TOOLBAR_SIZE-2), rect.w, TOOLBAR_SIZE-2, (tic_color_white));
tic->api.line(tic, rect.x+1, rect.y-(TOOLBAR_SIZE-1), rect.x+Width-2, rect.y-(TOOLBAR_SIZE-1), (tic_color_white));
{
static const char Label[] = "WARNING!";
s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, 0);
tic->api.text(tic, Label, rect.x + (Width - size)/2, rect.y-(TOOLBAR_SIZE-3), systemColor(tic_color_gray));
tic->api.text(tic, Label, rect.x + (Width - size)/2, rect.y-(TOOLBAR_SIZE-2), (tic_color_gray));
}
{
@@ -180,13 +180,13 @@ static void drawDialog(Dialog* dlg)
s32 x = rect.x + (Width - size)/2;
s32 y = rect.y + (TIC_FONT_HEIGHT+1)*(i+1);
tic->api.text(tic, dlg->text[i], x, y+1, systemColor(tic_color_black));
tic->api.text(tic, dlg->text[i], x, y, systemColor(tic_color_white));
tic->api.text(tic, dlg->text[i], x, y+1, (tic_color_black));
tic->api.text(tic, dlg->text[i], x, y, (tic_color_white));
}
}
drawButton(dlg, "YES", rect.x + (Width/2 - 26), rect.y + 45, systemColor(tic_color_dark_red), systemColor(tic_color_red), onYes, 0);
drawButton(dlg, "NO", rect.x + (Width/2 + 6), rect.y + 45, systemColor(tic_color_green), systemColor(tic_color_light_green), onNo, 1);
drawButton(dlg, "YES", rect.x + (Width/2 - 26), rect.y + 45, (tic_color_dark_red), (tic_color_red), onYes, 0);
drawButton(dlg, "NO", rect.x + (Width/2 + 6), rect.y + 45, (tic_color_green), (tic_color_light_green), onNo, 1);
}
static void tick(Dialog* dlg)
+10 -10
View File
@@ -56,7 +56,7 @@ static void drawPlayer(Keymap* keymap, s32 x, s32 y, s32 id)
{
char label[] = "PLAYER #%i";
sprintf(label, label, id+1);
keymap->tic->api.text(keymap->tic, label, x, y, systemColor(tic_color_white));
keymap->tic->api.text(keymap->tic, label, x, y, (tic_color_white));
}
@@ -84,14 +84,14 @@ static void drawPlayer(Keymap* keymap, s32 x, s32 y, s32 id)
bool selected = keymap->button == button;
if(over)
keymap->tic->api.rect(keymap->tic, rect.x-1, rect.y-1, rect.w, rect.h, systemColor(tic_color_dark_red));
keymap->tic->api.rect(keymap->tic, rect.x-1, rect.y-1, rect.w, rect.h, (tic_color_dark_red));
if(selected)
keymap->tic->api.rect(keymap->tic, rect.x-1, rect.y-1, rect.w, rect.h, systemColor(tic_color_white));
keymap->tic->api.rect(keymap->tic, rect.x-1, rect.y-1, rect.w, rect.h, (tic_color_white));
keymap->tic->api.text(keymap->tic, ButtonNames[i], rect.x, rect.y, selected ? systemColor(tic_color_black) : systemColor(tic_color_gray));
keymap->tic->api.text(keymap->tic, ButtonNames[i], rect.x, rect.y, selected ? (tic_color_black) : (tic_color_gray));
keymap->tic->api.text(keymap->tic, SDL_GetKeyName(SDL_GetKeyFromScancode(codes[button])), rect.x + OffsetX, rect.y, selected ? systemColor(tic_color_black) : systemColor(tic_color_white));
keymap->tic->api.text(keymap->tic, SDL_GetKeyName(SDL_GetKeyFromScancode(codes[button])), rect.x + OffsetX, rect.y, selected ? (tic_color_black) : (tic_color_white));
}
}
@@ -102,11 +102,11 @@ static void drawCenterText(Keymap* keymap, const char* text, s32 y, u8 color)
static void drawKeymap(Keymap* keymap)
{
keymap->tic->api.rect(keymap->tic, 0, 0, TIC80_WIDTH, TIC_FONT_HEIGHT * 3, systemColor(tic_color_white));
keymap->tic->api.rect(keymap->tic, 0, 0, TIC80_WIDTH, TIC_FONT_HEIGHT * 3, (tic_color_white));
{
static const char Label[] = "CONFIGURE BUTTONS MAPPING";
keymap->tic->api.text(keymap->tic, Label, (TIC80_WIDTH - sizeof Label * TIC_FONT_WIDTH)/2, TIC_FONT_HEIGHT, systemColor(tic_color_black));
keymap->tic->api.text(keymap->tic, Label, (TIC80_WIDTH - sizeof Label * TIC_FONT_WIDTH)/2, TIC_FONT_HEIGHT, (tic_color_black));
}
drawPlayer(keymap, 16, 40, 0);
@@ -115,14 +115,14 @@ static void drawKeymap(Keymap* keymap)
if(keymap->button < 0)
{
if(keymap->ticks % TIC_FRAMERATE < TIC_FRAMERATE/2)
drawCenterText(keymap, "SELECT BUTTON", 120, systemColor(tic_color_white));
drawCenterText(keymap, "SELECT BUTTON", 120, (tic_color_white));
}
else
{
char label[256];
sprintf(label, "PRESS A KEY FOR '%s'", ButtonNames[keymap->button % BUTTONS_COUNT]);
drawCenterText(keymap, label, 120, systemColor(tic_color_white));
drawCenterText(keymap, "ESC TO CANCEL", 126, systemColor(tic_color_white));
drawCenterText(keymap, label, 120, (tic_color_white));
drawCenterText(keymap, "ESC TO CANCEL", 126, (tic_color_white));
}
}
+27 -21
View File
@@ -99,7 +99,7 @@ static s32 drawWorldButton(Map* map, s32 x, s32 y)
setStudioMode(TIC_WORLD_MODE);
}
drawBitIcon(x, y, WorldIcon, over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue));
drawBitIcon(x, y, WorldIcon, over ? (tic_color_dark_gray) : (tic_color_light_blue));
return x;
@@ -137,7 +137,7 @@ static s32 drawGridButton(Map* map, s32 x, s32 y)
map->canvas.grid = !map->canvas.grid;
}
drawBitIcon(x, y, GridIcon, map->canvas.grid ? systemColor(tic_color_black) : over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue));
drawBitIcon(x, y, GridIcon, map->canvas.grid ? (tic_color_black) : over ? (tic_color_dark_gray) : (tic_color_light_blue));
return x;
}
@@ -186,7 +186,7 @@ static s32 drawSheetButton(Map* map, s32 x, s32 y)
}
}
drawBitIcon(rect.x, rect.y, map->sheet.show ? UpIcon : DownIcon, over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue));
drawBitIcon(rect.x, rect.y, map->sheet.show ? UpIcon : DownIcon, over ? (tic_color_dark_gray) : (tic_color_light_blue));
return x;
}
@@ -212,7 +212,7 @@ static s32 drawToolButton(Map* map, s32 x, s32 y, const u8* Icon, s32 width, con
}
}
drawBitIcon(rect.x, rect.y, Icon, map->mode == mode ? systemColor(tic_color_black) : over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue));
drawBitIcon(rect.x, rect.y, Icon, map->mode == mode ? (tic_color_black) : over ? (tic_color_dark_gray) : (tic_color_light_blue));
return x;
}
@@ -293,7 +293,7 @@ static void drawTileIndex(Map* map, s32 x, s32 y)
if(map->sheet.show)
{
SDL_Rect rect = {TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE-1, TIC_SPRITESHEET_SIZE, TIC_SPRITESHEET_SIZE};
SDL_Rect rect = {TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE, TIC_SPRITESHEET_SIZE, TIC_SPRITESHEET_SIZE};
if(checkMousePos(&rect))
{
@@ -322,13 +322,13 @@ static void drawTileIndex(Map* map, s32 x, s32 y)
{
char buf[] = "#999";
sprintf(buf, "#%03i", index);
map->tic->api.text(map->tic, buf, x, y, systemColor(tic_color_light_blue));
map->tic->api.text(map->tic, buf, x, y, (tic_color_light_blue));
}
}
static void drawMapToolbar(Map* map, s32 x, s32 y)
{
map->tic->api.rect(map->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE-1, systemColor(tic_color_white));
map->tic->api.rect(map->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white));
drawTileIndex(map, TIC80_WIDTH/2 - TIC_FONT_WIDTH, y);
@@ -348,7 +348,7 @@ static void drawSheet(Map* map, s32 x, s32 y)
SDL_Rect rect = {x, y, TIC_SPRITESHEET_SIZE, TIC_SPRITESHEET_SIZE};
map->tic->api.rect_border(map->tic, rect.x - 1, rect.y - 1, rect.w + 2, rect.h + 2, systemColor(tic_color_white));
map->tic->api.rect_border(map->tic, rect.x - 1, rect.y - 1, rect.w + 2, rect.h + 2, (tic_color_white));
if(checkMousePos(&rect))
{
@@ -398,7 +398,7 @@ static void drawSheet(Map* map, s32 x, s32 y)
s32 bw = map->sheet.rect.w * TIC_SPRITESIZE + 2;
s32 bh = map->sheet.rect.h * TIC_SPRITESIZE + 2;
map->tic->api.rect_border(map->tic, bx, by, bw, bh, systemColor(tic_color_white));
map->tic->api.rect_border(map->tic, bx, by, bw, bh, (tic_color_white));
}
}
@@ -411,7 +411,7 @@ static void drawCursorPos(Map* map, s32 x, s32 y)
sprintf(pos, "%03i:%03i", tx, ty);
s32 width = map->tic->api.text(map->tic, pos, TIC80_WIDTH, 0, systemColor(tic_color_gray));
s32 width = map->tic->api.text(map->tic, pos, TIC80_WIDTH, 0, (tic_color_gray));
s32 px = x + (TIC_SPRITESIZE + 3);
if(px + width >= TIC80_WIDTH) px = x - (width + 2);
@@ -419,8 +419,8 @@ static void drawCursorPos(Map* map, s32 x, s32 y)
s32 py = y - (TIC_FONT_HEIGHT + 2);
if(py <= TOOLBAR_SIZE) py = y + (TIC_SPRITESIZE + 3);
map->tic->api.rect(map->tic, px - 1, py - 1, width + 1, TIC_FONT_HEIGHT + 1, systemColor(tic_color_white));
map->tic->api.text(map->tic, pos, px, py, systemColor(tic_color_light_blue));
map->tic->api.rect(map->tic, px - 1, py - 1, width + 1, TIC_FONT_HEIGHT + 1, (tic_color_white));
map->tic->api.text(map->tic, pos, px, py, (tic_color_light_blue));
}
static void setMapSprite(Map* map, s32 x, s32 y)
@@ -455,7 +455,7 @@ static void drawTileCursor(Map* map)
s32 height = map->sheet.rect.h * TIC_SPRITESIZE + 2;
map->tic->api.rect_border(map->tic, mx - 1, my - 1,
width, height, systemColor(tic_color_white));
width, height, (tic_color_white));
{
s32 sx = map->sheet.rect.x;
@@ -556,13 +556,13 @@ static void resetSelection(Map* map)
static void drawSelectionRect(Map* map, s32 x, s32 y, s32 w, s32 h)
{
enum{Step = 3};
u8 color = systemColor(tic_color_white);
u8 color = (tic_color_white);
s32 index = map->tickCounter / 10;
for(s32 i = x; i < (x+w); i++) map->tic->api.pixel(map->tic, i, y, index++ % Step ? color : 0); index++;
for(s32 i = y; i < (y+h); i++) map->tic->api.pixel(map->tic, x + w-1, i, index++ % Step ? color : 0); index++;
for(s32 i = (x+w-1); i >= x; i--) map->tic->api.pixel(map->tic, i, y + h-1, index++ % Step ? color : 0); index++;
for(s32 i = (y+h-1); i >= y; i--) map->tic->api.pixel(map->tic, x, i, index++ % Step ? color : 0);
for(s32 i = x; i < (x+w); i++) {map->tic->api.pixel(map->tic, i, y, index++ % Step ? color : 0);} index++;
for(s32 i = y; i < (y+h); i++) {map->tic->api.pixel(map->tic, x + w-1, i, index++ % Step ? color : 0);} index++;
for(s32 i = (x+w-1); i >= x; i--) {map->tic->api.pixel(map->tic, i, y + h-1, index++ % Step ? color : 0);} index++;
for(s32 i = (y+h-1); i >= y; i--) {map->tic->api.pixel(map->tic, x, i, index++ % Step ? color : 0);}
}
static void drawPasteData(Map* map)
@@ -867,8 +867,8 @@ static void drawMap(Map* map)
s32 screenScrollX = map->scroll.x % TIC80_WIDTH;
s32 screenScrollY = map->scroll.y % TIC80_HEIGHT;
map->tic->api.line(map->tic, 0, TIC80_HEIGHT - screenScrollY, TIC80_WIDTH, TIC80_HEIGHT - screenScrollY, systemColor(tic_color_gray));
map->tic->api.line(map->tic, TIC80_WIDTH - screenScrollX, 0, TIC80_WIDTH - screenScrollX, TIC80_HEIGHT, systemColor(tic_color_gray));
map->tic->api.line(map->tic, 0, TIC80_HEIGHT - screenScrollY, TIC80_WIDTH, TIC80_HEIGHT - screenScrollY, (tic_color_gray));
map->tic->api.line(map->tic, TIC80_WIDTH - screenScrollX, 0, TIC80_WIDTH - screenScrollX, TIC80_HEIGHT, (tic_color_gray));
}
if(!map->sheet.show && checkMousePos(&rect))
@@ -1113,7 +1113,7 @@ static void tick(Map* map)
map->tic->api.clear(map->tic, TIC_COLOR_BG);
drawMap(map);
drawSheet(map, TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE-1);
drawSheet(map, TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE);
drawMapToolbar(map, TIC80_WIDTH - 9*TIC_FONT_WIDTH, 1);
drawToolbar(map->tic, TIC_COLOR_BG, false);
}
@@ -1131,6 +1131,11 @@ static void onStudioEvent(Map* map, StudioEvent event)
}
}
static void scanline(tic_mem* tic, s32 row)
{
memcpy(tic->ram.vram.palette.data, row < TOOLBAR_SIZE ? tic->config.palette.data : tic->cart.palette.data, sizeof(tic_palette));
}
void initMap(Map* map, tic_mem* tic)
{
if(map->history) history_delete(map->history);
@@ -1171,6 +1176,7 @@ void initMap(Map* map, tic_mem* tic)
},
.history = history_create(&tic->cart.gfx.map, sizeof tic->cart.gfx.map),
.event = onStudioEvent,
.scanline = scanline,
};
normalizeMap(&map->scroll.x, &map->scroll.y);
+1
View File
@@ -80,6 +80,7 @@ struct Map
void(*tick)(Map*);
void(*event)(Map*, StudioEvent);
void(*scanline)(tic_mem* tic, s32 row);
};
void initMap(Map*, tic_mem*);
+34 -34
View File
@@ -24,7 +24,7 @@
#include "fs.h"
#define DIALOG_WIDTH (TIC80_WIDTH/2)
#define DIALOG_HEIGHT (TIC80_HEIGHT/2-TOOLBAR_SIZE-1)
#define DIALOG_HEIGHT (TIC80_HEIGHT/2-TOOLBAR_SIZE)
static const char* Rows[] =
{
@@ -78,7 +78,7 @@ static void drawDialog(Menu* menu)
tic_mem* tic = menu->tic;
SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE-2), rect.w, TOOLBAR_SIZE-1};
SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE-1), rect.w, TOOLBAR_SIZE};
if(checkMousePos(&header))
{
@@ -110,16 +110,16 @@ static void drawDialog(Menu* menu)
rect = getRect(menu);
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_blue));
tic->api.rect_border(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_white));
tic->api.line(tic, rect.x, rect.y+DIALOG_HEIGHT, rect.x+DIALOG_WIDTH-1, rect.y+DIALOG_HEIGHT, systemColor(tic_color_black));
tic->api.rect(tic, rect.x, rect.y-(TOOLBAR_SIZE-3), rect.w, TOOLBAR_SIZE-3, systemColor(tic_color_white));
tic->api.line(tic, rect.x+1, rect.y-(TOOLBAR_SIZE-2), rect.x+DIALOG_WIDTH-2, rect.y-(TOOLBAR_SIZE-2), systemColor(tic_color_white));
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, (tic_color_blue));
tic->api.rect_border(tic, rect.x, rect.y, rect.w, rect.h, (tic_color_white));
tic->api.line(tic, rect.x, rect.y+DIALOG_HEIGHT, rect.x+DIALOG_WIDTH-1, rect.y+DIALOG_HEIGHT, (tic_color_black));
tic->api.rect(tic, rect.x, rect.y-(TOOLBAR_SIZE-2), rect.w, TOOLBAR_SIZE-2, (tic_color_white));
tic->api.line(tic, rect.x+1, rect.y-(TOOLBAR_SIZE-1), rect.x+DIALOG_WIDTH-2, rect.y-(TOOLBAR_SIZE-1), (tic_color_white));
{
static const char Label[] = "GAME MENU";
s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, 0);
tic->api.text(tic, Label, rect.x + (DIALOG_WIDTH - size)/2, rect.y-(TOOLBAR_SIZE-3), systemColor(tic_color_gray));
tic->api.text(tic, Label, rect.x + (DIALOG_WIDTH - size)/2, rect.y-(TOOLBAR_SIZE-2), (tic_color_gray));
}
{
@@ -149,14 +149,14 @@ static void drawTabDisabled(Menu* menu, s32 x, s32 y, s32 id)
}
}
tic->api.rect(tic, x, y-1, Width, Height+1, systemColor(tic_color_dark_gray));
tic->api.pixel(tic, x, y+Height-1, systemColor(tic_color_blue));
tic->api.pixel(tic, x+Width-1, y+Height-1, systemColor(tic_color_blue));
tic->api.rect(tic, x, y-1, Width, Height+1, (tic_color_dark_gray));
tic->api.pixel(tic, x, y+Height-1, (tic_color_blue));
tic->api.pixel(tic, x+Width-1, y+Height-1, (tic_color_blue));
{
char buf[] = "#1";
sprintf(buf, "#%i", id+1);
tic->api.fixed_text(tic, buf, x+2, y, systemColor(over ? tic_color_light_blue : tic_color_gray));
tic->api.fixed_text(tic, buf, x+2, y, (over ? tic_color_light_blue : tic_color_gray));
}
}
@@ -165,15 +165,15 @@ static void drawTab(Menu* menu, s32 x, s32 y, s32 id)
enum{Width = 15, Height = 7};
tic_mem* tic = menu->tic;
tic->api.rect(tic, x, y-2, Width, Height+2, systemColor(tic_color_white));
tic->api.pixel(tic, x, y+Height-1, systemColor(tic_color_black));
tic->api.pixel(tic, x+Width-1, y+Height-1, systemColor(tic_color_black));
tic->api.rect(tic, x+1, y+Height, Width-2 , 1, systemColor(tic_color_black));
tic->api.rect(tic, x, y-2, Width, Height+2, (tic_color_white));
tic->api.pixel(tic, x, y+Height-1, (tic_color_black));
tic->api.pixel(tic, x+Width-1, y+Height-1, (tic_color_black));
tic->api.rect(tic, x+1, y+Height, Width-2 , 1, (tic_color_black));
{
char buf[] = "#1";
sprintf(buf, "#%i", id+1);
tic->api.fixed_text(tic, buf, x+2, y, systemColor(tic_color_gray));
tic->api.fixed_text(tic, buf, x+2, y, (tic_color_gray));
}
}
@@ -218,7 +218,7 @@ static void drawPlayerButtons(Menu* menu, s32 x, s32 y)
if(strlen(label) > MaxChars)
label[MaxChars] = '\0';
tic->api.text(tic, label, rect.x+10, rect.y+2, systemColor(over ? tic_color_gray : tic_color_black));
tic->api.text(tic, label, rect.x+10, rect.y+2, (over ? tic_color_gray : tic_color_black));
}
}
@@ -228,12 +228,12 @@ static void drawGamepadSetupTabs(Menu* menu, s32 x, s32 y)
tic_mem* tic = menu->tic;
tic->api.rect(tic, x, y, Width, Height, systemColor(tic_color_white));
tic->api.pixel(tic, x, y, systemColor(tic_color_blue));
tic->api.pixel(tic, x+Width-1, y, systemColor(tic_color_blue));
tic->api.pixel(tic, x, y+Height-1, systemColor(tic_color_black));
tic->api.pixel(tic, x+Width-1, y+Height-1, systemColor(tic_color_black));
tic->api.rect(tic, x+1, y+Height, Width-2 , 1, systemColor(tic_color_black));
tic->api.rect(tic, x, y, Width, Height, (tic_color_white));
tic->api.pixel(tic, x, y, (tic_color_blue));
tic->api.pixel(tic, x+Width-1, y, (tic_color_blue));
tic->api.pixel(tic, x, y+Height-1, (tic_color_black));
tic->api.pixel(tic, x+Width-1, y+Height-1, (tic_color_black));
tic->api.rect(tic, x+1, y+Height, Width-2 , 1, (tic_color_black));
for(s32 i = 0; i < Tabs; i++)
{
@@ -283,12 +283,12 @@ static void drawGamepadMenu(Menu* menu)
if(down)
{
tic->api.text(tic, Label, rect.x, rect.y+1, systemColor(tic_color_light_blue));
tic->api.text(tic, Label, rect.x, rect.y+1, (tic_color_light_blue));
}
else
{
tic->api.text(tic, Label, rect.x, rect.y+1, systemColor(tic_color_black));
tic->api.text(tic, Label, rect.x, rect.y, systemColor(over ? tic_color_light_blue : tic_color_white));
tic->api.text(tic, Label, rect.x, rect.y+1, (tic_color_black));
tic->api.text(tic, Label, rect.x, rect.y, (over ? tic_color_light_blue : tic_color_white));
}
{
@@ -304,8 +304,8 @@ static void drawGamepadMenu(Menu* menu)
0b00000000,
};
drawBitIcon(rect.x-7, rect.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x-7, rect.y, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x-7, rect.y+1, Icon, (tic_color_black));
drawBitIcon(rect.x-7, rect.y, Icon, (tic_color_white));
}
drawGamepadSetupTabs(menu, dlgRect.x+25, dlgRect.y+4);
@@ -349,12 +349,12 @@ static void drawMainMenu(Menu* menu)
if(down)
{
tic->api.text(tic, Rows[i], label.x, label.y+1, systemColor(tic_color_light_blue));
tic->api.text(tic, Rows[i], label.x, label.y+1, (tic_color_light_blue));
}
else
{
tic->api.text(tic, Rows[i], label.x, label.y+1, systemColor(tic_color_black));
tic->api.text(tic, Rows[i], label.x, label.y, systemColor(over ? tic_color_light_blue : tic_color_white));
tic->api.text(tic, Rows[i], label.x, label.y+1, (tic_color_black));
tic->api.text(tic, Rows[i], label.x, label.y, (over ? tic_color_light_blue : tic_color_white));
}
if(i == menu->main.focus)
@@ -371,8 +371,8 @@ static void drawMainMenu(Menu* menu)
0b00000000,
};
drawBitIcon(label.x-7, label.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(label.x-7, label.y, Icon, systemColor(tic_color_white));
drawBitIcon(label.x-7, label.y+1, Icon, (tic_color_black));
drawBitIcon(label.x-7, label.y, Icon, (tic_color_white));
}
}
}
+34 -34
View File
@@ -93,7 +93,7 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music*
set(music, -1, channel);
}
drawBitIcon(rect.x, rect.y, LeftArrow, systemColor(over ? tic_color_light_blue : tic_color_dark_gray));
drawBitIcon(rect.x, rect.y, LeftArrow, (over ? tic_color_light_blue : tic_color_dark_gray));
}
{
@@ -115,16 +115,16 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music*
}
}
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_black));
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_black));
if(music->tracker.row == -1 && music->tracker.col / CHANNEL_COLS == channel)
{
music->tic->api.rect(music->tic, x - 1 + music->tracker.patternCol * TIC_FONT_WIDTH, y - 1, TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, systemColor(tic_color_red));
music->tic->api.rect(music->tic, x - 1 + music->tracker.patternCol * TIC_FONT_WIDTH, y - 1, TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, (tic_color_red));
}
char val[] = "99";
sprintf(val, "%02i", value);
music->tic->api.fixed_text(music->tic, val, x, y, systemColor(tic_color_white));
music->tic->api.fixed_text(music->tic, val, x, y, (tic_color_white));
}
{
@@ -142,7 +142,7 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music*
set(music, +1, channel);
}
drawBitIcon(rect.x, rect.y, RightArrow, systemColor(over ? tic_color_light_blue : tic_color_dark_gray));
drawBitIcon(rect.x, rect.y, RightArrow, (over ? tic_color_light_blue : tic_color_dark_gray));
}
}
@@ -172,7 +172,7 @@ static void drawSwitch(Music* music, s32 x, s32 y, const char* label, s32 value,
0b00000000,
};
music->tic->api.text(music->tic, label, x, y, systemColor(tic_color_white));
music->tic->api.text(music->tic, label, x, y, (tic_color_white));
{
x += (s32)strlen(label)*TIC_FONT_WIDTH;
@@ -187,13 +187,13 @@ static void drawSwitch(Music* music, s32 x, s32 y, const char* label, s32 value,
set(music, -1, data);
}
drawBitIcon(rect.x, rect.y, LeftArrow, systemColor(tic_color_dark_gray));
drawBitIcon(rect.x, rect.y, LeftArrow, (tic_color_dark_gray));
}
{
char val[] = "999";
sprintf(val, "%02i", value);
music->tic->api.fixed_text(music->tic, val, x += TIC_FONT_WIDTH, y, systemColor(tic_color_white));
music->tic->api.fixed_text(music->tic, val, x += TIC_FONT_WIDTH, y, (tic_color_white));
}
{
@@ -209,7 +209,7 @@ static void drawSwitch(Music* music, s32 x, s32 y, const char* label, s32 value,
set(music, +1, data);
}
drawBitIcon(rect.x, rect.y, RightArrow, systemColor(tic_color_dark_gray));
drawBitIcon(rect.x, rect.y, RightArrow, (tic_color_dark_gray));
}
}
@@ -1112,7 +1112,7 @@ static void drawTrackerFrames(Music* music, s32 x, s32 y)
}
}
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_black));
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_black));
}
for (s32 i = 0; i < MUSIC_FRAMES; i++)
@@ -1131,24 +1131,24 @@ static void drawTrackerFrames(Music* music, s32 x, s32 y)
0b00000000,
};
drawBitIcon(x - TIC_FONT_WIDTH, y - 1 + i*TIC_FONT_HEIGHT, Icon, systemColor(tic_color_white));
drawBitIcon(x - TIC_FONT_WIDTH, y - 1 + i*TIC_FONT_HEIGHT, Icon, (tic_color_white));
}
if (i == music->tracker.frame)
{
music->tic->api.rect(music->tic, x - 1, y - 1 + i*TIC_FONT_HEIGHT, Width, TIC_FONT_HEIGHT + 1, systemColor(tic_color_white));
music->tic->api.rect(music->tic, x - 1, y - 1 + i*TIC_FONT_HEIGHT, Width, TIC_FONT_HEIGHT + 1, (tic_color_white));
}
char buf[] = "99";
sprintf(buf, "%02i", i);
music->tic->api.fixed_text(music->tic, buf, x, y + i*TIC_FONT_HEIGHT, systemColor(tic_color_dark_gray));
music->tic->api.fixed_text(music->tic, buf, x, y + i*TIC_FONT_HEIGHT, (tic_color_dark_gray));
}
if(music->tracker.row >= 0)
{
char buf[] = "99";
sprintf(buf, "%02i", music->tracker.row);
music->tic->api.fixed_text(music->tic, buf, x, y - 9, systemColor(tic_color_white));
music->tic->api.fixed_text(music->tic, buf, x, y - 9, (tic_color_white));
}
}
@@ -1215,7 +1215,7 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
}
}
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_black));
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_black));
s32 start = music->tracker.scroll;
s32 end = start + Rows;
@@ -1229,7 +1229,7 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
if (i == music->tracker.row)
{
music->tic->api.rect(music->tic, x - 1, rowy - 1, Width, TIC_FONT_HEIGHT + 1, systemColor(tic_color_dark_red));
music->tic->api.rect(music->tic, x - 1, rowy - 1, Width, TIC_FONT_HEIGHT + 1, (tic_color_dark_red));
}
// draw selection
@@ -1239,13 +1239,13 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
if (rect.h > 1 && i >= rect.y && i < rect.y + rect.h)
{
s32 sx = x - 1;
tic->api.rect(tic, sx, rowy - 1, CHANNEL_COLS * TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, systemColor(tic_color_yellow));
tic->api.rect(tic, sx, rowy - 1, CHANNEL_COLS * TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, (tic_color_yellow));
}
}
if (checkPlayRow(music, i))
{
music->tic->api.rect(music->tic, x - 1, rowy - 1, Width, TIC_FONT_HEIGHT + 1, systemColor(tic_color_white));
music->tic->api.rect(music->tic, x - 1, rowy - 1, Width, TIC_FONT_HEIGHT + 1, (tic_color_white));
}
char rowStr[] = "--------";
@@ -1268,8 +1268,8 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
if (note >= NoteStart)
sprintf(rowStr, "%s%i%02i%01X--", Notes[note - NoteStart], octave + 1, sfx, volume & 0xf);
const u8 Colors[] = { systemColor(tic_color_light_green), systemColor(tic_color_orange), systemColor(tic_color_blue), systemColor(tic_color_gray) };
const u8 DarkColors[] = { systemColor(tic_color_green), systemColor(tic_color_brown), systemColor(tic_color_dark_blue), systemColor(tic_color_dark_gray) };
const u8 Colors[] = { (tic_color_light_green), (tic_color_orange), (tic_color_blue), (tic_color_gray) };
const u8 DarkColors[] = { (tic_color_green), (tic_color_brown), (tic_color_dark_blue), (tic_color_dark_gray) };
static u8 ColorIndexes[] = { 0, 0, 0, 1, 1, 2, 3, 3 };
bool beetRow = i % NOTES_PER_BEET == 0;
@@ -1283,7 +1283,7 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
}
}
}
else music->tic->api.fixed_text(music->tic, rowStr, x, rowy, systemColor(tic_color_dark_gray));
else music->tic->api.fixed_text(music->tic, rowStr, x, rowy, (tic_color_dark_gray));
if (i == music->tracker.row)
{
@@ -1291,13 +1291,13 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
{
s32 col = music->tracker.col % CHANNEL_COLS;
s32 colx = x - 1 + col * TIC_FONT_WIDTH;
music->tic->api.rect(music->tic, colx, rowy - 1, TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, systemColor(tic_color_red));
music->tic->api.draw_char(music->tic, rowStr[col], colx + 1, rowy, systemColor(tic_color_black));
music->tic->api.rect(music->tic, colx, rowy - 1, TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, (tic_color_red));
music->tic->api.draw_char(music->tic, rowStr[col], colx + 1, rowy, (tic_color_black));
}
}
if (i % NOTES_PER_BEET == 0)
music->tic->api.pixel(music->tic, x - 4, y + pos*TIC_FONT_HEIGHT + 2, systemColor(tic_color_dark_gray));
music->tic->api.pixel(music->tic, x - 4, y + pos*TIC_FONT_HEIGHT + 2, (tic_color_dark_gray));
}
}
@@ -1418,9 +1418,9 @@ static void drawPlayButtons(Music* music)
}
if(i == 0 && music->tracker.follow)
drawBitIcon(rect.x, rect.y, Icons + i*Rows, over ? systemColor(tic_color_peach) : systemColor(tic_color_red));
drawBitIcon(rect.x, rect.y, Icons + i*Rows, over ? (tic_color_peach) : (tic_color_red));
else
drawBitIcon(rect.x, rect.y, Icons + i*Rows, over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue));
drawBitIcon(rect.x, rect.y, Icons + i*Rows, over ? (tic_color_dark_gray) : (tic_color_light_blue));
}
}
@@ -1470,15 +1470,15 @@ static void drawModeTabs(Music* music)
}
if (music->tab == Tabs[i])
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_gray));
music->tic->api.rect(music->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_gray));
drawBitIcon(rect.x, rect.y, Icons + i*Rows, music->tab == Tabs[i] ? systemColor(tic_color_white) : over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue));
drawBitIcon(rect.x, rect.y, Icons + i*Rows, music->tab == Tabs[i] ? (tic_color_white) : over ? (tic_color_dark_gray) : (tic_color_light_blue));
}
}
static void drawMusicToolbar(Music* music)
{
music->tic->api.rect(music->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE - 1, systemColor(tic_color_white));
music->tic->api.rect(music->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white));
drawPlayButtons(music);
drawModeTabs(music);
@@ -1489,10 +1489,10 @@ static void drawPianoLayout(Music* music)
SDL_Event* event = NULL;
while ((event = pollEvent())){}
music->tic->api.clear(music->tic, systemColor(tic_color_gray));
music->tic->api.clear(music->tic, (tic_color_gray));
static const char Wip[] = "PIANO MODE - WORK IN PROGRESS...";
music->tic->api.fixed_text(music->tic, Wip, (TIC80_WIDTH - (sizeof Wip - 1) * TIC_FONT_WIDTH) / 2, TIC80_HEIGHT / 2, systemColor(tic_color_white));
music->tic->api.fixed_text(music->tic, Wip, (TIC80_WIDTH - (sizeof Wip - 1) * TIC_FONT_WIDTH) / 2, TIC80_HEIGHT / 2, (tic_color_white));
}
static void scrollNotes(Music* music, s32 delta)
@@ -1571,9 +1571,9 @@ static void drawTrackerLayout(Music* music)
}
}
music->tic->api.clear(music->tic, systemColor(tic_color_gray));
music->tic->api.clear(music->tic, (tic_color_gray));
drawTopPanel(music, 6, TOOLBAR_SIZE + 4);
drawTopPanel(music, 6, TOOLBAR_SIZE + 3);
drawTracker(music, 6, 35);
}
@@ -1592,7 +1592,7 @@ static void tick(Music* music)
}
drawMusicToolbar(music);
drawToolbar(music->tic, systemColor(tic_color_gray), false);
drawToolbar(music->tic, (tic_color_gray), false);
}
static void onStudioEvent(Music* music, StudioEvent event)
+37 -37
View File
@@ -63,7 +63,7 @@ static void drawSwitch(Sfx* sfx, s32 x, s32 y, const char* label, s32 value, voi
0b00000000,
};
sfx->tic->api.text(sfx->tic, label, x, y, systemColor(tic_color_white));
sfx->tic->api.text(sfx->tic, label, x, y, (tic_color_white));
{
x += (s32)strlen(label)*TIC_FONT_WIDTH;
@@ -78,13 +78,13 @@ static void drawSwitch(Sfx* sfx, s32 x, s32 y, const char* label, s32 value, voi
set(sfx, -1);
}
drawBitIcon(rect.x, rect.y, LeftArrow, systemColor(tic_color_dark_gray));
drawBitIcon(rect.x, rect.y, LeftArrow, (tic_color_dark_gray));
}
{
char val[] = "99";
sprintf(val, "%02i", value);
sfx->tic->api.fixed_text(sfx->tic, val, x += TIC_FONT_WIDTH, y, systemColor(tic_color_white));
sfx->tic->api.fixed_text(sfx->tic, val, x += TIC_FONT_WIDTH, y, (tic_color_white));
}
{
@@ -100,7 +100,7 @@ static void drawSwitch(Sfx* sfx, s32 x, s32 y, const char* label, s32 value, voi
set(sfx, +1);
}
drawBitIcon(rect.x, rect.y, RightArrow, systemColor(tic_color_dark_gray));
drawBitIcon(rect.x, rect.y, RightArrow, (tic_color_dark_gray));
}
}
@@ -156,7 +156,7 @@ static void setLoopSize(Sfx* sfx, s32 delta)
static void drawLoopPanel(Sfx* sfx, s32 x, s32 y)
{
sfx->tic->api.text(sfx->tic, "LOOP:", x, y, systemColor(tic_color_dark_gray));
sfx->tic->api.text(sfx->tic, "LOOP:", x, y, (tic_color_dark_gray));
enum {Gap = 2};
@@ -234,7 +234,7 @@ static void drawWaveButtons(Sfx* sfx, s32 x, s32 y)
}
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h,
active ? systemColor(tic_color_red) : over ? systemColor(tic_color_gray) : systemColor(tic_color_dark_gray));
active ? (tic_color_red) : over ? (tic_color_gray) : (tic_color_dark_gray));
{
enum{Size = 5};
@@ -254,7 +254,7 @@ static void drawWaveButtons(Sfx* sfx, s32 x, s32 y)
}
}
drawBitIcon(iconRect.x, iconRect.y, EmptyIcon, systemColor(over ? tic_color_gray : tic_color_dark_gray));
drawBitIcon(iconRect.x, iconRect.y, EmptyIcon, (over ? tic_color_gray : tic_color_dark_gray));
}
{
@@ -263,7 +263,7 @@ static void drawWaveButtons(Sfx* sfx, s32 x, s32 y)
for(s32 i = 0; i < ENVELOPE_VALUES/Scale; i++)
{
s32 value = tic_tool_peek4(wave->data, i*Scale)/Scale;
sfx->tic->api.pixel(sfx->tic, rect.x + i+1, rect.y + Height - value - 2, systemColor(tic_color_white));
sfx->tic->api.pixel(sfx->tic, rect.x + i+1, rect.y + Height - value - 2, (tic_color_white));
}
}
}
@@ -281,7 +281,7 @@ static void drawWaveButtons(Sfx* sfx, s32 x, s32 y)
}
if(full)
drawBitIcon(x+Width+HGap, y + (Count - start - 1)*(Height+Gap), FullIcon, systemColor(tic_color_white));
drawBitIcon(x+Width+HGap, y + (Count - start - 1)*(Height+Gap), FullIcon, (tic_color_white));
}
}
@@ -293,7 +293,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y)
for(s32 i = 0, sy = y; i < COUNT_OF(Labels); sy += Height, i++)
{
s32 size = sfx->tic->api.text(sfx->tic, Labels[i], 0, -TIC_FONT_HEIGHT, systemColor(tic_color_black));
s32 size = sfx->tic->api.text(sfx->tic, Labels[i], 0, -TIC_FONT_HEIGHT, (tic_color_black));
SDL_Rect rect = {x - size, sy, size, TIC_FONT_HEIGHT};
@@ -307,7 +307,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y)
}
}
sfx->tic->api.text(sfx->tic, Labels[i], rect.x, rect.y, i == sfx->canvasTab ? systemColor(tic_color_white) : systemColor(tic_color_dark_gray));
sfx->tic->api.text(sfx->tic, Labels[i], rect.x, rect.y, i == sfx->canvasTab ? (tic_color_white) : (tic_color_dark_gray));
}
tic_sound_effect* effect = getEffect(sfx);
@@ -328,7 +328,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y)
effect->pitch16x++;
}
sfx->tic->api.fixed_text(sfx->tic, Label, rect.x, rect.y, systemColor(effect->pitch16x ? tic_color_white : tic_color_dark_gray));
sfx->tic->api.fixed_text(sfx->tic, Label, rect.x, rect.y, (effect->pitch16x ? tic_color_white : tic_color_dark_gray));
}
break;
case SFX_ARPEGGIO_TAB:
@@ -345,7 +345,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y)
effect->reverse++;
}
sfx->tic->api.text(sfx->tic, Label, rect.x, rect.y, systemColor(effect->reverse ? tic_color_white : tic_color_dark_gray));
sfx->tic->api.text(sfx->tic, Label, rect.x, rect.y, (effect->reverse ? tic_color_white : tic_color_dark_gray));
}
break;
default: break;
@@ -354,7 +354,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y)
static void drawCanvas(Sfx* sfx, s32 x, s32 y)
{
sfx->tic->api.rect(sfx->tic, x, y, CANVAS_WIDTH, CANVAS_HEIGHT, systemColor(tic_color_dark_red));
sfx->tic->api.rect(sfx->tic, x, y, CANVAS_WIDTH, CANVAS_HEIGHT, (tic_color_dark_red));
for(s32 i = 0; i < CANVAS_HEIGHT; i += CANVAS_SIZE)
sfx->tic->api.line(sfx->tic, x, y + i, x + CANVAS_WIDTH, y + i, TIC_COLOR_BG);
@@ -367,7 +367,7 @@ static void drawCanvas(Sfx* sfx, s32 x, s32 y)
s32 tickIndex = *(pos.data + sfx->canvasTab);
if(tickIndex >= 0)
sfx->tic->api.rect(sfx->tic, x + tickIndex * CANVAS_SIZE, y, CANVAS_SIZE + 1, CANVAS_HEIGHT + 1, systemColor(tic_color_white));
sfx->tic->api.rect(sfx->tic, x + tickIndex * CANVAS_SIZE, y, CANVAS_SIZE + 1, CANVAS_HEIGHT + 1, (tic_color_white));
}
SDL_Rect rect = {x, y, CANVAS_WIDTH, CANVAS_HEIGHT};
@@ -409,26 +409,26 @@ static void drawCanvas(Sfx* sfx, s32 x, s32 y)
case SFX_VOLUME_TAB:
{
for(s32 j = 1, start = CANVAS_HEIGHT - CANVAS_SIZE; j <= CANVAS_ROWS - effect->data[i].volume; j++, start -= CANVAS_SIZE)
sfx->tic->api.rect(sfx->tic, x + i * CANVAS_SIZE + 1, y + 1 + start, CANVAS_SIZE-1, CANVAS_SIZE-1, systemColor(tic_color_red));
sfx->tic->api.rect(sfx->tic, x + i * CANVAS_SIZE + 1, y + 1 + start, CANVAS_SIZE-1, CANVAS_SIZE-1, (tic_color_red));
}
break;
case SFX_ARPEGGIO_TAB:
{
sfx->tic->api.rect(sfx->tic, x + i * CANVAS_SIZE + 1,
y + 1 + (CANVAS_HEIGHT - (effect->data[i].arpeggio+1)*CANVAS_SIZE), CANVAS_SIZE-1, CANVAS_SIZE-1, systemColor(tic_color_red));
y + 1 + (CANVAS_HEIGHT - (effect->data[i].arpeggio+1)*CANVAS_SIZE), CANVAS_SIZE-1, CANVAS_SIZE-1, (tic_color_red));
}
break;
case SFX_PITCH_TAB:
{
for(s32 j = SDL_min(0, effect->data[i].pitch); j <= SDL_max(0, effect->data[i].pitch); j++)
sfx->tic->api.rect(sfx->tic, x + i * CANVAS_SIZE + 1, y + 1 + (CANVAS_HEIGHT/2 - (j+1)*CANVAS_SIZE),
CANVAS_SIZE-1, CANVAS_SIZE-1, systemColor(tic_color_red));
CANVAS_SIZE-1, CANVAS_SIZE-1, (tic_color_red));
}
break;
case SFX_WAVE_TAB:
{
sfx->tic->api.rect(sfx->tic, x + i * CANVAS_SIZE + 1,
y + 1 + (CANVAS_HEIGHT - (effect->data[i].wave+1)*CANVAS_SIZE), CANVAS_SIZE-1, CANVAS_SIZE-1, systemColor(tic_color_red));
y + 1 + (CANVAS_HEIGHT - (effect->data[i].wave+1)*CANVAS_SIZE), CANVAS_SIZE-1, CANVAS_SIZE-1, (tic_color_red));
}
break;
default: break;
@@ -440,7 +440,7 @@ static void drawCanvas(Sfx* sfx, s32 x, s32 y)
if(loop->start > 0 || loop->size > 0)
{
for(s32 i = 0; i < loop->size; i++)
sfx->tic->api.rect(sfx->tic, x + (loop->start+i) * CANVAS_SIZE+1, y + CANVAS_HEIGHT - 2, CANVAS_SIZE-1, 2, systemColor(tic_color_yellow));
sfx->tic->api.rect(sfx->tic, x + (loop->start+i) * CANVAS_SIZE+1, y + CANVAS_HEIGHT - 2, CANVAS_SIZE-1, 2, (tic_color_yellow));
}
}
}
@@ -508,7 +508,7 @@ static void drawPiano(Sfx* sfx, s32 x, s32 y)
if(index >= 0)
sfx->tic->api.rect(sfx->tic, rect->x, rect->y, rect->w - (white ? 1 : 0), rect->h,
systemColor(sfx->play.active && effect->note == index ? tic_color_red : white ? tic_color_white : tic_color_black));
(sfx->play.active && effect->note == index ? tic_color_red : white ? tic_color_white : tic_color_black));
}
}
@@ -517,7 +517,7 @@ static void drawOctavePanel(Sfx* sfx, s32 x, s32 y)
tic_sound_effect* effect = getEffect(sfx);
static const char Label[] = "OCT";
sfx->tic->api.text(sfx->tic, Label, x, y, systemColor(tic_color_white));
sfx->tic->api.text(sfx->tic, Label, x, y, (tic_color_white));
x += sizeof(Label)*TIC_FONT_WIDTH;
@@ -537,7 +537,7 @@ static void drawOctavePanel(Sfx* sfx, s32 x, s32 y)
}
}
sfx->tic->api.draw_char(sfx->tic, i + '1', rect.x, rect.y, systemColor(i == effect->octave ? tic_color_white : tic_color_dark_gray));
sfx->tic->api.draw_char(sfx->tic, i + '1', rect.x, rect.y, (i == effect->octave ? tic_color_white : tic_color_dark_gray));
}
}
@@ -788,15 +788,15 @@ static void drawModeTabs(Sfx* sfx)
}
if (sfx->tab == Tabs[i])
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_black));
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_black));
drawBitIcon(rect.x, rect.y, Icons + i*Rows, systemColor(sfx->tab == Tabs[i] ? tic_color_white : over ? tic_color_dark_gray : tic_color_light_blue));
drawBitIcon(rect.x, rect.y, Icons + i*Rows, (sfx->tab == Tabs[i] ? tic_color_white : over ? tic_color_dark_gray : tic_color_light_blue));
}
}
static void drawSfxToolbar(Sfx* sfx)
{
sfx->tic->api.rect(sfx->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE-1, systemColor(tic_color_white));
sfx->tic->api.rect(sfx->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white));
enum{Width = 3 * TIC_FONT_WIDTH};
s32 x = TIC80_WIDTH - Width - TIC_SPRITESIZE*3;
@@ -825,7 +825,7 @@ static void drawSfxToolbar(Sfx* sfx)
char buf[] = "C#4";
sprintf(buf, "%s%i", Notes[effect->note], effect->octave+1);
sfx->tic->api.fixed_text(sfx->tic, buf, x, y, systemColor(over ? tic_color_dark_gray : tic_color_light_blue));
sfx->tic->api.fixed_text(sfx->tic, buf, x, y, (over ? tic_color_dark_gray : tic_color_light_blue));
}
drawModeTabs(sfx);
@@ -854,13 +854,13 @@ static void envelopesTick(Sfx* sfx)
drawSfxToolbar(sfx);
drawToolbar(sfx->tic, TIC_COLOR_BG, false);
drawTopPanel(sfx, Start, TOOLBAR_SIZE + Gap - 1);
drawCanvasTabs(sfx, Start-Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+1);
drawTopPanel(sfx, Start, TOOLBAR_SIZE + Gap);
drawCanvasTabs(sfx, Start-Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+2);
if(sfx->canvasTab == SFX_WAVE_TAB)
drawWaveButtons(sfx, Start + CANVAS_WIDTH + Gap-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+1);
drawWaveButtons(sfx, Start + CANVAS_WIDTH + Gap-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+2);
drawLoopPanel(sfx, Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+91);
drawCanvas(sfx, Start-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT);
drawLoopPanel(sfx, Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+92);
drawCanvas(sfx, Start-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT + 1);
drawOctavePanel(sfx, Start + Gap + PIANO_WIDTH + Gap-1, TIC80_HEIGHT - TIC_FONT_HEIGHT - (PIANO_HEIGHT - TIC_FONT_HEIGHT)/2 - Gap);
}
@@ -898,10 +898,10 @@ static void drawWaveformBar(Sfx* sfx, s32 x, s32 y)
active = true;
}
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h, systemColor(active ? tic_color_red : tic_color_white));
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h, (active ? tic_color_red : tic_color_white));
if(sfx->waveform.index == i)
sfx->tic->api.rect_border(sfx->tic, rect.x-2, rect.y-2, rect.w+4, rect.h+4, systemColor(tic_color_white));
sfx->tic->api.rect_border(sfx->tic, rect.x-2, rect.y-2, rect.w+4, rect.h+4, (tic_color_white));
{
tic_waveform* wave = getWaveformById(sfx, i);
@@ -909,7 +909,7 @@ static void drawWaveformBar(Sfx* sfx, s32 x, s32 y)
for(s32 i = 0; i < ENVELOPE_VALUES/Scale; i++)
{
s32 value = tic_tool_peek4(wave->data, i*Scale)/Scale;
sfx->tic->api.pixel(sfx->tic, rect.x + i+1, rect.y + Height - value - 2, systemColor(tic_color_black));
sfx->tic->api.pixel(sfx->tic, rect.x + i+1, rect.y + Height - value - 2, (tic_color_black));
}
}
}
@@ -921,7 +921,7 @@ static void drawWaveformCanvas(Sfx* sfx, s32 x, s32 y)
SDL_Rect rect = {x, y, Width, Height};
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_dark_red));
sfx->tic->api.rect(sfx->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_dark_red));
for(s32 i = 0; i < Height; i += CANVAS_SIZE)
sfx->tic->api.line(sfx->tic, rect.x, rect.y + i, rect.x + Width, rect.y + i, TIC_COLOR_BG);
@@ -958,7 +958,7 @@ static void drawWaveformCanvas(Sfx* sfx, s32 x, s32 y)
{
s32 value = tic_tool_peek4(wave->data, i);
sfx->tic->api.rect(sfx->tic, x + i * CANVAS_SIZE + 1,
y + 1 + (Height - (value+1)*CANVAS_SIZE), CANVAS_SIZE-1, CANVAS_SIZE-1, systemColor(tic_color_red));
y + 1 + (Height - (value+1)*CANVAS_SIZE), CANVAS_SIZE-1, CANVAS_SIZE-1, (tic_color_red));
}
}
+72 -79
View File
@@ -56,7 +56,7 @@ static s32 getIndexPosY(Sprite* sprite)
static void drawSelection(Sprite* sprite, s32 x, s32 y, s32 w, s32 h)
{
enum{Step = 3};
u8 color = systemColor(tic_color_white);
u8 color = (tic_color_white);
s32 index = sprite->tickCounter / 10;
for(s32 i = x; i < (x+w); i++) { sprite->tic->api.pixel(sprite->tic, i, y, index++ % Step ? color : 0);} index++;
@@ -75,8 +75,8 @@ static SDL_Rect getSpriteRect(Sprite* sprite)
static void drawCursorBorder(Sprite* sprite, s32 x, s32 y, s32 w, s32 h)
{
sprite->tic->api.rect_border(sprite->tic, x, y, w, h, systemColor(tic_color_black));
sprite->tic->api.rect_border(sprite->tic, x-1, y-1, w+2, h+2, systemColor(tic_color_white));
sprite->tic->api.rect_border(sprite->tic, x, y, w, h, (tic_color_black));
sprite->tic->api.rect_border(sprite->tic, x-1, y-1, w+2, h+2, (tic_color_white));
}
static void processPickerCanvasMouse(Sprite* sprite, s32 x, s32 y, s32 sx, s32 sy)
@@ -336,21 +336,21 @@ static void drawBrushSlider(Sprite* sprite, s32 x, s32 y)
}
}
sprite->tic->api.rect(sprite->tic, x+1, y, Size-2, Size*Count, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, x+1, y, Size-2, Size*Count, (tic_color_black));
for(s32 i = 0; i < Count; i++)
{
s32 offset = y + i*(Size+1);
sprite->tic->api.rect(sprite->tic, x, offset, Size, Size, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, x + 6, offset + 2, Count - i, 1, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, x, offset, Size, Size, (tic_color_black));
sprite->tic->api.rect(sprite->tic, x + 6, offset + 2, Count - i, 1, (tic_color_black));
}
sprite->tic->api.rect(sprite->tic, x+2, y+1, 1, Size*Count+1, systemColor(over ? tic_color_white : tic_color_gray));
sprite->tic->api.rect(sprite->tic, x+2, y+1, 1, Size*Count+1, (over ? tic_color_white : tic_color_gray));
s32 offset = y + (Count - sprite->brushSize)*(Size+1);
sprite->tic->api.rect(sprite->tic, x, offset, Size, Size, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, x+1, offset+1, Size-2, Size-2, systemColor(over ? tic_color_white : tic_color_gray));
sprite->tic->api.rect(sprite->tic, x, offset, Size, Size, (tic_color_black));
sprite->tic->api.rect(sprite->tic, x+1, offset+1, Size-2, Size-2, (over ? tic_color_white : tic_color_gray));
}
static void drawCanvas(Sprite* sprite, s32 x, s32 y)
@@ -362,13 +362,13 @@ static void drawCanvas(Sprite* sprite, s32 x, s32 y)
s32 ix = x + (CANVAS_SIZE - 4*TIC_FONT_WIDTH)/2;
s32 iy = TIC_SPRITESIZE + 2;
sprite->tic->api.text(sprite->tic, buf, ix, iy+1, systemColor(tic_color_black));
sprite->tic->api.text(sprite->tic, buf, ix, iy, systemColor(tic_color_white));
sprite->tic->api.text(sprite->tic, buf, ix, iy+1, (tic_color_black));
sprite->tic->api.text(sprite->tic, buf, ix, iy, (tic_color_white));
}
sprite->tic->api.rect_border(sprite->tic, x-1, y-1, CANVAS_SIZE+2, CANVAS_SIZE+2, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, x, y, CANVAS_SIZE, CANVAS_SIZE, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, x-1, y + CANVAS_SIZE+1, CANVAS_SIZE+2, 1, systemColor(tic_color_black));
sprite->tic->api.rect_border(sprite->tic, x-1, y-1, CANVAS_SIZE+2, CANVAS_SIZE+2, (tic_color_white));
sprite->tic->api.rect(sprite->tic, x, y, CANVAS_SIZE, CANVAS_SIZE, (tic_color_black));
sprite->tic->api.rect(sprite->tic, x-1, y + CANVAS_SIZE+1, CANVAS_SIZE+2, 1, (tic_color_black));
SDL_Rect rect = getSpriteRect(sprite);
s32 r = rect.x + rect.w;
@@ -506,18 +506,13 @@ static void drawMoveButtons(Sprite* sprite)
Func[i](sprite);
}
drawBitIcon(Rects[i].x, Rects[i].y+1, Icons + i*8, down ? systemColor(tic_color_white) : systemColor(tic_color_black));
drawBitIcon(Rects[i].x, Rects[i].y+1, Icons + i*8, down ? (tic_color_white) : (tic_color_black));
if(!down) drawBitIcon(Rects[i].x, Rects[i].y, Icons + i*8, systemColor(tic_color_white));
if(!down) drawBitIcon(Rects[i].x, Rects[i].y, Icons + i*8, (tic_color_white));
}
}
}
static void updateCartPalette(Sprite* sprite)
{
SDL_memcpy(sprite->tic->cart.palette.data, sprite->tic->ram.vram.palette.data, sizeof(tic_palette));
}
static void drawRGBSlider(Sprite* sprite, s32 x, s32 y, u8* value)
{
enum {Size = CANVAS_SIZE, Max = 255};
@@ -545,25 +540,23 @@ static void drawRGBSlider(Sprite* sprite, s32 x, s32 y, u8* value)
{
s32 mx = getMouseX() - x;
*value = mx * Max / (Size-1);
updateCartPalette(sprite);
}
}
sprite->tic->api.rect(sprite->tic, x, y+1, Size, 1, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, x, y, Size, 1, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, x, y+1, Size, 1, (tic_color_black));
sprite->tic->api.rect(sprite->tic, x, y, Size, 1, (tic_color_white));
{
s32 offset = x + *value * (Size-1) / Max - 1;
drawBitIcon(offset, y, Icon, systemColor(tic_color_black));
drawBitIcon(offset, y-1, Icon, systemColor(tic_color_white));
drawBitIcon(offset, y, Icon, (tic_color_black));
drawBitIcon(offset, y-1, Icon, (tic_color_white));
sprite->tic->api.pixel(sprite->tic, offset+1, y, sprite->color);
}
{
char buf[] = "FF";
sprintf(buf, "%02X", *value);
sprite->tic->api.text(sprite->tic, buf, x - 18, y - 2, systemColor(tic_color_dark_gray));
sprite->tic->api.text(sprite->tic, buf, x - 18, y - 2, (tic_color_dark_gray));
}
}
@@ -591,20 +584,17 @@ static void drawRGBSlider(Sprite* sprite, s32 x, s32 y, u8* value)
down = true;
if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
{
(*value)--;
updateCartPalette(sprite);
}
}
if(down)
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_white));
}
else
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, (tic_color_white));
}
}
@@ -632,20 +622,17 @@ static void drawRGBSlider(Sprite* sprite, s32 x, s32 y, u8* value)
down = true;
if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
{
(*value)++;
updateCartPalette(sprite);
}
}
if(down)
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_white));
}
else
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, (tic_color_white));
}
}
}
@@ -682,17 +669,17 @@ static void drawRGBTools(Sprite* sprite, s32 x, s32 y)
down = true;
if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
toClipboard(sprite->tic->ram.vram.palette.data, sizeof(tic_palette), false);
toClipboard(sprite->tic->cart.palette.data, sizeof(tic_palette), false);
}
if(down)
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_light_blue));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_light_blue));
}
else
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, (over ? tic_color_light_blue : tic_color_white));
}
}
@@ -733,12 +720,12 @@ static void drawRGBTools(Sprite* sprite, s32 x, s32 y)
if(down)
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_light_blue));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_light_blue));
}
else
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, (over ? tic_color_light_blue : tic_color_white));
}
}
}
@@ -747,7 +734,7 @@ static void drawRGBSliders(Sprite* sprite, s32 x, s32 y)
{
enum{Gap = 6, Count = sizeof(tic_rgb)};
u8* data = &sprite->tic->ram.vram.palette.data[sprite->color * Count];
u8* data = &sprite->tic->cart.palette.data[sprite->color * Count];
for(s32 i = 0; i < Count; i++)
drawRGBSlider(sprite, x, y + Gap*i, &data[i]);
@@ -781,23 +768,23 @@ static void drawPalette(Sprite* sprite, s32 x, s32 y)
}
}
sprite->tic->api.rect(sprite->tic, rect.x-1, rect.y-1, rect.w+2, rect.h+2, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x-1, rect.y-1, rect.w+2, rect.h+2, (tic_color_white));
for(s32 row = 0, i = 0; row < PALETTE_ROWS; row++)
for(s32 col = 0; col < PALETTE_COLS; col++)
sprite->tic->api.rect(sprite->tic, x + col * PALETTE_CELL_SIZE, y + row * PALETTE_CELL_SIZE, PALETTE_CELL_SIZE-1, PALETTE_CELL_SIZE-1, i++);
sprite->tic->api.rect(sprite->tic, rect.x-1, rect.y+rect.h+1, PALETTE_WIDTH+1, 1, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x-1, rect.y+rect.h+1, PALETTE_WIDTH+1, 1, (tic_color_black));
{
s32 offsetX = x + (sprite->color % PALETTE_COLS) * PALETTE_CELL_SIZE;
s32 offsetY = y + (sprite->color / PALETTE_COLS) * PALETTE_CELL_SIZE;
sprite->tic->api.rect(sprite->tic, offsetX - 1, offsetY - 1, PALETTE_CELL_SIZE + 1, PALETTE_CELL_SIZE + 1, sprite->color);
sprite->tic->api.rect_border(sprite->tic, offsetX - 2, offsetY - 2, PALETTE_CELL_SIZE + 3, PALETTE_CELL_SIZE + 3, systemColor(tic_color_white));
sprite->tic->api.rect_border(sprite->tic, offsetX - 2, offsetY - 2, PALETTE_CELL_SIZE + 3, PALETTE_CELL_SIZE + 3, (tic_color_white));
if(offsetY > y)
sprite->tic->api.rect(sprite->tic, offsetX - 2, rect.y + rect.h+2, PALETTE_CELL_SIZE+3, 1, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, offsetX - 2, rect.y + rect.h+2, PALETTE_CELL_SIZE+3, 1, (tic_color_black));
}
{
@@ -816,7 +803,7 @@ static void drawPalette(Sprite* sprite, s32 x, s32 y)
s32 offsetX = x + (sprite->color2 % PALETTE_COLS) * PALETTE_CELL_SIZE;
s32 offsetY = y + (sprite->color2 / PALETTE_COLS) * PALETTE_CELL_SIZE;
drawBitIcon(offsetX, offsetY, Icon, sprite->color2 == systemColor(tic_color_white) ? systemColor(tic_color_black) : systemColor(tic_color_white));
drawBitIcon(offsetX, offsetY, Icon, sprite->color2 == (tic_color_white) ? (tic_color_black) : (tic_color_white));
}
{
@@ -852,12 +839,12 @@ static void drawPalette(Sprite* sprite, s32 x, s32 y)
if(sprite->editPalette || down)
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (over ? tic_color_light_blue : tic_color_white));
}
else
{
drawBitIcon(rect.x, rect.y+1, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black));
drawBitIcon(rect.x, rect.y, Icon, (over ? tic_color_light_blue : tic_color_white));
}
}
}
@@ -899,8 +886,8 @@ static void drawSheet(Sprite* sprite, s32 x, s32 y)
{
SDL_Rect rect = {x, y, TIC_SPRITESHEET_SIZE, TIC_SPRITESHEET_SIZE};
sprite->tic->api.rect_border(sprite->tic, rect.x - 1, rect.y - 1, rect.w + 2, rect.h + 2, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_black));
sprite->tic->api.rect_border(sprite->tic, rect.x - 1, rect.y - 1, rect.w + 2, rect.h + 2, (tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, (tic_color_black));
if(checkMousePos(&rect))
{
@@ -920,7 +907,7 @@ static void drawSheet(Sprite* sprite, s32 x, s32 y)
s32 bx = getIndexPosX(sprite) + x - 1;
s32 by = getIndexPosY(sprite) + y - 1;
sprite->tic->api.rect_border(sprite->tic, bx, by, sprite->size + 2, sprite->size + 2, systemColor(tic_color_white));
sprite->tic->api.rect_border(sprite->tic, bx, by, sprite->size + 2, sprite->size + 2, (tic_color_white));
}
}
@@ -1072,12 +1059,12 @@ static void drawSpriteTools(Sprite* sprite, s32 x, s32 y)
if(pushed)
{
drawBitIcon(rect.x, y + 1, Icons + i*BITS_IN_BYTE, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, y + 1, Icons + i*BITS_IN_BYTE, (over ? tic_color_light_blue : tic_color_white));
}
else
{
drawBitIcon(rect.x, y+1, Icons + i*BITS_IN_BYTE, systemColor(tic_color_black));
drawBitIcon(rect.x, y, Icons + i*BITS_IN_BYTE, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, y+1, Icons + i*BITS_IN_BYTE, (tic_color_black));
drawBitIcon(rect.x, y, Icons + i*BITS_IN_BYTE, (over ? tic_color_light_blue : tic_color_white));
}
}
}
@@ -1163,15 +1150,15 @@ static void drawTools(Sprite* sprite, s32 x, s32 y)
0b00000000,
};
drawBitIcon(rect.x, y - 4, Icon, systemColor(tic_color_black));
drawBitIcon(rect.x, y - 5, Icon, systemColor(tic_color_white));
drawBitIcon(rect.x, y - 4, Icon, (tic_color_black));
drawBitIcon(rect.x, y - 5, Icon, (tic_color_white));
drawBitIcon(rect.x, y + 1, Icons + i*BITS_IN_BYTE, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, y + 1, Icons + i*BITS_IN_BYTE, (over ? tic_color_light_blue : tic_color_white));
}
else
{
drawBitIcon(rect.x, y+1, Icons + i*BITS_IN_BYTE, systemColor(tic_color_black));
drawBitIcon(rect.x, y, Icons + i*BITS_IN_BYTE, systemColor(over ? tic_color_light_blue : tic_color_white));
drawBitIcon(rect.x, y+1, Icons + i*BITS_IN_BYTE, (tic_color_black));
drawBitIcon(rect.x, y, Icons + i*BITS_IN_BYTE, (over ? tic_color_light_blue : tic_color_white));
}
}
@@ -1347,7 +1334,7 @@ static void processKeydown(Sprite* sprite, SDL_Keycode keycode)
static void drawSpriteToolbar(Sprite* sprite)
{
sprite->tic->api.rect(sprite->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE-1, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white));
// draw sprite size control
{
@@ -1370,16 +1357,16 @@ static void drawSpriteToolbar(Sprite* sprite)
}
for(s32 i = 0; i < 4; i++)
sprite->tic->api.rect(sprite->tic, rect.x + i*6, 1, 5, 5, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x + i*6, 1, 5, 5, (tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x, 2, 23, 3, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x+1, 3, 21, 1, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x, 2, 23, 3, (tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x+1, 3, 21, 1, (tic_color_white));
s32 size = sprite->size / TIC_SPRITESIZE, val = 0;
while(size >>= 1) val++;
sprite->tic->api.rect(sprite->tic, rect.x + val*6, 1, 5, 5, systemColor(tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x+1 + val*6, 2, 3, 3, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x + val*6, 1, 5, 5, (tic_color_black));
sprite->tic->api.rect(sprite->tic, rect.x+1 + val*6, 2, 3, 3, (tic_color_white));
}
bool bg = sprite->index < TIC_BANK_SPRITES;
@@ -1387,8 +1374,8 @@ static void drawSpriteToolbar(Sprite* sprite)
{
static const char Label[] = "BG";
SDL_Rect rect = {TIC80_WIDTH - 2 * TIC_FONT_WIDTH - 2, 0, 2 * TIC_FONT_WIDTH + 1, TIC_SPRITESIZE-1};
sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, bg ? systemColor(tic_color_black) : systemColor(tic_color_gray));
sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, bg ? (tic_color_black) : (tic_color_gray));
sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, (tic_color_white));
if(checkMousePos(&rect))
{
@@ -1407,8 +1394,8 @@ static void drawSpriteToolbar(Sprite* sprite)
{
static const char Label[] = "FG";
SDL_Rect rect = {TIC80_WIDTH - 4 * TIC_FONT_WIDTH - 4, 0, 2 * TIC_FONT_WIDTH + 1, TIC_SPRITESIZE-1};
sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, bg ? systemColor(tic_color_gray) : systemColor(tic_color_black));
sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, systemColor(tic_color_white));
sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, bg ? (tic_color_gray) : (tic_color_black));
sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, (tic_color_white));
if(checkMousePos(&rect))
{
@@ -1453,7 +1440,7 @@ static void tick(Sprite* sprite)
}
}
sprite->tic->api.clear(sprite->tic, systemColor(tic_color_gray));
sprite->tic->api.clear(sprite->tic, (tic_color_gray));
drawCanvas(sprite, 24, 20);
drawMoveButtons(sprite);
@@ -1466,7 +1453,7 @@ static void tick(Sprite* sprite)
drawSheet(sprite, TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, 7);
drawSpriteToolbar(sprite);
drawToolbar(sprite->tic, systemColor(tic_color_gray), false);
drawToolbar(sprite->tic, (tic_color_gray), false);
sprite->tickCounter++;
}
@@ -1483,6 +1470,11 @@ static void onStudioEvent(Sprite* sprite, StudioEvent event)
}
}
static void scanline(tic_mem* tic, s32 row)
{
memcpy(tic->ram.vram.palette.data, row < TOOLBAR_SIZE ? tic->config.palette.data : tic->cart.palette.data, sizeof(tic_palette));
}
void initSprite(Sprite* sprite, tic_mem* tic)
{
if(sprite->select.back == NULL) sprite->select.back = (u8*)SDL_malloc(CANVAS_SIZE*CANVAS_SIZE);
@@ -1511,5 +1503,6 @@ void initSprite(Sprite* sprite, tic_mem* tic)
.mode = SPRITE_DRAW_MODE,
.history = history_create(tic->cart.gfx.tiles, TIC_SPRITES * sizeof(tic_tile)),
.event = onStudioEvent,
.scanline = scanline,
};
}
+2 -1
View File
@@ -60,7 +60,8 @@ struct Sprite
struct History* history;
void (*tick)(Sprite*);
void(*event)(Sprite*, StudioEvent);
void (*event)(Sprite*, StudioEvent);
void (*scanline)(tic_mem* tic, s32 row);
};
void initSprite(Sprite*, tic_mem*);
+4 -7
View File
@@ -26,7 +26,7 @@ static void reset(Start* start)
{
u8* tile = (u8*)start->tic->ram.gfx.tiles;
start->tic->api.clear(start->tic, systemColor(tic_color_black));
start->tic->api.clear(start->tic, (tic_color_black));
static const u8 Reset[] = {0x00, 0x06, 0x96, 0x00};
u8 val = Reset[sizeof(Reset) * (start->ticks % TIC_FRAMERATE) / TIC_FRAMERATE];
@@ -38,9 +38,9 @@ static void reset(Start* start)
static void drawHeader(Start* start)
{
start->tic->api.fixed_text(start->tic, TIC_NAME_FULL, STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT, systemColor(tic_color_white));
start->tic->api.fixed_text(start->tic, TIC_VERSION_LABEL, (sizeof(TIC_NAME_FULL) + 1) * STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT, systemColor(tic_color_dark_gray));
start->tic->api.fixed_text(start->tic, TIC_COPYRIGHT, STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT*2, systemColor(tic_color_dark_gray));
start->tic->api.fixed_text(start->tic, TIC_NAME_FULL, STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT, (tic_color_white));
start->tic->api.fixed_text(start->tic, TIC_VERSION_LABEL, (sizeof(TIC_NAME_FULL) + 1) * STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT, (tic_color_dark_gray));
start->tic->api.fixed_text(start->tic, TIC_COPYRIGHT, STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT*2, (tic_color_dark_gray));
}
static void header(Start* start)
@@ -100,7 +100,4 @@ void initStart(Start* start, tic_mem* tic)
.tick = tick,
.play = false,
};
memcpy(tic->cart.palette.data, tic->config.palette.data, sizeof(tic_palette));
tic->api.reset(tic);
}
+49 -29
View File
@@ -466,8 +466,8 @@ void drawExtrabar(tic_mem* tic)
{
SDL_Rect rect = {x + i*Size, y, Size, Size};
u8 bgcolor = systemColor(tic_color_white);
u8 color = systemColor(tic_color_light_blue);
u8 bgcolor = (tic_color_white);
u8 color = (tic_color_light_blue);
if(checkMousePos(&rect))
{
@@ -479,7 +479,7 @@ void drawExtrabar(tic_mem* tic)
if(checkMouseDown(&rect, SDL_BUTTON_LEFT))
{
bgcolor = color;
color = systemColor(tic_color_white);
color = (tic_color_white);
}
else if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
{
@@ -497,15 +497,10 @@ const StudioConfig* getConfig()
return &studio.config.data;
}
u8 systemColor(u8 color)
{
return getConfig()->theme.palmap.data[color];
}
void drawToolbar(tic_mem* tic, u8 color, bool bg)
{
if(bg)
studio.tic->api.rect(tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE-1, systemColor(tic_color_white));
studio.tic->api.rect(tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white));
static const u8 TabIcon[] =
{
@@ -596,7 +591,7 @@ void drawToolbar(tic_mem* tic, u8 color, bool bg)
if(mode == i)
drawBitIcon(i * Size, 0, TabIcon, color);
drawBitIcon(i * Size, 0, Icons + i * BITS_IN_BYTE, mode == i ? systemColor(tic_color_white) : (over ? systemColor(tic_color_dark_gray) : systemColor(tic_color_light_blue)));
drawBitIcon(i * Size, 0, Icons + i * BITS_IN_BYTE, mode == i ? (tic_color_white) : (over ? (tic_color_dark_gray) : (tic_color_light_blue)));
}
if(mode >= 0) drawExtrabar(tic);
@@ -614,11 +609,11 @@ void drawToolbar(tic_mem* tic, u8 color, bool bg)
{
if(strlen(studio.tooltip.text))
{
studio.tic->api.text(tic, studio.tooltip.text, (COUNT_OF(Modes) + 1) * Size, 1, systemColor(tic_color_black));
studio.tic->api.text(tic, studio.tooltip.text, (COUNT_OF(Modes) + 1) * Size, 1, (tic_color_black));
}
else
{
studio.tic->api.text(tic, Names[mode], (COUNT_OF(Modes) + 1) * Size, 1, systemColor(tic_color_dark_gray));
studio.tic->api.text(tic, Names[mode], (COUNT_OF(Modes) + 1) * Size, 1, (tic_color_dark_gray));
}
}
}
@@ -771,9 +766,7 @@ void setStudioMode(EditorMode mode)
EditorMode prev = studio.mode;
if(prev == TIC_RUN_MODE)
{
studio.tic->api.pause(studio.tic);
}
if(mode != TIC_RUN_MODE)
studio.tic->api.reset(studio.tic);
@@ -820,9 +813,11 @@ EditorMode getStudioMode()
return studio.mode;
}
void showGameMenu()
static void showGameMenu()
{
studio.tic->api.pause(studio.tic);
studio.tic->api.reset(studio.tic);
initMenuMode();
studio.mode = TIC_MENU_MODE;
}
@@ -1390,7 +1385,7 @@ static u32* srcPaletteBlit(const u8* src)
memset(pal, 0xff, sizeof pal);
u8* dst = (u8*)pal;
const u8* end = src + sizeof studio.tic->ram.vram.palette;
const u8* end = src + sizeof(tic_palette);
enum{RGB = sizeof(tic_rgb)};
@@ -1411,22 +1406,38 @@ static void blit(u32* out, u32* bgOut, s32 pitch, s32 bgPitch)
const s32 pitchWidth = pitch/sizeof *out;
const s32 bgPitchWidth = bgPitch/sizeof *bgOut;
u32* row = out;
const u32* pal = srcPaletteBlit(studio.tic->cart.palette.data);
const u32* pal = paletteBlit();
void(*scanline)(tic_mem* memory, s32 row) = NULL;
switch(studio.mode)
{
case TIC_RUN_MODE:
scanline = studio.tic->api.scanline;
break;
case TIC_SPRITE_MODE:
scanline = studio.sprite.scanline;
break;
case TIC_MAP_MODE:
scanline = studio.map.scanline;
break;
default:
break;
}
for(s32 r = 0, pos = 0; r < TIC80_HEIGHT; r++, row += pitchWidth)
{
if(studio.mode == TIC_RUN_MODE || studio.mode == TIC_MENU_MODE)
if(scanline)
{
studio.tic->api.scanline(studio.tic, r);
scanline(studio.tic, r);
pal = paletteBlit();
}
if(bgOut)
{
u8 border = tic_tool_peek4(studio.tic->ram.vram.mapping, studio.tic->ram.vram.vars.border & 0xf);
SDL_memset4(bgOut, pal[border], TIC80_WIDTH);
bgOut += bgPitchWidth;
}
if(bgOut)
{
u8 border = tic_tool_peek4(studio.tic->ram.vram.mapping, studio.tic->ram.vram.vars.border & 0xf);
SDL_memset4(bgOut, pal[border], TIC80_WIDTH);
bgOut += bgPitchWidth;
}
SDL_memset4(row, 0, pitchWidth);
@@ -1994,6 +2005,11 @@ static void renderCursor()
blitCursor(studio.tic->config.gfx.tiles[getConfig()->theme.cursor.sprite].data);
}
static void useSystemPalette()
{
memcpy(studio.tic->ram.vram.palette.data, studio.tic->config.palette.data, sizeof(tic_palette));
}
static void renderStudio()
{
showTooltip("");
@@ -2046,14 +2062,18 @@ static void renderStudio()
{
studio.popup.counter--;
studio.tic->api.rect(studio.tic, 0, TIC80_HEIGHT - TIC_FONT_HEIGHT - 1, TIC80_WIDTH, TIC80_HEIGHT, systemColor(tic_color_red));
studio.tic->api.rect(studio.tic, 0, TIC80_HEIGHT - TIC_FONT_HEIGHT - 1, TIC80_WIDTH, TIC80_HEIGHT, (tic_color_red));
studio.tic->api.text(studio.tic, studio.popup.message, (s32)(TIC80_WIDTH - strlen(studio.popup.message)*TIC_FONT_WIDTH)/2,
TIC80_HEIGHT - TIC_FONT_HEIGHT, systemColor(tic_color_white));
TIC80_HEIGHT - TIC_FONT_HEIGHT, (tic_color_white));
}
studio.tic->api.tick_end(studio.tic);
blitSound();
if(studio.mode != TIC_RUN_MODE)
useSystemPalette();
blitTexture();
renderCursor();
@@ -2253,7 +2273,7 @@ static void setWindowIcon()
u32* pixels = SDL_malloc(Size * Size * sizeof(u32));
const u32* pal = paletteBlit();
const u32* pal = srcPaletteBlit(studio.tic->config.palette.data);
for(s32 j = 0, index = 0; j < Size; j++)
for(s32 i = 0; i < Size; i++, index++)
+3 -11
View File
@@ -43,13 +43,13 @@
#define TIC_MOD_CTRL (KMOD_GUI|KMOD_CTRL)
#define TOOLBAR_SIZE 8
#define TOOLBAR_SIZE 7
#define STUDIO_TEXT_WIDTH (TIC_FONT_WIDTH)
#define STUDIO_TEXT_HEIGHT (TIC_FONT_HEIGHT+1)
#define STUDIO_TEXT_BUFFER_WIDTH (TIC80_WIDTH / STUDIO_TEXT_WIDTH)
#define STUDIO_TEXT_BUFFER_HEIGHT (TIC80_HEIGHT / STUDIO_TEXT_HEIGHT)
#define TIC_COLOR_BG systemColor(tic_color_black)
#define TIC_COLOR_BG (tic_color_black)
#define DEFAULT_CHMOD 0755
#define CONFIG_TIC "config " TIC_VERSION_LABEL ".tic"
@@ -64,11 +64,6 @@ typedef struct
{
struct
{
struct
{
u8 data[TIC_PALETTE_SIZE];
} palmap;
struct
{
s32 sprite;
@@ -179,8 +174,6 @@ void showTooltip(const char* text);
SDL_Scancode* getKeymap();
u8 systemColor(u8 color);
const StudioConfig* getConfig();
void setSpritePixel(tic_tile* tiles, s32 x, s32 y, u8 color);
@@ -190,7 +183,6 @@ typedef void(*DialogCallback)(bool yes, void* data);
void showDialog(const char** text, s32 rows, DialogCallback callback, void* data);
void hideDialog();
void showGameMenu();
void hideGameMenu();
bool studioCartChanged();
@@ -199,4 +191,4 @@ void playSystemSfx(s32 id);
void runGameFromSurf();
void gotoSurf();
void exitFromGameMenu();
void runProject();
void runProject();
+1 -1
View File
@@ -482,7 +482,7 @@ static void updateMenuItemCover(Surf* surf, const u8* cover, s32 size)
{
const gif_color* c = &image->palette[image->buffer[i]];
tic_rgb rgb = { c->r, c->g, c->b };
u8 color = tic_tool_find_closest_color(tic->cart.palette.colors, &rgb);
u8 color = tic_tool_find_closest_color(tic->config.palette.colors, &rgb);
tic_tool_poke4(item->cover->data, i, color);
}
}
+2 -2
View File
@@ -441,8 +441,8 @@ static void api_pause(tic_mem* memory)
memcpy(&machine->pause.music_pos, &memory->ram.music_pos, sizeof memory->ram.music_pos);
memcpy(&machine->pause.vram, &memory->ram.vram, sizeof memory->ram.vram);
api_reset(memory);
memcpy(memory->ram.vram.palette.data, memory->config.palette.data, sizeof(tic_palette));
// api_reset(memory);
// memcpy(memory->ram.vram.palette.data, memory->config.palette.data, sizeof(tic_palette));
}
static void api_resume(tic_mem* memory)
+2 -2
View File
@@ -28,7 +28,7 @@
static void drawGrid(World* world)
{
Map* map = world->map;
u8 color = systemColor(tic_color_light_blue);
u8 color = (tic_color_light_blue);
for(s32 c = 0; c < TIC80_WIDTH; c += TIC_MAP_SCREEN_WIDTH)
world->tic->api.line(world->tic, c, 0, c, TIC80_HEIGHT, color);
@@ -58,7 +58,7 @@ static void drawGrid(World* world)
}
world->tic->api.rect_border(world->tic, map->scroll.x / TIC_SPRITESIZE, map->scroll.y / TIC_SPRITESIZE,
TIC_MAP_SCREEN_WIDTH+1, TIC_MAP_SCREEN_HEIGHT+1, systemColor(tic_color_red));
TIC_MAP_SCREEN_WIDTH+1, TIC_MAP_SCREEN_HEIGHT+1, (tic_color_red));
}
static void processKeydown(World* world, SDL_Keycode keycode)