Added MatrixExists() function

This commit is contained in:
n00b87
2025-11-18 21:59:55 -06:00
parent e6c0cb5a69
commit e0141b11e6
12 changed files with 2065 additions and 2010 deletions

View File

@@ -91,6 +91,8 @@ rc_intern_push_s( PUSH_S_STR_STACK, PUSH_S_S$ )
rc_intern_pop_s( POP_S$_STR_STACK ) rc_intern_pop_s( POP_S$_STR_STACK )
rc_intern_n_stack_size( STACK_SIZE_N_NUM_STACK ) rc_intern_n_stack_size( STACK_SIZE_N_NUM_STACK )
rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK ) rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK )
rc_intern_n_stack_exists( STACK_N_EXISTS_NUM_STACK )
rc_intern_s_stack_exists( STACK_S_EXISTS_STR_STACK )
rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE ) rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE )
rc_intern_fileClose( CLOSEFILE_STREAM ) rc_intern_fileClose( CLOSEFILE_STREAM )
rc_intern_fileReadByte( READBYTE_STREAM ) rc_intern_fileReadByte( READBYTE_STREAM )
@@ -471,6 +473,7 @@ rc_setMatrixScale( SETMATRIXSCALE_MA, SETMATRIXSCALE_X, SETMATRIXSCALE_Y, SET
rc_getMatrixTranslation( GETMATRIXTRANSLATION_MA, &GETMATRIXTRANSLATION_X, &GETMATRIXTRANSLATION_Y, &GETMATRIXTRANSLATION_Z ) rc_getMatrixTranslation( GETMATRIXTRANSLATION_MA, &GETMATRIXTRANSLATION_X, &GETMATRIXTRANSLATION_Y, &GETMATRIXTRANSLATION_Z )
rc_getMatrixRotation( GETMATRIXROTATION_MA, &GETMATRIXROTATION_X, &GETMATRIXROTATION_Y, &GETMATRIXROTATION_Z ) rc_getMatrixRotation( GETMATRIXROTATION_MA, &GETMATRIXROTATION_X, &GETMATRIXROTATION_Y, &GETMATRIXROTATION_Z )
rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z ) rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z )
rc_matrixExists( MATRIXEXISTS_MA )
rc_getClipboardText( ) rc_getClipboardText( )
rc_setClipboardText( SETCLIPBOARDTEXT_TXT$ ) rc_setClipboardText( SETCLIPBOARDTEXT_TXT$ )
rc_hasClipboardText( ) rc_hasClipboardText( )

View File

@@ -52,3 +52,4 @@ sub SetMatrixScale( mA, x, y, z )
sub GetMatrixTranslation( mA, ByRef x, ByRef y, ByRef z) sub GetMatrixTranslation( mA, ByRef x, ByRef y, ByRef z)
sub GetMatrixRotation( mA, ByRef x, ByRef y, ByRef z) sub GetMatrixRotation( mA, ByRef x, ByRef y, ByRef z)
sub GetMatrixScale( mA, ByRef x, ByRef y, ByRef z) sub GetMatrixScale( mA, ByRef x, ByRef y, ByRef z)
Function MatrixExists( mA )

View File

@@ -10,3 +10,5 @@ sub Push_S( str_stack, s$ )
function Pop_S$( str_stack ) function Pop_S$( str_stack )
function Stack_Size_N( num_stack ) function Stack_Size_N( num_stack )
function Stack_Size_S( str_stack ) function Stack_Size_S( str_stack )
Function Stack_N_Exists( num_stack )
Function Stack_S_Exists( str_stack )

View File

