no message

This commit is contained in:
BADIM-PC\Vadim 2017-09-28 18:52:52 +03:00
parent 58919641b7
commit 20c49034ac
4 changed files with 38 additions and 3 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -1126,20 +1126,45 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel)
} }
} }
static void drawTumbler(Music* music, s32 x, s32 y, s32 i)
{
tic_mem* tic = music->tic;
enum{On=36, Off = 52, Size=5, Chroma=14};
SDL_Rect rect = {x, y, Size, Size};
if(checkMousePos(&rect))
{
setCursor(SDL_SYSTEM_CURSOR_HAND);
showTooltip("on/off channel");
if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
music->tracker.patterns[i] = !music->tracker.patterns[i];
}
u8 color = Chroma;
tic->api.sprite(tic, &tic->config.gfx, music->tracker.patterns[i] ? On : Off, x, y, &color, 1);
}
static void drawTracker(Music* music, s32 x, s32 y) static void drawTracker(Music* music, s32 x, s32 y)
{ {
drawTrackerFrames(music, x, y); drawTrackerFrames(music, x, y);
x += TIC_FONT_WIDTH * 3; x += TIC_FONT_WIDTH * 3;
enum{ChannelWidth = TIC_FONT_WIDTH * 9};
for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++) for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++)
{ {
s32 patternId = tic_tool_get_pattern_id(getTrack(music), music->tracker.frame, i); s32 patternId = tic_tool_get_pattern_id(getTrack(music), music->tracker.frame, i);
drawEditbox(music, x + TIC_FONT_WIDTH * 9 * i + 2*TIC_FONT_WIDTH, y - 9, patternId, setChannelPattern, i); drawEditbox(music, x + ChannelWidth * i + 2*TIC_FONT_WIDTH, y - 9, patternId, setChannelPattern, i);
drawTumbler(music, x + ChannelWidth * i + 7*TIC_FONT_WIDTH, y - 9, i);
} }
for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++) for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++)
drawTrackerChannel(music, x + TIC_FONT_WIDTH * 9 * i, y, i); drawTrackerChannel(music, x + ChannelWidth * i, y, i);
} }
static void enableFollowMode(Music* music) static void enableFollowMode(Music* music)
@ -1336,6 +1361,12 @@ static void drawTrackerLayout(Music* music)
static void tick(Music* music) static void tick(Music* music)
{ {
tic_mem* tic = music->tic;
for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++)
if(!music->tracker.patterns[i])
tic->ram.registers[i].volume = 0;
switch (music->tab) switch (music->tab)
{ {
case MUSIC_TRACKER_TAB: drawTrackerLayout(music); break; case MUSIC_TRACKER_TAB: drawTrackerLayout(music); break;
@ -1383,6 +1414,8 @@ void initMusic(Music* music, tic_mem* tic)
.sfx = 0, .sfx = 0,
.volume = 0, .volume = 0,
}, },
.patterns = {true, true, true, true},
}, },
.tab = MUSIC_TRACKER_TAB, .tab = MUSIC_TRACKER_TAB,

View File

@ -49,6 +49,8 @@ struct Music
s32 volume; s32 volume;
} last; } last;
bool patterns[TIC_SOUND_CHANNELS];
} tracker; } tracker;
enum enum