Fixed byref variable pointer from rcbasic_build dev generator
This commit is contained in:
@@ -640,19 +640,19 @@ void rcbasic_export_dev()
|
|||||||
case ID_TYPE_NUM:
|
case ID_TYPE_NUM:
|
||||||
output_line += "ID_TYPE_NUM);";
|
output_line += "ID_TYPE_NUM);";
|
||||||
//fn_line += "num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].nid_value[0].value[0]";
|
//fn_line += "num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].nid_value[0].value[0]";
|
||||||
fn_line += "num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].nid_value.value[ num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
fn_line += "num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].nref[0].value[ num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
||||||
break;
|
break;
|
||||||
case ID_TYPE_BYREF_NUM:
|
case ID_TYPE_BYREF_NUM:
|
||||||
output_line += "ID_TYPE_BYREF_NUM);";
|
output_line += "ID_TYPE_BYREF_NUM);";
|
||||||
fn_line += "num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].nid_value.value[ num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
fn_line += "num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].nref[0].value[ num_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
||||||
break;
|
break;
|
||||||
case ID_TYPE_STR:
|
case ID_TYPE_STR:
|
||||||
output_line += "ID_TYPE_STR);";
|
output_line += "ID_TYPE_STR);";
|
||||||
fn_line += "str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].sid_value.value[ str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
fn_line += "str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].sref[0].value[ str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
||||||
break;
|
break;
|
||||||
case ID_TYPE_BYREF_STR:
|
case ID_TYPE_BYREF_STR:
|
||||||
output_line += "ID_TYPE_BYREF_STR);";
|
output_line += "ID_TYPE_BYREF_STR);";
|
||||||
fn_line += "str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].sid_value.value[ str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
fn_line += "str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].sref[0].value[ str_var[" + rc_intToString(id[i].fn_arg_vec[n]) + "].byref_offset ]";
|
||||||
break;
|
break;
|
||||||
case ID_TYPE_USER:
|
case ID_TYPE_USER:
|
||||||
//fn_arg_utype = "";
|
//fn_arg_utype = "";
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ void init_embedded_functions()
|
|||||||
add_embedded_arg("txt$", ID_TYPE_STR);
|
add_embedded_arg("txt$", ID_TYPE_STR);
|
||||||
embed_function("Input$", ID_TYPE_FN_STR);
|
embed_function("Input$", ID_TYPE_FN_STR);
|
||||||
add_embedded_arg("prompt$", ID_TYPE_STR);
|
add_embedded_arg("prompt$", ID_TYPE_STR);
|
||||||
|
embed_function("tst", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
|
||||||
embed_function("ArrayDim", ID_TYPE_FN_NUM);
|
embed_function("ArrayDim", ID_TYPE_FN_NUM);
|
||||||
add_embedded_arg("id", ID_TYPE_BYREF_NUM);
|
add_embedded_arg("id", ID_TYPE_BYREF_NUM);
|
||||||
embed_function("StringArrayDim", ID_TYPE_FN_NUM);
|
embed_function("StringArrayDim", ID_TYPE_FN_NUM);
|
||||||
|
|||||||
Binary file not shown.
@@ -55,6 +55,7 @@
|
|||||||
#include "rc_audio.h"
|
#include "rc_audio.h"
|
||||||
#include "rc_net.h"
|
#include "rc_net.h"
|
||||||
#include "rc_video.h"
|
#include "rc_video.h"
|
||||||
|
#include "rc_test.h"
|
||||||
#include <irrtheora.h>
|
#include <irrtheora.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -4322,10 +4323,10 @@ void rcbasic_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rcbasic_clean()
|
void rcbasic_clean()
|
||||||
{
|
{
|
||||||
rc_audio_quit();
|
rc_audio_quit();
|
||||||
rc_net_quit();
|
rc_net_quit();
|
||||||
rc_gfx_quit();
|
rc_gfx_quit();
|
||||||
byref_addr_table.empty();
|
byref_addr_table.empty();
|
||||||
loop_stack.empty();
|
loop_stack.empty();
|
||||||
n_stack.empty();
|
n_stack.empty();
|
||||||
@@ -4472,7 +4473,9 @@ int main(int argc, char * argv[])
|
|||||||
cout << "++Could not load rcbasic program" << endl;
|
cout << "++Could not load rcbasic program" << endl;
|
||||||
|
|
||||||
//rc_cleanSubprocessSystem();
|
//rc_cleanSubprocessSystem();
|
||||||
rcbasic_clean();
|
|
||||||
|
rcbasic_clean();
|
||||||
|
|
||||||
|
|
||||||
exit(rcbasic_exit_code);
|
exit(rcbasic_exit_code);
|
||||||
//cout << "Hello world!" << endl;
|
//cout << "Hello world!" << endl;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ bool rc_audio_init()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rc_audio_quit()
|
void rc_audio_quit()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < rc_sound.size(); i++)
|
for(int i = 0; i < rc_sound.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -92,8 +92,6 @@ bool rc_audio_quit()
|
|||||||
Mix_FreeMusic(rc_music);
|
Mix_FreeMusic(rc_music);
|
||||||
rc_music = NULL;
|
rc_music = NULL;
|
||||||
Mix_Quit();
|
Mix_Quit();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rc_queryAudioSpec(double * freq, double * format, double * channels)
|
int rc_queryAudioSpec(double * freq, double * format, double * channels)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,9 @@ case FN_Fprint: //Sub Procedure
|
|||||||
case FN_Input$: //String Function
|
case FN_Input$: //String Function
|
||||||
rc_push_str(rc_input( INPUT$_PROMPT$ ));
|
rc_push_str(rc_input( INPUT$_PROMPT$ ));
|
||||||
break;
|
break;
|
||||||
|
case FN_tst: //Sub Procedure
|
||||||
|
rc_tst( &TST_X );
|
||||||
|
break;
|
||||||
case FN_ArrayDim: //Number Function
|
case FN_ArrayDim: //Number Function
|
||||||
//DUMMY CASE
|
//DUMMY CASE
|
||||||
|
|
||||||
|
|||||||
@@ -210,18 +210,18 @@ bool rc_gfx_init()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rc_gfx_quit()
|
void rc_gfx_quit()
|
||||||
{
|
{
|
||||||
irrtheora::stopVideo();
|
if(irrtheora::videoExists())
|
||||||
irrtheora::deleteVideo();
|
{
|
||||||
|
irrtheora::stopVideo();
|
||||||
|
irrtheora::deleteVideo();
|
||||||
|
}
|
||||||
|
|
||||||
if(device)
|
if(device)
|
||||||
device->drop();
|
device->drop();
|
||||||
|
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rc_windowOpenEx(std::string title, int x, int y, int w, int h, uint32_t window_flags, irr::u8 AntiAlias, bool stencil_buffer, bool vsync)
|
bool rc_windowOpenEx(std::string title, int x, int y, int w, int h, uint32_t window_flags, irr::u8 AntiAlias, bool stencil_buffer, bool vsync)
|
||||||
@@ -330,6 +330,7 @@ void rc_closeWindow_hw()
|
|||||||
rc_font.clear();
|
rc_font.clear();
|
||||||
|
|
||||||
device->drop();
|
device->drop();
|
||||||
|
device = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc_cls()
|
void rc_cls()
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ void setSolidProperties(int actor)
|
|||||||
|
|
||||||
void rc_setActorCollisionShape(int actor_id, int shape_type, double mass)
|
void rc_setActorCollisionShape(int actor_id, int shape_type, double mass)
|
||||||
{
|
{
|
||||||
|
//std::cout << "Start ColShape" << std::endl;
|
||||||
if(rc_actor[actor_id].physics.rigid_body)
|
if(rc_actor[actor_id].physics.rigid_body)
|
||||||
{
|
{
|
||||||
rc_physics3D.world->removeCollisionObject(rc_actor[actor_id].physics.rigid_body, false);
|
rc_physics3D.world->removeCollisionObject(rc_actor[actor_id].physics.rigid_body, false);
|
||||||
@@ -213,6 +214,8 @@ void rc_setActorCollisionShape(int actor_id, int shape_type, double mass)
|
|||||||
if(!rc_actor[actor_id].physics.isSolid)
|
if(!rc_actor[actor_id].physics.isSolid)
|
||||||
mass = 1;
|
mass = 1;
|
||||||
|
|
||||||
|
//std::cout << "NEXT" << std::endl;
|
||||||
|
|
||||||
switch(shape_type)
|
switch(shape_type)
|
||||||
{
|
{
|
||||||
case RC_NODE_SHAPE_TYPE_NONE:
|
case RC_NODE_SHAPE_TYPE_NONE:
|
||||||
@@ -253,6 +256,7 @@ void rc_setActorCollisionShape(int actor_id, int shape_type, double mass)
|
|||||||
|
|
||||||
case RC_NODE_SHAPE_TYPE_CAPSULE:
|
case RC_NODE_SHAPE_TYPE_CAPSULE:
|
||||||
{
|
{
|
||||||
|
//std::cout << "CAPSULE" << std::endl;
|
||||||
rc_actor[actor_id].physics.shape_type = RC_NODE_SHAPE_TYPE_CAPSULE;
|
rc_actor[actor_id].physics.shape_type = RC_NODE_SHAPE_TYPE_CAPSULE;
|
||||||
ICapsuleShape* shape;
|
ICapsuleShape* shape;
|
||||||
|
|
||||||
@@ -6593,12 +6597,14 @@ void rc_setCameraRotation(double x, double y, double z)
|
|||||||
|
|
||||||
void rc_getCameraRotation(double* x, double* y, double* z)
|
void rc_getCameraRotation(double* x, double* y, double* z)
|
||||||
{
|
{
|
||||||
if(!(rc_active_canvas > 0 && rc_active_canvas < rc_canvas.size()))
|
if(rc_active_canvas <= 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
*x = rc_canvas[rc_active_canvas].camera.rx;
|
*x = rc_canvas[rc_active_canvas].camera.rx;
|
||||||
*y = rc_canvas[rc_active_canvas].camera.ry;
|
*y = rc_canvas[rc_active_canvas].camera.ry;
|
||||||
*z = rc_canvas[rc_active_canvas].camera.rz;
|
*z = rc_canvas[rc_active_canvas].camera.rz;
|
||||||
|
|
||||||
|
//std::cout << "Get Rotation: " << x[0] << ", " << y[0] << ", " << z[0] << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc_rotateCamera(double x, double y, double z)
|
void rc_rotateCamera(double x, double y, double z)
|
||||||
|
|||||||
@@ -98,8 +98,13 @@ bool rc_net_init()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rc_net_quit()
|
void rc_net_quit()
|
||||||
{
|
{
|
||||||
|
if(rc_socket_set)
|
||||||
|
{
|
||||||
|
SDLNet_FreeSocketSet(rc_socket_set);
|
||||||
|
rc_socket_set = NULL;
|
||||||
|
}
|
||||||
SDLNet_Quit();
|
SDLNet_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
rcbasic_runtime/rc_test.h
Normal file
12
rcbasic_runtime/rc_test.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef RC_TEST_H_INCLUDED
|
||||||
|
#define RC_TEST_H_INCLUDED
|
||||||
|
|
||||||
|
void rc_tst(double* z)
|
||||||
|
{
|
||||||
|
std::cout << "this is a test" << std::endl;
|
||||||
|
*z = 37;
|
||||||
|
|
||||||
|
std::cout << "the end" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // RC_TEST_H_INCLUDED
|
||||||
Reference in New Issue
Block a user