$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/video/png.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <png.h>
#include "stratagus.h"
#include "video.h"
#include "iolib.h"
#include "iocompat.h"

Functions

png.cpp - The png graphic file loader.
static void CL_png_read_data (png_structp png_ptr, png_bytep data, png_size_t length)
int LoadGraphicPNG (CGraphic *g)
 Load graphic from PNG file.
void SaveScreenshotPNG (const char *name)
 Save a screenshot to a PNG file.

Function Documentation

static void CL_png_read_data ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
) [static]

png read callback for CL-IO.

Parameters:
png_ptr png struct pointer.
data byte address to read to.
length number of bytes to read.

int LoadGraphicPNG ( CGraphic g  ) 

Load graphic from PNG file.

Load a png graphic file. Modified function from SDL_Image

Parameters:
g graphic to load.
Returns:
0 for success, -1 for error.

void SaveScreenshotPNG ( const char *  name  ) 

Save a screenshot to a PNG file.

Save a screenshot to a PNG file.

Parameters:
name PNG filename to save.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.