opengl: Add tiling for multi-textures.
This commit is contained in:
@@ -107,15 +107,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)).S * Self.texture_Details.texture_Tiling.S,
|
||||
Coords_and_Centroid.Coords (Index_t (i)).T * Self.texture_Details.texture_Tiling.T),
|
||||
Coords => (Coords_and_Centroid.Coords (Index_t (i)).S,
|
||||
Coords_and_Centroid.Coords (Index_t (i)).T),
|
||||
Shine => default_Shine);
|
||||
end loop;
|
||||
|
||||
the_Vertices (the_Vertices'Last) := (Site => Vector_3 (Coords_and_Centroid.Centroid & 0.0),
|
||||
Normal => Normal,
|
||||
Coords => (S => 0.5 * Self.texture_Details.texture_Tiling.S,
|
||||
T => 0.5 * Self.texture_Details.texture_Tiling.T),
|
||||
Coords => (S => 0.5,
|
||||
T => 0.5),
|
||||
Shine => default_Shine);
|
||||
|
||||
face_Geometry := new_Geometry (Vertices => the_Vertices);
|
||||
|
||||
@@ -7,12 +7,13 @@ is
|
||||
|
||||
package body Mixin
|
||||
is
|
||||
|
||||
overriding
|
||||
procedure Fade_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.fade_Level)
|
||||
is
|
||||
begin
|
||||
Self.texture_Details.Fades (which) := Now;
|
||||
Self.texture_Details.Fades (Which) := Now;
|
||||
end Fade_is;
|
||||
|
||||
|
||||
@@ -21,16 +22,36 @@ is
|
||||
function Fade (Self : in textured_Item; Which : in texture_Set.texture_Id) return texture_Set.fade_Level
|
||||
is
|
||||
begin
|
||||
return Self.texture_Details.Fades (which);
|
||||
return Self.texture_Details.Fades (Which);
|
||||
end Fade;
|
||||
|
||||
|
||||
|
||||
overriding
|
||||
procedure Tiling_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.Tiling)
|
||||
is
|
||||
begin
|
||||
Self.texture_Details.texture_Tilings (Which) := Now;
|
||||
end Tiling_is;
|
||||
|
||||
|
||||
|
||||
overriding
|
||||
function Tiling (Self : in textured_Item; Which : in texture_Set.texture_Id) return texture_Set.Tiling
|
||||
is
|
||||
begin
|
||||
return Self.texture_Details.texture_Tilings (Which);
|
||||
end Tiling;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure Texture_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||
Now : in openGL.asset_Name)
|
||||
is
|
||||
begin
|
||||
Self.texture_Details.Textures (Positive (which)) := Now;
|
||||
Self.texture_Details.Textures (Positive (Which)) := Now;
|
||||
end Texture_is;
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,13 @@ is
|
||||
procedure Fade_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.fade_Level);
|
||||
|
||||
overriding
|
||||
function Tiling (Self : in textured_Item; Which : in texture_Set.texture_Id) return texture_Set.Tiling;
|
||||
|
||||
overriding
|
||||
procedure Tiling_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.Tiling);
|
||||
|
||||
procedure Texture_is (Self : in out textured_Item; Which : in texture_Set.texture_Id;
|
||||
Now : in asset_Name);
|
||||
|
||||
|
||||
@@ -240,6 +240,25 @@ is
|
||||
|
||||
|
||||
|
||||
procedure Tiling_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.Tiling)
|
||||
is
|
||||
begin
|
||||
raise program_Error with External_Tag (Model.item'Class (Self)'Tag) & " Model does not support texturing.";
|
||||
end Tiling_is;
|
||||
|
||||
|
||||
|
||||
function Tiling (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.Tiling
|
||||
is
|
||||
begin
|
||||
raise program_Error with External_Tag (Model.item'Class (Self)'Tag) & " Model does not support texturing.";
|
||||
return (S => 0.0,
|
||||
T => 0.0);
|
||||
end Tiling;
|
||||
|
||||
|
||||
|
||||
function texture_Count (Self : in Item) return Natural
|
||||
is
|
||||
begin
|
||||
|
||||
@@ -78,6 +78,10 @@ is
|
||||
procedure Fade_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.fade_Level);
|
||||
|
||||
function Tiling (Self : in Item; Which : in texture_Set.texture_Id) return texture_Set.Tiling;
|
||||
procedure Tiling_is (Self : in out Item; Which : in texture_Set.texture_Id;
|
||||
Now : in texture_Set.Tiling);
|
||||
|
||||
function texture_Count (Self : in Item) return Natural;
|
||||
|
||||
function texture_Applied (Self : in Item; Which : in texture_Set.texture_Id) return Boolean;
|
||||
|
||||
Reference in New Issue
Block a user