Fixed API changes
This commit is contained in:
parent
96620667f5
commit
40b3cb2f8a
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.9)
|
cmake_minimum_required(VERSION 3.9)
|
||||||
|
|
||||||
project(TIC-80 C)
|
project(TIC-80 C CXX)
|
||||||
message("Building for target : ${CMAKE_SYSTEM_NAME}")
|
message("Building for target : ${CMAKE_SYSTEM_NAME}")
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID)
|
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID)
|
||||||
|
@ -133,6 +133,40 @@ target_include_directories(wren PRIVATE 3rd-party/wren-0.1.0/src/include)
|
||||||
target_include_directories(wren PRIVATE 3rd-party/wren-0.1.0/src/optional)
|
target_include_directories(wren PRIVATE 3rd-party/wren-0.1.0/src/optional)
|
||||||
target_include_directories(wren PRIVATE 3rd-party/wren-0.1.0/src/vm)
|
target_include_directories(wren PRIVATE 3rd-party/wren-0.1.0/src/vm)
|
||||||
|
|
||||||
|
################################
|
||||||
|
# SQUIRREL
|
||||||
|
################################
|
||||||
|
|
||||||
|
set(SQUIRREL_DIR 3rd-party/squirrel3.1)
|
||||||
|
set(SQUIRREL_SRC
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqapi.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqbaselib.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqclass.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqcompiler.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqdebug.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqfuncstate.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqlexer.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqmem.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqobject.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqstate.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqtable.cpp
|
||||||
|
${SQUIRREL_DIR}/squirrel/sqvm.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdaux.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdblob.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdio.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdmath.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdrex.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdstream.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdstring.cpp
|
||||||
|
${SQUIRREL_DIR}/sqstdlib/sqstdsystem.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(squirrel STATIC ${SQUIRREL_SRC})
|
||||||
|
set_target_properties(squirrel PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
target_include_directories(squirrel PRIVATE 3rd-party/squirrel3.1/include)
|
||||||
|
target_include_directories(squirrel PRIVATE 3rd-party/squirrel3.1/squirrel)
|
||||||
|
target_include_directories(squirrel PRIVATE 3rd-party/squirrel3.1/sqstdlib)
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# GIFLIB
|
# GIFLIB
|
||||||
################################
|
################################
|
||||||
|
@ -162,6 +196,7 @@ set(TIC80CORE_SRC
|
||||||
${TIC80CORE_DIR}/jsapi.c
|
${TIC80CORE_DIR}/jsapi.c
|
||||||
${TIC80CORE_DIR}/luaapi.c
|
${TIC80CORE_DIR}/luaapi.c
|
||||||
${TIC80CORE_DIR}/wrenapi.c
|
${TIC80CORE_DIR}/wrenapi.c
|
||||||
|
${TIC80CORE_DIR}/squirrelapi.c
|
||||||
${TIC80CORE_DIR}/ext/gif.c
|
${TIC80CORE_DIR}/ext/gif.c
|
||||||
3rd-party/blip-buf/blip_buf.c # TODO: link it as lib?
|
3rd-party/blip-buf/blip_buf.c # TODO: link it as lib?
|
||||||
3rd-party/duktape-2.2.0/src/duktape.c # TODO: link it as lib?
|
3rd-party/duktape-2.2.0/src/duktape.c # TODO: link it as lib?
|
||||||
|
@ -175,11 +210,12 @@ target_include_directories(tic80core PRIVATE 3rd-party/duktape-2.2.0/src)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/lua-5.3.1/src)
|
target_include_directories(tic80core PRIVATE 3rd-party/lua-5.3.1/src)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/giflib-5.1.4/lib)
|
target_include_directories(tic80core PRIVATE 3rd-party/giflib-5.1.4/lib)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/wren-0.1.0/src/include)
|
target_include_directories(tic80core PRIVATE 3rd-party/wren-0.1.0/src/include)
|
||||||
|
target_include_directories(tic80core PRIVATE 3rd-party/squirrel3.1/include)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/moonscript)
|
target_include_directories(tic80core PRIVATE 3rd-party/moonscript)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/fennel)
|
target_include_directories(tic80core PRIVATE 3rd-party/fennel)
|
||||||
|
|
||||||
add_dependencies(tic80core lua lpeg wren giflib)
|
add_dependencies(tic80core lua lpeg wren squirrel giflib)
|
||||||
target_link_libraries(tic80core lua lpeg wren giflib)
|
target_link_libraries(tic80core lua lpeg wren squirrel giflib)
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# SDL2
|
# SDL2
|
||||||
|
|
|
@ -1028,6 +1028,7 @@ static SQInteger squirrel_font(HSQUIRRELVM vm)
|
||||||
s32 height = TIC_SPRITESIZE;
|
s32 height = TIC_SPRITESIZE;
|
||||||
u8 chromakey = 0;
|
u8 chromakey = 0;
|
||||||
bool fixed = false;
|
bool fixed = false;
|
||||||
|
bool alt = false;
|
||||||
s32 scale = 1;
|
s32 scale = 1;
|
||||||
|
|
||||||
if(top >= 4)
|
if(top >= 4)
|
||||||
|
@ -1053,6 +1054,14 @@ static SQInteger squirrel_font(HSQUIRRELVM vm)
|
||||||
if(top >= 9)
|
if(top >= 9)
|
||||||
{
|
{
|
||||||
scale = getSquirrelNumber(vm, 9);
|
scale = getSquirrelNumber(vm, 9);
|
||||||
|
|
||||||
|
if (top >= 10)
|
||||||
|
{
|
||||||
|
SQBool b = SQFalse;
|
||||||
|
sq_getbool(vm, 10, &b);
|
||||||
|
alt = (b != SQFalse);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1065,7 +1074,7 @@ static SQInteger squirrel_font(HSQUIRRELVM vm)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 size = drawText(memory, text, x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont);
|
s32 size = drawText(memory, text, x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont, alt);
|
||||||
|
|
||||||
sq_pushinteger(vm, size);
|
sq_pushinteger(vm, size);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1086,6 +1095,7 @@ static SQInteger squirrel_print(HSQUIRRELVM vm)
|
||||||
s32 y = 0;
|
s32 y = 0;
|
||||||
s32 color = TIC_PALETTE_SIZE-1;
|
s32 color = TIC_PALETTE_SIZE-1;
|
||||||
bool fixed = false;
|
bool fixed = false;
|
||||||
|
bool alt = false;
|
||||||
s32 scale = 1;
|
s32 scale = 1;
|
||||||
|
|
||||||
const char* text = printString(vm, 2);
|
const char* text = printString(vm, 2);
|
||||||
|
@ -1108,6 +1118,13 @@ static SQInteger squirrel_print(HSQUIRRELVM vm)
|
||||||
if(top >= 7)
|
if(top >= 7)
|
||||||
{
|
{
|
||||||
scale = getSquirrelNumber(vm, 7);
|
scale = getSquirrelNumber(vm, 7);
|
||||||
|
|
||||||
|
if (top >= 8)
|
||||||
|
{
|
||||||
|
SQBool b = SQFalse;
|
||||||
|
sq_getbool(vm, 8, &b);
|
||||||
|
alt = (b != SQFalse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1119,7 +1136,7 @@ static SQInteger squirrel_print(HSQUIRRELVM vm)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 size = memory->api.text_ex(memory, text ? text : "nil", x, y, color, fixed, scale);
|
s32 size = memory->api.text_ex(memory, text ? text : "nil", x, y, color, fixed, scale, alt);
|
||||||
|
|
||||||
sq_pushinteger(vm, size);
|
sq_pushinteger(vm, size);
|
||||||
|
|
||||||
|
|
|
@ -575,7 +575,7 @@ void tic_close(tic_mem* memory)
|
||||||
machine->state.initialized = false;
|
machine->state.initialized = false;
|
||||||
|
|
||||||
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
getSquirrelScriptConfig()->close(tic);
|
getSquirrelScriptConfig()->close(memory);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TIC_BUILD_WITH_LUA)
|
#if defined(TIC_BUILD_WITH_LUA)
|
||||||
|
|
Loading…
Reference in New Issue