diff --git a/AnimationInfo.cpp b/AnimationInfo.cpp index 069c5026..168f604a 100644 --- a/AnimationInfo.cpp +++ b/AnimationInfo.cpp @@ -330,7 +330,7 @@ SDL_Rect AnimationInfo::findOpaquePoint(SDL_Rect *clip) //find the first opaque-enough pixel position for transbtn { int cell_width = image_surface->w/num_of_cells; - SDL_Rect cliprect = {0, 0, cell_width, image_surface->h}; + SDL_Rect cliprect = {0, 0, (Uint16)cell_width, (Uint16)image_surface->h}; if (clip) cliprect = *clip; #ifdef BPP16 @@ -409,7 +409,7 @@ void AnimationInfo::blendOnSurface( SDL_Surface *dst_surface, int dst_x, int dst if ( image_surface == NULL ) return; if ( alpha == 0 ) return; - SDL_Rect dst_rect = {dst_x, dst_y, pos.w, pos.h}, src_rect; + SDL_Rect dst_rect = {(Sint16)dst_x, (Sint16)dst_y, pos.w, pos.h}, src_rect; if ( doClipping( &dst_rect, &clip, &src_rect ) ) return; /* ---------------------------------------- */ @@ -669,7 +669,7 @@ void AnimationInfo::blendText( SDL_Surface *surface, int dst_x, int dst_y, { if (image_surface == NULL || surface == NULL) return; - SDL_Rect dst_rect = {dst_x, dst_y, surface->w, surface->h}; + SDL_Rect dst_rect = {(Sint16)dst_x, (Sint16)dst_y, (Uint16)surface->w, (Uint16)surface->h}; if (rotate_flag){ dst_rect.w = surface->h; dst_rect.h = surface->w; @@ -688,7 +688,7 @@ void AnimationInfo::blendText( SDL_Surface *surface, int dst_x, int dst_y, /* ---------------------------------------- */ /* 2nd clipping */ - SDL_Rect clip_rect = {0, 0, image_surface->w, image_surface->h}; + SDL_Rect clip_rect = {0, 0, (Uint16)image_surface->w, (Uint16)image_surface->h}; if ( doClipping( &dst_rect, &clip_rect, &clipped_rect ) ) return; src_rect.x += clipped_rect.x; @@ -830,10 +830,10 @@ void AnimationInfo::copySurface( SDL_Surface *surface, SDL_Rect *src_rect, SDL_R { if (!image_surface || !surface) return; - SDL_Rect _dst_rect = {0, 0, image_surface->w, image_surface->h}; + SDL_Rect _dst_rect = {0, 0, (Uint16)image_surface->w, (Uint16)image_surface->h}; if (dst_rect) _dst_rect = *dst_rect; - SDL_Rect _src_rect = {0, 0, surface->w, surface->h}; + SDL_Rect _src_rect = {0, 0, (Uint16)surface->w, (Uint16)surface->h}; if (src_rect) _src_rect = *src_rect; if (_src_rect.x >= surface->w) return; diff --git a/Layer.cpp b/Layer.cpp index 36802512..909b43fe 100644 --- a/Layer.cpp +++ b/Layer.cpp @@ -232,7 +232,7 @@ void OldMovieLayer::om_init() // Generate scanlines of solid greyscale, used for the glow effect. GlowSurface = AnimationInfo::allocSurface(width, MAX_GLOW); - for (SDL_Rect r = { 0, 0, width, 1 }; r.y < MAX_GLOW; r.y++) { + for (SDL_Rect r = { 0, 0, (Uint16)width, 1 }; r.y < MAX_GLOW; r.y++) { const int ry = (r.y * 30 / MAX_GLOW) + 4; SDL_FillRect(GlowSurface, &r, SDL_MapRGB(GlowSurface->format, ry, ry, ry)); } diff --git a/ONScripterLabel.cpp b/ONScripterLabel.cpp index ddf1ae55..622e7a95 100644 --- a/ONScripterLabel.cpp +++ b/ONScripterLabel.cpp @@ -1302,7 +1302,6 @@ int ONScripterLabel::init() // ---------------------------------------- // Sound related variables - this->cdaudio_flag = cdaudio_flag; if ( cdaudio_flag ){ if ( cdrom_drive_number >= 0 && cdrom_drive_number < SDL_CDNumDrives() ) cdrom_info = SDL_CDOpen( cdrom_drive_number ); @@ -2294,7 +2293,7 @@ void ONScripterLabel::displayTextWindow( SDL_Surface *surface, SDL_Rect &clip ) { if ( current_font->is_transparent ){ - SDL_Rect rect = {0, 0, screen_width, screen_height}; + SDL_Rect rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; if ( current_font == &sentence_font ) rect = sentence_font_info.pos; diff --git a/ONScripterLabel_command.cpp b/ONScripterLabel_command.cpp index 39f21c7a..c03bdde0 100644 --- a/ONScripterLabel_command.cpp +++ b/ONScripterLabel_command.cpp @@ -2054,7 +2054,7 @@ int ONScripterLabel::menu_windowCommand() #ifndef PSP if (async_movie) SMPEG_pause( async_movie ); screen_surface = SDL_SetVideoMode( screen_width, screen_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG ); - SDL_Rect rect = {0, 0, screen_width, screen_height}; + SDL_Rect rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; flushDirect( rect, refreshMode() ); if (async_movie){ SMPEG_setdisplay( async_movie, screen_surface, NULL, NULL ); @@ -2096,7 +2096,7 @@ int ONScripterLabel::menu_fullCommand() screen_surface = SDL_SetVideoMode( screen_width, screen_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG ); fullscreen_mode = false; } - SDL_Rect rect = {0, 0, screen_width, screen_height}; + SDL_Rect rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; flushDirect( rect, refreshMode() ); if (async_movie){ SMPEG_setdisplay( async_movie, screen_surface, NULL, NULL ); @@ -3639,7 +3639,7 @@ int ONScripterLabel::dvCommand() int ONScripterLabel::drawtextCommand() { - SDL_Rect clip = {0, 0, accumulation_surface->w, accumulation_surface->h}; + SDL_Rect clip = {0, 0, (Uint16)accumulation_surface->w, (Uint16)accumulation_surface->h}; text_info.blendOnSurface( accumulation_surface, 0, 0, clip ); return RET_CONTINUE; @@ -3671,7 +3671,7 @@ int ONScripterLabel::drawsp3Command() si.inv_mat[1][1] = si.mat[0][0] * 1000 / denom; } - SDL_Rect clip = {0, 0, screen_surface->w, screen_surface->h}; + SDL_Rect clip = {0, 0, (Uint16)screen_surface->w, (Uint16)screen_surface->h}; si.blendOnSurface2( accumulation_surface, x, y, clip, alpha ); si.setCell(old_cell_no); @@ -3694,7 +3694,7 @@ int ONScripterLabel::drawsp2Command() si.calcAffineMatrix(); si.setCell(cell_no); - SDL_Rect clip = {0, 0, screen_surface->w, screen_surface->h}; + SDL_Rect clip = {0, 0, (Uint16)screen_surface->w, (Uint16)screen_surface->h}; si.blendOnSurface2( accumulation_surface, si.pos.x, si.pos.y, clip, alpha ); return RET_CONTINUE; @@ -3711,7 +3711,7 @@ int ONScripterLabel::drawspCommand() AnimationInfo &si = sprite_info[sprite_no]; int old_cell_no = si.current_cell; si.setCell(cell_no); - SDL_Rect clip = {0, 0, accumulation_surface->w, accumulation_surface->h}; + SDL_Rect clip = {0, 0, (Uint16)accumulation_surface->w, (Uint16)accumulation_surface->h}; si.blendOnSurface( accumulation_surface, x, y, clip, alpha ); si.setCell(old_cell_no); @@ -3738,7 +3738,7 @@ int ONScripterLabel::drawclearCommand() int ONScripterLabel::drawbgCommand() { - SDL_Rect clip = {0, 0, accumulation_surface->w, accumulation_surface->h}; + SDL_Rect clip = {0, 0, (Uint16)accumulation_surface->w, (Uint16)accumulation_surface->h}; bg_info.blendOnSurface( accumulation_surface, bg_info.pos.x, bg_info.pos.y, clip ); return RET_CONTINUE; @@ -3755,7 +3755,7 @@ int ONScripterLabel::drawbg2Command() bi.rot = script_h.readInt(); bi.calcAffineMatrix(); - SDL_Rect clip = {0, 0, screen_surface->w, screen_surface->h}; + SDL_Rect clip = {0, 0, (Uint16)screen_surface->w, (Uint16)screen_surface->h}; bi.blendOnSurface2( accumulation_surface, bi.pos.x, bi.pos.y, clip, 256 ); @@ -3764,7 +3764,7 @@ int ONScripterLabel::drawbg2Command() int ONScripterLabel::drawCommand() { - SDL_Rect rect = {0, 0, screen_width, screen_height}; + SDL_Rect rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; flushDirect( rect, REFRESH_NONE_MODE ); dirty_rect.clear(); @@ -4239,7 +4239,7 @@ int ONScripterLabel::btnwaitCommand() if (txtbtn_show) txtbtn_visible = true; if (is_exbtn_enabled && exbtn_d_button_link.exbtn_ctl){ - SDL_Rect check_src_rect = {0, 0, screen_width, screen_height}; + SDL_Rect check_src_rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; decodeExbtnControl( exbtn_d_button_link.exbtn_ctl, &check_src_rect ); } @@ -4485,8 +4485,8 @@ int ONScripterLabel::bltCommand() if ( sw == dw && sw > 0 && sh == dh && sh > 0 ){ - SDL_Rect src_rect = {sx,sy,sw,sh}; - SDL_Rect dst_rect = {dx,dy,dw,dh}; + SDL_Rect src_rect = {(Sint16)sx,(Sint16)sy,(Uint16)sw,(Uint16)sh}; + SDL_Rect dst_rect = {(Sint16)dx,(Sint16)dy,(Uint16)dw,(Uint16)dh}; SDL_BlitSurface( btndef_info.image_surface, &src_rect, screen_surface, &dst_rect ); SDL_UpdateRect( screen_surface, dst_rect.x, dst_rect.y, dst_rect.w, dst_rect.h ); @@ -4538,7 +4538,7 @@ int ONScripterLabel::bltCommand() SDL_UnlockSurface(btndef_info.image_surface); SDL_UnlockSurface(accumulation_surface); - SDL_Rect dst_rect = {start_x, start_y, end_x-start_x, end_y-start_y}; + SDL_Rect dst_rect = {(Sint16)start_x, (Sint16)start_y, (Uint16)(end_x-start_x), (Uint16)(end_y-start_y)}; flushDirect( (SDL_Rect&)dst_rect, REFRESH_NONE_MODE ); } diff --git a/ONScripterLabel_effect.cpp b/ONScripterLabel_effect.cpp index 9a15dddb..101f454a 100644 --- a/ONScripterLabel_effect.cpp +++ b/ONScripterLabel_effect.cpp @@ -159,9 +159,9 @@ bool ONScripterLabel::doEffect( EffectLink *effect, bool clear_dirty_region ) int i, amp; int width, width2; int height, height2; - SDL_Rect src_rect={0, 0, screen_width, screen_height}; - SDL_Rect dst_rect={0, 0, screen_width, screen_height}; - SDL_Rect quake_rect={0, 0, screen_width, screen_height}; + SDL_Rect src_rect={0, 0, (Uint16)screen_width, (Uint16)screen_height}; + SDL_Rect dst_rect={0, 0, (Uint16)screen_width, (Uint16)screen_height}; + SDL_Rect quake_rect={0, 0, (Uint16)screen_width, (Uint16)screen_height}; /* ---------------------------------------- */ /* Execute effect */ diff --git a/ONScripterLabel_effect_breakup.cpp b/ONScripterLabel_effect_breakup.cpp index 4d3323a9..d6c9e497 100644 --- a/ONScripterLabel_effect_breakup.cpp +++ b/ONScripterLabel_effect_breakup.cpp @@ -255,8 +255,8 @@ void ONScripterLabel::effectBreakup( char *params, int duration ) bool *msk_buf = breakup_cellforms; for (int n=0; n= (BREAKUP_MOVE_FRAMES + BREAKUP_STILL_STATE)) { diff --git a/ONScripterLabel_effect_cascade.cpp b/ONScripterLabel_effect_cascade.cpp index 40f9809a..c9c8c495 100644 --- a/ONScripterLabel_effect_cascade.cpp +++ b/ONScripterLabel_effect_cascade.cpp @@ -40,8 +40,8 @@ void ONScripterLabel::effectCascade( char *params, int duration ) }; SDL_Surface *src_surface, *dst_surface; - SDL_Rect src_rect={0, 0, screen_width, screen_height}; - SDL_Rect dst_rect={0, 0, screen_width, screen_height}; + SDL_Rect src_rect={0, 0, (Uint16)screen_width, (Uint16)screen_height}; + SDL_Rect dst_rect={0, 0, (Uint16)screen_width, (Uint16)screen_height}; int mode, width, start, end; if (params[0] == 'u') diff --git a/ONScripterLabel_effect_trig.cpp b/ONScripterLabel_effect_trig.cpp index 8f109d96..a58eb432 100644 --- a/ONScripterLabel_effect_trig.cpp +++ b/ONScripterLabel_effect_trig.cpp @@ -62,8 +62,8 @@ void ONScripterLabel::effectTrvswave( char *params, int duration ) TRVSWAVE_WVLEN_START = 256 }; - SDL_Rect src_rect={0, 0, screen_width, 1}; - SDL_Rect dst_rect={0, 0, screen_width, 1}; + SDL_Rect src_rect={0, 0, (Uint16)screen_width, 1}; + SDL_Rect dst_rect={0, 0, (Uint16)screen_width, 1}; int ampl, wvlen; int y_offset = -screen_height / 2; int width = 256 * effect_counter / duration; diff --git a/ONScripterLabel_image.cpp b/ONScripterLabel_image.cpp index 0d09ce3b..f6b7be21 100644 --- a/ONScripterLabel_image.cpp +++ b/ONScripterLabel_image.cpp @@ -291,7 +291,7 @@ void ONScripterLabel::effectBlend( SDL_Surface *mask_surface, int trans_mode, Uint32 mask_value, SDL_Rect *clip, SDL_Surface *src1, SDL_Surface *src2, SDL_Surface *dst ) { - SDL_Rect rect = {0, 0, screen_width, screen_height}; + SDL_Rect rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; if (src1 == NULL) src1 = effect_src_surface; @@ -412,7 +412,7 @@ void ONScripterLabel::alphaBlendText( SDL_Surface *dst_surface, SDL_Rect dst_rec /* ---------------------------------------- */ /* 2nd clipping */ - SDL_Rect clip_rect = {0, 0, dst_surface->w, dst_surface->h}; + SDL_Rect clip_rect = {0, 0, (Uint16)dst_surface->w, (Uint16)dst_surface->h}; if ( AnimationInfo::doClipping( &dst_rect, &clip_rect, &clipped_rect ) ) return; x2 += clipped_rect.x; @@ -500,7 +500,7 @@ void ONScripterLabel::refreshSurface( SDL_Surface *surface, SDL_Rect *clip_src, { if (refresh_mode == REFRESH_NONE_MODE) return; - SDL_Rect clip = {0, 0, surface->w, surface->h}; + SDL_Rect clip = {0, 0, (Uint16)surface->w, (Uint16)surface->h}; if (clip_src) if ( AnimationInfo::doClipping( &clip, clip_src ) ) return; int i, top; @@ -670,8 +670,8 @@ void ONScripterLabel::createBackground() bg_info.fill(0, 0, 0, 0xff); if (anim.image_surface){ - SDL_Rect src_rect = {0, 0, anim.image_surface->w, anim.image_surface->h}; - SDL_Rect dst_rect = {0, 0, screen_width, screen_height}; + SDL_Rect src_rect = {0, 0, (Uint16)anim.image_surface->w, (Uint16)anim.image_surface->h}; + SDL_Rect dst_rect = {0, 0, (Uint16)screen_width, (Uint16)screen_height}; if (screen_width >= anim.image_surface->w){ dst_rect.x = (screen_width - anim.image_surface->w) / 2; }