Skip to content

Commit

Permalink
updatelibs: yaaa, thats it, lets test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasdr committed Jan 3, 2025
1 parent 2395b6c commit e0ee951
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 848 deletions.
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ ifeq ($(GLES2), YES)
endif

# subdirs
LIBS:= $(LIBS) subdirs
LIBS:= $(LIBS) make-subdirs

SRC = src
TINYXML = tinyxml
Expand Down Expand Up @@ -1054,11 +1054,18 @@ $(VULKAN_RENDERER_LIB_OBJS):$(OBJ)/%.o: $(SRC)/%.cpp | print-opts
$(OPENGLES2_RENDERER_LIB_OBJS):$(OBJ)/%.o: $(SRC)/%.cpp | print-opts
$(cpp-command)

subdirs:
clean-subdirs:
@mkdir -p lib
for dir in $(SUBDIRS); do \
cd ext/$$dir; \
$(MAKE) clean; \
cd ../..; \
done

make-subdirs:
@mkdir -p lib
for dir in $(SUBDIRS); do \
cd ext/$$dir; \
$(MAKE); \
cd ../..; \
cp ext/$$dir/lib/lib$$dir$(LIB_EXT) lib/; \
Expand Down Expand Up @@ -1155,7 +1162,7 @@ endif
@echo Done $@

ifeq ($(OSSHORT), Msys)
$(MAINS):$(BIN)/%:$(SRC)/%-main.cpp $(LIBS)
$(MAINS):$(BIN)/%:$(SRC)/%-main.cpp
@mkdir -p $(dir $@);
@scripts/windows-mingw-create-executable-rc.sh "$<" $@.rc
@windres $@.rc -o coff -o $@.rc.o
Expand All @@ -1172,13 +1179,13 @@ mains: $(MAINS)

all: mains

clean:
clean: clean-subdirs
rm -rf obj obj-debug $(LIB_DIR) $(BIN)

print-opts:
@echo Building with \"$(CXX) $(CPPFLAGS) $(CXXFLAGS)\"

.PHONY: all mains clean print-opts
.PHONY: all $(LIBS) mains clean print-opts

-include $(OBJS:%.o=%.d)
-include $(OBJS_DEBUG:%.o=%.d)
5 changes: 3 additions & 2 deletions ext/minitscript/src/minitscript/minitscript/MinitScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4798,7 +4798,7 @@ const MinitScript::Variable MinitScript::initializeMapSet(const string& scriptFi
lc = lc == '\\' && c == '\\'?'\0':c;
}
// convert to set if no values given
if (hasValues == false) {
if (hasValues == false && variable.getMapSize() > 0) {
Variable setVariable;
setVariable.setType(TYPE_SET);
const auto& mapValueReference = variable.getMapValueReference();
Expand Down Expand Up @@ -5086,8 +5086,8 @@ inline const MinitScript::Variable MinitScript::initializeVariable(const Variabl
case TYPE_ARRAY:
{
Variable arrayVariable;
//
arrayVariable.setType(TYPE_ARRAY);
//
auto arrayPointer = variable.getArrayPointer();
if (arrayPointer == nullptr) break;
for (const auto arrayEntry: *arrayPointer) {
Expand All @@ -5099,6 +5099,7 @@ inline const MinitScript::Variable MinitScript::initializeVariable(const Variabl
case TYPE_MAP:
{
Variable mapVariable;
mapVariable.setType(TYPE_MAP);
//
auto mapPointer = variable.getMapPointer();
if (mapPointer == nullptr) break;
Expand Down
4 changes: 2 additions & 2 deletions ext/minitscript/src/minitscript/minitscript/MinitScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -2425,11 +2425,11 @@ class minitscript::minitscript::MinitScript {
} else
if (StringTools::viewStartsWith(value, "{") == true &&
StringTools::viewEndsWith(value, "}") == true) {
*this = initializeMapSet(scriptFileName, value, minitScript, scriptIdx, statement);
setValue(initializeMapSet(scriptFileName, value, minitScript, scriptIdx, statement));
} else
if (StringTools::viewStartsWith(value, "[") == true &&
StringTools::viewEndsWith(value, "]") == true) {
*this = initializeArray(scriptFileName, value, minitScript, scriptIdx, statement);
setValue(initializeArray(scriptFileName, value, minitScript, scriptIdx, statement));
} else
if (viewIsFunctionAssignment(value, functionOrStacklet) == true) {
setFunctionAssignment(string(functionOrStacklet));
Expand Down
23 changes: 23 additions & 0 deletions ext/minitscript/src/minitscript/minitscript/ScriptMethods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,29 @@ void ScriptMethods::registerMethods(MinitScript* minitScript) {
};
minitScript->registerMethod(new MethodScriptStop(minitScript));
}
{
//
class MethodScriptGetGlobalVariables: public MinitScript::Method {
private:
MinitScript* minitScript { nullptr };
public:
MethodScriptGetGlobalVariables(MinitScript* minitScript): MinitScript::Method({}, MinitScript::TYPE_MAP), minitScript(minitScript) {}
const string getMethodName() override {
return "script.getGlobalVariables";
}
void executeMethod(span<MinitScript::Variable>& arguments, MinitScript::Variable& returnValue, const MinitScript::SubStatement& subStatement) override {
if (arguments.size() == 0) {
returnValue.setType(MinitScript::TYPE_MAP);
for (const auto& [variableName, variableValue]: minitScript->getRootScriptState().variables) {
returnValue.setMapEntry(variableName, *variableValue);
}
} else {
MINITSCRIPT_METHODUSAGE_COMPLAIN(getMethodName());
}
}
};
minitScript->registerMethod(new MethodScriptGetGlobalVariables(minitScript));
}
{
//
class MethodScriptGetVariables: public MinitScript::Method {
Expand Down
2 changes: 1 addition & 1 deletion ext/minitscript/src/minitscript/minitscript/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using std::string;
using minitscript::minitscript::Version;

string Version::getVersion() {
return "0.9.33 PRE-BETA";
return "0.9.34 PRE-BETA";
}

string Version::getCopyright() {
Expand Down
166 changes: 0 additions & 166 deletions resources/tests/scripts/advanced-test.tscript

This file was deleted.

Loading

0 comments on commit e0ee951

Please sign in to comment.