Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vsimage.cpp File Reference
#include "vsimage.h"
#include <GL/glut.h>
#include <GL/glext.h>
#include "cmd/unit_generic.h"
#include "vsfilesystem.h"
#include "vs_globals.h"
#include <png.h>
#include "posh.h"
#include "gfx/jpeg_memory.h"
#include <iostream>

Go to the source code of this file.

Classes

struct  my_error_mgr
 

Macros

#define png_jmpbuf(png_ptr)   ( (png_ptr)->jmpbuf )
 
#define DDS_CUBEMAP   0x00000200L
 
#define DDS_CUBEMAP_POSITIVEX   0x00000400L
 
#define DDS_CUBEMAP_NEGATIVEX   0x00000800L
 
#define DDS_CUBEMAP_POSITIVEY   0x00001000L
 
#define DDS_CUBEMAP_NEGATIVEY   0x00002000L
 
#define DDS_CUBEMAP_POSITIVEZ   0x00004000L
 
#define DDS_CUBEMAP_NEGATIVEZ   0x00008000L
 
#define DDS_CUBEMAP_ALLFACES
 
#define IS_POT(x)   ( !( (x)& ( (x)-1 ) ) )
 

Functions

 LOCALCONST_DEF (VSImage, int, SIZEOF_BITMAPFILEHEADER, sizeof(WORD)+sizeof(DWORD)+sizeof(WORD)+sizeof(WORD)+sizeof(DWORD)) LOCALCONST_DEF(VSImage
 
 sizeof (DWORD)+sizeof(LONG)+sizeof(LONG)+2 *sizeof(WORD)+2 *sizeof(DWORD)+2 *sizeof(LONG)+2 *sizeof(DWORD)) LOCALCONST_DEF(VSImage
 
 sizeof (BYTE)*4) VSImage
 
void PngReadFunc (png_struct *Png, png_bytep buf, png_size_t size)
 
static void png_cexcept_error (png_structp png_ptr, png_const_charp msg)
 
 METHODDEF (void) my_error_exit(j_common_ptr cinfo)
 

Variables

int PNG_HAS_PALETTE = 1
 
int PNG_HAS_COLOR = 2
 
int PNG_HAS_ALPHA = 4
 
 int
 
 SIZEOF_BITMAPINFOHEADER
 
 SIZEOF_RGBQUAD
 

Macro Definition Documentation

#define DDS_CUBEMAP   0x00000200L

Definition at line 34 of file vsimage.cpp.

#define DDS_CUBEMAP_NEGATIVEX   0x00000800L

Definition at line 36 of file vsimage.cpp.

#define DDS_CUBEMAP_NEGATIVEY   0x00002000L

Definition at line 38 of file vsimage.cpp.

#define DDS_CUBEMAP_NEGATIVEZ   0x00008000L

Definition at line 40 of file vsimage.cpp.

#define DDS_CUBEMAP_POSITIVEX   0x00000400L

Definition at line 35 of file vsimage.cpp.

#define DDS_CUBEMAP_POSITIVEY   0x00001000L

Definition at line 37 of file vsimage.cpp.

#define DDS_CUBEMAP_POSITIVEZ   0x00004000L

Definition at line 39 of file vsimage.cpp.

#define IS_POT (   x)    ( !( (x)& ( (x)-1 ) ) )

Definition at line 629 of file vsimage.cpp.

#define png_jmpbuf (   png_ptr)    ( (png_ptr)->jmpbuf )

Definition at line 19 of file vsimage.cpp.

Function Documentation

METHODDEF ( void  )

Definition at line 401 of file vsimage.cpp.

References my_error_mgr::setjmp_buffer.

402 {
403  //cinfo->err really points to a my_error_mgr struct, so coerce pointer
404  my_error_mgr *myerr = (my_error_mgr*) cinfo->err;
405 
406  //Always display the message.
407  //We could postpone this until after returning, if we chose.
408  (*cinfo->err->output_message)( cinfo );
409 
410  //Return control to the setjmp point
411  longjmp( myerr->setjmp_buffer, 1 );
412 }
static void png_cexcept_error ( png_structp  png_ptr,
png_const_charp  msg 
)
static

Definition at line 240 of file vsimage.cpp.

References VSFileSystem::vs_dprintf().

241 {
242  if (png_ptr)
243  ;
244 #ifndef PNG_NO_CONSOLE_IO
245  vs_dprintf(1,"libpng error: %s\n",msg);
246 #endif
247 }
void PngReadFunc ( png_struct *  Png,
png_bytep  buf,
png_size_t  size 
)

