log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- RISCOSbits releases a new laptop solution (News:4)
- Announcing the TIB 2024 Advent Calendar (News:2)
- RISC OS London Show Report 2024 (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
Acorn Arcade forums: Programming: Sprites, Sprites11, Sprites22
 
  Sprites, Sprites11, Sprites22
  ksattic (04:06 23/8/2004)
  monkeyson2 (09:10 23/8/2004)
  monkeyson2 (11:02 23/8/2004)
    ksattic (13:22 23/8/2004)
      adrianl (20:41 23/8/2004)
        adrianl (20:59 23/8/2004)
          ksattic (16:16 24/8/2004)
 
Simon Wilson Message #57426, posted by ksattic at 04:06, 23/8/2004
ksattic
Finally, an avatar!

Posts: 1291
Could someone please give me a quick rundown of the purpose of Sprites, Sprites11 and Sprites22?

I realise that files called Sprites or !Sprites usually contain rectangular pixel sprites (e.g. mode 15), while Sprites11 and Sprites22 files should contain square pixel variants. Is Sprites11 a RISC OS 5 only thing for high-colour sprites? Can RISC OS 4 render sprites that are usually found in Sprites11 files?

If my app has Sprites, Sprites11 and Sprites22 spritefiles for icons used within the app (that are not loaded into the sprite pool), how do I decide which to load? I presume I'll have to load all in case the user changes mode, or dynamically load/free the different spritefiles. How do I decide which to use? Do I look at the machine type from OS_ReadSysInfo and the mode params and make a decision based on this, making sure to check for mode changes?

Any help would speed up the update process for a popular (?) RISC OS utility! Thanks! :)
  ^[ Log in to reply ]
 
Phil Mellor Message #57434, posted by monkeyson2 at 09:10, 23/8/2004, in reply to message #57426
monkeyson2Please don't let them make me be a monkey butler

Posts: 12380
I think Sprites11 support was introduced into Select at some point.

As to determining which Sprites file to load, I tend to hack. Haven't done it recently, but last time I pulled the !WhateverAppName sprite out of the wimp sprite pool and identified its mode, and from that worked out the appropriate file. At least the Wimp does the tricky sprites/11/22 business then. I'm sure there's a better way though.

[Edited by monkeyson2 at 11:59, 23/8/2004]
  ^[ Log in to reply ]
 
Phil Mellor Message #57439, posted by monkeyson2 at 11:02, 23/8/2004, in reply to message #57426
monkeyson2Please don't let them make me be a monkey butler

Posts: 12380
Is Sprites11 a RISC OS 5 only thing for high-colour sprites?
I thought it was for ultra hi res graphics - ie modes with eigenvalues of 1 (X and Y). Sprites22 is for eigenvalues of 2 (X and Y), and Sprites for eigenvalues of 2(X) and 4(Y).

So maybe you could get the current screen mode's eigenvalues and work things out from that.
  ^[ Log in to reply ]
 
Simon Wilson Message #57446, posted by ksattic at 13:22, 23/8/2004, in reply to message #57439
ksattic
Finally, an avatar!

Posts: 1291
I thought it was for ultra hi res graphics - ie modes with eigenvalues of 1 (X and Y)
Ah, makes sense. I'll have a look tonight and see what I come up with.

Anyone have any further ideas/comments?

Thanks!
  ^[ Log in to reply ]
 
Adrian Lees Message #57459, posted by adrianl at 20:41, 23/8/2004, in reply to message #57446
Member
Posts: 1637
Anyone have any further ideas/comments?


Wimp_ReadSysInfo
entry R0 = 2
exit R0 -> pointer to iconsprites filename suffix for the configured mode (When loading the sprite files containing icons, the suffix should be tried; if the file does not exist, try the original filename.)

Don't be alarmed by 'configured mode'; it is the current mode (I've just checked, on RO5 anyway). This gives '24' for rectangular modes such as mode 15 but, historically, all modes were of this form so the convention is that !Sprites is used for eigenfactors 2,4.

BTW !Sprites23 is used for high-res mono graphics modes (A540?) though I don't suppose anyone will mind if you forget about those nowadays.
  ^[ Log in to reply ]
 
Adrian Lees Message #57460, posted by adrianl at 20:59, 23/8/2004, in reply to message #57459
Member
Posts: 1637
<pedant mode>We've both been using the eigenfactor term wrongly; in fact XEigFactor and YEigFactor (as returned by OS_ReadModeVariable) are the base 2 logarithm of the numbers after !Sprites, ie. log2(OS units/pixels), so that to get OS units from pixels you must use x = x_pix << XEigFactor)</pedant>

BTW, in case you didn't know - if you look at the Mode submenu in the Display Manager then you can see the EX and EY values that will be used.... this is AFAIK the only way to actually use !Sprites11 (enter EX0 EY0) ATM! :o

[Edited by adrianl at 22:03, 23/8/2004]
  ^[ Log in to reply ]
 
Simon Wilson Message #57488, posted by ksattic at 16:16, 24/8/2004, in reply to message #57460
ksattic
Finally, an avatar!

Posts: 1291
<pedant mode>We've both been using the eigenfactor term wrongly; in fact XEigFactor and YEigFactor (as returned by OS_ReadModeVariable) are the base 2 logarithm of the numbers after !Sprites, ie. log2(OS units/pixels), so that to get OS units from pixels you must use x = x_pix << XEigFactor)</pedant>
I wasn't going to say anything... ;)

I *did* know this, but I didn't actually notice the mistake(s) in this thread.

[Mode 28 would be an EX1 EY1 mode, whereby the screen width in OS units is 640 << 1 = 1280 (multiply by decimal two for those who can't do shifts).]
  ^[ Log in to reply ]
 

Acorn Arcade forums: Programming: Sprites, Sprites11, Sprites22