no message

This commit is contained in:
BADIM-PC\Vadim 2017-10-20 10:32:31 +03:00
parent fe0b2a44b5
commit d529493685
9 changed files with 36 additions and 36 deletions

View File

@ -26,7 +26,7 @@
#define TEXT_CURSOR_DELAY (TIC_FRAMERATE / 2) #define TEXT_CURSOR_DELAY (TIC_FRAMERATE / 2)
#define TEXT_CURSOR_BLINK_PERIOD TIC_FRAMERATE #define TEXT_CURSOR_BLINK_PERIOD TIC_FRAMERATE
#define TEXT_BUFFER_WIDTH STUDIO_TEXT_BUFFER_WIDTH #define TEXT_BUFFER_WIDTH STUDIO_TEXT_BUFFER_WIDTH
#define TEXT_BUFFER_HEIGHT ((TIC80_HEIGHT - TOOLBAR_SIZE_ - STUDIO_TEXT_HEIGHT) / STUDIO_TEXT_HEIGHT) #define TEXT_BUFFER_HEIGHT ((TIC80_HEIGHT - TOOLBAR_SIZE - STUDIO_TEXT_HEIGHT) / STUDIO_TEXT_HEIGHT)
struct OutlineItem struct OutlineItem
{ {
@ -34,7 +34,7 @@ struct OutlineItem
char* pos; char* pos;
}; };
#define OUTLINE_SIZE ((TIC80_HEIGHT - TOOLBAR_SIZE_*2)/TIC_FONT_HEIGHT) #define OUTLINE_SIZE ((TIC80_HEIGHT - TOOLBAR_SIZE*2)/TIC_FONT_HEIGHT)
#define OUTLINE_ITEMS_SIZE (OUTLINE_SIZE * sizeof(OutlineItem)) #define OUTLINE_ITEMS_SIZE (OUTLINE_SIZE * sizeof(OutlineItem))
static void history(Code* code) static void history(Code* code)
@ -1408,9 +1408,9 @@ static void textEditTick(Code* code)
static void drawPopupBar(Code* code, const char* title) static void drawPopupBar(Code* code, const char* title)
{ {
enum {TextY = TOOLBAR_SIZE_ + 1}; enum {TextY = TOOLBAR_SIZE + 1};
code->tic->api.rect(code->tic, 0, TOOLBAR_SIZE_, TIC80_WIDTH, TIC_FONT_HEIGHT + 1, systemColor(tic_color_blue)); code->tic->api.rect(code->tic, 0, TOOLBAR_SIZE, TIC80_WIDTH, TIC_FONT_HEIGHT + 1, systemColor(tic_color_blue));
code->tic->api.fixed_text(code->tic, title, 0, TextY, systemColor(tic_color_white)); code->tic->api.fixed_text(code->tic, title, 0, TextY, systemColor(tic_color_white));
code->tic->api.fixed_text(code->tic, code->popup.text, (s32)strlen(title)*TIC_FONT_WIDTH, TextY, systemColor(tic_color_white)); code->tic->api.fixed_text(code->tic, code->popup.text, (s32)strlen(title)*TIC_FONT_WIDTH, TextY, systemColor(tic_color_white));
@ -1576,7 +1576,7 @@ static void textGoToTick(Code* code)
code->tic->api.clear(code->tic, getConfig()->theme.code.bg); code->tic->api.clear(code->tic, getConfig()->theme.code.bg);
if(code->jump.line >= 0) 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); TIC80_WIDTH, TIC_FONT_HEIGHT+1, getConfig()->theme.code.select);
drawCode(code, false); drawCode(code, false);
@ -1691,7 +1691,7 @@ static void textOutlineTick(Code* code)
static void drawCodeToolbar(Code* code) static void drawCodeToolbar(Code* code)
{ {
code->tic->api.rect(code->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE_, systemColor(tic_color_white)); code->tic->api.rect(code->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
static const u8 Icons[] = static const u8 Icons[] =
{ {
@ -1838,7 +1838,7 @@ void initCode(Code* code, tic_mem* tic)
.tick = tick, .tick = tick,
.escape = escape, .escape = escape,
.cursor = {{tic->cart.code.data, NULL, 0, 0}, NULL, 0}, .cursor = {{tic->cart.code.data, NULL, 0, 0}, NULL, 0},
.rect = {0, TOOLBAR_SIZE_ + 1, 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}, .scroll = {0, 0, {0, 0}, false},
.tickCounter = 0, .tickCounter = 0,
.history = NULL, .history = NULL,

View File

@ -117,7 +117,7 @@ static void processKeydown(Dialog* dlg, SDL_Keysym* keysum)
static void drawDialog(Dialog* dlg) static void drawDialog(Dialog* dlg)
{ {
enum {Width = TIC80_WIDTH/2, Height = TIC80_HEIGHT/2-TOOLBAR_SIZE_}; enum {Width = TIC80_WIDTH/2, Height = TIC80_HEIGHT/2-TOOLBAR_SIZE};
tic_mem* tic = dlg->tic; tic_mem* tic = dlg->tic;
@ -126,7 +126,7 @@ static void drawDialog(Dialog* dlg)
rect.x -= dlg->pos.x; rect.x -= dlg->pos.x;
rect.y -= dlg->pos.y; rect.y -= dlg->pos.y;
SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE_-1), rect.w, TOOLBAR_SIZE_}; SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE-1), rect.w, TOOLBAR_SIZE};
if(checkMousePos(&header)) if(checkMousePos(&header))
{ {
@ -159,13 +159,13 @@ static void drawDialog(Dialog* dlg)
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_blue)); 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.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.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_-2), rect.w, TOOLBAR_SIZE_-2, systemColor(tic_color_white)); tic->api.rect(tic, rect.x, rect.y-(TOOLBAR_SIZE-2), rect.w, TOOLBAR_SIZE-2, systemColor(tic_color_white));
tic->api.line(tic, rect.x+1, rect.y-(TOOLBAR_SIZE_-1), rect.x+Width-2, rect.y-(TOOLBAR_SIZE_-1), systemColor(tic_color_white)); tic->api.line(tic, rect.x+1, rect.y-(TOOLBAR_SIZE-1), rect.x+Width-2, rect.y-(TOOLBAR_SIZE-1), systemColor(tic_color_white));
{ {
static const char Label[] = "WARNING!"; static const char Label[] = "WARNING!";
s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, 0); 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_-2), systemColor(tic_color_gray)); tic->api.text(tic, Label, rect.x + (Width - size)/2, rect.y-(TOOLBAR_SIZE-2), systemColor(tic_color_gray));
} }
{ {

View File

@ -26,9 +26,9 @@
#define SHEET_COLS (TIC_SPRITESHEET_SIZE / TIC_SPRITESIZE) #define SHEET_COLS (TIC_SPRITESHEET_SIZE / TIC_SPRITESIZE)
#define MAP_WIDTH (TIC80_WIDTH) #define MAP_WIDTH (TIC80_WIDTH)
#define MAP_HEIGHT (TIC80_HEIGHT - TOOLBAR_SIZE_) #define MAP_HEIGHT (TIC80_HEIGHT - TOOLBAR_SIZE)
#define MAP_X (0) #define MAP_X (0)
#define MAP_Y (TOOLBAR_SIZE_) #define MAP_Y (TOOLBAR_SIZE)
#define MAX_SCROLL_X (TIC_MAP_WIDTH * TIC_SPRITESIZE) #define MAX_SCROLL_X (TIC_MAP_WIDTH * TIC_SPRITESIZE)
#define MAX_SCROLL_Y (TIC_MAP_HEIGHT * TIC_SPRITESIZE) #define MAX_SCROLL_Y (TIC_MAP_HEIGHT * TIC_SPRITESIZE)
@ -293,7 +293,7 @@ static void drawTileIndex(Map* map, s32 x, s32 y)
if(map->sheet.show) if(map->sheet.show)
{ {
SDL_Rect rect = {TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE_, 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)) if(checkMousePos(&rect))
{ {
@ -328,7 +328,7 @@ static void drawTileIndex(Map* map, s32 x, s32 y)
static void drawMapToolbar(Map* map, s32 x, s32 y) static void drawMapToolbar(Map* map, s32 x, s32 y)
{ {
map->tic->api.rect(map->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE_, systemColor(tic_color_white)); map->tic->api.rect(map->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
drawTileIndex(map, TIC80_WIDTH/2 - TIC_FONT_WIDTH, y); drawTileIndex(map, TIC80_WIDTH/2 - TIC_FONT_WIDTH, y);
@ -417,7 +417,7 @@ static void drawCursorPos(Map* map, s32 x, s32 y)
if(px + width >= TIC80_WIDTH) px = x - (width + 2); if(px + width >= TIC80_WIDTH) px = x - (width + 2);
s32 py = y - (TIC_FONT_HEIGHT + 2); s32 py = y - (TIC_FONT_HEIGHT + 2);
if(py <= TOOLBAR_SIZE_) py = y + (TIC_SPRITESIZE + 3); 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.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.text(map->tic, pos, px, py, systemColor(tic_color_light_blue));
@ -1113,7 +1113,7 @@ static void tick(Map* map)
map->tic->api.clear(map->tic, TIC_COLOR_BG); map->tic->api.clear(map->tic, TIC_COLOR_BG);
drawMap(map); drawMap(map);
drawSheet(map, TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE_); drawSheet(map, TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE);
drawMapToolbar(map, TIC80_WIDTH - 9*TIC_FONT_WIDTH, 1); drawMapToolbar(map, TIC80_WIDTH - 9*TIC_FONT_WIDTH, 1);
drawToolbar(map->tic, TIC_COLOR_BG, false); drawToolbar(map->tic, TIC_COLOR_BG, false);
} }
@ -1133,7 +1133,7 @@ static void onStudioEvent(Map* map, StudioEvent event)
static void scanline(tic_mem* tic, s32 row) 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)); 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) void initMap(Map* map, tic_mem* tic)

View File

@ -24,7 +24,7 @@
#include "fs.h" #include "fs.h"
#define DIALOG_WIDTH (TIC80_WIDTH/2) #define DIALOG_WIDTH (TIC80_WIDTH/2)
#define DIALOG_HEIGHT (TIC80_HEIGHT/2-TOOLBAR_SIZE_) #define DIALOG_HEIGHT (TIC80_HEIGHT/2-TOOLBAR_SIZE)
static const char* Rows[] = static const char* Rows[] =
{ {
@ -78,7 +78,7 @@ static void drawDialog(Menu* menu)
tic_mem* tic = menu->tic; tic_mem* tic = menu->tic;
SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE_-1), rect.w, TOOLBAR_SIZE_}; SDL_Rect header = {rect.x, rect.y-(TOOLBAR_SIZE-1), rect.w, TOOLBAR_SIZE};
if(checkMousePos(&header)) if(checkMousePos(&header))
{ {
@ -113,13 +113,13 @@ static void drawDialog(Menu* menu)
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, systemColor(tic_color_blue)); 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.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.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_-2), rect.w, TOOLBAR_SIZE_-2, systemColor(tic_color_white)); tic->api.rect(tic, rect.x, rect.y-(TOOLBAR_SIZE-2), rect.w, TOOLBAR_SIZE-2, systemColor(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), systemColor(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), systemColor(tic_color_white));
{ {
static const char Label[] = "GAME MENU"; static const char Label[] = "GAME MENU";
s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, 0); 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_-2), systemColor(tic_color_gray)); tic->api.text(tic, Label, rect.x + (DIALOG_WIDTH - size)/2, rect.y-(TOOLBAR_SIZE-2), systemColor(tic_color_gray));
} }
{ {

View File

@ -1478,7 +1478,7 @@ static void drawModeTabs(Music* music)
static void drawMusicToolbar(Music* music) static void drawMusicToolbar(Music* music)
{ {
music->tic->api.rect(music->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE_, systemColor(tic_color_white)); music->tic->api.rect(music->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
drawPlayButtons(music); drawPlayButtons(music);
drawModeTabs(music); drawModeTabs(music);
@ -1573,7 +1573,7 @@ static void drawTrackerLayout(Music* music)
music->tic->api.clear(music->tic, systemColor(tic_color_gray)); music->tic->api.clear(music->tic, systemColor(tic_color_gray));
drawTopPanel(music, 6, TOOLBAR_SIZE_ + 3); drawTopPanel(music, 6, TOOLBAR_SIZE + 3);
drawTracker(music, 6, 35); drawTracker(music, 6, 35);
} }

View File

@ -796,7 +796,7 @@ static void drawModeTabs(Sfx* sfx)
static void drawSfxToolbar(Sfx* sfx) static void drawSfxToolbar(Sfx* sfx)
{ {
sfx->tic->api.rect(sfx->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE_, systemColor(tic_color_white)); sfx->tic->api.rect(sfx->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
enum{Width = 3 * TIC_FONT_WIDTH}; enum{Width = 3 * TIC_FONT_WIDTH};
s32 x = TIC80_WIDTH - Width - TIC_SPRITESIZE*3; s32 x = TIC80_WIDTH - Width - TIC_SPRITESIZE*3;
@ -854,13 +854,13 @@ static void envelopesTick(Sfx* sfx)
drawSfxToolbar(sfx); drawSfxToolbar(sfx);
drawToolbar(sfx->tic, TIC_COLOR_BG, false); drawToolbar(sfx->tic, TIC_COLOR_BG, false);
drawTopPanel(sfx, Start, TOOLBAR_SIZE_ + Gap); drawTopPanel(sfx, Start, TOOLBAR_SIZE + Gap);
drawCanvasTabs(sfx, Start-Gap, TOOLBAR_SIZE_ + Gap + TIC_FONT_HEIGHT+2); drawCanvasTabs(sfx, Start-Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+2);
if(sfx->canvasTab == SFX_WAVE_TAB) if(sfx->canvasTab == SFX_WAVE_TAB)
drawWaveButtons(sfx, Start + CANVAS_WIDTH + Gap-1, TOOLBAR_SIZE_ + Gap + TIC_FONT_HEIGHT+2); drawWaveButtons(sfx, Start + CANVAS_WIDTH + Gap-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+2);
drawLoopPanel(sfx, Gap, TOOLBAR_SIZE_ + Gap + TIC_FONT_HEIGHT+92); drawLoopPanel(sfx, Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+92);
drawCanvas(sfx, Start-1, TOOLBAR_SIZE_ + Gap + TIC_FONT_HEIGHT + 1); 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); drawOctavePanel(sfx, Start + Gap + PIANO_WIDTH + Gap-1, TIC80_HEIGHT - TIC_FONT_HEIGHT - (PIANO_HEIGHT - TIC_FONT_HEIGHT)/2 - Gap);
} }

View File

@ -1334,7 +1334,7 @@ static void processKeydown(Sprite* sprite, SDL_Keycode keycode)
static void drawSpriteToolbar(Sprite* sprite) static void drawSpriteToolbar(Sprite* sprite)
{ {
sprite->tic->api.rect(sprite->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE_, systemColor(tic_color_white)); sprite->tic->api.rect(sprite->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
// draw sprite size control // draw sprite size control
{ {
@ -1472,7 +1472,7 @@ static void onStudioEvent(Sprite* sprite, StudioEvent event)
static void scanline(tic_mem* tic, s32 row) 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)); 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) void initSprite(Sprite* sprite, tic_mem* tic)

View File

@ -505,7 +505,7 @@ u8 systemColor(u8 color)
void drawToolbar(tic_mem* tic, u8 color, bool bg) void drawToolbar(tic_mem* tic, u8 color, bool bg)
{ {
if(bg) if(bg)
studio.tic->api.rect(tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE_, systemColor(tic_color_white)); studio.tic->api.rect(tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, systemColor(tic_color_white));
static const u8 TabIcon[] = static const u8 TabIcon[] =
{ {

View File

@ -43,7 +43,7 @@
#define TIC_MOD_CTRL (KMOD_GUI|KMOD_CTRL) #define TIC_MOD_CTRL (KMOD_GUI|KMOD_CTRL)
#define TOOLBAR_SIZE_ 7 #define TOOLBAR_SIZE 7
#define STUDIO_TEXT_WIDTH (TIC_FONT_WIDTH) #define STUDIO_TEXT_WIDTH (TIC_FONT_WIDTH)
#define STUDIO_TEXT_HEIGHT (TIC_FONT_HEIGHT+1) #define STUDIO_TEXT_HEIGHT (TIC_FONT_HEIGHT+1)
#define STUDIO_TEXT_BUFFER_WIDTH (TIC80_WIDTH / STUDIO_TEXT_WIDTH) #define STUDIO_TEXT_BUFFER_WIDTH (TIC80_WIDTH / STUDIO_TEXT_WIDTH)