@@ -275,6 +275,10 @@ void init_embedded_functions()
add_embedded_arg("num_stack", ID_TYPE_NUM); add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_Size_S", ID_TYPE_FN_NUM); embed_function("Stack_Size_S", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM); add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("Stack_N_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_S_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("OpenFile", ID_TYPE_FN_NUM); embed_function("OpenFile", ID_TYPE_FN_NUM);
add_embedded_arg("fileName$", ID_TYPE_STR); add_embedded_arg("fileName$", ID_TYPE_STR);
add_embedded_arg("mode", ID_TYPE_NUM); add_embedded_arg("mode", ID_TYPE_NUM);
@@ -1368,6 +1372,8 @@ void init_embedded_functions()
add_embedded_arg("x", ID_TYPE_BYREF_NUM); add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM); add_embedded_arg("y", ID_TYPE_BYREF_NUM);
add_embedded_arg("z", ID_TYPE_BYREF_NUM); add_embedded_arg("z", ID_TYPE_BYREF_NUM);
embed_function("MatrixExists", ID_TYPE_FN_NUM);
add_embedded_arg("mA", ID_TYPE_NUM);
embed_function("GetClipboardText$", ID_TYPE_FN_STR); embed_function("GetClipboardText$", ID_TYPE_FN_STR);
embed_function("SetClipboardText", ID_TYPE_SUB); embed_function("SetClipboardText", ID_TYPE_SUB);
add_embedded_arg("txt$", ID_TYPE_STR); add_embedded_arg("txt$", ID_TYPE_STR);

Binary file not shown.

View File

@@ -269,6 +269,10 @@ embed_function("Stack_Size_N", ID_TYPE_FN_NUM);
add_embedded_arg("num_stack", ID_TYPE_NUM); add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_Size_S", ID_TYPE_FN_NUM); embed_function("Stack_Size_S", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM); add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("Stack_N_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_S_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("OpenFile", ID_TYPE_FN_NUM); embed_function("OpenFile", ID_TYPE_FN_NUM);
add_embedded_arg("fileName$", ID_TYPE_STR); add_embedded_arg("fileName$", ID_TYPE_STR);
add_embedded_arg("mode", ID_TYPE_NUM); add_embedded_arg("mode", ID_TYPE_NUM);
@@ -1362,6 +1366,8 @@ add_embedded_arg("mA", ID_TYPE_NUM);
add_embedded_arg("x", ID_TYPE_BYREF_NUM); add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM); add_embedded_arg("y", ID_TYPE_BYREF_NUM);
add_embedded_arg("z", ID_TYPE_BYREF_NUM); add_embedded_arg("z", ID_TYPE_BYREF_NUM);
embed_function("MatrixExists", ID_TYPE_FN_NUM);
add_embedded_arg("mA", ID_TYPE_NUM);
embed_function("GetClipboardText$", ID_TYPE_FN_STR); embed_function("GetClipboardText$", ID_TYPE_FN_STR);
embed_function("SetClipboardText", ID_TYPE_SUB); embed_function("SetClipboardText", ID_TYPE_SUB);
add_embedded_arg("txt$", ID_TYPE_STR); add_embedded_arg("txt$", ID_TYPE_STR);

File diff suppressed because it is too large Load Diff

View File

@@ -304,6 +304,12 @@ case FN_Stack_Size_N: //Number Function
case FN_Stack_Size_S: //Number Function case FN_Stack_Size_S: //Number Function
rc_push_num(rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK )); rc_push_num(rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK ));
break; break;
case FN_Stack_N_Exists: //Number Function
rc_push_num(rc_intern_n_stack_exists( STACK_N_EXISTS_NUM_STACK ));
break;
case FN_Stack_S_Exists: //Number Function
rc_push_num(rc_intern_s_stack_exists( STACK_S_EXISTS_STR_STACK ));
break;
case FN_OpenFile: //Number Function case FN_OpenFile: //Number Function
rc_push_num(rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE )); rc_push_num(rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE ));
break; break;
@@ -1445,6 +1451,9 @@ case FN_GetMatrixRotation: //Sub Procedure
case FN_GetMatrixScale: //Sub Procedure case FN_GetMatrixScale: //Sub Procedure
rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z ); rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z );
break; break;
case FN_MatrixExists: //Number Function
rc_push_num(rc_matrixExists( MATRIXEXISTS_MA ));
break;
case FN_GetClipboardText$: //String Function case FN_GetClipboardText$: //String Function
rc_push_str(rc_getClipboardText( )); rc_push_str(rc_getClipboardText( ));
break; break;

