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 Thu Mar 28, 2024 2:59 pm
All times are UTC + 0
Bug with the renderer
Moderators: stucuk
Post new topic   Reply to topic Page 1 of 1 [14 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
0warfighter0
Commander


Joined: 07 Dec 2007
Location: Belgium, Haasdonk

PostPosted: Tue Feb 17, 2009 9:58 pm    Post subject:  Bug with the renderer Reply with quote  Mark this post and the followings unread

Whenever you paint a shadow, you see that the original "object" has gone a bit of the center so a gap appears.

Screeny:


Back to top
View user's profile Send private message Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Tue Nov 26, 2013 11:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

I went to check this issue in OSSB code.

File:        SHP_Image.pas
Method:  DrawFrameImage(...)

There's a weird bit of code:
Code:

if flood and (not Preview) then
    Image.Canvas.Draw(4, 4, Bitmap)
else
    Image.Canvas.Draw(0, 0, Bitmap);



The second instruction is executed when drawing the 'shadow' frame.
The fourth instruction   is executed when drawing the 'unit' frame.

That would be the reason the 'unit' frame is off by 4 pixels.
I am wondering why the flood boolean is evaluated here.

I think it should be:

Code:

if Preview then
    Image.Canvas.Draw(0, 0, Bitmap)
else
    Image.Canvas.Draw(4, 4, Bitmap)

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


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

PostPosted: Wed Nov 27, 2013 3:54 am    Post subject: Reply with quote  Mark this post and the followings unread

The only feature of the entire program that uses DrawFrameImage with flood = false is the Auto Shadows, which is already deprecated. So, adding or removing the flood won't make much of a difference, except for a minimal speed up that you won't notice.

If you cut the flood from that part of the code, the Auto Shadows will draw the non shadow part at the same place of the shadow and you won't see the shadow.


In short, this change doesn't really make any difference at all and won't fix the problem listed above.




Btw: I reiterate that I hate the OS SHP Builder messcode.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 27, 2013 4:41 am    Post subject: Reply with quote  Mark this post and the followings unread

DrawFrameImageWithShadow(...) AND
DrawShadowWithFrameImage(...)

calls DrawFrameImage twice.

1st time : Flood == true ( draws the shadow )
2nd time : Flood == False (draws the 'owner' )


DrawShadowWithFrameImage(..) is called by:
   - The form TFrmShpImage ( RefreshImage1 )

      IF (IsItShadow & ShadowMode)
          DrawShadowWithFrameImage(.., .., .., .., false (Preview), .., .., ..)
      ELSE
          DrawFrameImage(.., .., .., .., true (FLOOD Parameter), .., Preview (false), .., ..)

Or did I miss something? Embarassed

Back to top
View user's profile Send private message
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 27, 2013 4:43 am    Post subject: Reply with quote  Mark this post and the followings unread

Hold on, I installed delphi 2006, I will see if it changes anything.

Back to top
View user's profile Send private message
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 27, 2013 4:51 am    Post subject: Reply with quote  Mark this post and the followings unread

Well I did a mistake.
Here's what works, tell me if there's something I'm missing, but :
Code:

if flood and (not Preview) then
    Image.Canvas.Draw(4, 4, Bitmap)
else
    Image.Canvas.Draw(0, 0, Bitmap);


IS replaced by

Code:

Image.Canvas.Draw(0, 0, Bitmap);


And now, things are good.



Capture.PNG
 Description:
 Filesize:  35.76 KB
 Viewed:  5732 Time(s)

Capture.PNG



Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Nov 27, 2013 7:22 am    Post subject: Reply with quote  Mark this post and the followings unread

If the source of SHP Builder 3.35 is still available, then you could also check there, because in 3.35 the normal image was correct aligned when viewing the shadow frames.
Only in the later versions it was misaligned.

But it's good to see someone trying to fix this as this is a quite annoying bug.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


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

PostPosted: Wed Nov 27, 2013 12:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Zaaz wrote:
DrawFrameImageWithShadow(...) AND
DrawShadowWithFrameImage(...)

calls DrawFrameImage twice.

1st time : Flood == true ( draws the shadow )
2nd time : Flood == False (draws the 'owner' )


DrawShadowWithFrameImage(..) is called by:
   - The form TFrmShpImage ( RefreshImage1 )

      IF (IsItShadow & ShadowMode)
          DrawShadowWithFrameImage(.., .., .., .., false (Preview), .., .., ..)
      ELSE
          DrawFrameImage(.., .., .., .., true (FLOOD Parameter), .., Preview (false), .., ..)

Or did I miss something? Embarassed


I was the one who actually missed that one. You are correct.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Sun Dec 01, 2013 3:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Are you going to change SHP_Image as well in a revision?

I'm including the modified SHP_Image.
Line 163 is where the modification is, I simply
removed the condition so that it always draws from the origin (0,0).



SHP_Image.pas
 Description:

Download
 Filename:  SHP_Image.pas
 Filesize:  20.83 KB
 Downloaded:  21 Time(s)


Back to top
View user's profile Send private message
Banshee
Supreme Banshee


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

PostPosted: Mon Dec 02, 2013 2:48 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm not ignoring this change. I'll test it before committing it. Be patient, because the auto-installer is my priority at the moment.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Mon Dec 02, 2013 3:04 am    Post subject: Reply with quote  Mark this post and the followings unread

Sorry. I was wondering if you forgot #Tongue

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


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

PostPosted: Fri Dec 06, 2013 7:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sorry, but this change has been tested and rejected. If you simply change the way it is displayed, it will make you paint above the place you really wanted to paint. Perhaps this is part of a solution that would need to change the way shadows are painted in FrmSHPImage.

To be really honest with you guys, I'm unable to reproduce this bug.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Sat Dec 07, 2013 5:19 am    Post subject: Reply with quote  Mark this post and the followings unread

Steps are simple:
1. Open e1.shp (TS).
2. Set Zoom to any value, but the higher the better so you can see.
3. Set FrameIndex to a shadow frame.
4. Check Shadow in menu.

That's it.

I've worked on this today, and I think I've resolved this. I'm joining a demo build with the modified files, and a file describing what the modifications.



Demo.zip
 Description:
Demo build .EXE, with modified files and description of what I did.

Download
 Filename:  Demo.zip
 Filesize:  870.3 KB
 Downloaded:  27 Time(s)


Back to top
View user's profile Send private message
Banshee
Supreme Banshee


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

PostPosted: Sat Dec 07, 2013 4:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, committed to revision 38.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [14 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.1771s ][ Queries: 14 (0.0117s) ][ Debug on ]