CAST II Game Engine

   DESCRIPTION       FEATURES       SCREENSHOTS       FORUMS       DOCUMENTATION       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TResource

Unit

Resources

Declaration

type TResource = class(TItem)

Description

Base resource class)

Hierarchy

TItem > TBaseItem

Methods

Overview

Publicconstructor Create(AManager: TItemsManager); override;
Publicdestructor Destroy; override;
Publicprocedure AddProperties(const Result: Props.TProperties); override;
Publicprocedure Allocate(ASize: Integer);
Protectedfunction Convert(OldFormat, NewFormat: Integer): Boolean; virtual;
Publicfunction GetElementSize: Integer; virtual;
Publicfunction GetItemSize(CountChilds: Boolean): Integer; override;
Publicclass function IsAbstract: Boolean; override;
Publicfunction Load(Stream: Basics.TStream): Boolean; override;
Protectedfunction LoadData(Stream: Basics.TStream): Boolean; virtual;
Publicfunction Save(Stream: Basics.TStream): Boolean; override;
Publicprocedure SetAllocated(ASize: Integer; AData: Pointer);
Protectedprocedure SetFormat(const Value: Integer);
Protectedprocedure SetLoaded(Value: Boolean); virtual;
Publicprocedure SetProperties(Properties: Props.TProperties); override;
Protectedprocedure UnloadData; virtual;

Description

Publicconstructor Create(AManager: TItemsManager); override;

 

Publicdestructor Destroy; override;

 

Publicprocedure AddProperties(const Result: Props.TProperties); override;

 

Publicprocedure Allocate(ASize: Integer);

Allocates an empty data buffer or changes allocated size of an existing one

Protectedfunction Convert(OldFormat, NewFormat: Integer): Boolean; virtual;

Should perform actual conversion from old format to a new one and return True if the conversion is possible and successful

Publicfunction GetElementSize: Integer; virtual;

Returns size of each element in resource

Publicfunction GetItemSize(CountChilds: Boolean): Integer; override;

 

Publicclass function IsAbstract: Boolean; override;

 

Publicfunction Load(Stream: Basics.TStream): Boolean; override;

Loads the resource from a stream

Protectedfunction LoadData(Stream: Basics.TStream): Boolean; virtual;

Read resource's data from the specified stream

Publicfunction Save(Stream: Basics.TStream): Boolean; override;

Saves the resource to a stream

Publicprocedure SetAllocated(ASize: Integer; AData: Pointer);

Sets already allocated and probably ready to use data

Protectedprocedure SetFormat(const Value: Integer);

Calls Convert() and if it returns True sets the new format

Protectedprocedure SetLoaded(Value: Boolean); virtual;

Not used yet

Publicprocedure SetProperties(Properties: Props.TProperties); override;

 

Protectedprocedure UnloadData; virtual;

Not used yet

Properties

Overview

Publicproperty Data: Pointer;
Publicproperty DataSize: Integer;
Publicproperty Format: Integer;
Publicproperty Loaded: Boolean;
Publicproperty TotalElements: Integer;

Description

Publicproperty Data: Pointer;

Pointer to the resource's data

Publicproperty DataSize: Integer;

Data size on bytes

Publicproperty Format: Integer;

Resource format

Publicproperty Loaded: Boolean;

Determines if the resource is loaded completely including its data

Publicproperty TotalElements: Integer;

Number of elements in the resource

Last modified: 4 Jul, 2008
Copyright (C) 2006-2008, casteng.com