diff --git a/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.adb b/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.adb index fed8453..d848f38 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.adb +++ b/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.adb @@ -161,13 +161,15 @@ is loop the_Vertices (Index_t (i)) := (Site => Vector_3 (the_Sites (i) & 0.0), Normal => Normal, - Coords => Coords_and_Centroid.Coords (Index_t (i)), + Coords => (Coords_and_Centroid.Coords (Index_t (i)).S * Self.Face.texture_Tiling, + Coords_and_Centroid.Coords (Index_t (i)).T * Self.Face.texture_Tiling), Shine => default_Shine); end loop; the_Vertices (the_Vertices'Last) := (Site => Vector_3 (Coords_and_Centroid.Centroid & 0.0), Normal => Normal, - Coords => (0.5, 0.5), + Coords => (S => 0.5 * Self.Face.texture_Tiling, + T => 0.5 * Self.Face.texture_Tiling), Shine => default_Shine); upper_Face := new_Face (Vertices => the_Vertices); diff --git a/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.ads b/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.ads index 16602e7..601f9c6 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.ads +++ b/3-mid/opengl/source/lean/model/opengl-model-polygon-lit_textured.ads @@ -14,9 +14,10 @@ is type Face is record - Fades : texture_Set.fade_Levels (texture_Set.texture_Id) := [others => 0.0]; - Textures : openGL.asset_Names (1 .. Positive (texture_Set.texture_Id'Last)) := [others => null_Asset]; -- The textures to be applied to the hex. - texture_Count : Natural := 0; + Fades : texture_Set.fade_Levels (texture_Set.texture_Id) := [others => 0.0]; + Textures : openGL.asset_Names (1 .. Positive (texture_Set.texture_Id'Last)) := [others => null_Asset]; -- The textures to be applied to the hex. + texture_Count : Natural := 0; + texture_Tiling : openGL.Real := 1.0; -- The number of times the texture should be wrapped. end record; diff --git a/4-high/gel/source/forge/gel-forge.adb b/4-high/gel/source/forge/gel-forge.adb index cef1bb8..418168e 100644 --- a/4-high/gel/source/forge/gel-forge.adb +++ b/4-high/gel/source/forge/gel-forge.adb @@ -181,17 +181,18 @@ is - function new_polygon_Sprite (in_World : in gel.World.view; - Name : in String; - Site : in math.Vector_3 := math.Origin_3D; - Mass : in math.Real := 1.0; - Friction : in math.Real := 0.5; - Bounce : in math.Real := 0.5; - is_Tangible : in Boolean := True; - Vertices : in Geometry_2d.Sites; - Color : in openGL.Color := opengl.Palette.White; - Texture : in openGL.asset_Name := openGL.null_Asset; - user_Data : in any_user_Data_view := null) return gel.Sprite.view + function new_polygon_Sprite (in_World : in gel.World.view; + Name : in String; + Site : in math.Vector_3 := math.Origin_3D; + Mass : in math.Real := 1.0; + Friction : in math.Real := 0.5; + Bounce : in math.Real := 0.5; + is_Tangible : in Boolean := True; + Vertices : in Geometry_2d.Sites; + Color : in openGL.Color := opengl.Palette.White; + Texture : in openGL.asset_Name := openGL.null_Asset; + texture_Tiling : in openGL.Real := 1.0; + user_Data : in any_user_Data_view := null) return gel.Sprite.view is use type Geometry_2d.Sites, openGL.asset_Name; @@ -219,9 +220,10 @@ is (Color, openGL.Opaque)).all'Access; else the_graphics_Model := openGL.Model.polygon.lit_textured.new_Polygon (openGL.Vector_2_array (Vertices), - Face => (Fades => [1 => 0.0, others => <>], - Textures => [1 => Texture, others => <>], - texture_Count => 1)).all'Access; + Face => (Fades => [1 => 0.0, others => <>], + Textures => [1 => Texture, others => <>], + texture_Count => 1, + texture_Tiling => texture_Tiling)).all'Access; end if; return gel.Sprite.Forge.new_Sprite (Name, @@ -237,18 +239,19 @@ is - function new_rectangle_Sprite (in_World : in gel.World.view; - Name : in String; - Site : in math.Vector_3 := math.Origin_3D; - Mass : in math.Real := 1.0; - Friction : in math.Real := 0.5; - Bounce : in math.Real := 0.5; - is_Tangible : in Boolean := True; + function new_rectangle_Sprite (in_World : in gel.World.view; + Name : in String; + Site : in math.Vector_3 := math.Origin_3D; + Mass : in math.Real := 1.0; + Friction : in math.Real := 0.5; + Bounce : in math.Real := 0.5; + is_Tangible : in Boolean := True; Width, - Height : in math.Real; - Color : in openGL.Color := opengl.Palette.White; - Texture : in openGL.asset_Name := openGL.null_Asset; - user_Data : in any_user_Data_view := null) return gel.Sprite.view + Height : in math.Real; + Color : in openGL.Color := opengl.Palette.White; + Texture : in openGL.asset_Name := openGL.null_Asset; + texture_Tiling : in openGL.Real := 1.0; + user_Data : in any_user_Data_view := null) return gel.Sprite.view is use Math; @@ -260,7 +263,18 @@ is [ half_Width, half_Height], [-half_Width, half_Height]]; begin - return new_polygon_Sprite (in_World, Name, Site, Mass, Friction, Bounce, is_Tangible, the_Vertices, Color, Texture, user_Data); + return new_polygon_Sprite (in_World, + Name, + Site, + Mass, + Friction, + Bounce, + is_Tangible, + the_Vertices, + Color, + Texture, + texture_Tiling, + user_Data); end new_rectangle_Sprite; diff --git a/4-high/gel/source/forge/gel-forge.ads b/4-high/gel/source/forge/gel-forge.ads index b6e5ad8..4a4d798 100644 --- a/4-high/gel/source/forge/gel-forge.ads +++ b/4-high/gel/source/forge/gel-forge.ads @@ -67,30 +67,35 @@ is Texture : in openGL.asset_Name := openGL.null_Asset; user_Data : in any_user_Data_view := null) return gel.Sprite.view; - function new_polygon_Sprite (in_World : in gel.World.view; - Name : in String; - Site : in math.Vector_3 := math.Origin_3D; - Mass : in math.Real := 1.0; - Friction : in math.Real := 0.5; - Bounce : in math.Real := 0.5; - is_Tangible : in Boolean := True; - Vertices : in Geometry_2d.Sites; - Color : in openGL.Color := opengl.Palette.White; - Texture : in openGL.asset_Name := openGL.null_Asset; - user_Data : in any_user_Data_view := null) return gel.Sprite.view; + function new_polygon_Sprite (in_World : in gel.World.view; + Name : in String; + Site : in math.Vector_3 := math.Origin_3D; + Mass : in math.Real := 1.0; + Friction : in math.Real := 0.5; + Bounce : in math.Real := 0.5; + is_Tangible : in Boolean := True; + Vertices : in Geometry_2d.Sites; + Color : in openGL.Color := opengl.Palette.White; + Texture : in openGL.asset_Name := openGL.null_Asset; + texture_Tiling : in openGL.Real := 1.0; + user_Data : in any_user_Data_view := null) return gel.Sprite.view; - function new_rectangle_Sprite (in_World : in gel.World.view; - Name : in String; - Site : in math.Vector_3 := math.Origin_3D; - Mass : in math.Real := 1.0; - Friction : in math.Real := 0.5; - Bounce : in math.Real := 0.5; - is_Tangible : in Boolean := True; + function new_rectangle_Sprite (in_World : in gel.World.view; + Name : in String; + Site : in math.Vector_3 := math.Origin_3D; + Mass : in math.Real := 1.0; + Friction : in math.Real := 0.5; + Bounce : in math.Real := 0.5; + is_Tangible : in Boolean := True; Width, - Height : in math.Real; - Color : in openGL.Color := opengl.Palette.White; - Texture : in openGL.asset_Name := openGL.null_Asset; - user_Data : in any_user_Data_view := null) return gel.Sprite.view; + Height : in math.Real; + Color : in openGL.Color := opengl.Palette.White; + Texture : in openGL.asset_Name := openGL.null_Asset; + texture_Tiling : in openGL.Real := 1.0; + user_Data : in any_user_Data_view := null) return gel.Sprite.view; + + + -- 3D --