diff options
-rw-r--r-- | image.c | 18 | ||||
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | navigator.c | 1 | ||||
-rw-r--r-- | texture.c | 2 | ||||
-rw-r--r-- | texture.h | 22 | ||||
-rw-r--r-- | viewport.c | 4 |
6 files changed, 26 insertions, 27 deletions
@@ -87,13 +87,13 @@ int imv_image_load(struct imv_image *img, const char* path) } img->num_frames = FreeImage_GetPageCount(img->mbmp); - //get the dimensions from the first frame + /* get the dimensions from the first frame */ FIBITMAP *frame = FreeImage_LockPage(img->mbmp, 0); img->width = FreeImage_GetWidth(frame); img->height = FreeImage_GetHeight(frame); FreeImage_UnlockPage(img->mbmp, frame, 0); - //load a frame + /* load a frame */ imv_image_load_next_frame(img); } else { FIBITMAP *image = FreeImage_Load(fmt, path, 0); @@ -127,7 +127,7 @@ void imv_image_load_next_frame(struct imv_image *img) FIBITMAP *frame32 = FreeImage_ConvertTo32Bits(frame); FreeImage_FlipVertical(frame32); - //First frame is always going to use the raw frame + /* First frame is always going to use the raw frame */ if(img->cur_frame > 0) { FreeImage_GetMetadata(FIMD_ANIMATION, frame, "DisposalMethod", &tag); if(FreeImage_GetTagValue(tag)) { @@ -154,7 +154,7 @@ void imv_image_load_next_frame(struct imv_image *img) FreeImage_UnlockPage(img->mbmp, frame, 0); - //If this frame is inset, we need to expand it for compositing + /* If this frame is inset, we need to expand it for compositing */ if(left != 0 || top != 0) { RGBQUAD color = {0,0,0,0}; FIBITMAP *expanded = FreeImage_EnlargeCanvas(frame32, @@ -169,13 +169,13 @@ void imv_image_load_next_frame(struct imv_image *img) } switch(disposal_method) { - case 0: //nothing specified, just use the raw frame + case 0: /* nothing specified, just use the raw frame */ if(img->cur_bmp) { FreeImage_Unload(img->cur_bmp); } img->cur_bmp = frame32; break; - case 1: //composite over previous frame + case 1: /* composite over previous frame */ if(img->cur_bmp && img->cur_frame > 0) { FIBITMAP *bg_frame = FreeImage_ConvertTo24Bits(img->cur_bmp); FreeImage_Unload(img->cur_bmp); @@ -184,16 +184,16 @@ void imv_image_load_next_frame(struct imv_image *img) FreeImage_Unload(frame32); img->cur_bmp = comp; } else { - //No previous frame, just render directly + /* No previous frame, just render directly */ if(img->cur_bmp) { FreeImage_Unload(img->cur_bmp); } img->cur_bmp = frame32; } break; - case 2: //TODO - set to background, composite over that + case 2: /* TODO - set to background, composite over that */ break; - case 3: //TODO - restore to previous content + case 3: /* TODO - restore to previous content */ break; } } @@ -150,7 +150,7 @@ int main(int argc, char** argv) SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); - //Use linear sampling for scaling + /* Use linear sampling for scaling */ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); struct imv_image img; @@ -162,7 +162,7 @@ int main(int argc, char** argv) struct imv_viewport view; imv_init_viewport(&view, window); - //Put us in fullscren by default if requested + /* Put us in fullscren by default if requested */ if(g_options.fullscreen) { imv_viewport_toggle_fullscreen(&view); } @@ -244,7 +244,7 @@ int main(int argc, char** argv) SDL_SetWindowTitle(window, (const char*)&title); imv_viewport_reset(&view); } - //Autoscale if requested + /* Autoscale if requested */ if(g_options.autoscale) { imv_viewport_scale_to_window(&view, &img); } diff --git a/navigator.c b/navigator.c index f24b0df..d8336ae 100644 --- a/navigator.c +++ b/navigator.c @@ -49,7 +49,6 @@ void imv_destroy_navigator(struct imv_navigator *nav) nav->num_paths = 0; } -//add a single path item with no other checks static void add_item(struct imv_navigator *nav, const char *path) { struct imv_loop_item *new_item = (struct imv_loop_item*) @@ -52,7 +52,7 @@ int imv_texture_set_image(struct imv_texture *tex, FIBITMAP *image) char* pixels = (char*)FreeImage_GetBits(frame); - //figure out how many chunks are needed, and create them + /* figure out how many chunks are needed, and create them */ if(tex->num_chunks > 0) { for(int i = 0; i < tex->num_chunks; ++i) { SDL_DestroyTexture(tex->chunks[i]); @@ -24,17 +24,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <FreeImage.h> struct imv_texture { - int width; //width of the texture overall - int height; //height of the texture overall - int num_chunks; //number of chunks allocated - SDL_Texture **chunks; //array of chunks - int num_chunks_wide; //number of chunks per row of the image - int num_chunks_tall; //number of chunks per column of the image - int chunk_width; //chunk width - int chunk_height; //chunk height - int last_chunk_width; //width of rightmost chunk - int last_chunk_height; //height of bottommost chunk - SDL_Renderer *renderer; //SDL renderer to draw to + int width; /* width of the texture overall */ + int height; /* height of the texture overall */ + int num_chunks; /* number of chunks allocated */ + SDL_Texture **chunks; /* array of chunks */ + int num_chunks_wide; /* number of chunks per row of the image */ + int num_chunks_tall; /* number of chunks per column of the image */ + int chunk_width; /* chunk width */ + int chunk_height; /* chunk height */ + int last_chunk_width; /* width of rightmost chunk */ + int last_chunk_height; /* height of bottommost chunk */ + SDL_Renderer *renderer; /* SDL renderer to draw to */ }; void imv_init_texture(struct imv_texture *tex, SDL_Renderer *r); @@ -98,10 +98,10 @@ void imv_viewport_scale_to_window(struct imv_viewport *view, const struct imv_im double image_aspect = (double)img->width / (double)img->height; if(window_aspect > image_aspect) { - //Image will become too tall before it becomes too wide + /* Image will become too tall before it becomes too wide */ view->scale = (double)wh / (double)img->height; } else { - //Image will become too wide before it becomes too tall + /* Image will become too wide before it becomes too tall */ view->scale = (double)ww / (double)img->width; } |