Menu

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.

Show posts Menu

Messages - Paul Smith

#106
Thanks for putting the Books online, will give them a read shortly. cant believe its Free.

arrays may be the the best option, but I have zero experience using them, i'm old fashioned and still use old programming techniques
with new bits added once I understand them.
#107
excellent, cant wait to read it when its available.
#108
couldn't get it working with it in a function( not you just my poor programming skills)
but your example made me understand it just like doing the same thing on a Amstrad CPC.
so I came up with this

GLOBAL amount, s
STARTDATA keys:
DATA 3, 3, 5, 5, 8, 1, 3, 9, 8, 0, 5, 9, 3, 9, 4, 1, 1, 0, 9, 4, 3, 0, 2, 2, 8, 4 // will have 255 values
ENDDATA

amount = 12

RESTORE keys

FOR t = 1 TO amount
READ s
NEXT
PRINT s,100,100
SHOWSCREEN
KEYWAIT

easy when you start to understand, Now doubt I'll be back when i forget how SHOWSCREEN works.  hehe

Just off topic MrTAToad is it you who wrote the GLBasic Programmers Reference Guide? if so do you still sell this and how much?

thanks for the help

Paul
#109
Hi all
Never had to  use DATA storage in my code so far, however now i need to store 255 static  values between 0 and 9
i also need to  read the value at different positions e.g. position 10 = 0 or position 220 = 6
I've looked at help file and examples for data,array etc (some to complicated for me)
came up with this test

GLOBAL a
STARTDATA keys:
DATA 3, 3, 5, 5, 8, 1, 3, 9, 8, 0, 5, 9, 3, 9, 4, 1, 1, 0, 9, 4, 3, 0, 2, 2, 8, 4 // will have 255 values
ENDDATA

RESTORE keys
WHILE TRUE
READ a
PRINT a, 100,100
SHOWSCREEN
KEYWAIT
WEND

this will read the numbers in order
have no idea how to make it go to postion 50 or 12 and read data.

Anyone have any better ways, or  pointers

Cheers



#110
Cheers Kanonet for the Example.

I've tested your code and it works proving it was my code.
Ive just got my code working, and what I found was if I used GRABSPRITE in a  FOR/NEXT then it didn't work
but If i used WHILE TRUE/WEND then it did, not sure why.
hopefully I'll have time to finish my program tonight
#111
Never Had a problem with grabsprite in 2D windows, Just started messing with 3D and doing tricks that look quite technical but again just illusions. once this bit is figured out I'll upload this part ( old school demo effect ).
If worst comes to worst then I may have to SAVEBMP Then loadsprite. 
#112
Hi All,

I'm having problems with GRABSPRITE, If I draw a 3D object in the centre of the screen and use  GRABSPRITE then all is OK
but if I do a for next loop 5x and rotate the object + grab 5 sprites then only the first one works.
Ive printed text across the object to prove  that GRABSPRITE is working and it is
if i //grabsprite  then the object turns so that OK
It grabs the whole screen but I know it  works as this is how i written and a 2D unlimited sprites demo.

Any Ideas?


FOR t = 1 TO 5
X_MAKE3D 1, 50, 45
PRINT t, 400, 300
xxx = xxx + 5
//yyy = yyy + 0.5
X_CAMERA 100 / 20, 0, 0, 0, 0, 0
X_SETTEXTURE 1, 1
X_ROTATION xxx, xxx , xxx, zzz
X_DRAWOBJ 0,0
//IF xxx > 360 THEN xxx = 0
//X_SPOT_LT -1, 0, 0,0,50, 0,0,0,90
GRABSPRITE t, 0, 0, 800, 600
//SHOWSCREEN
//KEYWAIT
NEXT
KEYWAIT
t = 0
WHILE TRUE
ZOOMSPRITE t, 100, 100, 1.1, 1.1
t = t +1
IF t = 5 THEN t = 0
SHOWSCREEN
WEND
#113
Sorted.Ogg encoder keeps encoding to stereo.selected mono 44.1k and tested ok
#114
Just got the new Sony Ericsson Arc S phone.2.3.4,and tested a few commands
I'm having problems with PLAYMUSIC
no sound with MP3
no sound with MP4( speaker turns on just about hear white noise when close to ear )
music mixed with junk with OGG

