Re: [BLACKBOX] [Fwd: Re: [BLACKBOX] Another trap during compile]

From: Oleg N. Cher <"Oleg>
Date: Sat, 23 Oct 2010 13:28:50 +0300

----boundary-LibPST-iamunique-945159421_-_-
Content-type: text/plain

Chris Burrows wrote:

>> MODULE XGrSettings;
>>
>> TYPE
>> ScreenDepthBits8 = BYTE;
>> ScreenDepthBits16 = SHORTINT;
>> ScreenDepthBits32 = INTEGER;
>> Color* = ScreenDepthBits8;
>>
>> ...
>>
>> END XGrSettings.
>>
>> PROCEDURE RGB* (r, g, b: SHORTCHAR): Color; BEGIN RETURN
>> SYSTEM.VAL(Color, Sdl.MapRGB(screen.format,
>> SYSTEM.VAL(UInt8, r), SYSTEM.VAL(UInt8, g),
>> SYSTEM.VAL(UInt8, b))) END RGB;
>>

> Difficult to say as I'm not familiar with the SDL library

Well, Sdl.MapRGB is defined as:

PROCEDURE [ccall] MapRGB* ["SDL_MapRGB"] (format: PPixelFormat; r:
UInt8; g: UInt8; b: UInt8): UInt32;

As you see, result type of MapRGB is always UInt32 (INTEGER, in fact),
and we need convert this value to one of types (BYTE, SHORTINT, INTEGER)
that defines screen color depth OPTIONALLY defined in other module.
UInt32, SInt32 are not my idea, it is adaptation of Delphi's JEDI SDL.

And you can understant what is OPTIONALLY SETTINGS before critique my way?

We can use {$IFDEF} in Pascal and Delphi, in CP I used optionally type,
defined in special settings module.

--
Oleg
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-945159421_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZX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AoZm9ybWF0OiBQUGl4ZWxGb3JtYXQ7IHI6IFxwYXINClVJbnQ4OyBn
OiBVSW50ODsgYjogVUludDgpOiBVSW50MzI7XHBhcg0KXHBhcg0KQXMgeW91IHNlZSwgcmVzdWx0
IHR5cGUgb2YgTWFwUkdCIGlzIGFsd2F5cyBVSW50MzIgKElOVEVHRVIsIGluIGZhY3QpLFxwYXIN
CmFuZCB3ZSBuZWVkIGNvbnZlcnQgdGhpcyB2YWx1ZSB0byBvbmUgb2YgdHlwZXMgKEJZVEUsIFNI
T1JUSU5ULCBJTlRFR0VSKVxwYXINCnRoYXQgZGVmaW5lcyBzY3JlZW4gY29sb3IgZGVwdGggT1BU
SU9OQUxMWSBkZWZpbmVkIGluIG90aGVyIG1vZHVsZS5ccGFyDQpVSW50MzIsIFNJbnQzMiBhcmUg
bm90IG15IGlkZWEsIGl0IGlzIGFkYXB0YXRpb24gb2YgRGVscGhpJ3MgSkVESSBTREwuXHBhcg0K
XHBhcg0KQW5kIHlvdSBjYW4gdW5kZXJzdGFudCB3aGF0IGlzIE9QVElPTkFMTFkgU0VUVElOR1Mg
YmVmb3JlIGNyaXRpcXVlIG15IHdheT9ccGFyDQpccGFyDQpXZSBjYW4gdXNlIFx7JElGREVGXH0g
aW4gUGFzY2FsIGFuZCBEZWxwaGksIGluIENQIEkgdXNlZCBvcHRpb25hbGx5IHR5cGUsXHBhcg0K
ZGVmaW5lZCBpbiBzcGVjaWFsIHNldHRpbmdzIG1vZHVsZS5ccGFyDQpccGFyDQotLVxwYXINCk9s
ZWdccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNz
YWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JFUk9O
LkNIfX0AVFAAQg==
----boundary-LibPST-iamunique-945159421_-_---
Received on Sat Oct 23 2010 - 12:28:50 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:29 UTC