Skip to content

Commit 65a9327

Browse files
committed
- Updated Windows installer.
- Updated Readme. - Fixed Battlescape soldiers starting at the back. - Added scroll wheel and camera movement to Battlescape level changing. - Some cleanup. git-svn-id: https://openxcom.svn.sourceforge.net/svnroot/openxcom/trunk@260 11c4a5ed-7179-4546-81a6-367b3be9d812
1 parent e7a6d4d commit 65a9327

11 files changed

Lines changed: 123 additions & 58 deletions

File tree

README.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,32 @@ contents of your X-Com folder into the DATA subfolder.
5050

5151
Run openxcom to play.
5252

53+
1.4. Options
54+
-------------
55+
You can use the following command-line arguments to
56+
change the game�s internal settings:
57+
58+
"-fullscreen" - starts the game in full-screen mode
59+
instead of in a window.
60+
61+
"-width w -height h" - resizes the game screen to that
62+
resolution. Since the original resolution is tiny, by default
63+
the game runs at 640�400 resolution (2x size). You can
64+
use this to make the game bigger to suit your tastes.
65+
Be careful though, the game will only work in full-screen
66+
if you use a resolution supported by your system.
67+
68+
You can also use the following keyboard shortcuts:
69+
70+
F5 - Saves screenshot to USER folder.
71+
F12 - Turns on/off FPS counter.
72+
ALT-ENTER - Turns on/off fullscreen mode.
73+
74+
You can also use custom music if you have issues with
75+
the default game MIDIs. The game will play any music file
76+
in MIDI, MP3 or OGG format that matches the original filenames
77+
in the Windows version (GMGEO1, GMGEO2, GMSTORY, etc).
78+
5379

5480
2. For developers
5581
===================

install/installer-win32.nsi

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ FunctionEnd
9191
!insertmacro MUI_PAGE_FINISH
9292

9393
!insertmacro MUI_UNPAGE_WELCOME
94+
!insertmacro MUI_UNPAGE_COMPONENTS
9495
!insertmacro MUI_UNPAGE_CONFIRM
9596
!insertmacro MUI_UNPAGE_INSTFILES
9697
!insertmacro MUI_UNPAGE_FINISH
@@ -151,6 +152,22 @@ Section "Game Files" SecMain
151152
CopyFiles /SILENT "$UFODIR\UNITS\*.*" "$INSTDIR\DATA\UNITS" 467
152153

153154
ufo_no:
155+
156+
SetOutPath "$INSTDIR\DATA\Language"
157+
158+
File "..\bin\DATA\Language\English.lng"
159+
File "..\bin\DATA\Language\French.geo"
160+
File "..\bin\DATA\Language\French.lng"
161+
File "..\bin\DATA\Language\German.geo"
162+
File "..\bin\DATA\Language\German.lng"
163+
File "..\bin\DATA\Language\Italian.geo"
164+
File "..\bin\DATA\Language\Italian.lng"
165+
File "..\bin\DATA\Language\Spanish.geo"
166+
File "..\bin\DATA\Language\Spanish.lng"
167+
168+
SetOutPath "$INSTDIR\USER"
169+
170+
File "..\bin\USER\README.txt"
154171

155172
;Store installation folder
156173
WriteRegStr HKLM "Software\${GAME_NAME}" "" $INSTDIR
@@ -204,10 +221,20 @@ SectionEnd
204221
!insertmacro MUI_FUNCTION_DESCRIPTION_END
205222

206223
;--------------------------------
207-
;Uninstaller Section
224+
;Uninstaller Sections
225+
226+
Section /o "un.Delete User Files" UnUser
227+
Delete "$INSTDIR\USER\*.*"
228+
SectionEnd
208229

209-
Section "Uninstall"
230+
Section "un.Delete X-Com Data" UnData
231+
RMDir /r "$INSTDIR\DATA"
232+
SectionEnd
210233