tried a few compression rates

Any Ideas?

here a copy of my log

@ECHO OFF

:: install Android SDK, Android NDK
:: install JDK


set HERE=%~dp0

set ANDROIDSDK=%HERE%..\android-sdk-windows
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_24


set PATH=%JAVA_HOME%\bin;%PATH%

"%ANDROIDSDK%\platform-tools\adb.exe" shell logcat glbasic:I SDL:I *:S


IF "%NOPAUSE%"=="" PAUSE
#115
Uninstalled everything and deleted all environment for java/android
reinstalled and set up all.
made new project but saved it onto my desktop, also gave it a company name.
Got a better log this time.
2 errors at end not sure what they mean.
set up an AVD not sure how to project to run on the emulator yet, will need to read more instructions.

thanks for the help.

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.8.048 SN:681be9d9 - 3D, NET
Wordcount:3 commands
compile+link:
BUILDSRIPT
BUILD STAGE 1: Compile and pack
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
     [echo] Converting compiled files and external libraries into C:\Users\Paul6175\Desktop\distribute\Android\bin\classes.dex...
     [echo] Packaging resources
     [echo] No key.store and key.alias properties found in build.properties.
     [echo] Please sign C:\Users\Paul6175\Desktop\distribute\Android\bin\glbasic-unsigned.apk manually
     [echo] and run zipalign from the Android SDK tools.

BUILD SUCCESSFUL
Total time: 8 seconds
BUILD STAGE 2: Install on device
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
     [echo] Converting compiled files and external libraries into C:\Users\Paul6175\Desktop\distribute\Android\bin\classes.dex...
     [echo] Packaging resources
     [echo] Running zip align on final apk...
     [echo] Debug Package: C:\Users\Paul6175\Desktop\distribute\Android\bin\glbasic-debug.apk
     [echo] Installing C:\Users\Paul6175\Desktop\distribute\Android\bin\glbasic-debug.apk onto default emulator or device...

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:641: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:271: exec returned: 1

Total time: 10 seconds
Android=C:\Users\Paul6175\Desktop\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 26.4 sec. Time: 22:16
Build: 1 succeeded.

#116
No spaces or symbols.
All I'm compiling at the moment is a simple hello world
new project "antest.gbas"

// --------------------------------- //
// Project: antest
// Start: Monday, September 12, 2011
// IDE Version: 10.106



PRINT "test test", 0, 50;
SHOWSCREEN
END
#117
After my current phone melted itself, I'm tempted to buy an  Android phone
before I recompile my old projects I thought I would test it out on some samples e.g helloworld( all compile in   w32 and Win-CE )
I'm getting the errors listed below then compiling
Ive followed the installation instructions and set environment paths etc
any Ideas what Im missing.

Win 7 64bit
java sdk 32 (tried 1.7 & 1.6)
android sdk (installed everything)


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.8.048 SN:681be9d9 - 3D, NET
Wordcount:4 commands
compile+link:
BUILDSRIPT
BUILD STAGE 1: Compile and pack
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
    [javac] C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android\gen\com\.helloworld\R.java:8: malformed floating point literal
    [javac] package com..helloworld;
    [javac]            ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:386: Compile failed; see the compiler error output for details.

Total time: 3 seconds
BUILD STAGE 2: Install on device
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
    [javac] C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android\gen\com\.helloworld\R.java:8: malformed floating point literal
    [javac] package com..helloworld;
    [javac]            ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:386: Compile failed; see the compiler error output for details.

Total time: 3 seconds
Android=C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 12.7 sec. Time: 17:11
Build: 1 succeeded.