From 8bedf8a366cb6c1179bc89678c863517b9356d48 Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Sat, 21 Jun 2025 16:51:22 -0300 Subject: refa Remove View2D View2D is almost useless and add too much complexity for the engine, so I am removing it. --- test/src/mode/demo.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'test/src/mode/demo.rb') diff --git a/test/src/mode/demo.rb b/test/src/mode/demo.rb index 65ea52a..86ef578 100644 --- a/test/src/mode/demo.rb +++ b/test/src/mode/demo.rb @@ -1,4 +1,4 @@ -# Copyright 2022-2023 Frederico de Oliveira Linhares +# Copyright 2022-2025 Frederico de Oliveira Linhares # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -81,14 +81,12 @@ module Mode @camera_orientation = CandyGear::Orientation3D.new(0.0, 0.0, 0.0); color = CandyGear::Vector3D.new(0.12, 0.12, 0.18); - @view1 = CandyGear::View2D.new( - CandyGear::Vector4D.new(0, 0, 1280, 240), 640, 120); - @view2 = CandyGear::View3D.new( + @view = CandyGear::View.new( CandyGear::Vector4D.new(0, 240, 1280, 480), 1280, 480); - CandyGear.views = [@view1, @view2]; + CandyGear.change_views([@view], 640, 360); - @view2.camera_position = @camera_position; - @view2.camera_orientation = @camera_orientation; + @view.camera_position = @camera_position; + @view.camera_orientation = @camera_orientation; end def key_down(key) @@ -125,16 +123,16 @@ module Mode def tick() @sprite.draw( - @view1, @sprite_position.x, @sprite_position.y, + @sprite_position.x, @sprite_position.y, @sprite_position.w, @sprite_position.h); @japanese_text_sprite.draw( - @view1, @japanese_text_position.x, @japanese_text_position.y, + @japanese_text_position.x, @japanese_text_position.y, @japanese_text_position.w, @japanese_text_position.h); @english_text_sprite.draw( - @view1, @english_text_position.x, @english_text_position.y, + @english_text_position.x, @english_text_position.y, @english_text_position.w, @english_text_position.h); @instances_orientation.rotate(0.0, BOX_ROTATION_SPEED, 0.0); - @rectangle.draw_rectangle(@view1, @color); + @rectangle.draw_rectangle(@color); @instances.each {_1.draw()}; @skeletal_model.draw(); # @sprite_3d.draw(); -- cgit v1.2.3