234+
Section "-un.Main"
235+
236+
SetOutPath "$TEMP"
237+
211238
Delete "$INSTDIR\OpenXcom.exe"
212239
Delete "$INSTDIR\libogg-0.dll"
213240
Delete "$INSTDIR\libvorbis-0.dll"
@@ -221,11 +248,24 @@ Section "Uninstall"
221248
Delete "$INSTDIR\msvcr100.dll"
222249
Delete "$INSTDIR\COPYING"
223250
Delete "$INSTDIR\README.txt"
251+
224252
Delete "$INSTDIR\DATA\README.txt"
253+
Delete "$INSTDIR\DATA\Language\English.lng"
254+
Delete "$INSTDIR\DATA\Language\French.geo"
255+
Delete "$INSTDIR\DATA\Language\French.lng"
256+
Delete "$INSTDIR\DATA\Language\German.geo"
257+
Delete "$INSTDIR\DATA\Language\German.lng"
258+
Delete "$INSTDIR\DATA\Language\Italian.geo"
259+
Delete "$INSTDIR\DATA\Language\Italian.lng"
260+
Delete "$INSTDIR\DATA\Language\Spanish.geo"
261+
Delete "$INSTDIR\DATA\Language\Spanish.lng"
262+
RMDir "$INSTDIR\DATA\Language"
263+
RMDir "$INSTDIR\DATA"
264+
265+
Delete "$INSTDIR\USER\README.txt"
266+
RMDir "$INSTDIR\USER"
225267

226268
Delete "$INSTDIR\Uninstall.exe"
227-
228-
RMDir /r "$INSTDIR\DATA"
229269
RMDir "$INSTDIR"
230270

231271
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
@@ -242,6 +282,19 @@ Section "Uninstall"
242282

243283
SectionEnd
244284

285+
;--------------------------------
286+
;Uninstaller Descriptions
287+
288+
;Language strings
289+
LangString DESC_UnUser ${LANG_ENGLISH} "Deletes all savegames, screenshots, options, etc."
290+
LangString DESC_UnData ${LANG_ENGLISH} "Deletes the copied X-Com resources."
291+
292+
;Assign language strings to sections
293+
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
294+
!insertmacro MUI_DESCRIPTION_TEXT ${UnUser} $(DESC_UnUser)
295+
!insertmacro MUI_DESCRIPTION_TEXT ${UnData} $(DESC_UnData)
296+
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
297+
245298
;--------------------------------
246299
;Version Information
247300

src/Basescape/BaseInfoState.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,13 @@ void BaseInfoState::edtBaseKeyPress(Action *action)
393393
*/
394394
void BaseInfoState::miniClick(Action *action)
395395
{
396+
if (_mini->getHoveredBase() < 0)
397+
return;
396398
unsigned int base = _mini->getHoveredBase();
397-
if (base >= 0 && base < _game->getSavedGame()->getBases()->size())
399+
if (base < _game->getSavedGame()->getBases()->size())
398400
{
399401
_mini->setSelectedBase(base);
400-
_base = _game->getSavedGame()->getBases()->at(_mini->getHoveredBase());
402+
_base = _game->getSavedGame()->getBases()->at(base);
401403
_state->setBase(_base);
402404
init();
403405
}

src/Basescape/BasescapeState.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,13 @@ void BasescapeState::viewMouseOut(Action *action)
422422
*/
423423
void BasescapeState::miniClick(Action *action)
424424
{
425+
if (_mini->getHoveredBase() < 0)
426+
return;
425427
unsigned int base = _mini->getHoveredBase();
426-
if (base >= 0 && base < _game->getSavedGame()->getBases()->size())
428+
if (base < _game->getSavedGame()->getBases()->size())
427429
{
428430
_mini->setSelectedBase(base);
429-
_base = _game->getSavedGame()->getBases()->at(_mini->getHoveredBase());
431+
_base = _game->getSavedGame()->getBases()->at(base);
430432
init();
431433
}
432434
}

src/Battlescape/BattlescapeGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void BattlescapeGenerator::addSoldier(Soldier *soldier, RuleUnitSprite *rules)
235235
Position pos;
236236
int x, y, z;
237237

238-
for (int i = 0; i < _height * _length * _width; i++)
238+
for (int i = _height * _length * _width - 1; i >= 0; i--)
239239
{
240240
// to spawn an xcom soldier, there has to be a tile, with a floor, with the starting point attribute and no object in the way
241241
if (_save->getTiles()[i] && _save->getTiles()[i]->getMapData(O_FLOOR) && _save->getTiles()[i]->getMapData(O_FLOOR)->getSpecialType() == START_POINT && !_save->getTiles()[i]->getMapData(O_OBJECT))

src/Battlescape/BattlescapeState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void BattlescapeState::mapClick(Action *action)
261261
Pathfinding *pf = _battleGame->getPathfinding();
262262
pf->calculate(_battleGame->getSelectedUnit(), pos);
263263
}
264-
if (action->getDetails()->button.button == SDL_BUTTON_RIGHT)
264+
else if (action->getDetails()->button.button == SDL_BUTTON_RIGHT)
265265
{
266266
BattleUnit *unit = _battleGame->getSelectedUnit();
267267
unit->lookAt(pos);

src/Battlescape/Map.cpp

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -357,44 +357,23 @@ void Map::drawTerrain()
357357
}
358358

359359
/**
360-
* Blits the map onto another surface.
361-
* @param surface Pointer to another surface.
362-
*/
363-
void Map::blit(Surface *surface)
364-
{
365-
Surface::blit(surface);
366-
}
367-
368-
/**
369-
* Ignores any mouse clicks that are outside the map.
370-
* @param action Pointer to an action.
371-
* @param state State that the action handlers belong to.
372-
*/
373-
void Map::mousePress(Action *action, State *state)
374-
{
375-
376-
}
377-
378-
/**
379-
* Ignores any mouse clicks that are outside the map.
360+
* Handles map mouse shortcuts.
380361
* @param action Pointer to an action.
381362
* @param state State that the action handlers belong to.
382363
*/
383-
void Map::mouseRelease(Action *action, State *state)
364+
void Map::mouseClick(Action *action, State *state)
384365
{
385-
366+
InteractiveSurface::mouseClick(action, state);
367+
if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP)
368+
{
369+
up();
370+
}
371+
else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN)
372+
{
373+
down();
374+
}
386375
}
387376

