English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 29 October 2016, 12:12   #1
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 220
Send a message via MSN to BSzili
Optimal way of drawing sprites using RTG

I've got a bunch of 8bpp chunky sprites with palette transparency I want to draw using RTG (currently using CGX). As a quick solution I wrote a function that goes through every line, finds continuous runs of non-transparent pixels and draws these line segments. It works reasonably well for small sprites, but it gets slow as the width increases.
There must be a better way to do this, other than converting every sprite into a struct BitMap + bitmask combo at load time. Perhaps somebody knows a library with color key RTG blitting functions?
BSzili is offline  
AdSense AdSense  
Old 03 November 2016, 13:01   #2
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 259
I'm not really an expert on software sprites, but you could check out how SDL does it?
My guess is that there is not much to optimize beyond what you thought up, but like I said, I'm no expert and have never written a software sprite routine.
roondar is offline  
Old 03 November 2016, 13:25   #3
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 43
Posts: 909
Send a message via Yahoo to Samurai_Crow
I wouldn't look at SDL since it hardly supports 8 bit modes at all. I'd suggest Allegro 4's old RLE compressed or even compiled sprites. It's similar to yours but doesn't even store the transparent pixels at all! It just does memory copies for sprites that never intersect the border as inlined code.
Samurai_Crow is offline  
Old 04 November 2016, 14:10   #4
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 220
Send a message via MSN to BSzili
Thanks for the tips. Both RLE compression and compiled sprites would speed things up considerably, since most of the time is wasted on per-pixel comparisons. Unfortunately the game I'm working on generates many of these large sprites on the fly and they are only used once, so pre-compressing or compiling them is not an option. I'll probably get rid of them, since they are only used in intro and menu animations.
I'll check out Allegro 4 routines, it can still be useful for ingame sprites.
BSzili is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimal Amiga OS3.x installation? eXeler0 Amiga scene 17 29 October 2016 02:50
Was CDXL format Optimal for CD32 Mad-Matt Retrogaming General Discussion 11 18 June 2016 10:04
ISOCD Optimal settings? Whitesnake support.Apps 7 07 March 2007 21:24
Optimal sound configuration? Melvein support.WinUAE 0 03 May 2003 13:42
A1200 - the optimal configuration ? malino New to Emulation or Amiga scene 2 03 January 2003 11:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:43.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.12403 seconds with 14 queries