Skip to content

Commit

Permalink
modify version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lets-all-be-stupid-forever committed Sep 22, 2024
1 parent 4b1b1d2 commit 690c5b4
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ wip
todo.txt
sdk
ca_*
lusarc/scripts
luasrc/scripts
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OPTION(OPENMP "Use OpenMP for thread detection")

IF (OPENMP)
find_package(OpenMP REQUIRED)
add_compile_definitions(HAVE_OPENMP=1)
add_compile_definitions(WITH_OPENMP=1)
ENDIF()

set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}")
Expand Down Expand Up @@ -126,7 +126,7 @@ ELSE ()
SET(luajit_lib luajit)
ENDIF()
IF (OPENMP)
SET(openmp_lib OpenMP::OpenMP_C)
SET(openmp_lib OpenMP::OpenMP_C OpenMP::OpenMP_CXX)
ENDIF ()
target_link_libraries(calib raylib ${shlwapi_lib} nfd ${openmp_lib} ${luajit_lib} ${clip_libs})

Expand All @@ -146,5 +146,5 @@ ENDIF()
IF (WIN32)
add_executable(ca_console src/main.c)
target_link_libraries(ca_console calib)
add_compile_definitions(ca_console PUBLIC SHOW_CONSOLE=1)
target_compile_definitions(ca_console PRIVATE CA_SHOW_CONSOLE=1)
ENDIF()
8 changes: 7 additions & 1 deletion deploy_here.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
set -e
mkdir bin
cp ../build/Release/* bin/
cp -r ../luasrc/ .
mkdir luasrc
cp ../luasrc/*.lua luasrc/
cp -r ../luasrc/component_examples luasrc/
cp -r ../luasrc/ctpd luasrc/
cp -r ../luasrc/imgs luasrc/
cp -r ../luasrc/levels luasrc/
cp -r ../luasrc/template_scripts luasrc/
cp -r ../assets/ .
cp ../LuaJIT/src/lua51.* bin/
6 changes: 2 additions & 4 deletions luasrc/levels/sandbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ table.insert(chips, ram)
table.insert(chips, ramDisplay)



return {
icon = "../luasrc/imgs/levels/sandbox_icon.png",
name = 'Sandbox',
Expand All @@ -49,16 +48,15 @@ You also have an example of custom (reusable) components such as:
- A RAM component
- A RAM Display component
You can create your own components and levels in the `script/` folder of your game installation. (if the folder is not there you can create one)
You can create your own components and levels in the `luasrc/scripts/` folder of your game installation. (if the folder is not there you can create one from the template in `luasrc/template_scripts/`)
You can look at the `luasrc/` folder for references/examples.
The game will look for the `scripts/init.lua` script at initialization, so you can import/register your levels and scripts from there.
You can open the game folder in steam via right click on the game name in "library", then go to "Manage" -> "Browse Local Files".
`Attention:` You shouldn't modify the scripts in "luasrc/" folder because they are overidden in updates. Your custom scripts should be stored in the `scripts/` folder (or somewhere in your machine if you want to, in which case you should import them from the `scripts/init.lua`).
`Attention:` Mind not modifying scripts outside the `luasrc/scripts/` folder because they are overidden in updates.
]],
chips = chips
}
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#endif

#ifdef WIN32
#ifndef SHOW_CONSOLE
#ifndef CA_SHOW_CONSOLE
// This pragma hides the console app terminal in window.
// We might want to make it flexible so people can use it to debug lua scripts.
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
Expand Down
3 changes: 3 additions & 0 deletions src/rendering.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include "colors.h"
#include "font.h"
#include "math.h"
#if defined(WITH_OPENMP)
#include "omp.h"
#endif
#include "string.h"

void RenderImageSimple(Image* out, Image img, float pixel_size, int camera_x,
Expand Down
8 changes: 7 additions & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#ifndef VERSION_H
#define VERSION_H
#define CA_VERSION "v1.0.3 - 20Sep2024"
#define CA_VERSION "v1.0.4 - 22Sep2024"

// v1.0.3 --> v1.0.4: Improved Lua Support
// - (QoL) Loads lua scripts from luasrc/scripts folder.
// Improved Sandbox level with Keyboard + ROM + RAM + Display
// components for reference.
// - (QoL) Added console launcher version for windows.
//
// v1.0.2 --> v1.0.3: Small QoL
// - (QoL) Window starts maximized. Initial window is a bit smaller, to make
// it work better at smaller screens. Dialogs change size with screen
Expand Down

0 comments on commit 690c5b4

Please sign in to comment.