Fixed crash introduced by my prev commit

This commit is contained in:
pelya
2010-06-10 18:56:52 +03:00
parent a2a899eecf
commit 80a6d34cd3
3 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
AppName="Alien Blaster"
AppFullName=de.schwardtnet.alienblaster
ScreenOrientation=v
ScreenOrientation=h
AppDataDownloadUrl="http://sites.google.com/site/xpelyax/Home/alienblaster110_data.zip?attredirects=0&d=1"
DownloadToSdcard=n
SdlVideoResize=y

View File

@@ -6,7 +6,7 @@
<application android:label="@string/app_name">
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@@ -2683,10 +2683,10 @@ SDL_RenderCopy(SDL_Texture * texture, const SDL_Rect * srcrect,
SDL_Rect real_srcrect;
SDL_Rect real_dstrect;
#if SDL_VIDEO_RENDER_RESIZE
int realW = window->display->current_mode.w;
int realH = window->display->current_mode.h;
int fakeW = window->w;
int fakeH = window->h;
int realW;
int realH;
int fakeW;
int fakeH;
#endif
CHECK_TEXTURE_MAGIC(texture, -1);
@@ -2739,6 +2739,10 @@ SDL_RenderCopy(SDL_Texture * texture, const SDL_Rect * srcrect,
}
#if SDL_VIDEO_RENDER_RESIZE
realW = window->display->current_mode.w;
realH = window->display->current_mode.h;
fakeW = window->w;
fakeH = window->h;
if( fakeW > realW || fakeH > realH ) {
real_dstrect.x = real_dstrect.x * realW / fakeW;
real_dstrect.y = real_dstrect.y * realH / fakeH;