~ubuntu-branches/ubuntu/natty/spring/natty

« back to all changes in this revision

Viewing changes to rts/Rendering/Textures/3DOTextureHandler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-09-23 18:56:03 UTC
  • mfrom: (3.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20100923185603-st97s5chplo42y7w
Tags: 0.82.5.1+dfsg1-1ubuntu1
* Latest upstream version for online play
* debian/control: Replace (rather than conflict) spring-engine
  - spring-engine will be a dummy package (LP: #612905)
  - also set maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// 3DOTextureHandler.cpp: implementation of the C3DOTextureHandler class.
2
 
//
3
 
//////////////////////////////////////////////////////////////////////
 
1
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
4
2
 
5
3
#include "StdAfx.h"
6
4
 
11
9
#include "mmgr.h"
12
10
 
13
11
#include "3DOTextureHandler.h"
14
 
#include "FileSystem/FileHandler.h"
15
 
#include "FileSystem/SimpleParser.h"
16
 
#include "LogOutput.h"
17
 
#include "Platform/errorhandler.h"
18
12
#include "Rendering/ShadowHandler.h"
 
13
#include "Rendering/UnitDrawer.h"
19
14
#include "Rendering/Textures/Bitmap.h"
20
 
#include "Rendering/UnitModels/UnitDrawer.h"
21
15
#include "TAPalette.h"
 
16
#include "System/Exceptions.h"
 
17
#include "System/LogOutput.h"
22
18
#include "System/Util.h"
23
 
#include "System/Exceptions.h"
 
19
#include "System/Vec2.h"
 
20
#include "System/FileSystem/FileHandler.h"
 
21
#include "System/FileSystem/SimpleParser.h"
 
22
 
24
23
 
25
24
//////////////////////////////////////////////////////////////////////
26
25
// Construction/Destruction
124
123
        } else {
125
124
                bigTexX=2048;
126
125
                bigTexY=2048;
127
 
                handleerror(0,"Too many/large unit textures to fit in 2048*2048","Error",0);
 
126
                throw content_error("Too many/large texture in 3do textureatlas to fit in 2048*2048");
128
127
        }
129
128
 
130
129
        qsort(texfiles,numfiles,sizeof(TexFile*),CompareTatex2);
161
160
                                        cury=maxy;
162
161
                                        maxy+=curtex1->ysize;
163
162
                                        if(maxy>bigTexY){
164
 
                                                handleerror(0,"Too many/large unit textures","Error",0);
 
163
                                                throw content_error("Too many/large texture in 3do textureatlas to fit in 2048*2048");
165
164
                                                break;
166
165
                                        }
167
166
                                        thisSub.push_back(int2(0,cury));
265
264
        if((tti=textures.find(name))!=textures.end()){
266
265
                return tti->second;
267
266
        }
268
 
        LogObject() << "Unknown texture " << name.c_str() << "\n";
 
267
        LogObject() << "unknown 3DO texture " << name.c_str() << "\n";
269
268
        return textures[" "];
270
269
}
271
270