Example #1
0
void af_window_set_position(int x, int y)
{
    GtkWidget *window = global_get("window");
    global_set("x", (gpointer)x);
    global_set("y", (gpointer)y);
    gtk_window_move(GTK_WINDOW(window), x, y);
}
Example #2
0
void init_sound(void) {
	global* global_handle = global_get_singleton();

	sound_manager* sound_manager_handle = NULL;
	sound_manager_alloc(&sound_manager_handle);

	global_set(global_handle, GLOBAL_SOUND_MANAGER, sound_manager_handle);

	sound_map* sound_map_handle = NULL;
	sound_map_alloc(&sound_map_handle);

	global_set(global_handle, GLOBAL_SOUND_MAP, sound_map_handle);
}
Example #3
0
static void continue_prepare(struct compile_and_run_frame *frame)
{
  value closure;
  struct global_state *gcopy;

  if (mprepare_load_next_start(&frame->ps))
    return;

  mprepare_vars(&frame->ps);

  gcopy = copy_global_state(frame->ps.ccontext->gstate);
  GCPRO1(gcopy);
  closure = compile_code(frame->ps.ccontext->gstate, frame->f->body);
  GCPOP(1);

  if (closure)
    {
      GCPRO1(closure);
      if (debug_lvl > 1)
	output_value(muderr, prt_examine, closure);
      frame->state = running;
      if (frame->dontrun)
	{
	  /* Just leave the closure itself as the result */
	  stack_reserve(sizeof(value));
	  stack_push(closure);
	}
      else
	push_closure(closure, 0);
      GCPOP(1);
      return;
    }
  global_set(frame->ps.ccontext->gstate, gcopy);
  runtime_error(error_compile_error);
}
Example #4
0
void af_window_set_title(char *title)
{
    GtkWidget *window = global_get("window");

    global_set("title", title);
    gtk_window_set_title(GTK_WINDOW(window), title);
}
Example #5
0
// --- virtual functions ---
UgResult	ug_plugin_global_set (const UgPluginInterface* iface, guint parameter, gpointer data)
{
	UgGlobalSetFunc  global_set = iface->global_set;

	if (global_set)
		return global_set (parameter, data);
	return UG_RESULT_UNSUPPORT;
}
Example #6
0
void af_window_set_top(int top)
{
    GtkWidget *window = global_get("window");
    int x, y;
    gtk_window_get_position(GTK_WINDOW(window), &x, &y);
    y = top;
    global_set("y", (gpointer)y);
    gtk_window_move(GTK_WINDOW(window), x, y);
}
Example #7
0
void af_window_set_left(int left)
{
    GtkWidget *window = global_get("window");
    int x, y;
    gtk_window_get_position(GTK_WINDOW(window), &x, &y);
    x = left;
    global_set("x", (gpointer)x);
    gtk_window_move(GTK_WINDOW(window), x, y);
}
Example #8
0
void af_window_set_fullscreen(gboolean fullscreen)
{
    GtkWidget *window = global_get("window");

    global_set("fullscreen", (gpointer)fullscreen);

    if (fullscreen)
        gtk_window_fullscreen(GTK_WINDOW(window));
    else
        gtk_window_unfullscreen(GTK_WINDOW(window));
}
Example #9
0
void af_window_set_height(int height)
{
    if (height < 0) return ;
    global_set("height", (gpointer)height);

    GtkWidget *window = global_get("window");

    if (gtk_window_get_resizable(GTK_WINDOW(window))) {
        gtk_window_resize(GTK_WINDOW(window), (gint)global_get("width"), (gint)global_get("height"));
    } else {
        gtk_widget_set_size_request(GTK_WIDGET(window), (gint)global_get("width"), (gint)global_get("height"));
    }
}
Example #10
0
void init_core(void) {
	config* config_handle = NULL;
	config_alloc(&config_handle, "config/core.cfg");

	engine_init(config_get_int_value(config_handle, "enable_alarms"));

	global* global_handle = NULL;
	global_alloc(&global_handle);

	config_free(&config_handle);

	global_set(global_handle, GLOBAL_EDITOR_MODE, EDITOR_MODE_OFF);
}
Example #11
0
void init_systems(void) {
	global* global_handle = global_get_singleton();

	entity_global* entity_global_handle = NULL;
	entity_global_alloc(&entity_global_handle);

	global_set(global_handle, GLOBAL_ENTITY_GLOBAL, entity_global_handle);

	syscontainer* syscontainer_handle = NULL;
	syscontainer_alloc(&syscontainer_handle);

	e_system_alloc(syscontainer_handle, system_entity_manager, system_entity_manager_entity_mask, system_entity_manager_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_chunk_draw, system_chunk_draw_entity_mask, system_chunk_draw_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_gameobject_draw, system_gameobject_draw_entity_mask, system_gameobject_draw_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_camera, system_camera_entity_mask, system_camera_entity_mask_size, 1);
	e_system_alloc(syscontainer_handle, system_player, system_player_entity_mask, system_player_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_music_manager, system_music_manager_entity_mask, system_music_manager_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_chunk_manager, system_chunk_manager_entity_mask, system_chunk_manager_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_entity_global, system_entity_global_entity_mask, system_entity_global_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_enemy_blob, system_enemy_blob_entity_mask, system_enemy_blob_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_bullet, system_bullet_entity_mask, system_bullet_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_cbox, system_cbox_entity_mask, system_cbox_entity_mask_size, 0);
	e_system_alloc(syscontainer_handle, system_world, system_world_entity_mask, system_world_entity_mask_size, 1);
	e_system_alloc(syscontainer_handle, system_background, system_background_entity_mask, system_background_entity_mask_size, 1);

	global_set(global_handle, GLOBAL_SYSCONTAINER, syscontainer_handle);

	collision_solver* collision_solver_handle = NULL;
	collision_solver_alloc(&collision_solver_handle);

	global_set(global_handle, GLOBAL_COLLISION_SOLVER, collision_solver_handle);

	entity_map* entity_map_handle = NULL;

	entity_map_alloc(&entity_map_handle);

	global_set(global_handle, GLOBAL_ENTITY_MAP, entity_map_handle);
}
Example #12
0
static void __lambda_16(void *data, int argc, object self_7382, object r_7336) {
  
closureN_type c_73137;
c_73137.hdr.mark = gc_color_red;
 c_73137.hdr.grayed = 0;
c_73137.tag = closureN_tag;
 c_73137.fn = (function_type)__lambda_15;
c_73137.num_args = 1;
c_73137.num_elements = 1;
c_73137.elements = (object *)alloca(sizeof(object) * 1);
c_73137.elements[0] = ((closureN)self_7382)->elements[0];

return_closcall1(data,(closure)&c_73137,  global_set(__glo_ast_117lambda_91body_scheme_cyclone_ast, r_7336));; 
}
Example #13
0
static void __lambda_25(void *data, int argc, object self_7373, object r_7345) {
  
closureN_type c_73119;
c_73119.hdr.mark = gc_color_red;
 c_73119.hdr.grayed = 0;
c_73119.tag = closureN_tag;
 c_73119.fn = (function_type)__lambda_24;
c_73119.num_args = 1;
c_73119.num_elements = 1;
c_73119.elements = (object *)alloca(sizeof(object) * 1);
c_73119.elements[0] = ((closureN)self_7373)->elements[0];

return_closcall1(data,(closure)&c_73119,  global_set(__glo_ast_117lambda_127_scheme_cyclone_ast, r_7345));; 
}
Example #14
0
static void __lambda_10(void *data, int argc, object self_7388, object r_7330) {
  
closureN_type c_73149;
c_73149.hdr.mark = gc_color_red;
 c_73149.hdr.grayed = 0;
c_73149.tag = closureN_tag;
 c_73149.fn = (function_type)__lambda_9;
c_73149.num_args = 1;
c_73149.num_elements = 1;
c_73149.elements = (object *)alloca(sizeof(object) * 1);
c_73149.elements[0] = ((closureN)self_7388)->elements[0];

return_closcall1(data,(closure)&c_73149,  global_set(__glo_ast_117set_91lambda_91body_67_scheme_cyclone_ast, r_7330));; 
}
Example #15
0
static void __lambda_26(void *data, int argc, object self_7380, object r_7327) {
  
closureN_type c_73219;
c_73219.hdr.mark = gc_color_red;
 c_73219.hdr.grayed = 0;
c_73219.tag = closureN_tag;
 c_73219.fn = (function_type)__lambda_25;
c_73219.num_args = 1;
c_73219.num_elements = 1;
c_73219.elements = (object *)alloca(sizeof(object) * 1);
c_73219.elements[0] = ((closureN)self_7380)->elements[0];

return_closcall1(data,(closure)&c_73219,  global_set(__glo__85macro_117env_85_scheme_cyclone_macros, r_7327));; 
}
Example #16
0
static void __lambda_1(void *data, int argc, object self_7398, object r_7374) {
  
closureN_type c_73104;
c_73104.hdr.mark = gc_color_red;
 c_73104.hdr.grayed = 0;
c_73104.tag = closureN_tag;
 c_73104.fn = (function_type)__lambda_0;
c_73104.num_args = 1;
c_73104.num_elements = 1;
c_73104.elements = (object *)alloca(sizeof(object) * 1);
c_73104.elements[0] = ((closureN)self_7398)->elements[0];

return_closcall1(data,(closure)&c_73104,  global_set(__glo__85macro_117defined_91macros_85_scheme_cyclone_macros, r_7374));; 
}
Example #17
0
static void __lambda_8(void *data, int argc, object self_7390, object _75make_732) {
  
closureN_type c_73156;
c_73156.hdr.mark = gc_color_red;
 c_73156.hdr.grayed = 0;
c_73156.tag = closureN_tag;
 c_73156.fn = (function_type)__lambda_7;
c_73156.num_args = 3;
c_73156.num_elements = 1;
c_73156.elements = (object *)alloca(sizeof(object) * 1);
c_73156.elements[0] = _75make_732;

return_closcall1(data,  ((closureN)self_7390)->elements[0],  global_set(__glo_ast_117_75make_91lambda_scheme_cyclone_ast, &c_73156));; 
}
Example #18
0
static void __lambda_22(void *data, int argc, object self_7376, object r_7342) {
  
closureN_type c_73125;
c_73125.hdr.mark = gc_color_red;
 c_73125.hdr.grayed = 0;
c_73125.tag = closureN_tag;
 c_73125.fn = (function_type)__lambda_21;
c_73125.num_args = 1;
c_73125.num_elements = 1;
c_73125.elements = (object *)alloca(sizeof(object) * 1);
c_73125.elements[0] = ((closureN)self_7376)->elements[0];

return_closcall1(data,(closure)&c_73125,  global_set(__glo_ast_117lambda_91id_scheme_cyclone_ast, r_7342));; 
}
Example #19
0
int init_window()
{
    GtkWidget * window;
    GtkWidget * scroll_window;
    GtkWidget * view;

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    view = webkit_web_view_new();
    scroll_window = gtk_scrolled_window_new(NULL, NULL);

    global_set("window", window);
    global_set("view", view);
    global_set("scrollwindow", scroll_window);

    init_setting(window, view);


    // gtk_container_add(GTK_CONTAINER(window), view);
    gtk_container_add(GTK_CONTAINER(window), scroll_window);
    gtk_container_add(GTK_CONTAINER(scroll_window), view);


    return 0;
}
Example #20
0
static void __lambda_1(void *data, int argc, closure _,object k_7350, object args_738, object body_737) {
  Cyc_st_add(data, "scheme/cyclone/ast.sld:ast:make-lambda");

closureN_type c_73100;
c_73100.hdr.mark = gc_color_red;
 c_73100.hdr.grayed = 0;
c_73100.tag = closureN_tag;
 c_73100.fn = (function_type)__lambda_0;
c_73100.num_args = 1;
c_73100.num_elements = 3;
c_73100.elements = (object *)alloca(sizeof(object) * 3);
c_73100.elements[0] = args_738;
c_73100.elements[1] = body_737;
c_73100.elements[2] = k_7350;


common_type local_73109; object c_73110 = Cyc_fast_sum(data,&local_73109,obj_int2obj(1), __glo__85lambda_91id_85_scheme_cyclone_ast);
return_closcall1(data,(closure)&c_73100,  global_set(__glo__85lambda_91id_85_scheme_cyclone_ast, c_73110));; 
}
Example #21
0
void init_graphic(void) {
	global* global_handle = global_get_singleton();

	config* config_handle = NULL;
	config_alloc(&config_handle, "config/graphics.cfg");

	int resx = config_get_int_value(config_handle, "resx");
	int resy = config_get_int_value(config_handle, "resy");
	int samples = config_get_int_value(config_handle, "msaa");
	int windowed = config_get_int_value(config_handle, "windowed");
	int vsync = config_get_int_value(config_handle, "vertical_sync");

	config_free(&config_handle);

	window* window_handle = NULL;
	window_alloc(&window_handle, resx, resy, samples, !windowed, vsync, 1);

	window_set_blend_mode(window_handle, WINDOW_BLEND_ALPHA);
	window_set_clear_color(window_handle, 0.0f, 0.0f, 0.0f, 0.0f);

	global_set(global_handle, GLOBAL_WINDOW, window_handle);

	hl_render* hl_render_handle = NULL;
	hl_render_alloc(&hl_render_handle);

	global_set(global_handle, GLOBAL_HL_RENDER, hl_render_handle);

	// effect* effect_motion_blur_handle = NULL;
	// effect_alloc(&effect_motion_blur_handle, effect_motion_blur_init, effect_motion_blur_render, effect_motion_blur_config, effect_motion_blur_free, window_get_width(window_handle), window_get_height(window_handle));
	// hl_render_add_effect(hl_render_handle, effect_motion_blur_handle, WINDOW_BLEND_ALPHA);

	camera* camera_handle = NULL;
	camera_alloc(&camera_handle);

	camera_set_dimension(camera_handle, CAMERA_SIZE * (float) window_get_width(window_handle) / (float) window_get_height(window_handle), CAMERA_SIZE);
	camera_set_position(camera_handle, 0.0f, 0.0f);

	camera_update_matrices(camera_handle);

	global_set(global_handle, GLOBAL_CAMERA, camera_handle);

	shader* shader_texture_handle = NULL;
	shader_alloc(&shader_texture_handle, SHADER_TEXTURE_VS, SHADER_TEXTURE_PS);

	global_set(global_handle, GLOBAL_SHADER_TEXTURE, shader_texture_handle);

	text* text_handle = NULL;
	text_alloc(&text_handle, camera_handle, window_handle);

	global_set(global_handle, GLOBAL_TEXT, text_handle);

	input* input_handle = NULL;
	input_alloc(&input_handle, window_handle);

	global_set(global_handle, GLOBAL_INPUT, input_handle);

	debug_draw* debug_draw_handle = NULL;
	debug_draw_alloc(&debug_draw_handle, hl_render_handle);

	global_set(global_handle, GLOBAL_DEBUG_DRAW, debug_draw_handle);
}
Example #22
0
static void __lambda_3(void *data, int argc, object self_7397, object r_7363) {
  return_closcall1(data,  ((closureN)self_7397)->elements[0],  global_set(__glo__85macro_117env_85_scheme_cyclone_macros, r_7363));; 
}
Example #23
0
static void __lambda_24(void *data, int argc, object self_7382, object r_7326) {
  return_closcall1(data,  ((closureN)self_7382)->elements[0],  global_set(__glo__85macro_117defined_91macros_85_scheme_cyclone_macros, r_7326));; 
}
Example #24
0
void af_window_set_border(gboolean border)
{
    GtkWidget *window = global_get("window");
    global_set("border", (gpointer)border);
    gtk_window_set_decorated(GTK_WINDOW(window), border);
}
Example #25
0
void af_window_set_resizable(gboolean resizable)
{
    GtkWidget *window = global_get("window");
    global_set("resizable", (gpointer)resizable);
    gtk_window_set_resizable(GTK_WINDOW(window), resizable);
}
Example #26
0
static void __lambda_32(void *data, int argc, object self_7369, object r_7326) {
  return_direct1(data,__lambda_31,global_set(__glo__85icyc_91env_85, r_7326));; 
}