text
stringlengths
0
234
GL.Errors.log;
for Each in visual_Geometrys'Range loop
declare
use GL.Skins, GL.Geometry;
the_Geometry : GL.skinned_geometry.skinned_Geometry renames visual_Geometrys (Each);
begin
if the_Geometry.Skin /= current_Skin then
current_Skin := the_Geometry.Skin;
enable (current_Skin.all);
GL.Errors.log;
end if;
if the_Geometry.Veneer /= null then
enable (the_Geometry.Veneer.all);
GL.Errors.log;
end if;
GL.PushMatrix;
GL.Translate (the_Visual.centre);
Multiply_GL_Matrix (the_Visual.rotation);
draw (the_Geometry.Geometry.all);
GL.Errors.log;
GL.PopMatrix;
Function Definition: procedure Dispose is new Ada.Unchecked_Deallocation (Texture_info_array, p_Texture_info_array);
Function Body: -----------------------------------
-- 2) Fast access through a name --
-----------------------------------
package Texture_Name_Mapping is new Ada.Containers.Hashed_Maps
(Key_Type => Ada.Strings.Unbounded.Unbounded_String,
Element_Type => Image_ID,
Hash => Ada.Strings.Unbounded.Hash,
Equivalent_Keys => Ada.Strings.Unbounded."=");
type Texture_2d_infos_type is record
tex : p_Texture_info_array;
map : Texture_Name_Mapping.Map;
last_entry_in_use : Image_ID;
end record;
empty_texture_2d_infos : constant Texture_2d_infos_type :=
(null,
Texture_Name_Mapping.Empty_Map,
null_image
);
Texture_2d_Infos : Texture_2d_infos_type := empty_texture_2d_infos;
-----------------------------
-- Load_texture (internal) --
-----------------------------
procedure Load_texture_2D (id : Image_ID; blending_hint : out Boolean) is
tex_name : constant String := Trim (Texture_2d_Infos.tex.all (id).name, Right);
procedure Try (zif : in out Zip.Zip_info; name : String) is
use UnZip.Streams;
ftex : Zipped_File_Type;
procedure Try_a_type (tex_name_ext : String; format : GL.IO.Supported_format) is
begin
Open (ftex, zif, tex_name_ext);
GL.IO.Load (Stream (ftex), format, Image_ID'Pos (id) + 1, blending_hint);
Close (ftex);
exception
when Zip.File_name_not_found =>
raise;
when e : others =>
Raise_Exception (
Exception_Identity (e),
Exception_Message (e) & " on texture : " & tex_name_ext);
end Try_a_type;
begin -- Try
Load_if_needed (zif, name);
Try_a_type (tex_name & ".TGA", GL.IO.TGA);
exception
when Zip.File_name_not_found =>
Try_a_type (tex_name & ".BMP", GL.IO.BMP);
end Try;
begin
begin
Try (zif_level, To_String (level_data_name));
exception
when Zip.File_name_not_found |
Zip.Zip_file_open_Error =>
-- Not found in level - specific pack
Try (zif_global, To_String (global_data_name));
Function Definition: procedure deallocate is new ada.unchecked_Deallocation (Impostor'Class, p_Impostor);
Function Body: begin
destroy (o.all);
deallocate (o);
Function Definition: procedure Display (o : in out tri_Mesh;
Function Body: clip : in Clipping_data)
is
begin
null;
end Display;
procedure set_Vertices (Self : in out tri_Mesh; To : access GL.geometry.GL_vertex_Array)
is