Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - UBERmonkeybot

Pages: 1 ... 14 15 [16]
226
GLBasic - en / Re: Android Graphics Problem
« on: 2015-Aug-02 »
It would appear it is something to do with the SPRCOL command after the drawsprite.
If i remove the SPRCOLL section then the graphics display fine.
I am checking a collisionsprite against a background sprite(full screen)
e.g.

      DRAWSPRITE ColSpriteB,dude.x#+10,dude.y#+60
      IF  SPRCOLL(ColSpriteB,dude.x#+10,dude.y#+60,GameBgndSpr,0,0)
             dude.yv#=0
         dude.y#=dude.oy#
         IF dude.xv#>0 THEN dude.xv#=dude.xv#-0.3
         IF dude.xv#<0 THEN dude.xv#=dude.xv#+0.3
         ENDIF

227
I just reinstalled SpaceFractal's Android Extras and all was well

228
Anyone else having this problem?

I seem to be getting a load of Java errors

compile:
    [javac] Compiling 17 source files to C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: mSingleton has private access in SDLActivity
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                      ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: cannot find symbol
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                                 ^
    [javac]   symbol:   variable isOuya
    [javac]   location: variable mSingleton of type SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: illegal start of type
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]          ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:375: error: cannot find symbol
    [javac]          base64EncodedPublicKey=SDLActivity.getStringResourceByName("com.google.play", "");
    [javac]                                            ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:380: error: cannot find symbol
    [javac]          SLIDEME=SDLActivity.getStringResourceByName("SlideME", "");
    [javac]                             ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:385: error: cannot find symbol
    [javac]          APPLAND_PUBLIC_KEY=SDLActivity.getStringResourceByName("Appland", "");
    [javac]                                        ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 6 errors
    [javac] 3 warnings

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: mSingleton has private access in SDLActivity
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                      ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: cannot find symbol
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                                 ^
    [javac]   symbol:   variable isOuya
    [javac]   location: variable mSingleton of type SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: illegal start of type
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]          ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:375: error: cannot find symbol
    [javac]          base64EncodedPublicKey=SDLActivity.getStringResourceByName("com.google.play", "");
    [javac]                                            ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:380: error: cannot find symbol
    [javac]          SLIDEME=SDLActivity.getStringResourceByName("SlideME", "");
    [javac]                             ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:385: error: cannot find symbol
    [javac]          APPLAND_PUBLIC_KEY=SDLActivity.getStringResourceByName("Appland", "");
    [javac]                                        ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 6 errors
    [javac] 3 warnings

229
GLBasic - en / Re: Android Graphics Problem
« on: 2015-Aug-01 »
Nope it's not that.

Here is a link to the code if anyone has the time or inclination to look.

https://drive.google.com/file/d/0B_jPlZixO8uQa3VmWnhBR01pN0E/view?usp=sharing


230
GLBasic - en / Re: Android Graphics Problem
« on: 2015-Aug-01 »
As part of my debugging procedure i am displaying the graphics after they have loaded.
They do display so they are definitely loaded correctly.

I have done a clean and recompiled to no avail.
It seems weird that it works on my phone so i think it must be a local problem on my tablet.

To clarify when i said corrupted i mean they don't show up.
I am using .BMP
Screenshots attached.
the first is android

I believe i have the latest version of android extras.

Thanks


231
GLBasic - en / Android Graphics Problem
« on: 2015-Aug-01 »
Hi All,
I have a prog running on Windows and also compiles to my phone(HTC one) with no probs,when i put it on my tablet(Galaxy Tab S 10.1) some of the graphics are corrupt,I assume that there are some files already on the Tablet that are not being written over.
I have searched for an answer and also tried to find the relevent files on my Tab.


Any ideas what i can do?

Thanks in advance.

232
GLBasic - en / Re: Android Graphics problem
« on: 2015-Jun-28 »
Thanks for the info.

233
GLBasic - en / Re: Android Graphics problem
« on: 2015-Jun-27 »
Ahh,is it a bug in Android then?

234
GLBasic - en / Re: Android Graphics problem
« on: 2015-Jun-27 »
Brilliant!  Thanks that worked.

I assumed that if i drew to the backbuffer and grabbed it it would be the same result.


235
GLBasic - en / Android Graphics problem
« on: 2015-Jun-24 »
Hi,
I am a total NOOB at GLB,i have created a prog to bounce a ball round the  screen as a test,it runs fine in windows but when i compile it to Android i just get a block moving around inplace of the ball.
Does anyone have any ideas,I have read loads of stuff on the forum but still cant work out what is going on.



Code: (glbasic) [Select]
// --------------------------------- //
// Project: bounce your balls
// Start: Saturday, June 20, 2015
// IDE Version: 12.312


// FREE-VERSION:
// Need Premium for Features:
// 3D Graphics
// Network Commands
// INLINE C/C+++ code

// SETCURRENTDIR("Media") // go to media files

