Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ -z "$CC" ]; then
CC=c++
fi

CFLAGS="-D_GNU_SOURCE -fPIC -fpermissive -Wno-write-strings -Wno-comment"
CFLAGS="-std=c++11 -D_GNU_SOURCE -fPIC -fpermissive -Wno-write-strings -Wno-comment"
CFLAGS="$CFLAGS -Wno-null-dereference -Wno-logical-op-parentheses -Wno-switch"
CFLAGS="$CFLAGS -I$SRC_ROOT -I$CUSTOM_ROOT"

Expand Down
561 changes: 282 additions & 279 deletions code/custom/generated/command_metadata.h

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions code/platform_linux/alsa_funcs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ALSA_FN(int , hw_params_set_format , (snd_pcm_t *pcm, snd_pcm_h
ALSA_FN(int , hw_params_set_channels , (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val))
ALSA_FN(int , hw_params_set_rate , (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir))
ALSA_FN(int , hw_params_set_buffer_size, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val))
ALSA_FN(int , hw_params_set_period_size_near, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int dir))
ALSA_FN(int , hw_params_set_buffer_size_near, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val))
ALSA_FN(int , hw_params , (snd_pcm_t *pcm, snd_pcm_hw_params_t *params))
ALSA_FN(void , hw_params_free , (snd_pcm_hw_params_t *obj))
ALSA_FN(int , poll_descriptors_count , (snd_pcm_t *pcm))
Expand Down
7 changes: 4 additions & 3 deletions code/platform_linux/linux_4ed_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ linux_audio_main(void* _unused)
const u32 SamplesPerSecond = 48000;
const u32 SamplesPerBuffer = 16*SamplesPerSecond/1000;
const u32 ChannelCount = 2;
const u32 BytesPerSample = 2; // S16LE
const u32 BufferSize = SamplesPerBuffer * BytesPerSample;
const u32 BufferCount = 3;
const u32 MixBufferSize = (SamplesPerBuffer * ChannelCount * sizeof(f32));
const u32 SampleBufferSize = (SamplesPerBuffer * ChannelCount * sizeof(i16));
Expand Down Expand Up @@ -99,7 +97,10 @@ linux_audio_main(void* _unused)
chk( snd_pcm.hw_params_set_format (pcm, hw, SND_PCM_FORMAT_S16_LE));
chk( snd_pcm.hw_params_set_channels (pcm, hw, ChannelCount));
chk( snd_pcm.hw_params_set_rate (pcm, hw, SamplesPerSecond, 0));
chk( snd_pcm.hw_params_set_buffer_size (pcm, hw, BufferSize * BufferCount));
snd_pcm_uframes_t period_frames = SamplesPerBuffer;
snd_pcm_uframes_t buffer_frames = period_frames * BufferCount;
chk( snd_pcm.hw_params_set_period_size_near (pcm, hw, &period_frames, 0));
chk( snd_pcm.hw_params_set_buffer_size_near (pcm, hw, &buffer_frames));
chk( snd_pcm.hw_params (pcm, hw));
snd_pcm.hw_params_free (hw);

Expand Down
15 changes: 5 additions & 10 deletions code/platform_linux/linux_4ed_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,14 @@ system_get_file_list(Arena* arena, String_Const_u8 directory){
continue;
}

*fip = push_array_zero(arena, File_Info, 1);
(*fip)->file_name = push_u8_stringf(arena, "%.*s", d->d_reclen, name);

struct stat st;
if (fstatat(fd, name, &st, 0) == -1){
perror("fstatat");
}
else{
if (fstatat(fd, name, &st, 0) != -1){
*fip = push_array_zero(arena, File_Info, 1);
(*fip)->file_name = push_u8_stringf(arena, "%.*s", d->d_reclen, name);
(*fip)->attributes = linux_file_attributes_from_struct_stat(&st);
fip = &(*fip)->next;
result.count++;
}

fip = &(*fip)->next;
result.count++;
}
closedir(dir);

Expand Down
14 changes: 14 additions & 0 deletions sync-fork.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

cd "$(realpath "$(dirname "$0")")"

BRANCH="${1:-develop}"

echo "Syncing $BRANCH from upstream..."
gh repo sync --branch "$BRANCH"

echo "Updating local $BRANCH..."
git fetch origin
git merge --ff-only "origin/$BRANCH"
29 changes: 29 additions & 0 deletions user-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

set -e

cd "$(realpath "$(dirname "$0")")"

BUILD_DIR="$PWD/build"
INSTALL_DIR="${1:-$HOME/opt/4ed}"
BIN_DIR="${BINDIR:-$HOME/.local/bin}"

mkdir -p "$INSTALL_DIR"

cp -a "$BUILD_DIR/4ed" \
"$BUILD_DIR/4ed_app.so" \
"$BUILD_DIR/custom_4coder.so" \
"$BUILD_DIR/bindings.4coder" \
"$BUILD_DIR/config.4coder" \
"$BUILD_DIR/LICENSE.txt" \
"$BUILD_DIR/README.txt" \
"$BUILD_DIR/changes.txt" \
"$INSTALL_DIR/"

cp -a "$BUILD_DIR/fonts" "$BUILD_DIR/themes" "$INSTALL_DIR/"

mkdir -p "$BIN_DIR"
ln -sf "$INSTALL_DIR/4ed" "$BIN_DIR/4ed"

echo "Installed 4ed to: $INSTALL_DIR"
echo "Linked: $BIN_DIR/4ed -> $INSTALL_DIR/4ed"
Loading