388-
/**
389-
* Ignores any mouse clicks that are outside the map
390-
* @param action Pointer to an action.
391-
* @param state State that the action handlers belong to.
392-
*/
393-
/*void Map::mouseClick(Action *action, State *state)
394-
{
395-
int test=0;
396-
}*/
397-
398377
/**
399378
* Handles map keyboard shortcuts.
400379
* @param action Pointer to an action.
@@ -617,19 +596,25 @@ void Map::animate()
617596
*/
618597
void Map::up()
619598
{
620-
_viewHeight++;
621-
minMaxInt(&_viewHeight, 0, _save->getHeight()-1);
622-
draw();
599+
if (_viewHeight < _save->getHeight() - 1)
600+
{
601+
_viewHeight++;
602+
_mapOffsetY += _spriteHeight / 2;
603+
draw();
604+
}
623605
}
624606

625607
/**
626608
* Go one level down.
627609
*/
628610
void Map::down()
629611
{
630-
_viewHeight--;
631-
minMaxInt(&_viewHeight, 0, _save->getHeight()-1);
632-
draw();
612+
if (_viewHeight > 0)
613+
{
614+
_viewHeight--;
615+
_mapOffsetY -= _spriteHeight / 2;
616+
draw();
617+
}
633618
}
634619

635620
/**
@@ -639,6 +624,7 @@ void Map::down()
639624
void Map::setViewHeight(int viewheight)
640625
{
641626
_viewHeight = viewheight;
627+
minMaxInt(&_viewHeight, 0, _save->getHeight()-1);
642628
draw();
643629
}
644630

src/Battlescape/Map.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,8 @@ class Map : public InteractiveSurface
8282
void draw();
8383
/// draws the terrain
8484
void drawTerrain();
85-
/// blit the surface
86-
void blit(Surface *surface);
87-
/// Special handling for mouse presses.
88-
void mousePress(Action *action, State *state);
89-
/// Special handling for mouse releases.
90-
void mouseRelease(Action *action, State *state);
9185
/// Special handling for mouse clicks.
92-
//void mouseClick(Action *action, State *state);
86+
void mouseClick(Action *action, State *state);
9387
/// Special handling for mous over
9488
void mouseOver(Action *action, State *state);
9589
/// Special handling for key presses.

src/Engine/Game.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ Language *const Game::getLanguage() const
265265
}
266266

267267
/**
268-
* Sets a new saved game for the game to use.
269-
* @param save Pointer to the saved game.
268+
* Changes the language currently in use by the game.
269+
* @param lang Pointer to the language.
270270
*/
271271
void Game::setLanguage(Language *lang)
272272
{

src/Engine/Language.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Language::~Language()
4444
* to a wide-character string.
4545
* @note Adapted from http://www.linuxquestions.org/questions/programming-9/wstring-utf8-conversion-in-pure-c-701084/
4646
* @param src UTF-8 string.
47+
* @return Wide-character string.
4748
*/
4849
std::wstring Language::utf8ToWstr(const std::string& src)
4950
{
@@ -104,6 +105,7 @@ std::wstring Language::utf8ToWstr(const std::string& src)
104105
* to a 8-bit string encoded in UTF-8.
105106
* @note Adapted from http://www.linuxquestions.org/questions/programming-9/wstring-utf8-conversion-in-pure-c-701084/
106107
* @param src Wide-character string.
108+
* @return UTF-8 string.
107109
*/
108110
std::string Language::wstrToUtf8(const std::wstring& src)
109111
{

0 commit comments

Comments
 (0)