# HG changeset patch # User koda # Date 1247320077 0 # Node ID 03fd99dff989b42fe4cb72487cb98db64ccb56e3 # Parent bf0b59d3536ad58f5ef5bd3732923e518fc37c62 accessory stuff for iphone diff -r bf0b59d3536a -r 03fd99dff989 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Fri Jul 10 19:10:29 2009 +0000 +++ b/hedgewars/SDLh.pas Sat Jul 11 13:47:57 2009 +0000 @@ -101,7 +101,6 @@ {$ENDIF} SDL_APPINPUTFOCUS = 2; - SDL_GL_DOUBLEBUFFER = 5; RMask = $000000FF; GMask = $0000FF00; @@ -220,23 +219,43 @@ state: Byte; keysym: TSDL_KeySym; end; - - {$IFDEF SDL13} - TSDL_MouseMotionEvent = record - type_: byte; - which: byte; - state: byte; - x : LongInt; - y : LongInt; - xrel : LongInt; - yrel : LongInt; - end; - {$ENDIF} + TSDL_GLattr = ( + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION ); + +{$IFDEF SDL13} + TSDL_MouseMotionEvent = record + type_: byte; + which: byte; + state: byte; + x : LongInt; + y : LongInt; + xrel : LongInt; + yrel : LongInt; + end; +{$ENDIF} TSDL_QuitEvent = record type_: Byte; end; - TSDL_ResizeEvent = record + TSDL_ResizeEvent = record type_: Byte; w, h: LongInt; end; @@ -249,10 +268,10 @@ SDL_KEYDOWN, SDL_KEYUP: (key: TSDL_KeyboardEvent); SDL_QUITEV: (quit: TSDL_QuitEvent); SDL_VIDEORESIZE: (resize: TSDL_ResizeEvent); - {$IFDEF SDL13} - SDL_MOUSEMOTION: (motion: TSDL_MouseMotionEvent); - {$ENDIF} - end; +{$IFDEF SDL13} + SDL_MOUSEMOTION: (motion: TSDL_MouseMotionEvent); +{$ENDIF} + end; PByteArray = ^TByteArray; TByteArray = array[0..65535] of Byte; @@ -322,7 +341,7 @@ function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; -function SDL_GL_SetAttribute(attr: byte; value: LongInt): LongInt; cdecl; external SDLLibName; +function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName; procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName; (* TTF *) diff -r bf0b59d3536a -r 03fd99dff989 hedgewars/hwengine.dpr --- a/hedgewars/hwengine.dpr Fri Jul 10 19:10:29 2009 +0000 +++ b/hedgewars/hwengine.dpr Sat Jul 11 13:47:57 2009 +0000 @@ -243,6 +243,30 @@ for p:= Succ(Low(TPathType)) to High(TPathType) do if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] end; + {$IFDEF IPHONEOS} + 0: begin + PathPrefix:= 'hedgewars/Data'; + recordFileName:= 'hedgewars/save.hws'; + val('320', cScreenWidth); + val('480', cScreenHeight); + cInitWidth:= cScreenWidth; + cInitHeight:= cScreenHeight; + cBitsStr:= '32'; + val(cBitsStr, cBits); + val('100', cInitVolume); + isMusicEnabled:= false; + isSoundEnabled:= false; + cLocaleFName:= 'en.txt'; + cFullScreen:= false; + cAltDamage:= false; + cShowFPS:= false; + val('8', cTimerInterval); + cReducedQuality:= false; + + for p:= Succ(Low(TPathType)) to High(TPathType) do + if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] + end; + {$ENDIF} 3: begin val(ParamStr(2), ipcPort); GameType:= gmtLandPreview; diff -r bf0b59d3536a -r 03fd99dff989 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Fri Jul 10 19:10:29 2009 +0000 +++ b/hedgewars/uStore.pas Sat Jul 11 13:47:57 2009 +0000 @@ -959,6 +959,7 @@ procedure SetupOpenGL; begin SetScale(2.0); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glMatrixMode(GL_MODELVIEW); @@ -966,6 +967,7 @@ {$IFDEF DEBUGFILE} AddFileLog('GL_MAX_TEXTURE_SIZE: ' + inttostr(MaxTextureSize)); {$ENDIF} + end; procedure SetScale(f: GLfloat);