File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
core/src/avm2/globals/flash/display3D/textures Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ pub fn upload_from_bitmap_data<'gc>(
8383 args : & [ Value < ' gc > ] ,
8484) -> Result < Value < ' gc > , Error < ' gc > > {
8585 if let Some ( texture) = this. as_texture ( ) {
86- if let Some ( source) = args[ 0 ] . coerce_to_object ( activation) ?. as_bitmap_data ( ) {
86+ let source_obj = args. get_object ( activation, 0 , "source" ) ?;
87+
88+ if let Some ( source) = source_obj. as_bitmap_data ( ) {
8789 let side = args[ 1 ] . coerce_to_u32 ( activation) ?;
8890 let mip_level = args[ 2 ] . coerce_to_u32 ( activation) ?;
8991 if mip_level == 0 {
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ pub fn upload_from_bitmap_data<'gc>(
2525 args : & [ Value < ' gc > ] ,
2626) -> Result < Value < ' gc > , Error < ' gc > > {
2727 if let Some ( texture) = this. as_texture ( ) {
28- if let Some ( source) = args[ 0 ] . coerce_to_object ( activation) ?. as_bitmap_data ( ) {
28+ let source_obj = args. get_object ( activation, 0 , "source" ) ?;
29+
30+ if let Some ( source) = source_obj. as_bitmap_data ( ) {
2931 texture. context3d ( ) . copy_bitmapdata_to_texture (
3032 source. sync ( activation. context . renderer ) ,
3133 texture. handle ( ) ,
Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ pub fn upload_from_bitmap_data<'gc>(
117117 args : & [ Value < ' gc > ] ,
118118) -> Result < Value < ' gc > , Error < ' gc > > {
119119 if let Some ( texture) = this. as_texture ( ) {
120- if let Some ( source) = args[ 0 ] . coerce_to_object ( activation) ?. as_bitmap_data ( ) {
120+ let source_obj = args. get_object ( activation, 0 , "source" ) ?;
121+
122+ if let Some ( source) = source_obj. as_bitmap_data ( ) {
121123 let mip_level = args[ 1 ] . coerce_to_u32 ( activation) ?;
122124 if mip_level == 0 {
123125 texture. context3d ( ) . copy_bitmapdata_to_texture (
You can’t perform that action at this time.
0 commit comments