File diff suppressed because it is too large Load Diff

View File

@@ -304,6 +304,12 @@ case FN_Stack_Size_N: //Number Function
case FN_Stack_Size_S: //Number Function case FN_Stack_Size_S: //Number Function
rc_push_num(rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK )); rc_push_num(rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK ));
break; break;
case FN_Stack_N_Exists: //Number Function
rc_push_num(rc_intern_n_stack_exists( STACK_N_EXISTS_NUM_STACK ));
break;
case FN_Stack_S_Exists: //Number Function
rc_push_num(rc_intern_s_stack_exists( STACK_S_EXISTS_STR_STACK ));
break;
case FN_OpenFile: //Number Function case FN_OpenFile: //Number Function
rc_push_num(rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE )); rc_push_num(rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE ));
break; break;
@@ -1445,6 +1451,9 @@ case FN_GetMatrixRotation: //Sub Procedure
case FN_GetMatrixScale: //Sub Procedure case FN_GetMatrixScale: //Sub Procedure
rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z ); rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z );
break; break;
case FN_MatrixExists: //Number Function
rc_push_num(rc_matrixExists( MATRIXEXISTS_MA ));
break;
case FN_GetClipboardText$: //String Function case FN_GetClipboardText$: //String Function
rc_push_str(rc_getClipboardText( )); rc_push_str(rc_getClipboardText( ));
break; break;

View File

@@ -1346,6 +1346,13 @@ void rc_getMatrixScale(int mA, double* x, double* y, double* z)
*x = m.getScale().X; *x = m.getScale().X;
*y = m.getScale().Y; *y = m.getScale().Y;
*z = m.getScale().Z; *z = m.getScale().Z;
}
bool rc_matrixExists(int mA)
{
if(mA < 0 || mA >= rc_matrix.size())
return false;
return rc_matrix[mA].active;
} }
#endif // RC_MATRIX_H_INCLUDED #endif // RC_MATRIX_H_INCLUDED

View File

@@ -37,9 +37,9 @@
1759134832 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h 1759134832 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h
<TargetConditionals.h> <TargetConditionals.h>
1762837355 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h 1763524596 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_stdlib.h 1763522526 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_stdlib.h
"rc_os_defines.h" "rc_os_defines.h"
<sys/param.h> <sys/param.h>
<iostream> <iostream>
@@ -112,7 +112,7 @@
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/theoraplay.h 1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/theoraplay.h
1734372966 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_matrix.h 1763524510 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_matrix.h
<iostream> <iostream>
<vector> <vector>
<bits/stdc++.h> <bits/stdc++.h>
@@ -2279,7 +2279,7 @@
"rc_gfx_core.h" "rc_gfx_core.h"
<irrtheora.h> <irrtheora.h>
1762837355 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_func130_cases.h 1763524596 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_func130_cases.h
1760243468 source:/home/n00b/Projects/irrBullet/src/irrBullet.cpp 1760243468 source:/home/n00b/Projects/irrBullet/src/irrBullet.cpp
"irrBullet.h" "irrBullet.h"
@@ -2531,7 +2531,7 @@
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_physics3D_base.h 1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_physics3D_base.h
"rc_gfx_core.h" "rc_gfx_core.h"
1760248010 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h 1763452437 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h
"ProjectiveTextures.h" "ProjectiveTextures.h"
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h 1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h
@@ -2547,7 +2547,7 @@
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_particles.h 1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_particles.h
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_scene.h 1763452639 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_scene.h
"rc_gfx_core.h" "rc_gfx_core.h"
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_camera.h 1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_camera.h