Skip to content

Commit

Permalink
It builds again
Browse files Browse the repository at this point in the history
  • Loading branch information
buj committed Sep 15, 2024
1 parent dc145a4 commit 60813df
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 11 deletions.
4 changes: 2 additions & 2 deletions freesprite/EditorLayerPicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ void EditorLayerPicker::render(XY position)
//SDL_SetRenderDrawColor(g_rd, 0x30, 0x30, 0x30, focused ? 0x80 : 0x30);
//SDL_RenderFillRect(g_rd, &r);

SDL_Color colorBG1 = { 0x30, 0x30, 0x30, focused ? 0xa0 : 0x90};
SDL_Color colorBG2 = { 0x10, 0x10, 0x10, focused ? 0xa0 : 0x90};
SDL_Color colorBG1 = { 0x30, 0x30, 0x30, uint8_t(focused ? 0xa0 : 0x90)};
SDL_Color colorBG2 = { 0x10, 0x10, 0x10, uint8_t(focused ? 0xa0 : 0x90)};
renderGradient(r, sdlcolorToUint32(colorBG2), sdlcolorToUint32(colorBG1), sdlcolorToUint32(colorBG1), sdlcolorToUint32(colorBG1));
if (focused) {
SDL_SetRenderDrawColor(g_rd, 0xff, 0xff, 0xff, 255);
Expand Down
3 changes: 2 additions & 1 deletion freesprite/FileIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "pugixml/pugixml.hpp"
#include "astc_dec/astc_decomp.h"
#include "base64/base64.hpp"
#include "MainEditorPalettized.h"
#include <cstdio>

enum VTFFORMAT
Expand Down Expand Up @@ -1931,7 +1932,7 @@ MainEditor* loadAnyIntoSession(std::string utf8path)
#if _WIDEPATHS
fPath = utf8StringToWstring(utf8path);
#else
fPath = path;
fPath = utf8path;
#endif

for (FileSessionImportNPath importer : g_fileSessionImportersNPaths) {
Expand Down
6 changes: 3 additions & 3 deletions freesprite/platform_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ void platformPreInit() {

}
void platformInit() {

}
void platformPostInit() {

}

void platformTrySaveImageFile(EventCallbackListener* caller) {}
void platformTryLoadImageFile(EventCallbackListener* caller) {}
void platformTrySaveOtherFile(EventCallbackListener* caller, std::vector<std::pair<std::string,std::string>> filetypes, std::string windowTitle, int evt_id) {}
void platformTryLoadOtherFile(EventCallbackListener* caller, std::string extension, std::string windowTitle) {}
void platformTryLoadOtherFile(EventCallbackListener* listener, std::vector<std::pair<std::string, std::string>> filetypes, std::string windowTitle, int evt_id) {}

void platformOpenFileLocation(PlatformNativePathString path) {}

Expand Down
2 changes: 1 addition & 1 deletion linux-build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(freesprite)
set(CMAKE_CXX_STANDARD 23)
file(GLOB SRC ../freesprite/*.c* ../freesprite/**/*.c*)
link_directories(${CMAKE_SOURCE_DIR}/lib)
link_directories(${CMAKE_SOURCE_DIR}/../freesprite/imagecdylib/target/release/)
add_executable(freesprite ${SRC})
target_link_libraries(freesprite z)
target_link_libraries(freesprite m)
Expand Down
10 changes: 8 additions & 2 deletions linux-build/_voidsprite.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env sh

D="$(dirname "$0")"
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )

LD_LIBRARY_PATH="$D/lib:$LD_LIBRARY_PATH" exec -a voidsprite "$D/__freesprite" $@
LD_LIBRARY_PATH="$DIR/lib:$LD_LIBRARY_PATH" exec -a voidsprite "$DIR/__freesprite" $@

28 changes: 26 additions & 2 deletions linux-build/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
set -e

SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )

echo ':: building imagecdylib ::'

cd ../freesprite/imagecdylib
cargo build --release
cd "$DIR"

echo ':: building voidsprite ::'

cmake -G Ninja
ninja
mkdir -p dist
cp -r lib dist/

echo ':: packaging ::'

mkdir -p dist/lib/

cp ../freesprite/imagecdylib/target/release/lib* dist/lib/

find ../freesprite \( -name "*.ico" -o -name "*.ttf" \) -exec cp {} dist/ \;
cp -r ../freesprite/assets/ dist/
cp freesprite dist/__freesprite
cp _voidsprite.sh dist/voidsprite

echo ':: done ::'

0 comments on commit 60813df

Please sign in to comment.