TYPE tgame
sx
sy
ENDTYPE

GLOBAL game AS tgame

TYPE tc
x=100
y=200
xv#=1
yv#=1
ENDTYPE
GLOBAL c AS tc


GETSCREENSIZE game.sx,game.sy

GLOBAL progC=1
circle (20,20,20,10,0xff,0,0,0,1,0xff)
GLOBAL circSpr=1
GRABSPRITE circSpr,0,0,40,40

SETLOOPSUB  "MainLoop"


DEBUG "debug code"


FUNCTION logoscreen:
PRINT 200,200,"Bouncy balls"
SHOWSCREEN
ENDFUNCTION

FUNCTION Gameloop:
LOCAL x=200//RND(game.sx)
LOCAL y=200//RND(game.sy)
LOCAL rad=50//RND(50)
DRAWSPRITE circSpr,c.x,c.y
c.x#=c.x#+c.xv#
c.y#=c.y#+c.yv#
IF c.x#>game.sx-40 THEN c.xv#=-RND(10)
IF c.x#<0  THEN c.xv#=10
IF c.y#>game.sy-40 THEN c.yv#=-RND(10)
IF c.y#<0  THEN c.yv#=10
SHOWSCREEN
ENDFUNCTION


FUNCTION circle: xs,ys,r,s,c1,c2,c3,thickness,fill,fillCol

 LOCAL a,cox#,coy#,cx#,cy#
  cx#=COS(a)*r
  cy#=SIN(a)*r
  cox#=cx#
  coy#=cy#
// DRAWLINE xs,ys,xs+10,ys,0xff0000
  FOR rd#=r  TO r+thickness STEP 0.5
  FOR a=0 TO 360 STEP s
  cx#=COS(a)*rd#
  cy#=SIN(a)*rd#
  DRAWLINE xs+cx#,ys+cy#,xs+cox#,ys+coy#,RGB(c1,c2,c3)
  cox=cx
  coy=cy
  NEXT
NEXT

//IF fill THEN FloodFill (xs,ys,fillCol)//,xs-(10),ys-(10),xs+(10),ys+(10),0)


ENDFUNCTION // CIRCLE



SUB MainLoop:
IF progC=0 THEN logoscreen ()
IF progC=1 THEN Gameloop()
ENDSUB





FUNCTION FloodFill: Pix_Num_X,Pix_Num_Y,fillcol%,screenx%=-1,screeny%=-1,width%=-1,height%=-1,Preview%=FALSE
//
// Pix_Num_X, Pix_Num_Y This the starting point to flood within the captured area of screen.
//                      These numbers are in relation to the sprite of the captured area, not the location of the pixel on the screen itself.
//
// fillcol              This is the fill color Floodfill will use to flood. The fill covers all pixels within the captured area which share the original color of
//                      the starting pix_num, and is limited by the edges of the captured area contained in the sprite, and will not cover other colors
//                      or jump lines across the captured area which have some other color.
//
// screenx,screeny      This is the optional starting x,y for the screen area capture. If no x,y is given, the default is (0,0), the upper left corner of the screen.
//
// width, height        This is the optional width and length of the screen capture. If no width or height is given, the ending screensize values are used, which is the lower right corner of the screen.
//
// Preview         When the optional Preview parameter is set for TRUE, the captured screen area is displayed against a grid background;
//                      and the selected starting pixel is set to black, unless the background is already black in which case it is set to white.
//                      As a single pixel is very small and hard to see, so you will have to look very closely to spot it.
//                       (Note: If Preview mode is used, ALL optional parameters must be used.)
//                      This mode is intended for programer use to check his or her screen capture area.
// ---------------------------------------------------------------------------------------------------------------------------------------
LOCAL id% = GENSPRITE()
LOCAL sw,sh
GETSCREENSIZE sw,sh
//Preview%=TRUE

// If default values are present, set them based on the screen size.

IF screenx < 2 THEN screenx=0
IF screeny < 2 THEN screeny = 0
IF width < 2 THEN width = sw-screenx
IF height < 2 THEN height = sh-screeny

// Errorcheck to avoid overrunning the limits of the screen
IF screenx+width > sw THEN width = sw-screenx
IF screeny+height > sh THEN height = sh-screeny

GRABSPRITE id%,screenx,screeny,width,height

IF Preview = TRUE

        LOCAL PixHold%

        CLEARSCREEN
        DRW_Grid() // Draws a gridwork on the background so the captured section of screen is easy to recognize.
        ALPHATESTING 1.0
        DRAWSPRITE id,screenx,screeny

        // Now we display the starting pixel in either black or white, depending on the background.

        PixHold = GETPIXEL (screenx+Pix_Num_X,screeny+Pix_Num_Y)
        IF PixHold = RGB(0,0,0)
                SETPIXEL screenx+Pix_Num_X,screeny+Pix_Num_Y, RGB(255,255,255)
        ELSE
                SETPIXEL screenx+Pix_Num_X,screeny+Pix_Num_Y, RGB(1,1,1)
        ENDIF
        SHOWSCREEN;     KEYWAIT
        ALPHATESTING 0.0
        SETPIXEL screenx+Pix_Num_X,screeny+Pix_Num_Y,PixHold // Here we restore the original color of the starting pixel for the flood fill to work on.

