Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Mar 29, 2024 4:50 am
All times are UTC + 0
Stu... suggestions of things to do when fixing the shadows
Moderators: stucuk
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Wed Feb 25, 2004 2:11 am    Post subject:  Stu... suggestions of things to do when fixing the shadows Reply with quote  Mark this post and the followings unread

I know that in the hope to make image loads faster (and they really loaded much faster), I did some crap which affected the shadows that refuses to appear sometimes. You will probably restore the old code, but listen to the folowing suggestions to make it faster:

In SHP_Image.pas -> Procedure DrawFrameImage
Code:
// Set image width n height

image1.Picture.Bitmap.Width := SHP.header.Width*zoom;
image1.Picture.Bitmap.Height := SHP.header.Height*zoom;


This code is only needed when the image size changes, otherwise it's a waste of time. Move it to the procedure I created in FrmMain, the TFrmMain.ResizePaintArea.

--------------------------------------------------------------------------------------

Second, avoid using the method .FillRect to make squares because that code contains a load of useless code for us, which also waste time from user. This could be replaced by something like:

Code:
Procedure MakeSquare(Start:TPoint2D; Multiplier:byte; colour:TColor);
var
   x,y:smallint;
begin
   for y := (Start.Y * Multiplier) to (((Start.Y + 1) * Multiplier) - 1) do
      for x: = (Start.X * Multiplier) to (((Start.X + 1) * Multiplier) - 1) do
         image1.Picture.Bitmap.Canvas.Pixels[x,y]:= colour;
end;


--------------------------------------------------------------------------------------

And, finally... if you can make the act of changing colours a way faster, it will also help, since it's useless to rewrite all set of palettes just to change the X from one colour to another...




That's all for now. I will try to mess up with colour replacement Twisted Evil

Back to top
View user's profile Send private message Visit poster's website Skype Account
stucuk
Geek


Joined: 27 Aug 2002

PostPosted: Wed Feb 25, 2004 3:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'll let u break shp builder when i give u the source. (still not added IMAGE -> SHP to the batch yet...)

_________________
Free Map Editor - Game Requirements - Stucuk.Net

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1532s ][ Queries: 11 (0.0075s) ][ Debug on ]