____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <png.h>
#include "stratagus.h"
#include "video.h"
#include "iolib.h"
#include "iocompat.h"
Go to the source code of this file.
Functions | |
| static void | CL_png_read_data (png_structp png_ptr, png_bytep data, png_size_t length) |
| int | LoadGraphicPNG (CGraphic *g) |
| Make an OpenGL texture. | |
| void | SaveScreenshotPNG (const std::string &name) |
| Set the current callbacks. | |
Definition in file png.cpp.
| static void CL_png_read_data | ( | png_structp | png_ptr, | |
| png_bytep | data, | |||
| png_size_t | length | |||
| ) | [static] |
png read callback for CL-IO.
| png_ptr | png struct pointer. | |
| data | byte address to read to. | |
| length | number of bytes to read. |
Definition at line 60 of file png.cpp.
References CFile::read().
Referenced by LoadGraphicPNG().
| int LoadGraphicPNG | ( | CGraphic * | g | ) |
Make an OpenGL texture.
Load a png graphic file. Modified function from SDL_Image
| g | graphic to load. |
Definition at line 81 of file png.cpp.
References CL_OPEN_READ, CL_png_read_data(), CFile::close(), CGraphic::File, CGraphic::GraphicHeight, CGraphic::GraphicWidth, int(), LibraryFileName(), CFile::open(), and CGraphic::Surface.
Referenced by CGraphic::Load().
| void SaveScreenshotPNG | ( | const std::string & | name | ) |
Set the current callbacks.
Save a screenshot to a PNG file.
| name | PNG filename to save. |
Definition at line 314 of file png.cpp.
References CVideo::Depth, CVideo::Height, CVideo::LockScreen(), TheScreen, CVideo::UnlockScreen(), UseOpenGL, Video, and CVideo::Width.
Referenced by Screenshot().
1.5.6