ENDIF

TYPE Fillpixel
        x%
        y%
ENDTYPE

GLOBAL pixels%[]


        LOCAL i[]  AS Fillpixel
        LOCAL newi AS Fillpixel
        LOCAL newx%,newy%,dir%
        LOCAL fillover%,fillcolour%
        LOCAL fillmap%[]
        LOCAL red%,green%,blue%,alpha%

        IF Pix_Num_X<0 OR Pix_Num_Y<0 OR Pix_Num_X>=width% OR Pix_Num_Y>=height
                DEBUG "Out of area."
                RETURN
        ENDIF

        SPRITE2MEM (pixels[],id)

        // Convert the fill colour to SPRITEMEM format.
         fillcolour=bOR(fillcol, ASL(255, 24))

        // Get the colour that will be filled over.
        red=bAND(pixels[Pix_Num_X+Pix_Num_Y*width%], 0xff)
        green=bAND(ASR(pixels[Pix_Num_X+Pix_Num_Y*width%],8), 0xff)
        blue=bAND(ASR(pixels[Pix_Num_X+Pix_Num_Y*width%],16), 0xff)
        alpha=bAND(ASR(pixels[Pix_Num_X+Pix_Num_Y*width%],24), 0xff)
        fillover=bOR(RGB(red,green,blue), ASL(alpha, 24))

        // If the fill pixel is same colour as then abort.
        IF fillover=fillcolour THEN RETURN

//      CLEARSCREEN;PRINT fillover+" "+fillcolour,50,50;SHOWSCREEN;KEYWAIT;END

        // Set the start position.
        newi.x=Pix_Num_X
        newi.y=Pix_Num_Y
        pixels[Pix_Num_X+Pix_Num_Y*width%]=fillcolour
        DIMPUSH i[],newi

        // Reset the fill check map.
        DIM fillmap[width%][height]
        fillmap[Pix_Num_X][Pix_Num_Y]=1

        FOREACH pixel IN i[]

                // New test position based on the direction.
                FOR dir=0 TO 3

                        SELECT dir

                        CASE 0                  // Right
                                newx=pixel.x+1
                                newy=pixel.y
                        CASE 1                  // Down
                                newx=pixel.x
                                newy=pixel.y+1
                        CASE 2                  // Left
                                newx=pixel.x-1
                                newy=pixel.y
                        CASE 3                  // Up
                                newx=pixel.x
                                newy=pixel.y-1
                        ENDSELECT


                        IF newx>=0 AND newy>=0 AND newx<width% AND newy<height  // Make sure the new position is in the boundaries of the screen/sprite.
                                IF fillmap[newx][newy]=0                                                        // If not already checked continue
                                        fillmap[newx][newy]=1                                                   // Flag this pixel as now checked
                                        IF pixels[newx+newy*width%]=fillover                    // Check pixel colour is the correct fill over colour.
                                                pixels[newx+newy*width%]=fillcolour                     // Fill and make a new pixel.
                                                newi.x=newx
                                                newi.y=newy
                                                DIMPUSH i[],newi
                                        ENDIF
                                ENDIF
                        ENDIF
                NEXT
                DELETE pixel                                                                            // Remove pixel from list
        NEXT
//
        MEM2SPRITE (pixels[],id,width%,height)
        DRAWSPRITE id,screenx,screeny//;USEASBMP;SHOWSCREEN;KEYWAIT

        DIM fillmap[0][0]
        RETURN id

ENDFUNCTION
// ------------------------------------------------------------- //
// ---  DRW_Grid  --- // Just Some Interesting Wallpaper.
// ------------------------------------------------------------- //
FUNCTION DRW_Grid:

// Red Grid Lines, for lay out. ///////////
CONSTANT RED% = RGB(255,0,0),GREY% = RGB(100,100,100)
LOCAL sw%,sh%
GETSCREENSIZE sw,sh
LOCAL cnt%,sw_Inc% = sw/32,sh_Inc%=sh/32
FOR cnt = -16 TO 16
        DRAWLINE sw/2-sw_Inc*cnt,0,sw/2-sw_Inc*cnt,sh,GREY
        DRAWLINE 0,sh/2-sh_Inc*cnt,sw,sh/2-sh_Inc*cnt,GREY
NEXT

DRAWLINE sw/2,0,sw/2,sh,RED
DRAWLINE 0,sh/2,sw,sh/2,RED

ENDFUNCTION // DRW_Grid





Pages: 1 ... 14 15 [16]