×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    66

    A serious problem with 6600- setFullScreenMode and Version of device ?

    Hi,

    Up to now I implemented in midp 1.0 on 3650 and such devices but now
    I have a serious problem with 6600 device. ( using now midp 2.0 )

    I know that many times, there has been discussed this setFullScreenMode
    but believe me I have searched all the forums titles however I have still problems.

    If I use setFullScreenMode(true) and even hardcode sizeChanged by width=176 and height = 208 , it is fine on emulator but on my Nokia 6600 device height reacts as 144. The screen seems in full screen but when I press
    a soft key the 64 pixels from bottom ( 208 - 144 ) is not rendered. I mean it reacts as height = 144.

    Secondly,
    I have read the 6600 issues document, it says:

    ----------------------------------------------------
    2.10 Changing the FullScreenMode of Canvas to True
    Description:

    If the FullScreenMode of Canvas is changed to true, the Commands in the Options menu don’t have any effect. If any soft key is pressed, the Options menu is shown, but choosing a Command does nothing.

    Solution:
    No solutions exist for software version 3.42.1 or 4.09.1.




    Known Issues In The Nokia 6600 MIDP 2.0 Implementation 11
    2.11 Commands in Full Screen
    Description:
    Commands can be added to full screen but they do not work.

    Solution:
    No solutions exist for software version 3.42.1, but this issue has been corrected in software version 4.09.1.
    ---------------------------------------------------------------------

    and this document also says:
    ---------------------------------------
    This document presents known issues related to the MIDP 2.0 implementation in the first commercial software versions of the Nokia 6600 device. The software version numbers are 3.42.1 and 4.09.1. The software version can be checked by typing *#0000#. Note that new software versions will not be released for the Nokia 6600 device.
    ----------------------------------------

    Well when I type *#0000# my software version is 5.53.0

    Is my problem related with this version ? I mean I have tried all the ways to correct the setFullScreenMode and the command issues when full screen.
    Although the emulator runs correct now, my Nokia 6600 does not run correctly, it behaves as height is 144, the 64 pixels from bottom is not rendered.

    The 6600 issue says from above that;
    "Note that new software versions will not be released for the Nokia 6600 device."
    What does it mean ? Is my 5.53.0 the wrong software, but it is higher, if so
    how can I sell my game to 6600 devices ? That is a big problem.

    To show my code:

    public class GameScreen extends GameCanvas implements Runnable, CommandListener {

    private static final int MILLIS_PER_TICK = 50;

    private Command backCommand = new Command( Locale.getString( "General.Exit" ), Command.EXIT,1);


    private boolean isPlay; // Game Loop runs when isPlay is true
    private int width; // To hold screen width
    private int height; // To hold screen height

    private int scnViewWidth; // Hold Width Screen View Port
    private int scnViewHeight; // Hold Height Screen View Port

    private Thread gameThread = null;


    private static final int MOVE = 6;



    int x, y;

    // Constructor and initialization
    public GameScreen() throws Exception {
    super(true);
    addCommand(backCommand);
    setCommandListener(this);

    setFullScreenMode(true);

    try{ Thread.sleep( 100 ); }catch(InterruptedException e){ }

    this.sizeChanged( getWidth(), 208 );
    width = getWidth(); // get screen width
    height = 208; // get screen height
    scnViewWidth = width; // Set View Port width to screen width
    scnViewHeight = height; // Set View Port height to screen height


    ........

    }

    // Start thread for game loop
    public void start() {
    gameThread = new Thread(this);
    gameThread.start();
    }

    // Stop thread for game loop
    public void stop() {
    gameThread = null;
    }

    // Main Game Loop
    public void run() {
    Graphics g = getGraphics();

    Thread currentThread = Thread.currentThread();

    try {
    while (currentThread == gameThread) {
    long startTime = System.currentTimeMillis();
    if (isShown()) {
    if (isPlay) {
    tick();
    }
    render(g);


    }
    long timeTake = System.currentTimeMillis() - startTime;
    if (timeTake < MILLIS_PER_TICK) {
    synchronized (this) {
    wait(MILLIS_PER_TICK - timeTake);
    }
    } else {
    currentThread.yield();
    }
    }
    } catch (InterruptedException ex) {
    // won't be thrown
    }

    }

    // Handle dynamic changes to game including user input
    public void tick() {
    this.sizeChanged( getWidth(), 208 );
    // Scroll Terrain
    gameMap.scrollTerrain();

    // Player Actions
    int keyStates = getKeyStates();

    ... here key actions..


    }

    public void commandAction(Command c, Displayable d) {
    if (c == backCommand) {
    MyMidlet.getApp().activateMenu(); // I want to go to main menu
    }
    }

    // Method to Display Graphics
    private void render(Graphics g) {



    g.setColor(0x000000);
    g.fillRect(0,0,176,208);

    // LayerManager Paint Graphics
    this.sizeChanged( getWidth(), 208 );


    layerManager.paint(g,0,0);


    flushGraphics();
    }

    protected void sizeChanged(int w, int h)
    {
    width = getWidth();
    height = 208;
    }


    }

  2. #2
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    66

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    is there nobody to reply my question ?

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    Some advice:

    1) Remove the "Thread.sleep(100)" statement.
    2) Do not calculate the screen size from the constructor.
    3) Do not call sizeChanged() yourself, because it is supposed to be called by the virtual machine, signalling the new height of the screen.
    4) Only after getting a call from sizeChanged() from the framework, use the new height to calculate all of your screen objects' size, and then call flushGraphics().


    This should solve your problem, as the issue with the fullScreenMode method is fixed for your firmware version.

    Daniel

  4. #4
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    66

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    Quote Originally Posted by dcrocha
    Some advice:

    1) Remove the "Thread.sleep(100)" statement.
    2) Do not calculate the screen size from the constructor.
    3) Do not call sizeChanged() yourself, because it is supposed to be called by the virtual machine, signalling the new height of the screen.
    4) Only after getting a call from sizeChanged() from the framework, use the new height to calculate all of your screen objects' size, and then call flushGraphics().


    This should solve your problem, as the issue with the fullScreenMode method is fixed for your firmware version.

    Daniel
    Hi Daniel,

    I think the point is the time when sizeChanged() method is called by framework, how and when can be known that sizeChanged is called ?
    I understand from your comment that I have to use and call all paramters after sizeChanged() method.

    protected void sizeChanged(int w, int h)
    {
    width = w;
    heigth = h;
    }

    Would this method enough to set the width and height, actully I have tried this way also ?

  5. #5
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    66

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    Daniel,

    I mean that from above my code, you can see that flushGraphics() is called in
    render method. How can I know that sizeChanged is called first ?

  6. #6
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    Hi,

    In addition to your code below:

    protected void sizeChanged(int w, int h)
    {
    width = w;
    heigth = h;
    //call your rendering method here and make sure
    //it doesn't have any hardcoded values.
    }

    You should add also a call to flushGraphics() or your rendering method, and it should draw your objects to the screen with the new sizes. Of course, you must also be absolutely sure none of your rendering methods or coordinate calculation methods is using hardcoded values.

    As a last resort, if you can't get that working, I'd suggest two things:

    1) Grab some sample application from the Internet that makes use of a full screen canvas and take a look at its source code.
    2) Try with FullCanvas class of the Nokia UI API.

    Daniel

  7. #7
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    66

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    Quote Originally Posted by dcrocha
    Hi,

    In addition to your code below:

    protected void sizeChanged(int w, int h)
    {
    width = w;
    heigth = h;
    //call your rendering method here and make sure
    //it doesn't have any hardcoded values.
    }

    You should add also a call to flushGraphics() or your rendering method, and it should draw your objects to the screen with the new sizes. Of course, you must also be absolutely sure none of your rendering methods or coordinate calculation methods is using hardcoded values.

    As a last resort, if you can't get that working, I'd suggest two things:

    1) Grab some sample application from the Internet that makes use of a full screen canvas and take a look at its source code.
    2) Try with FullCanvas class of the Nokia UI API.

    Daniel

    Hi Daniel,
    If I use g.setClip(0,0,getWidth(),getHeight());
    after g.fillRect(0,0,getWidth(),getHeight()); like that:

    private void render(Graphics g) {

    g.setColor(0x000000);
    g.fillRect(0,0,getWidth(),getHeight());
    g.setClip(0,0,getWidth(),getHeight()); // here is the solution..
    terrain = gameMap.getTerrain();
    layerManager.paint(g,0,0);
    flushGraphics();

    }

    everything is fine now.. it works

    g.setClip() is the solution..

    but now I am dealing with the Back command, it is also a problem..

  8. #8
    Registered User
    Join Date
    Sep 2006
    Posts
    2

    Re: A serious problem with 6600- setFullScreenMode and Version of device ?

    This problem is found early on MIDP1.0 until now.
    I wonder why Nokia would let this bug lasting for such a long time......>_<

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×