Definition at line 225 of file vsimage.cpp.

References TPngFileBuffer::Buffer, VsnetOSS::memcpy(), TPngFileBuffer::Pos, size, and VSFileSystem::vs_dprintf().

226 {
227  vs_dprintf(3,"Preparing to copy %u bytes from PngFileBuffer\n");
228  TPngFileBuffer *PngFileBuffer = (TPngFileBuffer*) png_get_io_ptr( Png );
229  memcpy( buf, PngFileBuffer->Buffer+PngFileBuffer->Pos, size );
230  PngFileBuffer->Pos += size;
231 }
sizeof ( BYTE  )

Definition at line 64 of file vsimage.cpp.

65 {
66  this->img_depth = 8;
67  this->img_color_type = 8;
68  this->sizeY = 1;
69  this->sizeX = 1;
70  this->Init();
71  this->mode = _24BIT;
72 }

Variable Documentation

ZenergyPercent tertiary Missile level destination cloak targ unsigned OnlyCollideWithTarget aiscript pos axis Vforce Location torque amt amt v index role role acootuallydock factionname hull int

Definition at line 62 of file vsimage.cpp.

Referenced by quadsquare::AddHeightMapAux(), AddMounts(), NetClient::AddObjects(), FSM::Node::AddSound(), StarSystem::AddUnit(), apply_float_to_unsigned_int(), BeamXML::beginElement(), StarSystemGent::beginStar(), biModifyMouseSensitivity(), bootstrap_main_loop(), ROLES::buildroles(), VsnetDownload::Client::Item::changeState(), ChooseNavPoint(), CLAMP_UINT(), BaseInterface::Room::Click(), StarDate::ConvertFullTrekDate(), decode_dxt5_alpha(), ROLES::discreteLog(), double_to_int(), DownSampleTexture(), TextInputDisplay::draw(), HaloSystem::Draw(), VDU::Draw(), GameUnit< UnitType >::Draw(), GFXVertexList::Draw(), NavigationSystem::DrawMission(), GameUnit< UnitType >::DrawNow(), PacketMem::dump(), Unit::EjectCargo(), BaseUtil::EraseLink(), BaseUtil::EraseObj(), PlanetaryOrbit::Execute(), Orders::FireAt::Execute(), navscreenoccupied::findfreefloat(), flickerDamage(), float_to_int(), g(), generateStarSystem(), get_alpha(), Unit::GetCargo(), GetColorFromSuccess(), Pilot::getCommFace(), FSM::getCommMessageMood(), quadsquare::GetHeight(), GFXVertexList::GetIndex(), Mesh::getLOD(), SaveNetUtil::GetSaveBuffer(), FSM::Node::GetSound(), GFXCircle(), GFXGetFramerate(), GFXSetMaterial(), gluSphereMap(), Music::GotoSong(), HSV_To_RGB(), LaunchOneParticle(), Mesh::LoadMeshes(), Unit::LoadRow(), loadStringList(), AnimatedTexture::LoadVideoSource(), main(), AnimatedTexture::MakeActive(), MatchingMood(), BaseComputer::maxQuantityForPlayer(), Packet::Packet(), PlayMusic(), prettyPrintFloat(), processDelayedMissions(), randInt(), GFXVertexList::RefreshDisplayList(), Briefing::Ship::Render(), VsnetHTTPSocket::reopenConnection(), VsnetHTTPSocket::resendData(), ScoreKill(), Orders::FireAt::ShouldFire(), shouldreflect(), BaseComputer::showPlayerInfo(), Spherize(), GameUnit< UnitType >::Split(), FSM::Node::StopSound(), Audio::Test::testMultiStreaming(), Audio::Test::testMultiStreaming2(), Audio::Test::testStreaming(), Unit::UpdatePhysics(), Unit::UpdateSubunitPhysics(), StarSystem::UpdateUnitPhysics(), Unit::UpgradeMounts(), and VsnetDownload::Client::VSNotify().

int PNG_HAS_ALPHA = 4

Definition at line 58 of file vsimage.cpp.

Referenced by LoadTex(), and texTransform().

int PNG_HAS_COLOR = 2

Definition at line 57 of file vsimage.cpp.

Referenced by LoadTex(), and texTransform().

int PNG_HAS_PALETTE = 1

Definition at line 56 of file vsimage.cpp.

Referenced by texTransform().

SIZEOF_BITMAPINFOHEADER

Definition at line 62 of file vsimage.cpp.

SIZEOF_RGBQUAD

Definition at line 64 of file vsimage.cpp.