Can`t compile under Mac OS 1.6.4 Example Pong.

Previous topic - Next topic

VlasovAlexey

If you past all files to same root - all work fine.
Example:

[Folder] _CodeSignature
[Folder] Media
Icon.png
Info.plist
iPhone-Info.plist
Islands
PkgInfo
ResourceRules.plist

Textures and Sprites not displayed. Now move "Media" files to root:


[Folder] _CodeSignature
[Folder] Media
Icon.png
Info.plist
iPhone-Info.plist
---------------------
Land.bmp
Water.bmp
---------------------
Islands
PkgInfo
ResourceRules.plist

and now work fine. This rule work for any 3D Examples for me.
Finally, model loading is very slow(1-1,2Mb per second) on "Animation" example.

Moebius

#16
I'll do more tests later but I had the same problem.  I modified the 3D Maze example to work using only mouse controls (aka touch controls), and then tried to compile for iOS.  There were three problems:
1)  No textures applied to the 3D objects, leaving me with a screen of white and grey.
2)  MOUSEAXIS(0), supposed to return the mouse's X speed, consistently returns 319 above the actual speed.  There seems to be no problem with MOUSEAXIS(1) - Y speed.
3)  GETMOUSECOUNT() consistently returns 4.  Isn't it supposed to return the number of fingers being used on the multitouch screen?

For the record, I HAVE tried Vlasov's 'solution' and using the Media folder.  I made sure that all files were added in XCode's resource list, and I confirmed that they are all added correctly in the .plists and other files inside the .app.  Regardless of whether the media folder is used, all 3D objects were not textured.

If anyone is willing to try it, paste this over the main loop in the example and try compiling:
Code (glbasic) Select
WHILE TRUE
dtime = GETTIMER()
// Show FPS / FPS anzeigen
fps = ((1000/dtime)+fps)/2
delay=delay+dtime
IF delay>1000 // 1/2 sec
delay=0
ShowFPS=fps
ENDIF

// limit on slow machines / begrenzen f. langsame Rechner
dtime = MIN(dtime, 16)

// For nicer textures / für schönere Texturen
X_MIPMAPPING TRUE

// 3D Viewport
X_MAKE3D 1, 800, 45
// Set Camera / Kamera setzen
X_CAMERA ply_x, sz*.75, ply_y, ply_x+COS(ply_dir)*sz, sz*.7, ply_y+SIN(ply_dir)*sz
// Only draw front faces / Nur vorferseiten zeichnen
X_SPOT_LT 0, RGB(255,255,255), ply_x, sz*.75, ply_y, ply_x+COS(ply_dir)*sz, sz*.7, ply_y+SIN(ply_dir)*sz, 360
X_FOG RGB(0,0,0), TRUE, 0.01, 0
X_CULLMODE 1
// Draw walls / Wände zeichnen
X_SETTEXTURE 0, -1
X_DRAWOBJ 0,0
X_SETTEXTURE 1, -1
INC offset#, 0.005
X_SETTEXTUREOFFSET offset, offset
X_DRAWOBJ 1,0


// Floor and walls are different objects, since GLBasic handles
// one texture per object. You could have drawn all needed
// Textures in one sprite and use texture coordinates
// to display only parts of the sprite - would be faster

// Boden und Wände sind 2 Objekte, da GLBasic jedem Objekt eine
// eingene Textur zuweist. Man kann alle benötigten Texturen in
// ein Sprite zeichnen und dann mit Texturkoordinaten nur
// einen Bereich davon verwenden - das wäre schneller

//mx=GETJOYY(0)*dtime/100
mx=GETMOUSECOUNT()*MOUSEAXIS(0)*dtime/100
//my=0
// IF KEY(200) THEN my=1
// IF KEY(208) THEN my=-1

my1=my1 - GETMOUSECOUNT()*MOUSEAXIS(1)
my=my1*dtime/10000
//my=-GETJOYZ(0)

// Remember current position / Aktuelle Position merken
ply_x_old = ply_x
ply_y_old = ply_y
// Try moving in 'x' / Versuchen in 'x' Richtung zu bewegen
ply_x=ply_x+my*COS(ply_dir)*sz*dtime/1000
// IF X_COLLISIONAABB(0,0,ply_x, sz/2, ply_y, sz/4, sz/2, sz/4) THEN ply_x=ply_x_old
IF X_COLLISION(0, 0, sz/4, ply_x, sz/2, ply_y) THEN ply_x = ply_x_old

ply_y=ply_y+my*SIN(ply_dir)*sz*dtime/1000
// Try moving in 'y' / Versuchen in 'y' Richtung zu bewegen
// IF X_COLLISIONAABB(0,0,ply_x, sz/2, ply_y, sz/4, sz/2, sz/4) THEN ply_y=ply_y_old
IF X_COLLISION(0, 0, sz/4, ply_x, sz/2, ply_y) THEN ply_y = ply_y_old
// Turn player / Spieler drehen
ply_dir=ply_dir+mx

X_MAKE2D

// Visualize level data in 2D / Level Daten in 2D zeichnen
ALPHAMODE 1
FOR X=0 TO BOUNDS(Level[], 0)-1; FOR y=0 TO BOUNDS(Level[], 1)-1
IF Level[X][y] THEN DRAWRECT X*10, y*10+20, 10, 10, RGB(128,128,128)
NEXT;NEXT
DRAWRECT ply_x*10/sz-4, ply_y*10/sz+20-4, 7, 7, RGB(255,255,255)
ALPHAMODE 0

PRINT "0:"+FORMAT$(3, 0, MOUSEAXIS(0))+" 1:" + FORMAT$(3,0,MOUSEAXIS(1)) + " #:" + GETMOUSECOUNT(), 0,0
SHOWSCREEN
WEND


EDIT:  And btw 2D apps that I have tested seem to load media fine...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Kitty Hello

try disabling the used features one by one. Light/fog/texture offset.

Moebius

I've tried previous versions without texture offset and lighting, but not fog.  I would try but I'm having problems compiling at the moment.  I'll post when I get things working again...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary