Merge pull request #43985 from Faless/js/4.0_em_fixes
[HTML5] HiDPI, emscripten fixes
This commit is contained in:
commit
84dbd3be63
3 changed files with 9 additions and 5 deletions
|
@ -885,6 +885,9 @@ public:
|
||||||
void render_target_disable_clear_request(RID p_render_target) override {}
|
void render_target_disable_clear_request(RID p_render_target) override {}
|
||||||
void render_target_do_clear_request(RID p_render_target) override {}
|
void render_target_do_clear_request(RID p_render_target) override {}
|
||||||
|
|
||||||
|
void render_target_set_sdf_size_and_scale(RID p_render_target, RS::ViewportSDFOversize p_size, RS::ViewportSDFScale p_scale) override {}
|
||||||
|
Rect2i render_target_get_sdf_rect(RID p_render_target) const override { return Rect2i(); }
|
||||||
|
|
||||||
RS::InstanceType get_base_type(RID p_rid) const override {
|
RS::InstanceType get_base_type(RID p_rid) const override {
|
||||||
if (mesh_owner.owns(p_rid)) {
|
if (mesh_owner.owns(p_rid)) {
|
||||||
return RS::INSTANCE_MESH;
|
return RS::INSTANCE_MESH;
|
||||||
|
@ -943,7 +946,7 @@ public:
|
||||||
PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()) override { return 0; }
|
PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()) override { return 0; }
|
||||||
void free_polygon(PolygonID p_polygon) override {}
|
void free_polygon(PolygonID p_polygon) override {}
|
||||||
|
|
||||||
void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel) override {}
|
void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) override {}
|
||||||
void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) override {}
|
void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) override {}
|
||||||
|
|
||||||
RID light_create() override { return RID(); }
|
RID light_create() override { return RID(); }
|
||||||
|
@ -952,8 +955,9 @@ public:
|
||||||
void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) override {}
|
void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) override {}
|
||||||
void light_update_directional_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_cull_distance, const Rect2 &p_clip_rect, LightOccluderInstance *p_occluders) override {}
|
void light_update_directional_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_cull_distance, const Rect2 &p_clip_rect, LightOccluderInstance *p_occluders) override {}
|
||||||
|
|
||||||
|
void render_sdf(RID p_render_target, LightOccluderInstance *p_occluders) override {}
|
||||||
RID occluder_polygon_create() override { return RID(); }
|
RID occluder_polygon_create() override { return RID(); }
|
||||||
void occluder_polygon_set_shape_as_lines(RID p_occluder, const Vector<Vector2> &p_lines) override {}
|
void occluder_polygon_set_shape(RID p_occluder, const Vector<Vector2> &p_points, bool p_closed) override {}
|
||||||
void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) override {}
|
void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) override {}
|
||||||
void set_shadow_texture_size(int p_size) override {}
|
void set_shadow_texture_size(int p_size) override {}
|
||||||
|
|
||||||
|
|
|
@ -948,8 +948,8 @@ void DisplayServerJavaScript::window_set_size(const Size2i p_size, WindowID p_wi
|
||||||
last_width = p_size.x;
|
last_width = p_size.x;
|
||||||
last_height = p_size.y;
|
last_height = p_size.y;
|
||||||
double scale = godot_js_display_pixel_ratio_get();
|
double scale = godot_js_display_pixel_ratio_get();
|
||||||
emscripten_set_canvas_element_size(canvas_id, p_size.x * scale, p_size.y * scale);
|
emscripten_set_canvas_element_size(canvas_id, p_size.x, p_size.y);
|
||||||
emscripten_set_element_css_size(canvas_id, p_size.x, p_size.y);
|
emscripten_set_element_css_size(canvas_id, p_size.x / scale, p_size.y / scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
Size2i DisplayServerJavaScript::window_get_size(WindowID p_window) const {
|
Size2i DisplayServerJavaScript::window_get_size(WindowID p_window) const {
|
||||||
|
|
|
@ -200,7 +200,7 @@ const GodotFS = {
|
||||||
}
|
}
|
||||||
FS.mkdirTree(dir);
|
FS.mkdirTree(dir);
|
||||||
}
|
}
|
||||||
FS.writeFile(path, new Uint8Array(buffer), { 'flags': 'wx+' });
|
FS.writeFile(path, new Uint8Array(buffer));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue