Difference between revisions of "FillArea"

From WikiPrizm
Jump to navigationJump to search
(Specified category.)
(Better follows template of other useful Prizm routines pages.)
Line 1: Line 1:
 +
== Synopsis ==
 
Fills a rectangular area of (width,height) with upper-left corner at (x,y)
 
Fills a rectangular area of (width,height) with upper-left corner at (x,y)
 
  <nowiki>
 
  <nowiki>
 +
== Source code ==
 
void fillArea(unsigned x,unsigned y,unsigned w,unsigned h,unsigned short col){
 
void fillArea(unsigned x,unsigned y,unsigned w,unsigned h,unsigned short col){
 
unsigned short*s=(unsigned short*)0xA8000000;
 
unsigned short*s=(unsigned short*)0xA8000000;
Line 12: Line 14:
 
}
 
}
 
</nowiki>
 
</nowiki>
 +
== Comment ==
 +
Function written by Programmer Nerd.
 
[[Category: Useful Routines]]
 
[[Category: Useful Routines]]

Revision as of 21:38, 17 April 2014

Synopsis

Fills a rectangular area of (width,height) with upper-left corner at (x,y)

== Source code ==
void fillArea(unsigned x,unsigned y,unsigned w,unsigned h,unsigned short col){
	unsigned short*s=(unsigned short*)0xA8000000;
	s+=(y*384)+x;
	while(h--){
		unsigned w2=w;
		while(w2--)
			*s++=col;
		s+=384-w;
	}
}

Comment

Function written by Programmer Nerd.