Esempio n. 1
0
	void	as_mouse_show(const function_call& fn)
	{
		as_mouse*	mouse = cast_to<as_mouse>(fn.this_ptr);
		render_handler* rh = get_render_handler();
		if (mouse && rh)
		{
			rh->set_cursor(render_handler::VISIBLE_CURSOR);
		}
	}
Esempio n. 2
0
	void x3ds_definition::load_texture(const char* infile)
	{
		if (infile == NULL)
		{
			return;
		}			

		if (strlen(infile) == 0)
		{
			return;
		}			

		if (m_material.get(infile, NULL))
		{
			// loaded already
			return;
		}

		// try to load & create texture from file

		// is path relative ?
		tu_string url = get_player()->get_workdir();
		if (strstr(infile, ":") || infile[0] == '/')
		{
			url = "";
		}
		url += infile;

		image::rgb* im = image::read_jpeg(url.c_str());
		if (im)
		{
			bitmap_info* bi = get_render_handler()->create_bitmap_info_rgb(im);
			delete im;
			bi->layout();
			m_material[infile] = bi;
		}
		else
		{
			log_error("can't load '%s'\n", infile);
		}
	}