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 - dbots

#1
Quote from: matchy on 2013-Mar-30
Quote from: Ian Price on 2013-Mar-29
Quotethe reason I wrote the question was while being developing on Android platform. I am not interested on Windows right now
matchy, take note ;) :P
The reason I replied and modified my intent is because I, well...nevermind.
Huh ? Did I modified my intent ? I suppose you know better than me, right ?
#2
Quote from: Moru on 2013-Mar-30
No, there is nothing wrong with a case that has no target. If you want something to always happen if there is no matching case, you need to use DEFAULT as the last CASE.
No, I didn't mean that there is something wrong with a CASE that has no target.
Simply, when the CASE has no target (whose target causes the problem due to mine wrong reference to array's dimension) then all executed well and now I can understand it why.

My last question was that maybe the compiler should understand that the array's dimension I use is out of declared dimension and through some error before linking. Anyway it's all clear now.
#3
OK I found it.
The problem is that I declare :
DIM arr_icons[5][3];

but then I use :
arr_icons[1][3] = ...

The second dimension goes from 0 to 2.

What happened with commented CASEs was because stop1 gets a random value from my code so when its value would not belong to any CASE then the erroneous arr_icons[1][3] would not execute.

Shouldn't the compiler find that ?

Thanks for the help !
#4
Thanks Moru, you are absolutely right !
I activated debugging and I have :
Code (glbasic) Select

Injection started

bounds: [   5][   3]
access: [   1][   3]
.......Out of DIM array

Can you please explain what all these mean ? What I don't understand is that I don't fill the array... it's a set of CASES whose code does not even get executed so array is not filled and cause any memory problem.
Why it's "Out of DIM array" ?
#5
Hi, I have the following code :
Code (glbasic) Select

DIM arr_icons[5][3];
.......
SELECT stop1
CASE 0
arr_icons[1][1] = "KA"; arr_icons[1][2] = "LE"; arr_icons[1][3] = "7";
CASE 1
arr_icons[1][1] = "BE"; arr_icons[1][2] = "KA"; arr_icons[1][3] = "LE";
CASE 2
arr_icons[1][1] = "DA"; arr_icons[1][2] = "BE"; arr_icons[1][3] = "KA";
CASE 3
arr_icons[1][1] = "CH"; arr_icons[1][2] = "DA"; arr_icons[1][3] = "BE";
CASE 4
arr_icons[1][1] = "KA"; arr_icons[1][2] = "CH"; arr_icons[1][3] = "DA";
CASE 5
arr_icons[1][1] = "7";  arr_icons[1][2] = "KA"; arr_icons[1][3] = "CH";
CASE 6
arr_icons[1][1] = "MH"; arr_icons[1][2] = "7";  arr_icons[1][3] = "KA";
CASE 7
arr_icons[1][1] = "BE"; arr_icons[1][2] = "MH";  arr_icons[1][3] = "7";
CASE 8
arr_icons[1][1] = "DA"; arr_icons[1][2] = "BE";  arr_icons[1][3] = "MH";
CASE 9
arr_icons[1][1] = "LE"; arr_icons[1][2] = "DA";  arr_icons[1][3] = "BE";
CASE 10
arr_icons[1][1] = "CH"; arr_icons[1][2] = "LE";  arr_icons[1][3] = "DA";
CASE 11
arr_icons[1][1] = "MH"; arr_icons[1][2] = "CH";  arr_icons[1][3] = "LE";
CASE 12
arr_icons[1][1] = "PO"; arr_icons[1][2] = "MH";  arr_icons[1][3] = "CH";
// CASE 13
// arr_icons[1][1] = "CH"; arr_icons[1][2] = "PO";  arr_icons[1][3] = "MH";
// CASE 14
// arr_icons[1][1] = "KA"; arr_icons[1][2] = "CH";  arr_icons[1][3] = "PO";
// CASE 15
// arr_icons[1][1] = "DA"; arr_icons[1][2] = "KA";  arr_icons[1][3] = "CH";
// CASE 16
// arr_icons[1][1] = "PO"; arr_icons[1][2] = "DA";  arr_icons[1][3] = "KA";
// CASE 17
// arr_icons[1][1] = "MH"; arr_icons[1][2] = "PO";  arr_icons[1][3] = "DA";
// CASE 18
// arr_icons[1][1] = "7";  arr_icons[1][2] = "MH";  arr_icons[1][3] = "PO";
// CASE 19
// arr_icons[1][1] = "LE"; arr_icons[1][2] = "7";   arr_icons[1][3] = "MH";
ENDSELECT

in a sample game I write and it executes well.
But, when I remove any of the commented CASE lines, so if I have more than 13 active CASEs inside my SELECT, then application hangs when started... Any ideas ?
#6
Quote from: Ian Price on 2013-Mar-29
It means use sprite commands instead (DRAWSPRITE, DRAWANIM etc.) of primitive drawing (DRAWRECT, DRAWLINE).
Now, that makes more sense to the whole set of answers. Thanks
#7
@ Ian : Thanks, but what does "just replace the DRAWRECT commands with sprites instead" mean ?
#8
Hi guys,
the reason I wrote the question was while being developing on Android platform. I am not interested on Windows right now since I use other tools for that. Anyway, I will post my results and opinion when I will implement that solution on my code.
Thanks.
#9
Hi guys, here is my problem that I need some help :
I have a clear black image let's say 100x100 pixels and also I have a set of many 10x10 small images as separate ones.
What I want is to be able to select any of the small images, and draw it on the large image and after having prepared that large image accordingly (let's say like a puzzle of small images every time) then use that large image to display it on my program.
I want to be able to change that large image over and over during the program is executed, for example be able to replace a specific area of it that has already been filled previously, with another small image, over and over again.
I have been working with Delphi and DelphiX in the past and did that with DrawRect, is there something similar here ?
Thank you very much
#10
Thank you mentalthink, I have been using Audacity and tools like GIMP and Paint.NET but for batch conversions I will have in mind what you suggest. BTW, I don't know Spanish at all :)
#11
Yes my friend, that's what was needed. I setup OGG to 44100 and background music is crystal quality without noise.
Thank you all for your help.
#12
Well, I replaced the music file with an OGG type format, now I hear something but it's not the music, it has too much noise.
Probably I must change the sampling rate or something else or maybe the Android version is old ?
Where can I find detailed information about all these ?
Thank you
#13
Thank you mentalthink, I will try that and post the results.
#14
Hi all,

I 've written a small sample game and use some mp3 sounds (with playsound) and all is fine.
My problem starts when I use playmusic, in order to add a continuous background music in the game.

What I do in code, is to call :
PLAYMUSIC "bgmusic.wav", TRUE
MUSICVOLUME 1
at the beginning of the project, having enabled :
SETCURRENTDIR("Media")
also at first line just before everything

The strange thing is that when I test the project on windows background music plays just fine but when I transfer the game on my Android device then I don't background music. My Android's version is 2.3.
I have tried both with mp3 and wav sound for background, the result is always negative.
Also, I have all graphics and sounds in the Media folder under the .app folder generated for the project and when I build the apk I see that all multimedia files are placed correctly under assets/Media, so it's not that files are missing.
Thank you in advance
#15
Wow, that makes me feel like a dump  :giveup:
I thought that rnd(x) would give results 0..x-1, as I have used for years in C++
Anyway, thank you very much kanonet, for your reply