Skip to content

Commit

Permalink
Fixed crash introduced by my prev commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pelya committed Jun 10, 2010
1 parent a2a899e commit 80a6d34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion alienblaster/AppSettings.cfg
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion alienblaster/project/AndroidManifest.xml
Expand Up @@ -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" />
Expand Down
12 changes: 8 additions & 4 deletions alienblaster/project/jni/sdl/src/video/SDL_video.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 80a6d34

Please sign in to comment.