Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Samsung e317 bug  (Read 1109 times)
0 Members and 1 Guest are viewing this topic.
Offline wooD

Senior Newbie




J2ME Developer


« Posted 2005-01-13 15:33:48 »

I have an odd issue with a Samsung e317. The app works on every other phone and I'm beginning to believe it is an actual problem with the phone. i've tested this on three other phones and it works fine (Samsung a620, Sanyo 8100, Nokia 3595).

This is the code in question. It draws images from within images so I can limit my file size by cramming everything into one or two images.
1  
2  
3  
4  
5  
6  
7  
8  
public void drawSubImage(Graphics g, Image src,int x,int y, int subx, int suby, int width, int height)
{
  g.setClip(x,y,width,height);
  g.drawImage(src,(x-subx),(y-suby),Graphics.TOP|Graphics.LEFT);

  // reset the clip rect so further drawing works
 g.setClip(0,0,scrx,scry);
}

The problem seems to be with the second setClip which sets the clip rect back to the full screen. I have checked scrx and scry values and they are fine.

Only the graphical elements show up after calls to drawSubImage and none of the hand drawn stuff. Subsequent calls to drawSubImage do seem to work because all the image elements on the screen are drawn, just not the line/fill elements.

This is drawn to an offscreen (mutable) image and not the screen, but I don't see how that would matter. Especially since it works on other phones.

Anyone seen similar problems on the e317?

Thanks,
Wood

Offline wooD

Senior Newbie




J2ME Developer


« Reply #1 - Posted 2005-01-17 15:08:54 »

I'm convinced that the Samsung e317 (Cingular) has a bug in the Graphics.fillRect method.

I did a bunch more testing with Ofscreen bitmaps and found that fill rect will not draw outside screen size if the offscreen bitmap is larger than the screen.   I found a page that describes a very similar problem with Graphics.drawLine http://jroller.org/page/wangjammer5/20040617 on earlier Samsung phones.  This talks about drawLine problems and the way to fix it with fillRect, but similar in behavior.

The offscreen image is larger than the screen size by 20 pixels (my tile size) so I only have to draw into the bitmap when the screen offset is larger than 20. Then I scroll smoothly and only update on the edges when the offset is > 20.

Samsung's developer website doesn't describe any problems what so ever with any phone and it has message boards that have questions that have gone unanswered for months. Quite stale. Welcome the J2ME hell. Bad implementations and bad developer support.

Quote

<Rant>
To describe the J2ME world as bad gives it way too much justice. A better description would be the absolute worst environment anyone could possibly work with. The next "worst" environment would be a million times better. Coming from someone who's been in the trenches for 5 years now. It has never improved and has only progressively gotten worse. If you plan to enter this market, take this into acount as a huge huge risk. Every phone you plan to support will require a special version of your program and hours and hours of time to test and write phone specific work arounds with no debug capability on the device, not even System.out.  Not only do we get the performance hit of a JVM, but we have the same problems as C anyways. Very disappointing.
</Rant>


This is not one of my required phones (yet),  just the phone I carry so I'm not sure if I'm going to fix it or not. The work around I'm thinking about is to have three offscreen images, one as large as the screen and two 20 pixel wide strips, one horizontal and one vertical at the bottom and right. I'll typically have to draw all three to update the screen and do some odd behavior to update them all when the scroll factor reachs 20.

The other workaround is funny. Since the other phones have drawLine problems and the work around is to use fillRect with a width of 1, I was thinking I could maybe use drawLine in a loop to fill in the rect. Hmmm, probably a performance pig but it would be a lot easier to implement than the three separate offscreen bitmaps. Assuming drawLine didn't have the same problem.

Hope that helps some one out there.

Wood

Offline wooD

Senior Newbie




J2ME Developer


« Reply #2 - Posted 2005-01-26 14:13:27 »

Just a note on one of my work arounds. Rewriting the fillRect with drawLine calls did not fix the problem. I'm betting the same bug exists in drawLine in that you cannot draw into an offscreen image in the areas that are larger than screen size.

The only solution I see is to have three offscreen images. One will be screen size, the other two will be my tile width/height and I will draw the second two on the right and bottom. I have not yet implemented this and may or may not depending on distribution.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (35 views)
2014-07-24 01:59:36

Riven (34 views)
2014-07-23 21:16:32

Riven (22 views)
2014-07-23 21:07:15

Riven (25 views)
2014-07-23 20:56:16

ctomni231 (56 views)
2014-07-18 06:55:21

Zero Volt (48 views)
2014-07-17 23:47:54

danieldean (39 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!