1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "VideoModes.h"
28 VideoModes::VideoModes(void)
32 VideoModes::~VideoModes(void)
36 int VideoModes::AddVideoMode(int w
, int h
, int bpp
, bool fs
, bool checkUnique
)
38 VideoMode
vm( w
, h
, bpp
, fs
);
40 for (unsigned int i
= 0; i
< modes
.size(); i
++) {
46 modes
.push_back( vm
);
50 int VideoModes::FindVideoMode(VideoMode
& vm
)
52 for (unsigned int i
= 0; i
< modes
.size(); i
++) {
60 void VideoModes::RemoveEntry(unsigned int n
)
62 if (n
>= modes
.size()) {
65 vector
< VideoMode
>::iterator m
= modes
.begin();
70 void VideoModes::Empty(void)
72 vector
< VideoMode
>::iterator m
;
73 for (m
= modes
.begin(); m
!= modes
.end(); ++m
) {
78 VideoMode
VideoModes::operator[](unsigned int n
)
80 if (n
>= modes
.size()) {
86 unsigned int VideoModes::Count(void)
88 return (unsigned int) modes
.size();