Compare commits

...

487 Commits
master ... 1.5

Author SHA1 Message Date
pelya
145d01d3df Railroad tutorial, by Deliso Jan 2015-12-06 19:00:15 +02:00
pelya
bd387f5eb3 Fixed windows hidden when moved slightly off-screen to the left 2015-12-06 03:23:09 +02:00
Sergii Pylypenko
9b3502f377 Better font detection 2015-12-06 00:08:34 +02:00
Sergii Pylypenko
fc64d1ef15 Set font path to app local directory instead of the /system/fonts, because random devices miss random fonts 2015-12-05 23:53:14 +02:00
Sergii Pylypenko
577577a8ba Fixed compilation 2015-12-04 16:52:12 +02:00
Sergii Pylypenko
9fb654556d Bump version 2015-12-04 16:36:11 +02:00
frosch
48928658f4 (svn r27461) [1.5] -Update: Documentation 2015-12-04 16:34:44 +02:00
frosch
4cb769e85e (svn r27433) [1.5] -Update: Documentation 2015-12-04 16:34:44 +02:00
frosch
83191d3a86 (svn r27432) [1.5] -Backport from trunk:
- Fix: When selecting a refit cargo for orders, do not check whether the vehicle is in a depot or station, and do not ask whether the vehicle currently allows station-refitting. Also hide the refit cost for orders, it is not predictable (r27428)
- Fix: Use the NewGRF railtype sorting order in the infrastructure window (r27427)
- Fix: Crash when switching to or taking over companies, when an order window of a vehicle of the new company was opened. Now close those windows [FS#5842] (r27425)
- Fix: Towns did not connect roads to existing roads, unless they had only a single roadbit. Otoh, towns also tried to connect to single roadbit tiles such as tunnels and depots, even though they were not connectable in the direction of interest [FS#6374] (r27424)
- Fix: When towns expanded single-bit roadtiles using a grid-layout, they used the layout position of the neighbouring tile (r27423)
- Fix: Aircraft picked the wrong airport entry point, if airports were rotated by 180 degree [FS#6341] (r27422)
2015-12-04 16:34:44 +02:00
frosch
08b4493899 (svn r27431) [1.5] -Backport from trunk:
- Fix: Consider text and icon sizes when drawing the client list [FS#6265] (r27421)
- Fix: GrowTownAtRoad sometimes returned false, even when a house was built [FS#6362] (r27420)
- Fix: CmdSellRailWagon did not revert all actions properly when no orderlist could be allocated [FS#6369] (r27419)
- Fix: Desync due to incorrect storage of segments with different railtype in the YAPF cache [FS#6329] [FS#6379] (r27418)
- Fix: When a dedicated server was paused with no clients, the master server advertisement interval was slowed, causing deadvertisement of the server [FS#6368] (r27400)
2015-12-04 16:34:33 +02:00
frosch
40cd79b6ab (svn r27430) [1.5] -Backport from trunk:
- Fix: [Makefile] Game script directory and compat*.nut were never installed on *nix (r27399)
- Fix: There are two different availability conditions for fdatasync in the manpage. Use them both, since at least on some MinGW versions one is not enough (r27389)
- Fix: win32 sound driver failed to report errors (r27383)
- Fix: Clickareas in settings tree were misaligned when the filter warning was displayed, if the setting height was defined by the icons instead of the font [FS#6358] (r27366)
- Fix: Center settings filter warning also vertically, and also in case of multiple lines (r27365)
2015-12-04 16:27:41 +02:00
rubidium
4a83667fde (svn r27429) [1.5] -Backport: language updates from trunk 2015-12-04 16:27:41 +02:00
Sergii Pylypenko
9a78b6e45e Fixed multiplayer chat 2015-09-04 22:55:00 +03:00
Sergii Pylypenko
90c427aa10 Updated version files to 1.5.2 2015-09-04 18:04:27 +03:00
frosch
3447ac0f4e (svn r27392) [1.5] -Update: Documentation 2015-09-04 18:03:54 +03:00
frosch
04b5576d34 (svn r27355) [1.5] -Update: Documentation 2015-09-04 18:03:54 +03:00
rubidium
9f872d0c24 (svn r27353) [1.5] -Backport from trunk: language updates 2015-09-04 18:03:53 +03:00
frosch
73046c96b0 (svn r27351) [1.5] -Backport from trunk:
- Fix: Do not rerandomise the town name when only cost-estimating the founding [FS#6332] (r27341)
- Fix: Make variety distribution not assume that sea level is at height 0.2 / 3 * TGPGetMaxHeight() [FS#6335] (r27331, r27330, r27329, r27328)
- Fix: Remove corner-case optimisation for line drawing, which failed for dashed lines  (r27324)
- Fix: Clipping of inclined lines did not account for the 'horizontal width' being bigger than the 'real width' (r27323, r27322)
2015-09-04 18:03:53 +03:00
frosch
c53364fa28 (svn r27350) [1.5] -Backport from trunk:
- Fix: Incorrect owner assignment when adding/removing road/tram to/from bridges [FS#6317] (r27313, r27312)
- Fix: Mark infrastructure window dirty in more cases (r27311)
- Change: Auto-complete partial roads when building level-crossings [FS#6283] (r27309)
2015-09-04 18:03:53 +03:00
frosch
e8c47e1550 (svn r27349) [1.5] -Backport from trunk:
- Fix: Prevent breaking of tram-reversal points by adding more road pieces [FS#6283] (r27308)
- Fix: Error message window with manager face failed with GUI zoom [FS#6259] (r27307)
- Fix: Account for road-bridges and drive-through-stops in CanFollowRoad [FS#6320] (r27306, r27305)

Conflicts:
	src/error_gui.cpp
2015-09-04 18:03:51 +03:00
frosch
56a4665213 (svn r27348) [1.5] -Backport from trunk:
- Fix: Password window layout with GUI zoom [FS#6321] (r27304, r27303)
- Fix: Speed-only timetables got assigned times in stations [FS#6313] (r27302, r27301)
- Fix: Enforce the company's default service intervals when purchasing another company [FS#6254] (r27282, r27281)
- Fix: Cloning/autoreplace/autorenew did not copy custom service intervals (r27280)

Conflicts:
	src/widget.cpp
2015-09-04 18:01:38 +03:00
Sergii Pylypenko
0e398c5b8f Fixed refit window too big. 2015-06-19 21:33:42 +03:00
pelya
1b2d57231f Fixed 'New game' dialog 2015-06-19 02:04:12 +03:00
Sergii Pylypenko
08b4f14830 Updated version to 1.5.1 2015-06-19 01:46:10 +03:00
frosch
d55a6d8a0e (svn r27297) [1.5] -Update: Documentation 2015-06-16 22:38:11 +03:00
frosch
07e3266c38 (svn r27275) [1.5] -Update: Documentation 2015-06-16 22:38:11 +03:00
rubidium
dac22dc2a3 (svn r27274) [1.5] -Backport: language updates from trunk 2015-06-16 22:38:11 +03:00
frosch
3b4451ee72 (svn r27273) [1.5] -Backport from trunk:
- Fix: Do not consider road junctions with trivial dead ends as branch points during town growth [FS#6245] (r27260, r27259, r27244)
- Fix: In some cases town growth failure was considered as success [FS#6240] (r27249, r27247)
2015-06-16 22:38:11 +03:00
frosch
84c1e0669f (svn r27272) [1.5] -Backport from trunk:
- Fix: ScriptList::RemoveList failed to remove a list from itself [FS#6287] (r27258)
- Fix: Combined button+dropdown widgets in order and autoreplace GUI had incorrect hitbox when using GUI zoom [FS#6270] (r27255)
- Fix: When building a lock on DC_AUTO-removable water-based objects, the water class was always set to canal [FS#6264] (r27254)
- Fix: When crossing tram tracks with railroads, cost of extra roads was not being counted [FS#6282] (r27253)

Conflicts:
	src/widget.cpp
2015-06-16 22:38:05 +03:00
frosch
43dd41b4e4 (svn r27271) [1.5] -Backport from trunk:
- Fix: Invalid infrastructure counting when crossing tram tracks with railroads [FS#6281] (r27252)
- Fix: Broken error message in configure [FS#6286] (r27250)
- Fix: Town labels on smallmap and zoomed-out viewports were not centered [FS#6257] (r27248)
- Fix: Removing a rail waypoint used the remove-rail-station cost [FS#6251] (r27245)
2015-06-16 22:35:10 +03:00
frosch
960600af4f (svn r27270) [1.5] -Backport from trunk:
- Fix: Duplicate frees due to pool item classes not having copy constructors [FS#6285] (r27243)
- Fix: Crash when no AIs were installed due to improper handling of non-ASCII characters by the string pointer lexer [FS#6272] (r27233)
- Fix: Compilation on DragonflyBSD [FS#6274] (r27224, r27223)
- Fix: Use the current maximum speed as limited by bridges, orders etc. for all vehicle types alike when considering increased smoke emissions of vehicles [FS#6278] (r27222)
- Fix: Multi-value keys in the desktop entry shall end with a trailing separator (r27221)
- Fix: Draw path reservation on the whole bridge, not only on the bridge heads (r27209)
- Fix: Draw correct overlay sprites for path reservations on bridges and tunnels (r27208)
2015-06-16 22:35:10 +03:00
Sergii Pylypenko
9fa342727b WTF why is it swapped? 2015-04-29 22:06:48 +03:00
Sergii Pylypenko
2660e33dd2 Non-blocking text input. so you won't get kicked by server because of no reply to ping 2015-04-29 21:40:05 +03:00
Sergii Pylypenko
ba230ce5a0 Changing GUI zoom factor will also change resolution 2015-04-29 21:09:36 +03:00
Sergii Pylypenko
d05e05ee68 Fixed sort button marker not centered 2015-04-29 20:56:56 +03:00
Sergii Pylypenko
27ac4fea36 Fixed 'Replace vehicles' dialog 2015-04-29 20:42:42 +03:00
Sergii Pylypenko
29bde57722 Fixed dropdown box too narrow and cropping text 2015-04-29 20:42:11 +03:00
Sergii Pylypenko
959b08da1d Removed todo 2015-04-29 19:47:23 +03:00
Sergii Pylypenko
cf5c64d6b0 Fixed 'Buy vehicle' dialog not resizable 2015-04-29 19:46:30 +03:00
Sergii Pylypenko
91aa28291c Adjusting vehicle window size 2015-04-28 23:31:53 +03:00
Sergii Pylypenko
a36b26ab82 Fxied crash in 'Replace vehicle' window 2015-04-28 22:42:11 +03:00
Sergii Pylypenko
d400d979e6 Fixed 'Buy vehicle' window 2015-04-14 23:41:59 +03:00
pelya
c03272c1ab Fixed 'check online content' dialog 2015-04-14 13:36:10 +03:00
pelya
5a4ddb9de0 Reverted more SetMinimalSize() hacks 2015-04-14 13:23:21 +03:00
pelya
1af24b9102 Reverted SetMinimalSize() changes, they are not needed anymore 2015-04-14 13:16:58 +03:00
pelya
2ddebe9592 Fixed 'new game' dialog 2015-04-14 13:05:14 +03:00
pelya
d3993f883f Set default min size for all widgets 2015-04-14 13:04:40 +03:00
pelya
f4d77adc41 More fixes to network GUI 2015-04-13 02:09:02 +03:00
pelya
cb4ca527ac Fixed multiplayer widgets 2015-04-13 01:53:54 +03:00
pelya
7582ec5b6d Fixed OpenTTD release version, for the third time eh 2015-04-13 01:25:26 +03:00
pelya
b6f1c60eb3 Fixed release version yet another time 2015-04-13 01:23:11 +03:00
pelya
81e6db93d6 Fixed toolbar and status bar 2015-04-13 01:11:50 +03:00
pelya
96271cb970 Fixed crash in minimap legend 2015-04-13 00:31:52 +03:00
pelya
1855913084 Fixes in vehicle GUI 2015-04-13 00:16:44 +03:00
pelya
a8f74e07a5 Fixed game settings dialog 2015-04-12 23:53:32 +03:00
pelya
0bea3aec12 Centered dropdown drop button 2015-04-12 22:59:21 +03:00
pelya
082a60d3ca Centered vertical scrollbar 2015-04-12 22:55:07 +03:00
pelya
bfd2b7f768 Centered vertical scrollbar arrows 2015-04-12 22:47:28 +03:00
pelya
64a46c69d1 Centered close box sprite 2015-04-12 22:31:43 +03:00
pelya
f889ed089a New GFX functions to draw cenetered sprites 2015-04-12 22:31:20 +03:00
pelya
ee251f2093 Added BLACK_REMAP mode in 16bpp blitter 2015-04-12 21:56:00 +03:00
pelya
52f4b584c7 Print crash log to Android logcat 2015-04-12 21:55:29 +03:00
pelya
564fbb6367 Fixed dropdown box not putting droplist above the widget 2015-04-12 21:53:51 +03:00
Sergii Pylypenko
ec6fbef959 Updated version numbers to OpenTTD 1.5.0 official release 2015-04-08 20:01:44 +03:00
frosch
b7aa162257 (svn r27216) [1.5] -Update: Documentation 2015-04-08 20:00:49 +03:00
frosch
829b505cff (svn r27214) [1.5] -Backport from trunk:
- Fix: [NewGRF] Add Misc. GRF Feature Flag 6 to enable the second rocky tile set [FS#6260] (r27200)
2015-04-08 20:00:37 +03:00
pelya
a99fe098ac Fixed mouse input not processed, fixed PC compilation 2015-03-29 22:54:44 +03:00
pelya
e6d5436e7c Fixed compilatin, reverted several of my changes 2015-03-29 22:37:58 +03:00
pelya
6da09497d7 Updated version to 1.5.0-RC1 2015-03-29 21:50:10 +03:00
pelya
0d868d80bd Merge branch 'master' into 1.5
Conflicts:
	src/ai/ai_gui.cpp
	src/build_vehicle_gui.cpp
	src/cheat_gui.cpp
	src/company_gui.cpp
	src/depot_gui.cpp
	src/dock_gui.cpp
	src/genworld_gui.cpp
	src/misc_gui.cpp
	src/network/network_content_gui.cpp
	src/network/network_gui.cpp
	src/newgrf_gui.cpp
	src/news_gui.cpp
	src/rail_gui.cpp
	src/road_gui.cpp
	src/settings_gui.cpp
	src/settings_gui.h
	src/station_gui.cpp
	src/table/settings.ini
	src/toolbar_gui.cpp
	src/toolbar_gui.h
	src/vehicle_gui.cpp
	src/video/sdl_v.cpp
	src/widget.cpp
	src/widgets/settings_widget.h
2015-03-29 21:48:14 +03:00
frosch
ed5ccce41b (svn r27195) [1.5] -Update: Documentation 2015-03-29 20:42:26 +03:00
frosch
6b42179419 (svn r27194) [1.5] -Change: New titlegame (Emperor Jake) 2015-03-29 20:42:13 +03:00
frosch
5b1632f4aa (svn r27190) -Fix [FS#6255] (r27106): Original road vehicle acceleration crashed for vehicles taking over. 2015-03-16 20:01:14 +00:00
translators
dbcf0d8625 (svn r27189) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
2015-03-16 17:45:22 +00:00
translators
a04042f7b4 (svn r27188) -Update from WebTranslator v3.0:
korean - 2 changes by telk5093
2015-03-15 20:20:16 +00:00
frosch
aef1cf42e1 (svn r27187) -Fix: Code style. 2015-03-15 12:19:58 +00:00
michi_cc
ab048fdcd1 (svn r27186) -Codechange: Rename AlwaysDrawUnpavedRoads() to better reflect what it does. 2015-03-14 14:27:07 +00:00
rubidium
7cb07acd86 (svn r27185) -Fix: prevent the compiler from optimizing an assignment away which caused GCC 5 to actually crash 2015-03-13 20:54:35 +00:00
rubidium
76b1bd0f4c (svn r27184) -Cleanup: remove some removed strings 2015-03-13 20:53:29 +00:00
rubidium
7ae2a1764d (svn r27183) -Fix: GCC5 compilation 2015-03-13 19:42:49 +00:00
translators
a149707db7 (svn r27182) -Update from WebTranslator v3.0:
luxembourgish - 4 changes by Phreeze
2015-03-13 17:45:21 +00:00
translators
f34340a2d6 (svn r27181) -Update from WebTranslator v3.0:
french - 4 changes by glx
2015-03-11 17:46:24 +00:00
translators
18d8d3e5a6 (svn r27180) -Update from WebTranslator v3.0:
catalan - 16 changes by juanjo
norwegian_bokmal - 4 changes by cuthbert
spanish - 1 changes by juanjo
2015-03-10 17:47:16 +00:00
translators
ad056b0da5 (svn r27179) -Update from WebTranslator v3.0:
afrikaans - 10 changes by telanus
croatian - 4 changes by VoyagerOne
finnish - 4 changes by jpx_
hebrew - 9 changes by oofnik
italian - 3 changes by lorenzodv
korean - 11 changes by Gimel3830, telk5093
lithuanian - 4 changes by Stabilitronas
polish - 4 changes by wojteks86
romanian - 29 changes by kneekoo
gaelic - 4 changes by GunChleoc
slovak - 17 changes by Milsa
spanish - 4 changes by SilverSurferZzZ
2015-03-09 18:15:33 +00:00
frosch
a14b836bf2 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 2015-03-07 18:27:01 +00:00
translators
163ab9fd56 (svn r27177) -Update from WebTranslator v3.0:
catalan - 3 changes by juanjo
dutch - 4 changes by habell
russian - 4 changes by Lone_Wolf
spanish - 10 changes by juanjo
tamil - 7 changes by ganesh
2015-03-02 17:46:37 +00:00
planetmaker
0a9364cef6 (svn r27176) -Fix: Compilation with MinGW64 (Eddy Arfik) 2015-03-02 09:10:16 +00:00
translators
833f680a5e (svn r27175) -Update from WebTranslator v3.0:
catalan - 14 changes by arnau
italian - 4 changes by lorenzodv
korean - 3 changes by telk5093
2015-03-01 17:46:04 +00:00
alberth
da9721ffd6 (svn r27174) -Feature[FS#6236]: Display relative offset changes in the sprite aligner (juzza1). 2015-03-01 08:17:14 +00:00
frosch
06e97d529b (svn r27173) -Fix [FS#6237] (r27134): Use the regular clipping functions in the sprite aligner instead of some magic. 2015-02-28 20:09:49 +00:00
frosch
c0801cbd8d (svn r27172) -Fix [FS#6238] (r27167): Apparently Windows randomly drops SetCursorPos calls. According to internet due to incorrect/missing synchronisation in threads accessing the event queue. 2015-02-28 17:13:07 +00:00
translators
b251ba3e66 (svn r27171) -Update from WebTranslator v3.0:
korean - 11 changes by telk5093
latin - 2 changes by Supercheese
2015-02-25 17:46:35 +00:00
frosch
c7ec7761f8 (svn r27169) -Update: Documentation 2015-02-24 19:25:31 +00:00
translators
a601894017 (svn r27168) -Update from WebTranslator v3.0:
latin - 4 changes by Supercheese
2015-02-23 17:45:46 +00:00
frosch
3cceb21a94 (svn r27167) -Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped way to far, when OpenTTD lagged during mouse event processing. 2015-02-22 23:06:45 +00:00
frosch
74b0e2b73e (svn r27166) -Codechange: Optimise ScriptList by making use of iterators instead of looking up map-items multiple times per API call. 2015-02-22 23:04:02 +00:00
translators
10c653e702 (svn r27165) -Update from WebTranslator v3.0:
english_US - 3 changes by Supercheese
2015-02-22 17:45:17 +00:00
alberth
cd36ff1bfe (svn r27164) -Add: [NoGo] Game scripts can point to a location, station, industry, or town when publishing news. 2015-02-22 17:25:29 +00:00
frosch
6cb930168f (svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88) 2015-02-22 15:26:27 +00:00
frosch
8d04567343 (svn r27162) -Fix [FS#6208]: Tile selection was drawn outside of map in some cases. (adf88) 2015-02-22 15:05:48 +00:00
frosch
939719ffc0 (svn r27161) -Fix [FS#6156] [FS#6206]: Reimplement the viewport drawing algorithm. 2015-02-22 14:42:34 +00:00
frosch
d35670aa2a (svn r27160) -Fix: Division of signed values by TILE_SIZE requires cast to stay signed. 2015-02-22 14:14:30 +00:00
frosch
7dee16a9b9 (svn r27159) -Codechange: Simplify mapping from smallmap to viewport coordinates by duplicating less code. 2015-02-22 14:12:34 +00:00
frosch
79380a566e (svn r27158) -Codechange: Simplify mapping from viewport to smallmap coordinates by duplicating less code. 2015-02-22 14:10:44 +00:00
frosch
bd3a8bf9e4 (svn r27157) -Fix: Mark bridge middle tiles dirty when building/removing/changing bridges. 2015-02-22 14:01:24 +00:00
translators
9a601a1029 (svn r27156) -Update from WebTranslator v3.0:
traditional_chinese - 1 changes by siu238X
2015-02-20 17:45:21 +00:00
translators
2b82b55b7f (svn r27155) -Update from WebTranslator v3.0:
traditional_chinese - 1 changes by siu238X
2015-02-19 17:45:41 +00:00
translators
993622d770 (svn r27154) -Update from WebTranslator v3.0:
indonesian - 9 changes by UseYourIllusion
korean - 4 changes by telk5093
2015-02-18 17:45:30 +00:00
translators
c4f8995a1d (svn r27153) -Update from WebTranslator v3.0:
german - 3 changes by mbender
korean - 2 changes by telk5093
malay - 12 changes by im54
2015-02-15 17:45:47 +00:00
frosch
4b39e3d98c (svn r27152) -Fix: Generated files. 2015-02-15 14:56:21 +00:00
frosch
04b8fe6d0b (svn r27151) -Add: Allow changing max heightlevel in scenario editor. 2015-02-14 21:55:30 +00:00
frosch
e40c3149de (svn r27150) -Fix (r27146): Forgot scenario toolbar. 2015-02-14 21:22:47 +00:00
translators
5779e0d192 (svn r27149) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
2015-02-14 17:45:41 +00:00
frosch
891e4c40ce (svn r27148) -Fix: Rounding and unit-conversion inconsistencies in calls to MarkAllViewportsDirty. 2015-02-14 12:53:07 +00:00
frosch
5ebc0c9934 (svn r27147) -Fix: Scale (non-custom) default window sizes according to GUI zoom. 2015-02-13 21:25:48 +00:00
frosch
abe22e594d (svn r27146) -Fix: Make statusbar and chat-entry window use the same width as the toolbar. Otherwise they lack a size definition. 2015-02-13 21:13:45 +00:00
translators
0360abb54e (svn r27145) -Update from WebTranslator v3.0:
malay - 11 changes by TheITChap
2015-02-13 17:45:22 +00:00
frosch
3d37abf802 (svn r27144) -Change: The chatbox-width setting now uses percent of screen width instead of pixels. 2015-02-12 20:00:23 +00:00
translators
f610db45b8 (svn r27142) -Update from WebTranslator v3.0:
turkish - 77 changes by wakeup
2015-02-10 17:45:15 +00:00
translators
9cb0d889d7 (svn r27141) -Update from WebTranslator v3.0:
indonesian - 57 changes by fanioz
korean - 3 changes by telk5093
2015-02-09 17:45:34 +00:00
alberth
6670d28cca (svn r27140) -Codechange: Fix typo in GenenerateLandscapeWindowMode (chillcore) 2015-02-08 21:05:48 +00:00
translators
11d6570585 (svn r27139) -Update from WebTranslator v3.0:
korean - 12 changes by Gimel3830
2015-02-08 17:45:49 +00:00
frosch
00981908d0 (svn r27138) -Fix: [NewGRF] Negative positions in industry layouts were interpreted incorrectly; however since the wrong behaviour is saner, define as the correct behaviour for GRFv8. 2015-02-06 21:56:50 +00:00
frosch
f933dec10b (svn r27137) -Fix (r0): Oilrig empty-tile checks were incorrect due to wrong TileIndexDiff->TileIndexDiffC conversion. 2015-02-06 21:54:19 +00:00
translators
dcf5c12280 (svn r27136) -Update from WebTranslator v3.0:
afrikaans - 1 changes by telanus
2015-02-05 17:45:18 +00:00
frosch
b6568912f1 (svn r27135) -Fix: Misalignment in generate world window in case of small fonts. 2015-02-01 22:04:50 +00:00
frosch
8767a11d60 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 2015-02-01 20:54:24 +00:00
frosch
cd3f113249 (svn r27133) -Fix: Dragging of free wagons in depot failed with GUI zoom. 2015-02-01 19:40:04 +00:00
frosch
a0c42f25a4 (svn r27132) -Codechange: Add an assertion about the size of the Tile struct to ensure alignment assumptions. 2015-02-01 12:25:51 +00:00
frosch
18a1131e9f (svn r27131) -Fix: Dropdown- and tooltip-windows should not steal the focus. 2015-02-01 12:23:39 +00:00
translators
4e626567ae (svn r27130) -Update from WebTranslator v3.0:
simplified_chinese - 1 changes by ww9980
2015-01-31 17:45:21 +00:00
translators
70d52a502a (svn r27129) -Update from WebTranslator v3.0:
malay - 18 changes by im54
2015-01-30 17:45:13 +00:00
translators
c2ce131f21 (svn r27128) -Update from WebTranslator v3.0:
afrikaans - 2 changes by kdzar
2015-01-29 17:45:32 +00:00
translators
fd3388467f (svn r27127) -Update from WebTranslator v3.0:
latin - 1 changes by Supercheese
2015-01-26 17:45:25 +00:00
planetmaker
19bf264433 (svn r27126) -Fix [FS#6218] (r26873): Reduce memory footprint of map array by shuffling its variables 2015-01-26 10:27:51 +00:00
translators
14a24f5732 (svn r27125) -Update from WebTranslator v3.0:
latin - 3 changes by Supercheese
2015-01-23 17:45:19 +00:00
translators
577d812df4 (svn r27124) -Update from WebTranslator v3.0:
norwegian_nynorsk - 18 changes by 2rB
2015-01-22 17:45:22 +00:00
frosch
bf714413a2 (svn r27123) -Fix [FS#5371] [FS#6214]: API docs (krinn) 2015-01-20 19:11:31 +00:00
translators
f22b6d3116 (svn r27122) -Update from WebTranslator v3.0:
bulgarian - 22 changes by komara
2015-01-19 17:45:27 +00:00
translators
d97b60fb21 (svn r27121) -Update from WebTranslator v3.0:
irish - 2 changes by tem
latin - 1 changes by Supercheese
2015-01-18 17:45:32 +00:00
translators
c16caa87d5 (svn r27120) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
2015-01-17 17:45:21 +00:00
frosch
e5a8f6e7d4 (svn r27119) -Fix: Action 7/9 condition 0A failed for present, but disabled, NewGRF. 2015-01-17 15:00:02 +00:00
translators
59db260e63 (svn r27118) -Update from WebTranslator v3.0:
english_US - 1 changes by Supercheese
irish - 5 changes by tem
2015-01-15 17:45:31 +00:00
frosch
0a10fce8f1 (svn r27117) -Fix/Feature: Make use of both rocky tile sets from the base graphics. 2015-01-10 20:10:51 +00:00
translators
99b89f67db (svn r27116) -Update from WebTranslator v3.0:
esperanto - 1 changes by polluks
slovak - 15 changes by Blayss
2015-01-10 17:46:35 +00:00
translators
de3e7110e0 (svn r27115) -Update from WebTranslator v3.0:
irish - 10 changes by tem
2015-01-07 17:45:20 +00:00
translators
63318c2144 (svn r27114) -Update from WebTranslator v3.0:
catalan - 2 changes by juanjo
danish - 2 changes by Gankenstein
spanish - 5 changes by juanjo
2015-01-06 17:45:49 +00:00
translators
a41fc2e341 (svn r27113) -Update from WebTranslator v3.0:
spanish - 1 changes by juanjo
2015-01-05 17:45:15 +00:00
translators
4dc65dd9b5 (svn r27112) -Update from WebTranslator v3.0:
luxembourgish - 1 changes by Phreeze
spanish - 2 changes by SilverSurferZzZ
2015-01-04 17:45:35 +00:00
alberth
39d6562158 (svn r27111) -Doc: Extend script documentation with Save and Load functions. 2015-01-04 15:14:13 +00:00
translators
e25e44866e (svn r27110) -Update from WebTranslator v3.0:
afrikaans - 1 changes by telanus
spanish - 1 changes by SilverSurferZzZ
2015-01-03 17:45:29 +00:00
rubidium
f0924bb910 (svn r27109) -Fix (r27102): MinGW compilation 2015-01-02 19:50:43 +00:00
translators
19198a2156 (svn r27108) -Update from WebTranslator v3.0:
latin - 1 changes by Supercheese
spanish - 2 changes by SilverSurferZzZ
2015-01-02 17:45:51 +00:00
rubidium
cd9d6f85e5 (svn r27107) -Fix [FS#6183]: road vehicles could not reverse to be sent to depots when the following tile has the right type to run on, but could not be entered; e.g. facing toward a depot with the entry facing the wrong way failed to reverse whereas facing towards an empty tile allowed the vehicle to reverse (estys) 2015-01-02 12:11:20 +00:00
michi_cc
9983ddee32 (svn r27106) -Fix [FS#6176]: Use the actual max speed of the vehicle in front when determining if a RV can overtake. 2015-01-01 22:39:35 +00:00
rubidium
84b7773724 (svn r27105) -Fix [FS#6195]: grow_counter was not properly bounded by growth_rate, but by some other value used to calculate growth_rate. 2015-01-01 21:25:42 +00:00
rubidium
65f836f677 (svn r27104) -Fix [FS#6194]: support 64 bits integere in the ScriptLists as well 2015-01-01 21:08:19 +00:00
rubidium
dd40950643 (svn r27103) -Update: copyright date 2015-01-01 20:51:18 +00:00
rubidium
978d4e4eaa (svn r27102) -Fix [FS#6194]: money values would end up wrong in strings when outside of the bounds of a 32 bits integer 2015-01-01 20:50:43 +00:00
translators
1ed92b3ca3 (svn r27101) -Update from WebTranslator v3.0:
simplified_chinese - 4 changes by mhching
luxembourgish - 17 changes by Phreeze
2014-12-31 17:45:32 +00:00
translators
44cfdbbfc6 (svn r27100) -Update from WebTranslator v3.0:
luxembourgish - 334 changes by Phreeze
2014-12-30 17:45:27 +00:00
translators
3245076905 (svn r27099) -Update from WebTranslator v3.0:
spanish - 2 changes by SilverSurferZzZ
2014-12-27 17:45:27 +00:00
translators
202adad53a (svn r27098) -Update from WebTranslator v3.0:
hungarian - 1 changes by Brumi
2014-12-26 17:45:15 +00:00
translators
4841873f36 (svn r27097) -Update from WebTranslator v3.0:
serbian - 26 changes by Suleiman
2014-12-25 17:45:19 +00:00
frosch
6b0ea01f4e (svn r27095) -Update: Documentation 2014-12-24 19:31:26 +00:00
translators
e02b267f01 (svn r27094) -Update from WebTranslator v3.0:
esperanto - 4 changes by polluks
2014-12-24 17:45:15 +00:00
frosch
0bc06e8e08 (svn r27093) -Update: Add 3rdparty/os2 licenses to readme.txt 2014-12-24 17:37:30 +00:00
frosch
93fb724f87 (svn r27092) -Fix/Add [FS#6186]: Compilation on OS/2 (smedles) 2014-12-24 17:17:18 +00:00
frosch
23b44140a9 (svn r27091) -Fix [FS#6170] (r27012): Make manpage more portable. (bentley) 2014-12-24 16:53:04 +00:00
frosch
ff43128963 (svn r27090) -Codechange [FS#5976]: Simplify some hierarchical groups code. (Juanjo) 2014-12-24 16:49:57 +00:00
translators
2cf3024d39 (svn r27089) -Update from WebTranslator v3.0:
esperanto - 24 changes by polluks
2014-12-23 17:45:30 +00:00
translators
cd4db2e8e7 (svn r27088) -Update from WebTranslator v3.0:
irish - 20 changes by tem
2014-12-22 17:45:13 +00:00
rubidium
fe92e9678f (svn r27087) -Fix (r26864): the shadow bit of disaster vehicles got cleared after being set to show a shadow 2014-12-21 20:49:15 +00:00
alberth
8f6df8c230 (svn r27086) -Codechange: Simplify opening of windows by always returning a valid window pointer. 2014-12-18 18:22:23 +00:00
alberth
eb9da96a46 (svn r27085) -Fix: Always return a valid window to the world generation gui code. 2014-12-18 18:20:59 +00:00
alberth
b67d483b46 (svn r27084) -Doc: Improve documentation of AllocateWindowDescFront. 2014-12-18 16:50:11 +00:00
translators
21a4672485 (svn r27083) -Update from WebTranslator v3.0:
latin - 9 changes by Supercheese
2014-12-16 17:45:31 +00:00
translators
768a4cd790 (svn r27082) -Update from WebTranslator v3.0:
lithuanian - 4 changes by Stabilitronas
2014-12-14 17:45:22 +00:00
translators
79e90dfe11 (svn r27081) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
lithuanian - 11 changes by Stabilitronas
2014-12-13 17:45:40 +00:00
translators
cfa4bf7e8c (svn r27080) -Update from WebTranslator v3.0:
latin - 2 changes by Supercheese
2014-12-11 17:45:32 +00:00
planetmaker
84e2d4dd9e (svn r27079) -Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3) 2014-12-11 12:25:53 +00:00
translators
395c65e561 (svn r27078) -Update from WebTranslator v3.0:
latin - 12 changes by Supercheese
portuguese - 47 changes by ZeDWeB
2014-12-10 17:45:59 +00:00
translators
8c4d779ff1 (svn r27077) -Update from WebTranslator v3.0:
danish - 10 changes by manframe
2014-12-08 17:45:49 +00:00
translators
489958f1a4 (svn r27076) -Update from WebTranslator v3.0:
arabic_egypt - 1 changes by awensome
2014-12-07 17:45:17 +00:00
frosch
1bbe59af69 (svn r27075) -Fix [FS#6182]: Variable 47 used the carge translation table of the wrong GRF in case of callback 1D. 2014-12-07 14:13:21 +00:00
translators
051be72ba3 (svn r27074) -Update from WebTranslator v3.0:
japanese - 16 changes by guppy
2014-12-05 17:45:14 +00:00
translators
801d4ba918 (svn r27073) -Update from WebTranslator v3.0:
danish - 14 changes by manframe
2014-12-04 17:45:15 +00:00
translators
bd6a4c35c4 (svn r27072) -Update from WebTranslator v3.0:
danish - 8 changes by manframe
korean - 3 changes by telk5093
serbian - 22 changes by SoMiPro202
2014-12-03 17:46:16 +00:00
translators
9edee18e28 (svn r27071) -Update from WebTranslator v3.0:
spanish - 2 changes by juanjo
2014-12-02 17:45:26 +00:00
translators
68937dc638 (svn r27070) -Update from WebTranslator v3.0:
catalan - 1 changes by juanjo
spanish - 3 changes by juanjo
2014-12-01 17:45:48 +00:00
translators
c2acc4ffbb (svn r27069) -Update from WebTranslator v3.0:
bulgarian - 3 changes by pdedinski
2014-11-30 17:45:17 +00:00
translators
61d1f8e121 (svn r27068) -Update from WebTranslator v3.0:
danish - 28 changes by manframe
tamil - 52 changes by aswn
2014-11-26 17:45:22 +00:00
translators
91cb6e8774 (svn r27067) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
2014-11-25 17:45:18 +00:00
translators
ef49bca5c7 (svn r27066) -Update from WebTranslator v3.0:
polish - 19 changes by wojteks86
2014-11-23 17:45:54 +00:00
translators
4e3622bade (svn r27065) -Update from WebTranslator v3.0:
danish - 18 changes by manframe
2014-11-21 17:45:16 +00:00
translators
4b62fc9bbd (svn r27064) -Update from WebTranslator v3.0:
danish - 35 changes by manframe
irish - 16 changes by tem
2014-11-20 17:45:41 +00:00
frosch
e4063cb6d4 (svn r27063) -Fix [FS#6172]: Some lists did not use natural string sorting. 2014-11-18 20:12:42 +00:00
translators
ae17dd7d19 (svn r27062) -Update from WebTranslator v3.0:
latin - 5 changes by Supercheese
2014-11-14 17:45:15 +00:00
translators
ca02d7df4f (svn r27061) -Update from WebTranslator v3.0:
czech - 1 changes by marek995
latvian - 1 changes by Parastais
2014-11-13 17:45:38 +00:00
peter1138
e21ebb26c8 (svn r27060) -Doc: Remove obsolete comment (64KB LUT would be 8GB with current limits) 2014-11-11 11:50:04 +00:00
planetmaker
2d3ad05aa7 (svn r27059) -Change: [Makefile] Make sure to use plain mercurial output unaltered by personal presets 2014-11-09 16:37:07 +00:00
translators
2072edc02c (svn r27058) -Update from WebTranslator v3.0:
french - 1 changes by romazoon
galician - 70 changes by permudo
latin - 5 changes by Supercheese
2014-11-08 17:45:53 +00:00
translators
f3ec20a494 (svn r27057) -Update from WebTranslator v3.0:
latin - 2 changes by Supercheese
2014-11-06 17:45:32 +00:00
translators
aa0e397c97 (svn r27056) -Update from WebTranslator v3.0:
czech - 2 changes by Eskymak
portuguese - 4 changes by vesgo
2014-11-05 17:46:01 +00:00
translators
a2bde8dba6 (svn r27055) -Update from WebTranslator v3.0:
simplified_chinese - 6 changes by siu238X
traditional_chinese - 49 changes by siu238X
2014-11-04 17:45:38 +00:00
translators
a9a8ed5188 (svn r27054) -Update from WebTranslator v3.0:
irish - 9 changes by tem
portuguese - 40 changes by vesgo
2014-11-03 17:45:59 +00:00
translators
3eb4d49f97 (svn r27053) -Update from WebTranslator v3.0:
latin - 2 changes by Supercheese
vietnamese - 145 changes by nglekhoi
2014-11-02 17:46:34 +00:00
translators
c0445bb20a (svn r27052) -Update from WebTranslator v3.0:
simplified_chinese - 24 changes by siu238X
traditional_chinese - 19 changes by siu238X
swedish - 23 changes by Chrill
2014-11-01 17:46:13 +00:00
translators
619e6bbeda (svn r27051) -Update from WebTranslator v3.0:
irish - 15 changes by tem
2014-10-29 17:45:14 +00:00
translators
e9ba763f74 (svn r27050) -Update from WebTranslator v3.0:
irish - 62 changes by tem
korean - 1 changes by telk5093
2014-10-28 17:45:28 +00:00
peter1138
1ad3db76e6 (svn r27049) -Fix (r26482): Fix compilation with --enable-desync-debug. 2014-10-28 11:32:19 +00:00
peter1138
2c21d4fbd1 (svn r27048) -Fix (r26158): Position in articulated vehicle is 4D, not 4A. 2014-10-28 00:51:51 +00:00
translators
9cb1ca6fbd (svn r27047) -Update from WebTranslator v3.0:
norwegian_nynorsk - 58 changes by eloekset
spanish - 2 changes by SilverSurferZzZ
turkish - 10 changes by wakeup
2014-10-27 17:47:15 +00:00
fonsinchen
221f1a2e46 (svn r27046) -Fix [FS#5812]: Don't require double-press from non-dead console hotkeys. 2014-10-26 20:01:36 +00:00
translators
7e6eb5043b (svn r27045) -Update from WebTranslator v3.0:
irish - 83 changes by tem
gaelic - 1 changes by GunChleoc
spanish - 2 changes by SilverSurferZzZ
2014-10-26 17:46:16 +00:00
frosch
372acd13be (svn r27044) -Change (r26905, r26984): Scale heightmap greyscales > 0 evenly to heightlevels > 0, instead of giving heightlevel 1 a bigger loading. Sea level remains at pure black only. 2014-10-25 22:24:05 +00:00
rubidium
ed8f48a945 (svn r27043) -Fix: could not enter third digit of snow line height 2014-10-25 21:02:59 +00:00
translators
574767cacf (svn r27042) -Update from WebTranslator v3.0:
irish - 265 changes by tem
2014-10-25 17:45:23 +00:00
rubidium
f453c166c5 (svn r27041) -Update: ob* translations 2014-10-25 12:35:48 +00:00
fonsinchen
0affe0e119 (svn r27040) -Fix: Don't use GCC diagnostic push/pop if unsupported 2014-10-25 12:32:42 +00:00
translators
dd8f90882f (svn r27039) -Update from WebTranslator v3.0:
irish - 123 changes by tem
latvian - 77 changes by Parastais
2014-10-24 17:45:29 +00:00
translators
543656f256 (svn r27038) -Update from WebTranslator v3.0:
belarusian - 21 changes by KorneySan
catalan - 2 changes by juanjo
czech - 14 changes by Eskymak
russian - 1 changes by KorneySan
2014-10-23 17:46:24 +00:00
rubidium
988b387f14 (svn r27037) -Fix [FS#6150] (r26878): m6 was moved from Tile To TileExtended, but it wasn't properly removed from Tile (patch by Juanjo) 2014-10-23 17:13:44 +00:00
rubidium
1149f7be46 (svn r27036) -Fix [FS#6148] (r26928): crash when changing smallmap colour when the smallmap window has not been opened yet 2014-10-23 10:50:34 +00:00
matthijs
3ef8ddce2b (svn r27035) -Feature: Support .txt.xz changelog, readme and license files in basesets, newgrfs, etc 2014-10-23 10:49:19 +00:00
matthijs
fa0860db9d (svn r27034) -Feature: Support .txt.gz changelog, readme and license files in basesets, newgrfs, etc 2014-10-23 10:49:16 +00:00
matthijs
3596bee92f (svn r27033) -Codechange: Generalize GetTextfile for multiple extensions
- Instead of hardcoding the .txt extension in a printf string, it is
    now stored in an array of possible extensions. This array still only
    contains .txt, so behaviour is unchanged, but this makes it easier
    to add other extensions later.
2014-10-23 10:49:14 +00:00
rubidium
a0f58d54dc (svn r27032) -Merge: documentation updates from 1.4 branch 2014-10-23 09:47:15 +00:00
translators
05e8bdebc2 (svn r27031) -Update from WebTranslator v3.0:
irish - 94 changes by tem
2014-10-22 17:45:39 +00:00
rubidium
09f6c46d0b (svn r27030) -Fix: crash when having the vehicle list opened from a buoy or oil rig while the buoy/oil rig gets its final removal (i.e. the sign gets removed) 2014-10-21 19:16:47 +00:00
translators
3cd00ed2fc (svn r27027) -Update from WebTranslator v3.0:
catalan - 2 changes by juanjo
dutch - 2 changes by habell
finnish - 45 changes by jpx_
irish - 58 changes by tem
spanish - 2 changes by SilverSurferZzZ
2014-10-21 17:48:00 +00:00
rubidium
c017c18c26 (svn r27026) -Fix: some (older-ish) GCC compiler warnings 2014-10-21 16:58:15 +00:00
translators
a2f1351a90 (svn r27025) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
latin - 8 changes by Supercheese
norwegian_bokmal - 6 changes by cuthbert
2014-10-18 17:47:05 +00:00
peter1138
0889145dc5 (svn r27024) -Codechange: Adjust spacing on small order list. 2014-10-18 16:12:48 +00:00
peter1138
ca4f7b0eca (svn r27023) -Codechange: Scale tooltip size by UI scale. 2014-10-18 16:11:40 +00:00
translators
616622a8c0 (svn r27022) -Update from WebTranslator v3.0:
afrikaans - 2 changes by telanus
swedish - 3 changes by spacejens
welsh - 9 changes by kazzie
2014-10-17 17:46:54 +00:00
translators
eb2c2bdafa (svn r27021) -Update from WebTranslator v3.0:
afrikaans - 20 changes by telanus
romanian - 17 changes by kitguyy
2014-10-16 17:45:44 +00:00
rubidium
0c2f4bdc2b (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 2014-10-15 18:31:37 +00:00
translators
4f1d50190a (svn r27019) -Update from WebTranslator v3.0:
catalan - 3 changes by juanjo
croatian - 1 changes by VoyagerOne
romanian - 19 changes by kitguyy
russian - 6 changes by Lone_Wolf
spanish - 2 changes by SilverSurferZzZ
2014-10-15 17:46:35 +00:00
rubidium
4c6febee49 (svn r27018) -Fix [FS#6141] (r27008): the higher amplitudes needed for higher maps were not ignored properly causing much smoother maps than wanted 2014-10-14 17:49:32 +00:00
translators
5911d5cb93 (svn r27017) -Update from WebTranslator v3.0:
catalan - 11 changes by juanjo
english_US - 1 changes by Supercheese
german - 6 changes by planetmaker
hungarian - 14 changes by Brumi
italian - 1 changes by lorenzodv
latin - 6 changes by Supercheese
spanish - 3 changes by SilverSurferZzZ
welsh - 8 changes by kazzie
2014-10-14 17:48:51 +00:00
peter1138
4de8b75605 (svn r27016) -Fix (r27004): Setting font-sprite data failed for some user(s). 2014-10-14 16:09:21 +00:00
peter1138
d549ed2d6c (svn r27015) -Codechange: Also scale the character spacing for fonts without shadow. 2014-10-14 14:16:38 +00:00
rubidium
ba96233b6e (svn r27014) -Fix [FS#6102]: unit number was not always fully shown in depots 2014-10-14 11:40:38 +00:00
rubidium
890f50d491 (svn r27013) -Codechange: extract the functionality to determine the number of digits to make space for when drawing an unit number into a separate function 2014-10-14 11:23:41 +00:00
rubidium
76f6bf0b32 (svn r27012) -Change: improvements to the man page (bentley) 2014-10-14 08:24:47 +00:00
translators
6cba7f4447 (svn r27011) -Update from WebTranslator v3.0:
catalan - 1 changes by juanjo
croatian - 15 changes by VoyagerOne
dutch - 28 changes by habell
latin - 5 changes by Supercheese
latvian - 50 changes by Olby
gaelic - 34 changes by GunChleoc
spanish - 2 changes by SilverSurferZzZ
2014-10-13 17:49:11 +00:00
rubidium
5d7f235bd3 (svn r27010) -Feature [FS#4126]: more height levels (ic111, ChillCore, CommanderZ) 2014-10-13 14:30:59 +00:00
rubidium
0efe811f74 (svn r27009) -Add: extra level of general map heightness (ChillCore) 2014-10-13 14:22:48 +00:00
rubidium
1d685c9711 (svn r27008) -Change: extrapolate the amplitudes for the large wavelengths needed for much higher maps 2014-10-13 14:16:20 +00:00
rubidium
cb64738f4c (svn r27007) -Codechange: allow for more frequencies (based on patch by ic111) 2014-10-13 14:14:04 +00:00
rubidium
4a497c1bbb (svn r27006) -Codechange: move getting of the amplitude to a seperate function 2014-10-13 14:12:06 +00:00
rubidium
325d2b419d (svn r27005) -Fix (r26999): variety distribution curve map scaling did one conversion to height_t too many 2014-10-13 14:07:37 +00:00
peter1138
aa6fdf6f13 (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 2014-10-12 20:43:25 +00:00
rubidium
660a95e5d2 (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 2014-10-12 18:41:53 +00:00
rubidium
26574124b1 (svn r27002) -Fix-ish: replace some non-ASCII characters with ASCII characters, e.g. @þaram to @param 2014-10-12 18:26:54 +00:00
translators
0b76408304 (svn r27001) -Update from WebTranslator v3.0:
afrikaans - 4 changes by telanus
catalan - 16 changes by juanjo
english_US - 6 changes by Supercheese
french - 5 changes by glx
hungarian - 66 changes by IPG
italian - 5 changes by lorenzodv
korean - 5 changes by telk5093
russian - 5 changes by Lone_Wolf
spanish - 4 changes by SilverSurferZzZ
2014-10-12 17:49:12 +00:00
rubidium
ffb443934a (svn r27000) -Fix (r26999): compilation error with some versions of GCC 2014-10-12 11:53:13 +00:00
rubidium
a9de336295 (svn r26999) -Codechange: make the variety distribution automatically scale to the maximum height of the map 2014-10-12 11:28:45 +00:00
rubidium
c44c6b0f9b (svn r26998) -Change: account for the map size when determining the maximum height of the landscape; a 24 high mountain at 64x64 leaves barely any usable space, but on a 4096x4096 it's just a "small" bump (ic111) 2014-10-12 10:55:49 +00:00
rubidium
5159d90e6c (svn r26997) -Fix/codechange: use signed integers for TGP's internal map size and X/Y variables due to X/Y in comparisons occasionally getting smaller than 0 due to subtractions 2014-10-12 10:49:29 +00:00
peter1138
dcced1007b (svn r26996) -Codechange: Don't clamp airport construction window size -- this causes very poor performance if the game window is not large enough. 2014-10-12 10:48:18 +00:00
frosch
3ea4eebe9a (svn r26995) -Fix: Add missing files to source.list 2014-10-11 21:38:32 +00:00
planetmaker
51a2a31c46 (svn r26994) -Fix (r26992): Missing svn properties 2014-10-11 21:35:56 +00:00
planetmaker
ff71a8f5c9 (svn r26993) -Feature: Latin translation (Supercheese) 2014-10-11 21:30:33 +00:00
translators
3c2316b979 (svn r26992) -Update from WebTranslator v3.0:
basque - 60 changes by Thadah
french - 10 changes by glx
italian - 8 changes by lorenzodv
norwegian_bokmal - 4 changes by cuthbert
swedish - 3 changes by Zuu
2014-10-11 17:48:09 +00:00
rubidium
d43c3d73e1 (svn r26991) -Fix [FS#6132]: typo in help text (Supercheese) 2014-10-11 16:16:52 +00:00
peter1138
2655de52d7 (svn r26990) -Feature: Add option to choose normal, double or quad-size interface. 2014-10-11 13:22:37 +00:00
planetmaker
f7c64bc2dd (svn r26989) -Change [FS#6135]: Introduction of Euro in Lithuania is 2015 (devastator) 2014-10-10 23:07:59 +00:00
frosch
354f03ad5d (svn r26988) -Add: [NewGRF] Allow callback 160 to access variable 61. 2014-10-10 19:46:10 +00:00
translators
1e954351ff (svn r26987) -Update from WebTranslator v3.0:
english_US - 8 changes by Supercheese
german - 9 changes by planetmaker
korean - 10 changes by telk5093
russian - 8 changes by Lone_Wolf
2014-10-10 17:46:12 +00:00
frosch
4132e4e7e3 (svn r26986) -Change: Rename 'Advanced Settings' to just 'Settings'. 2014-10-09 21:16:29 +00:00
frosch
f72e4dfbe4 (svn r26985) -Change: Make settings categories more descriptive. 2014-10-09 20:40:36 +00:00
frosch
284912d102 (svn r26984) -Fix (r26905) [FS#6134]: Heightlevels must be scaled by number of intervals, not by the value of the highest interval. Otherwise the highest interval becomes non-proportionally small. 2014-10-09 19:57:40 +00:00
frosch
9efb6be700 (svn r26983) -Fix: Account for max_heightlevel when saving heightmaps. 2014-10-09 19:52:07 +00:00
translators
c3e286ae58 (svn r26982) -Update from WebTranslator v3.0:
simplified_chinese - 39 changes by siu238X
2014-10-09 17:46:13 +00:00
translators
bea7010a8b (svn r26979) -Update from WebTranslator v3.0:
english_US - 1 changes by Supercheese
2014-10-08 17:45:15 +00:00
peter1138
39fa9d2127 (svn r26978) -Fix (r23609): Typo in game script warning message. 2014-10-08 16:34:52 +00:00
translators
8a971f0229 (svn r26976) -Update from WebTranslator v3.0:
korean - 6 changes by telk5093
2014-10-07 17:45:44 +00:00
rubidium
815576440c (svn r26975) -Fix: reading too many bits when determining the client index for desync debug message 2014-10-07 17:32:29 +00:00
rubidium
fdd5b2293d (svn r26971) -Fix: widget_data was sometimes uint16 and sometimes uint32; make it always be uint32 2014-10-06 19:16:29 +00:00
rubidium
9f654b200d (svn r26970) -Fix (r26969): non-sse animated blitter crashed occasionally 2014-10-06 19:15:00 +00:00
rubidium
eabb35a874 (svn r26969) -Fix (r26869): black palette didn't work very well with unmasked 32bpp sprites 2014-10-06 18:45:51 +00:00
translators
485f60bb9f (svn r26968) -Update from WebTranslator v3.0:
croatian - 4 changes by VoyagerOne
2014-10-06 17:45:25 +00:00
rubidium
42a4379fad (svn r26967) -Fix [FS#6127]: inconsistency between strings regarding cloning vehicles (Supercheese) 2014-10-06 16:36:36 +00:00
peter1138
c7e2b466a5 (svn r26966) -Codechange: Remove two strings made obsolete in r26965. 2014-10-05 21:21:24 +00:00
peter1138
ee266b9b9d (svn r26965) -Codechange: Add palette bit to indicate that palette is actually a text colour remap, and draw closebox as a sprite, using said bit. Change news popup to use closebox widget for its closebox. 2014-10-05 21:18:37 +00:00
peter1138
d3c614c3cf (svn r26964) -Codechange: Allow editbox size to change. 2014-10-05 18:10:01 +00:00
translators
c4e8c81707 (svn r26963) -Update from WebTranslator v3.0:
english_US - 3 changes by Supercheese
hebrew - 10 changes by oofnik
norwegian_bokmal - 39 changes by cuthbert
2014-10-05 17:45:47 +00:00
peter1138
a0c53f7c4c (svn r26962) -Fix: Set up scrollbar size at the correct time (where it can be changed). Also ensure scrollbar is long enough to at least contain its buttons. 2014-10-05 16:43:44 +00:00
peter1138
b46e61be63 (svn r26961) -Codechange: GUI-scale for landscape editor terraform window. 2014-10-05 14:01:44 +00:00
peter1138
6872b647f1 (svn r26960) -Codechange: Draw sort button symbols as sprites, and pad sort buttons with non-static width. 2014-10-05 11:20:02 +00:00
peter1138
ae22f8ab55 (svn r26959) -Codechange: GUI-scale for settings window. 2014-10-04 20:34:43 +00:00
peter1138
79e124cf2b (svn r26957) -Codechange: Spread the station cargo icons out by GUI scale. 2014-10-04 20:18:25 +00:00
peter1138
44fa18b4fa (svn r26956) -Codechange: GUI-scale for cheat window. 2014-10-04 19:52:23 +00:00
rubidium
67991b70f0 (svn r26955) -Fix [FS#6126]: owner of road depot road types were not properly changed upon bankruptcy causing crashes when trying to remove the depot in certain situations 2014-10-04 19:23:43 +00:00
peter1138
d3332d106b (svn r26954) -Codechange: GUI-scale for AI/GS settings and NewGRF settings windows. 2014-10-04 18:19:22 +00:00
peter1138
7f6a282b7f (svn r26953) -Codechange: GUI-scale for company manager face on news popup. 2014-10-04 18:13:10 +00:00
translators
cc0847deb9 (svn r26952) -Update from WebTranslator v3.0:
japanese - 54 changes by guppy
2014-10-04 17:45:15 +00:00
peter1138
f7f49c15a3 (svn r26951) -Codechange: Do the GUI-scale dance for vehicle, depot, and purchase lists. 2014-10-04 16:40:23 +00:00
peter1138
3b3c1f1cec (svn r26950) -Codechange: GUI-scale dancing for NewGRF objects window. 2014-10-04 11:49:05 +00:00
translators
687ad230d8 (svn r26949) -Update from WebTranslator v3.0:
catalan - 2 changes by juanjo
english_US - 5 changes by Supercheese
brazilian_portuguese - 19 changes by Tucalipe
russian - 3 changes by Lone_Wolf
spanish - 2 changes by SilverSurferZzZ
2014-10-03 17:46:24 +00:00
translators
94c7401a78 (svn r26948) -Update from WebTranslator v3.0:
catalan - 2 changes by juanjo
spanish - 1 changes by SilverSurferZzZ
2014-10-02 17:45:22 +00:00
rubidium
a255c87d32 (svn r26947) -Fix [FS#6122, FS#6125]: textual improvements of the base "translation" 2014-10-02 17:41:36 +00:00
rubidium
517bfd4361 (svn r26946) -Fix (r26945): MSVC doesn't seem to have round yet 2014-10-02 17:40:45 +00:00
rubidium
94513de4f8 (svn r26945) -Fix-ish: better scaling of the "cells" in which variety distribution happens for non-square maps (attempt to make reasonably square areas) 2014-10-02 17:32:45 +00:00
translators
ada4718568 (svn r26944) -Update from WebTranslator v3.0:
czech - 74 changes by djst
spanish - 2 changes by SilverSurferZzZ
2014-10-01 17:45:44 +00:00
planetmaker
d40eafd92e (svn r26943) -Fix: [Win32] Silence a warning about comparison of signed and unsigned variables when using gcc 2014-09-30 21:10:32 +00:00
peter1138
04c78761b7 (svn r26942) -Codechange: Make sprite aligner useful for people making full-zoom graphics. 2014-09-30 11:35:21 +00:00
peter1138
3911ea1f90 (svn r26941) -Codechange: Make NewGRF sprite aligner work with GUI size. 2014-09-30 11:29:23 +00:00
rubidium
d63fcbe519 (svn r26940) -Fix (r26937): comparing values of different signedness 2014-09-29 19:21:55 +00:00
rubidium
e550580d74 (svn r26939) -Cleanup: some bits of coding style cleanup for TGP 2014-09-29 19:04:34 +00:00
rubidium
72354f7e6a (svn r26938) -Codechange: simplify RandomHeight significantly 2014-09-29 19:04:02 +00:00
rubidium
4549a07a89 (svn r26937) -Cleanup: simplify the logic for heightmap generation in TGP; instead of performing more and more loops the larger the map becomes to elaborately set the height to 0 many times, just run it for each frequency and be done with it 2014-09-29 18:18:21 +00:00
translators
5d09105bf1 (svn r26936) -Update from WebTranslator v3.0:
spanish - 1 changes by SilverSurferZzZ
2014-09-29 17:45:23 +00:00
peter1138
217635d357 (svn r26935) -Codechange: Fit company colour selection drop down list to UI scale. 2014-09-28 19:19:47 +00:00
peter1138
fc3ee5b7a8 (svn r26934) -Fix (r26933): Don't statically initialise non-static variables. 2014-09-28 09:21:51 +00:00
peter1138
b1f6dd5455 (svn r26933) -Codechange: Resize engine preview window to fit vehicle sprite. 2014-09-28 09:02:11 +00:00
rubidium
e1120327e7 (svn r26932) -Codechange: replace some constants with less weird looking constants and simplify clamping by actually using Clamp 2014-09-27 20:39:32 +00:00
translators
3ae9ca8759 (svn r26931) -Update from WebTranslator v3.0:
russian - 3 changes by Lone_Wolf
2014-09-27 17:45:18 +00:00
rubidium
340ecd7385 (svn r26930) -Add: extra shadings to he heightmap colour tables (Chillcore) 2014-09-27 14:51:34 +00:00
rubidium
367150ba34 (svn r26929) -Change: accounts for maximum height when filling the height legend of the smallmap 2014-09-27 14:49:37 +00:00
rubidium
4b8d6ee319 (svn r26928) -Change: scale the heightmap colours over the whole range of heights (based on patch by ic111) 2014-09-27 11:17:54 +00:00
rubidium
ae406cf52e (svn r26927) -Codechange: split the heightmap colour tables into their own file in the table folder 2014-09-27 10:43:59 +00:00
rubidium
84920f721d (svn r26926) -Change: limit flat world height to the maximum configured map height 2014-09-27 09:53:48 +00:00
translators
e41a83dc32 (svn r26925) -Update from WebTranslator v3.0:
croatian - 14 changes by VoyagerOne
german - 49 changes by planetmaker
spanish - 2 changes by SilverSurferZzZ
welsh - 3 changes by kazzie
2014-09-26 17:46:30 +00:00
peter1138
d408cabca7 (svn r26924) -Codechange: Fit YES/NO query window buttons to window, instead of unaligned. 2014-09-26 16:15:50 +00:00
peter1138
a1929222d5 (svn r26923) -Codechange: Make multiplayer lobby fit to icon size. 2014-09-26 16:05:42 +00:00
frosch
049c7dba29 (svn r26922) -Fix: Include strings.h on HAIKU for strcasecmp. Some platforms do not have a strings.h at all, most define the functions in string.h as well. 2014-09-25 20:45:25 +00:00
peter1138
01c30568e8 (svn r26921) -Codechange: Adjust content window listing to fit icon size. 2014-09-25 19:27:07 +00:00
translators
33061f4024 (svn r26920) -Update from WebTranslator v3.0:
french - 79 changes by glx
spanish - 3 changes by SilverSurferZzZ
tamil - 2 changes by vv
2014-09-25 17:45:45 +00:00
peter1138
d48a176f4c (svn r26919) -Fix [FS#6096]: Crash when enabling "Full animation" if multiplayer chat text is on screen. 2014-09-25 16:04:02 +00:00
fonsinchen
1b8186ea8e (svn r26918) -Fix [FS#6110]: Reserve cargo only after unloading finished or if the vehicle has the desired cargo already 2014-09-24 20:56:52 +00:00
fonsinchen
7306fe015d (svn r26917) -Revert (r26857): It broke improved loading. 2014-09-24 20:55:47 +00:00
translators
2df038c705 (svn r26916) -Update from WebTranslator v3.0:
afrikaans - 13 changes by mulderpf
catalan - 24 changes by juanjo
spanish - 3 changes by SilverSurferZzZ
2014-09-24 17:45:37 +00:00
frosch
fc36231cdf (svn r26915) -Fix: API docs 2014-09-24 16:45:20 +00:00
translators
b752ba6a0c (svn r26912) -Update from WebTranslator v3.0:
czech - 21 changes by argoneus
korean - 2 changes by telk5093
lithuanian - 18 changes by Stabilitronas
spanish - 3 changes by SilverSurferZzZ
welsh - 14 changes by kazzie
2014-09-23 17:46:13 +00:00
rubidium
1477b365c1 (svn r26911) -Change: increase maximum possible flat land height in scenario editor to be entered directly (ic111) 2014-09-22 19:21:37 +00:00
rubidium
22dd5ddca1 (svn r26910) -Fix: account for the height of the landscape at the edge of the map to determine the scroll boundaries (based on patch by ic111) 2014-09-22 18:14:44 +00:00
translators
04a8b1cdf9 (svn r26909) -Update from WebTranslator v3.0:
belarusian - 13 changes by KorneySan
catalan - 1 changes by juanjo
english_US - 15 changes by Supercheese
german - 13 changes by planetmaker
italian - 14 changes by lorenzodv
korean - 17 changes by telk5093
polish - 13 changes by wojteks86
russian - 13 changes by Lone_Wolf
2014-09-22 17:46:35 +00:00
rubidium
1c077e596b (svn r26908) -Codechange: replace a magic number by a more logical calculation 2014-09-22 15:04:18 +00:00
peter1138
49dafc0848 (svn r26907) -Codechange: Scale engine purchase list to GUI zoom level for multihead engines. 2014-09-22 13:13:02 +00:00
peter1138
4f63bbedc1 (svn r26906) -Codechange: Scale depot and station picker buttons by GUI zoom level. 2014-09-22 08:01:25 +00:00
rubidium
8a0e523ce5 (svn r26905) -Change: account for the maximum map height when converting heightmaps 2014-09-21 18:29:18 +00:00
rubidium
11e9afdf5e (svn r26904) -Fix: account for the height level for showing the seen area in the viewport (ic111) 2014-09-21 18:07:54 +00:00
translators
9a2d28e4c6 (svn r26903) -Update from WebTranslator v3.0:
lithuanian - 132 changes by Stabilitronas
vietnamese - 1 changes by nglekhoi
welsh - 5 changes by kazzie
2014-09-21 17:45:52 +00:00
rubidium
58f1e15bce (svn r26902) -Fix (r26900): erroneous spaces instead of tabs 2014-09-21 17:37:30 +00:00
rubidium
1d81ca44f2 (svn r26901) -Fix [FS#6120]: typo in string 2014-09-21 17:31:41 +00:00
rubidium
dfd472f4a4 (svn r26900) -Fix-ish: dirty the appropriate area around map edges when terraforming there to prevent any artefacts from occuring (ic111) 2014-09-21 17:29:48 +00:00
rubidium
6cee5310c1 (svn r26899) -Codechange: reduce the amount of tiles that needs to be drawn by taking the height of tiles into account instead of drawing way too many (ic111) 2014-09-21 17:27:37 +00:00
rubidium
0584d36c0b (svn r26898) -Fix: hopefully make regression under MinGW work again 2014-09-21 17:22:50 +00:00
fonsinchen
14604b9215 (svn r26897) -Change: Add some more AIStationList autotests 2014-09-21 16:45:51 +00:00
fonsinchen
3f2da92ea2 (svn r26896) -Codechange: Move AIStationList* tests to separate test case 2014-09-21 16:44:37 +00:00
fonsinchen
82baae3eb8 (svn r26895) -Change: Allow for multiple independent test cases for AI API regression 2014-09-21 16:41:03 +00:00
fonsinchen
df1971fbde (svn r26894) -Feature: Swap method for script lists 2014-09-21 16:25:15 +00:00
fonsinchen
d206b436aa (svn r26893) -Feature: ScriptStationList_Cargo for sorting cargo by from and via 2014-09-21 16:20:48 +00:00
fonsinchen
b6833fc6ef (svn r26892) -Feature: Script API for retrieving planned flow 2014-09-21 16:20:14 +00:00
fonsinchen
78df68e695 (svn r26891) -Codechange: Add methods to retrieve flows from a FlowStatMap 2014-09-21 16:19:52 +00:00
rubidium
b0c7488f6d (svn r26890) -Cleanup: remove unneeded obfuscation via IConsoleSetSetting 2014-09-21 14:45:35 +00:00
fonsinchen
ce9d75f517 (svn r26889) -Feature: Predict links for station-autorefitting vehicles 2014-09-21 14:22:32 +00:00
rubidium
4e021f0059 (svn r26888) -Codechange: use ints for some z-levels of vehicles (ic111) 2014-09-21 12:44:38 +00:00
rubidium
6b35c182ce (svn r26887) -Add: cheat for changing the height level (mostly due to the mess with changing snow levels and such) 2014-09-21 12:39:24 +00:00
rubidium
babe50da92 (svn r26886) -Change (r26885): the max height setting belongs more in the limitations section of the settings 2014-09-21 12:35:34 +00:00
rubidium
fa193ece85 (svn r26885) -Feature-ish: user interface for limiting the maximum height of a map 2014-09-21 12:25:04 +00:00
rubidium
d17a4e0918 (svn r26884) -Change: scale the NewGRF's snow line level according to the configured maximum map height 2014-09-21 12:02:03 +00:00
rubidium
0daf8085c0 (svn r26883) -Change: make maximum desert height scale with the maximum configured height 2014-09-21 11:53:06 +00:00
rubidium
647a3c8e5f (svn r26882) -Feature: allow limiting the height of bridges (ic111) 2014-09-21 11:40:11 +00:00
rubidium
b50c649405 (svn r26881) -Codechange: bump the savegame version 2014-09-21 11:28:29 +00:00
rubidium
ab3660278a (svn r26880) -Add: stub settings for limiting bridge and map height 2014-09-21 11:27:34 +00:00
rubidium
dc2b4f2498 (svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible 2014-09-21 11:24:51 +00:00
rubidium
f3b79480ed (svn r26878) -Change: move m6 to TileExtended to keep Tile 8 bytes and thus better alignable 2014-09-21 11:23:33 +00:00
rubidium
8a993b6141 (svn r26877) -Update: documentation about the map array 2014-09-21 11:20:29 +00:00
rubidium
173a234951 (svn r26876) -Codechange: move 'has bride above' data from m6 to type 2014-09-21 11:20:11 +00:00
rubidium
f82c07b582 (svn r26875) -Codechange: move TropicZone information from m6 to type 2014-09-21 11:18:10 +00:00
rubidium
fe1e883dc9 (svn r26874) -Fix (r26872): hopefully fix MSVC compile error 2014-09-21 11:17:47 +00:00
rubidium
337af973b0 (svn r26873) -Change: split type_height into a type and height array (ic111) 2014-09-21 11:14:58 +00:00
rubidium
3dfb423446 (svn r26872) -Change: give the disaster vehicles the same treatment as aircraft in r26866; make the ascend and descend if needed to cross high mountains (based on patch by ic111) 2014-09-21 11:12:42 +00:00
peter1138
c709953a3b (svn r26871) -Codechange: Centre and draw arbitrary size highscore screen. Highscore text continues to be drawn with 640x480 dimensions. 2014-09-21 09:12:04 +00:00
rubidium
44bcff645c (svn r26870) -Fix (r15190): since freeform edges the 'tile height' at southern edge * 8 pixels just 'south' of the edge tile would not be drawn and would as a result not be refreshed causing artefacts to remain there. This adds a virtual slope to level 0 so it can be redrawn appropriately. Loosely based on patch by ic111 2014-09-21 08:19:32 +00:00
rubidium
6592da4952 (svn r26869) -Add: support for an all black palette to prevent the need of having a black tile of all different slopes (ic111) 2014-09-21 07:57:45 +00:00
rubidium
feab521cd5 (svn r26868) -Add: methods for getting a (theoretical) slope and tile height of tiles outside of the map array (ic111) 2014-09-21 07:48:18 +00:00
rubidium
f9be0f5faa (svn r26867) -Fix (r26866): hopefully fix MSVC compile error 2014-09-21 06:41:11 +00:00
rubidium
39ded38c01 (svn r26866) -Change: make aircraft ascend/descend when they are too close to the ground or too far away (based on patch by ic111) 2014-09-21 06:35:34 +00:00
translators
51e2c2bf62 (svn r26865) -Update from WebTranslator v3.0:
welsh - 11 changes by kazzie
2014-09-20 17:45:14 +00:00
rubidium
8ab4f746f2 (svn r26864) -Codechange: bring a bit more OO into the disaster vehicles 2014-09-20 15:46:44 +00:00
rubidium
ac269a3f08 (svn r26863) -Codechange: move a number of Vehicle* functions into the Vehicle class 2014-09-20 15:31:26 +00:00
peter1138
c07aea8ab8 (svn r26862) -Codechange: Don't shrink widget size in new game window. 2014-09-20 12:27:09 +00:00
peter1138
2f871d02b3 (svn r26861) -Codechange: Include height of dropdown image in dropdown widget. Draw vertically centred image in dropdown button. 2014-09-20 12:25:36 +00:00
rubidium
890c61d596 (svn r26860) -Codechange: improve worst case performance of terraforming (O(n^2) -> O(n log n)) and let memory usage scale to the amount of tiles affected instead of allocating memory for the worst case scenario (patch by ic111) 2014-09-20 12:11:15 +00:00
frosch
fba10bead9 (svn r26859) -Fix [FS#6119]: Height computation of game script text in town GUI did not consider margins. 2014-09-20 11:32:54 +00:00
peter1138
657c108d32 (svn r26858) -Codechange: Rearrange smallmap filter and settings expand/collapse buttons to fix frame borders and allow buttons to fit height of resize button. 2014-09-20 10:23:38 +00:00
fonsinchen
e353f22dc1 (svn r26857) -Fix [FS#6110]: Reserve cargo after refitting and only if necessary. 2014-09-20 09:41:25 +00:00
peter1138
c2d4068a5e (svn r26856) -Codechange: Ensure company face widgets can fit company face. 2014-09-20 09:18:22 +00:00
peter1138
2bb3524416 (svn r26855) -Codechange: Render vertical scrollbars the same as horizontal scrollbars, with sprites instead of text. 2014-09-20 08:55:35 +00:00
peter1138
a3eaa31178 (svn r26854) -Codechange: Don't override computed minimal size with static minimal size, instead only increase it. 2014-09-20 00:27:14 +00:00
rubidium
6a1ed21342 (svn r26853) -Cleanup [Squirrel]: remove some stuff that we never did and especially never should use 2014-09-19 20:06:51 +00:00
rubidium
1bc9785a6e (svn r26852) -Fix: WT3 validation error 2014-09-19 17:53:50 +00:00
translators
118bb9a193 (svn r26851) -Update from WebTranslator v3.0:
belarusian - 33 changes by KorneySan
brazilian_portuguese - 100 changes by Tucalipe
russian - 2 changes by KorneySan
welsh - 4 changes by kazzie
2014-09-19 17:47:00 +00:00
planetmaker
7836a487ae (svn r26850) -Fix: [Makefile] Compilation of strgen requires also defining variable in for platforms like Solaris 2014-09-19 09:28:23 +00:00
alberth
1e7992d4f9 (svn r26849) -Fix[FS#6113]: Better display of refit information in articulated vehicles. 2014-09-18 19:53:22 +00:00
alberth
d0f23b0b7e (svn r26848) -Codechange: Unduplicate summing of cargo capacities in GetTotalCapacityOfArticulatedParts. 2014-09-18 19:50:41 +00:00
fonsinchen
672b14a7c6 (svn r26847) -Fix [FS#6110]: Don't assign a next hop when returning cargo 2014-09-18 17:49:19 +00:00
translators
41ad2aecd8 (svn r26846) -Update from WebTranslator v3.0:
bulgarian - 46 changes by Wold
english_US - 5 changes by Supercheese
2014-09-18 17:45:51 +00:00
rubidium
e87572d103 (svn r26845) -Fix [Squirrel]: more uninitialized variables in constructors 2014-09-17 18:35:45 +00:00
rubidium
d3a68c3391 (svn r26844) -Fix: clang compile error 2014-09-17 17:52:50 +00:00
translators
5fe44256e2 (svn r26843) -Update from WebTranslator v3.0:
ukrainian - 25 changes by Strategy
welsh - 8 changes by kazzie
2014-09-17 17:45:37 +00:00
rubidium
c35e638c36 (svn r26842) -Codechange [Squirrel]: other simple cases of non-initialised instance variables 2014-09-16 21:14:18 +00:00
rubidium
8560071dbc (svn r26841) -Codechange [Squirrel]: move the actual initialisation of instance variables of SQString into the constructor 2014-09-16 21:13:24 +00:00
rubidium
20cb257a05 (svn r26840) -Fix [Squirrel]: merge Init and constructor of SQSharedState 2014-09-16 21:11:14 +00:00
rubidium
525316ea9b (svn r26839) -Fix [Squirrel]: some dead code and making switch fall throughs more explicit 2014-09-16 21:10:01 +00:00
rubidium
061be20b78 (svn r26838) -Fix (r26831): attempt to make MSVC like the code again 2014-09-16 20:14:03 +00:00
rubidium
e19dfdee99 (svn r26837) -Fix [Squirrel]: remove some pointless assignments 2014-09-16 20:09:20 +00:00
rubidium
3d2f511f43 (svn r26836) -Fix [Squirrel]: merge SQLexer::Init with the constructor; there's no need to construct first and then call init in the next line 2014-09-16 20:08:44 +00:00
rubidium
5502a19f3d (svn r26835) -Fix [Squirrel]: remove dead code from the lexer 2014-09-16 20:07:47 +00:00
rubidium
fef12f24dd (svn r26834) -Fix [Squirrel]: prevent unitialized memory warning by moving code from (static) Init to constructure for SQFunctionProto 2014-09-16 20:07:19 +00:00
rubidium
8716e0c26d (svn r26833) -Fix [Squirrel]: remove a few bits of dead code 2014-09-16 20:06:28 +00:00
rubidium
dd0254220f (svn r26832) -Fix [Squirrel]: ensure instance variable of SQNativeClosure is properly initialized 2014-09-16 20:06:05 +00:00
rubidium
de8230a219 (svn r26831) -Fix [Squirrel]: (bogus) warning about falling through in a switch 2014-09-16 20:05:21 +00:00
rubidium
a27c92acb5 (svn r26830) -Fix: WT3 string validation 2014-09-16 17:56:15 +00:00
translators
3280146448 (svn r26829) -Update from WebTranslator v3.0:
finnish - 19 changes by jpx_
persian - 65 changes by Garga
polish - 4 changes by wojteks86
russian - 2 changes by Lone_Wolf
swedish - 31 changes by spacejens
urdu - 80 changes by siphr
welsh - 42 changes by kazzie
2014-09-16 17:47:02 +00:00
rubidium
876d87097a (svn r26828) -Fix: memory leak when passing -c multiple times 2014-09-16 17:14:07 +00:00
frosch
5ecbc2dd16 (svn r26827) -Change [FS#6116]: The ok-button in the OSK for the signs list should just close the OSK. 2014-09-15 19:26:03 +00:00
translators
ff7ce41362 (svn r26826) -Update from WebTranslator v3.0:
croatian - 4 changes by VoyagerOne
greek - 2 changes by Jubilee
italian - 4 changes by lorenzodv
korean - 32 changes by telk5093
persian - 34 changes by farazfaraji
urdu - 9 changes by siphr
2014-09-15 17:47:04 +00:00
translators
b90fc355fb (svn r26821) -Update from WebTranslator v3.0:
greek - 95 changes by Jubilee
gaelic - 33 changes by GunChleoc
2014-09-14 15:30:47 +00:00
rubidium
c225276a7a (svn r26819) -Fix [FS#6112] (r26787): trying to delete just loaded objects that had not yet resolved their references caused a crash upon savegame load (only when loading a game from a server, e.g. joining MP) 2014-09-14 15:11:33 +00:00
michi_cc
79e180250c (svn r26818) -Fix [FS#AndyShouldHaveFoundFlySprayByNow] (r26758): [OSX] Line history and scrolling in the console window went on a walk. 2014-09-13 22:00:10 +00:00
translators
84b9d25374 (svn r26817) -Update from WebTranslator v3.0:
afrikaans - 2 changes by telanus
catalan - 4 changes by juanjo
german - 3 changes by planetmaker
russian - 2 changes by Lone_Wolf
2014-09-13 17:46:45 +00:00
frosch
a7678c367e (svn r26816) -Fix [FS#6109]: Properly zero-initialise data in _temp_engine. 2014-09-13 14:46:03 +00:00
planetmaker
035fedd30b (svn r26815) -Change: Allow to set the granularity of the tooltip hover time in milliseconds instead of seconds. New default value is 250ms 2014-09-13 13:30:31 +00:00
planetmaker
7663c54905 (svn r26814) -Fix [FS#6098]: Wording of tooltip in sprite alignment tool 2014-09-12 20:30:23 +00:00
translators
7e159a5303 (svn r26813) -Update from WebTranslator v3.0:
afrikaans - 16 changes by telanus
german - 25 changes by MG
2014-09-12 17:45:33 +00:00
translators
889592549b (svn r26812) -Update from WebTranslator v3.0:
afrikaans - 9 changes by telanus
polish - 30 changes by McZapkie
slovak - 4 changes by Milsa
slovenian - 1 changes by ntadej
spanish - 4 changes by SilverSurferZzZ
2014-09-11 17:46:29 +00:00
alberth
f24aa8807d (svn r26811) -Fix[FS#6108]: Fixed spelling error in widget name. 2014-09-11 17:10:38 +00:00
translators
82aa086673 (svn r26810) -Update from WebTranslator v3.0:
dutch - 76 changes by habell
spanish - 6 changes by SilverSurferZzZ
swedish - 51 changes by spacejens
welsh - 26 changes by kazzie
2014-09-10 17:45:58 +00:00
rubidium
18e157fe7a (svn r26809) -Fix: do not dereference the -1 index of the file names array of music files. It definitely breaks on m68k, and might cause failures on other platforms as well 2014-09-10 16:33:42 +00:00
translators
77a77575dc (svn r26808) -Update from WebTranslator v3.0:
catalan - 26 changes by juanjo
hebrew - 3 changes by rril
russian - 1 changes by Lone_Wolf
spanish - 7 changes by SilverSurferZzZ
2014-09-09 17:46:14 +00:00
translators
1806f6ba81 (svn r26807) -Update from WebTranslator v3.0:
catalan - 18 changes by juanjo
croatian - 29 changes by VoyagerOne
english_US - 29 changes by Supercheese
italian - 29 changes by lorenzodv
russian - 29 changes by Lone_Wolf
spanish - 12 changes by SilverSurferZzZ
2014-09-08 17:46:46 +00:00
translators
378e92e6ed (svn r26806) -Update from WebTranslator v3.0:
esperanto - 1 changes by Ryton
gaelic - 49 changes by GunChleoc
2014-09-07 17:45:44 +00:00
alberth
aa2078a40e (svn r26805) -Feature: Allow hiding of non-interesting engines in the autoreplace GUI. 2014-09-07 16:14:38 +00:00
alberth
cb3f69f746 (svn r26804) -Feature: Allow hiding of non-interesting engines in the build vehicle GUI. 2014-09-07 16:14:06 +00:00
alberth
48c5bb4dc0 (svn r26803) -Doc: Document some fields in the build vehicle gui, and the rail definition struct. 2014-09-07 16:13:29 +00:00
alberth
44d2f6a988 (svn r26802) -Add: Command to set visibility of an engine for a company (based on patch by Juanjo). 2014-09-07 16:12:58 +00:00
alberth
7df9a39172 (svn r26801) -Add: Labels above the lists in the autoreplace GUI. 2014-09-07 16:11:58 +00:00
alberth
5d38e0f24b (svn r26800) -Feature[FS#1640]: Vehicle sorting in autoreplace GUI. 2014-09-07 16:11:14 +00:00
alberth
427fdb2fb3 (svn r26799) -Codechange: Export vehicle sorting data and functions. 2014-09-07 16:10:27 +00:00
alberth
8292133522 (svn r26798) -Codechange: Code style fixes. 2014-09-07 16:09:48 +00:00
rubidium
5f8b37047a (svn r26797) -Codechange: rewrite the UTF8 reading code to make use of already existing functions instead of partially trying to implemented them 2014-09-07 16:03:41 +00:00
rubidium
9cbdd45751 (svn r26796) -Fix: reading of high byte of "ASCII" files yielded a negative int8, then casted to an uint32 which caused the Squirrel lexer to bail out. Regardless... the file isn't actually ASCII, but that's beyond the point for now 2014-09-07 16:03:02 +00:00
frosch
599a5a1969 (svn r26792) -Fix: TC_NO_SHADE did not work for 32bpp text rendering. 2014-09-07 15:25:54 +00:00
frosch
e00f4cac59 (svn r26788) -Add: Desync replay option to skip/replay failed commands 2014-09-07 14:21:16 +00:00
frosch
d2ec27c6c4 (svn r26787) -Fix (r20547): Loading a game with order backups leaked Orders and left unreachable items in the pool. 2014-09-07 13:52:20 +00:00
frosch
db45d979db (svn r26786) -Fix: Also replay failed commands. 2014-09-07 13:36:18 +00:00
rubidium
be23e13e33 (svn r26785) -Fix [Squirrel]: loading a value saved as boolean caused it to be of type integer instead of boolean 2014-09-07 09:30:57 +00:00
rubidium
00e1e69187 (svn r26784) -Codechange [Squirrel]: use WChar for the lexer 2014-09-07 06:46:03 +00:00
rubidium
0d042630d5 (svn r26783) -Fix (r26781): removed one include too many 2014-09-06 20:38:39 +00:00
rubidium
4506858a83 (svn r26782) -Fix (r26781): was in the wrong folder when commiting 2014-09-06 20:22:59 +00:00
rubidium
e8a72f8234 (svn r26781) -Codechange [Squirrel]: remove includes/definitions that are already in stdafx.h 2014-09-06 20:20:35 +00:00
rubidium
fc6d256948 (svn r26780) -Cleanup: remove unused SQUIRREL_API macro 2014-09-06 20:11:00 +00:00
rubidium
ed365a33c0 (svn r26779) -Cleanup [Squirrel]: remove extern "C" statements; we won't be exporting things to C from our squirrel 2014-09-06 20:05:07 +00:00
rubidium
506de3c53d (svn r26778) -Codechange: remove pointless rsl macro 2014-09-06 19:57:01 +00:00
rubidium
ac7ef48b0d (svn r26777) -Codechange: use safe string functions in squirrel code as well, and prevent using the ones that are deemed unsafe 2014-09-06 19:54:35 +00:00
rubidium
a106bd1dd5 (svn r26776) -Codechange: use safe string functions in script/squirrel*.cpp 2014-09-06 19:28:09 +00:00
rubidium
a7044da533 (svn r26775) -Cleanup [Squirrel]: "resolve" several of the unicode wrapper defines 2014-09-06 18:10:36 +00:00
rubidium
65cab46a84 (svn r26774) -Cleanup [Squirrel]: remove _SC macro 2014-09-06 17:46:56 +00:00
translators
cab419130e (svn r26773) -Update from WebTranslator v3.0:
bulgarian - 20 changes by komara
esperanto - 94 changes by Ryton
2014-09-06 17:45:42 +00:00
rubidium
ab4f228aa8 (svn r26772) -Cleanup [Squirrel]: remove traces to SQUNICODE define 2014-09-06 17:36:29 +00:00
rubidium
95549e6da5 (svn r26771) -Cleanup: remove OTTD2SQ and SQ2OTTD 2014-09-06 17:30:33 +00:00
rubidium
20a83b406e (svn r26770) -Fix [Squirrel]: in case SQChar is a char (previously everything non-Windows or non-Unicode, now everything), the lexer throws away the higher bytes of characters 2014-09-06 17:22:06 +00:00
rubidium
e874be7691 (svn r26769) -Codechange [Squirrel]: remove the difference between some platforms having wchar for SQChar and others just char; always use char (and UTF-8) like in the rest of (internal) OpenTTD 2014-09-06 17:20:45 +00:00
translators
2f697aa06d (svn r26768) -Update from WebTranslator v3.0:
bulgarian - 13 changes by komara
esperanto - 87 changes by Ryton
spanish - 19 changes by juanjo
2014-09-05 17:45:37 +00:00
translators
63b06faece (svn r26767) -Update from WebTranslator v3.0:
bulgarian - 8 changes by komara
2014-09-04 17:45:18 +00:00
translators
f54ce4f2fd (svn r26766) -Update from WebTranslator v3.0:
catalan - 5 changes by juanjo
2014-09-01 17:45:33 +00:00
translators
9270d243cd (svn r26765) -Update from WebTranslator v3.0:
welsh - 47 changes by kazzie
2014-08-31 17:45:19 +00:00
frosch
44fabee8ca (svn r26764) -Fix: Buffer overrun in SQCompiler::Error. (kalenz) 2014-08-31 10:20:30 +00:00
translators
12a6d877a6 (svn r26763) -Update from WebTranslator v3.0:
korean - 41 changes by telk5093
2014-08-30 17:45:19 +00:00
translators
2f6a314b36 (svn r26762) -Update from WebTranslator v3.0:
catalan - 6 changes by juanjo
2014-08-29 17:45:17 +00:00
translators
d4589aaba6 (svn r26761) -Update from WebTranslator v3.0:
catalan - 2 changes by juanjo
english_US - 3 changes by Supercheese
spanish - 2 changes by juanjo
2014-08-27 17:45:46 +00:00
translators
86b4144a4a (svn r26760) -Update from WebTranslator v3.0:
english_US - 1 changes by Supercheese
ukrainian - 62 changes by Strategy
2014-08-25 17:45:29 +00:00
translators
47561a55a3 (svn r26759) -Update from WebTranslator v3.0:
italian - 50 changes by lorenzodv
spanish - 138 changes by juanjo
2014-08-24 17:45:30 +00:00
michi_cc
1a35644033 (svn r26758) -Fix [FS#5972]: [OSX] Implement more of the text editing API to prevent crashes and improve IME support. 2014-08-24 10:34:43 +00:00
translators
09d079b666 (svn r26757) -Update from WebTranslator v3.0:
afrikaans - 1 changes by telanus
catalan - 1 changes by juanjo
2014-08-23 17:45:42 +00:00
frosch
5853f9c714 (svn r26756) -Fix (r26747): Ground vehicle breakdown smoke was not supposed to be available yet, since it is a looping animation. 2014-08-23 13:31:20 +00:00
frosch
c6cd861997 (svn r26755) -Fix (r26747) [FS#6093]: Silence MSVC warning. 2014-08-23 10:44:32 +00:00
translators
6fbca04f06 (svn r26754) -Update from WebTranslator v3.0:
catalan - 9 changes by juanjo
2014-08-22 17:45:28 +00:00
rubidium
d214ca2c7d (svn r26753) -Fix: desync due to not always properly restoring game state from the savegame 2014-08-22 17:11:59 +00:00
translators
fd82ab4b60 (svn r26752) -Update from WebTranslator v3.0:
korean - 1 changes by telk5093
2014-08-20 17:45:28 +00:00
translators
01827a992d (svn r26751) -Update from WebTranslator v3.0:
croatian - 47 changes by VoyagerOne
english_AU - 50 changes by mrtux
finnish - 25 changes by jpx_
korean - 1 changes by telk5093
polish - 50 changes by wojteks86
2014-08-19 17:46:25 +00:00
453 changed files with 24528 additions and 21467 deletions

View File

@@ -1 +1 @@
1.4.2 26740 0 1.4.2 1.5.3 27462 0 1.5.3

View File

@@ -172,6 +172,7 @@ install: bundle
$(Q)install -d "$(INSTALL_BINARY_DIR)" $(Q)install -d "$(INSTALL_BINARY_DIR)"
$(Q)install -d "$(INSTALL_ICON_DIR)" $(Q)install -d "$(INSTALL_ICON_DIR)"
$(Q)install -d "$(INSTALL_DATA_DIR)/ai" $(Q)install -d "$(INSTALL_DATA_DIR)/ai"
$(Q)install -d "$(INSTALL_DATA_DIR)/game"
$(Q)install -d "$(INSTALL_DATA_DIR)/baseset" $(Q)install -d "$(INSTALL_DATA_DIR)/baseset"
$(Q)install -d "$(INSTALL_DATA_DIR)/lang" $(Q)install -d "$(INSTALL_DATA_DIR)/lang"
$(Q)install -d "$(INSTALL_DATA_DIR)/scripts" $(Q)install -d "$(INSTALL_DATA_DIR)/scripts"
@@ -182,6 +183,7 @@ else
endif endif
$(Q)install -m 644 "$(BUNDLE_DIR)/lang/"* "$(INSTALL_DATA_DIR)/lang" $(Q)install -m 644 "$(BUNDLE_DIR)/lang/"* "$(INSTALL_DATA_DIR)/lang"
$(Q)install -m 644 "$(BUNDLE_DIR)/ai/"* "$(INSTALL_DATA_DIR)/ai" $(Q)install -m 644 "$(BUNDLE_DIR)/ai/"* "$(INSTALL_DATA_DIR)/ai"
$(Q)install -m 644 "$(BUNDLE_DIR)/game/"* "$(INSTALL_DATA_DIR)/game"
$(Q)install -m 644 "$(BUNDLE_DIR)/baseset/"* "$(INSTALL_DATA_DIR)/baseset" $(Q)install -m 644 "$(BUNDLE_DIR)/baseset/"* "$(INSTALL_DATA_DIR)/baseset"
$(Q)install -m 644 "$(BUNDLE_DIR)/scripts/"* "$(INSTALL_DATA_DIR)/scripts" $(Q)install -m 644 "$(BUNDLE_DIR)/scripts/"* "$(INSTALL_DATA_DIR)/scripts"
ifndef DO_NOT_INSTALL_DOCS ifndef DO_NOT_INSTALL_DOCS

View File

@@ -2,12 +2,12 @@
# $Id$ # $Id$
if ! [ -f ai/regression/regression.nut ]; then if ! [ -f ai/regression/completeness.sh ]; then
echo "Make sure you are in the root of OpenTTD before starting this script." echo "Make sure you are in the root of OpenTTD before starting this script."
exit 1 exit 1
fi fi
cat ai/regression/regression.nut | tr ';' '\n' | awk ' cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk '
/^function/ { /^function/ {
for (local in locals) { for (local in locals) {
delete locals[local] delete locals[local]
@@ -61,7 +61,7 @@ cat ai/regression/regression.nut | tr ';' '\n' | awk '
} }
' | sed 's/ //g' | sort | uniq > tmp.in_regression ' | sed 's/ //g' | sort | uniq > tmp.in_regression
grep 'DefSQ.*Method' ../src/ai/api/*.hpp.sq | grep -v 'AIError::' | grep -v 'AIAbstractList::Valuate' | grep -v '::GetClassName' | sed 's/^[^,]*, &//g;s/,[^,]*//g' | sort > tmp.in_api grep 'DefSQ.*Method' ../src/script/api/ai/*.hpp.sq | grep -v 'AIError::' | grep -v 'AIAbstractList::Valuate' | grep -v '::GetClassName' | sed 's/^[^,]*, &//g;s/,[^,]*//g' | sort > tmp.in_api
diff -u tmp.in_regression tmp.in_api | grep -v '^+++' | grep '^+' | sed 's/^+//' diff -u tmp.in_regression tmp.in_api | grep -v '^+++' | grep '^+' | sed 's/^+//'

View File

@@ -4,7 +4,7 @@ class Regression extends AIInfo {
function GetAuthor() { return "OpenTTD NoAI Developers Team"; } function GetAuthor() { return "OpenTTD NoAI Developers Team"; }
function GetName() { return "Regression"; } function GetName() { return "Regression"; }
function GetShortName() { return "REGR"; } function GetShortName() { return "REGR"; }
function GetDescription() { return "This runs regression-tests on all commands. On the same map the result should always be the same."; } function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
function GetVersion() { return 1; } function GetVersion() { return 1; }
function GetAPIVersion() { return "1.5"; } function GetAPIVersion() { return "1.5"; }
function GetDate() { return "2007-03-18"; } function GetDate() { return "2007-03-18"; }

View File

@@ -2,14 +2,11 @@
# $Id$ # $Id$
if ! [ -f ai/regression/regression.nut ]; then if ! [ -f ai/regression/run.sh ]; then
echo "Make sure you are in the root of OpenTTD before starting this script." echo "Make sure you are in the root of OpenTTD before starting this script."
exit 1 exit 1
fi fi
cp ai/regression/regression.nut ai/regression/main.nut
cp ai/regression/regression_info.nut ai/regression/info.nut
if [ -f scripts/game_start.scr ]; then if [ -f scripts/game_start.scr ]; then
mv scripts/game_start.scr scripts/game_start.scr.regression mv scripts/game_start.scr scripts/game_start.scr.regression
fi fi
@@ -22,27 +19,46 @@ fi
if [ "$1" = "-g" ]; then if [ "$1" = "-g" ]; then
gdb="gdb --ex run --args " gdb="gdb --ex run --args "
fi fi
if [ -n "$gdb" ]; then
$gdb ./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav if [ -d "ai/regression/tst_$1" ]; then
tests="ai/regression/tst_$1"
elif [ -d "ai/regression/tst_$2" ]; then
tests="ai/regression/tst_$2"
else else
./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav -d script=2 -d misc=9 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[script\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' | grep -v '^dbg: \[.*\]' > tmp.regression tests=ai/regression/tst_*
fi fi
ret=0 ret=0
if [ -z "$gdb" ]; then for tst in $tests; do
res="`diff -ub ai/regression/regression.txt tmp.regression`" echo -n "Running $tst... "
if [ -z "$res" ]; then
echo "Regression test passed!"
else
echo "Regression test failed! Difference:"
echo "$res"
ret=1
fi
echo ""
echo "Regression test done"
fi
rm -f ai/regression/main.nut ai/regression/info.nut # Make sure that only one info.nut is present for each test run. Otherwise openttd gets confused.
cp ai/regression/regression_info.nut $tst/info.nut
sav=$tst/test.sav
if ! [ -f $sav ]; then
sav=ai/regression/empty.sav
fi
if [ -n "$gdb" ]; then
$gdb ./openttd -x -c ai/regression/regression.cfg $params -g $sav
else
./openttd -x -c ai/regression/regression.cfg $params -g $sav -d script=2 -d misc=9 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[script\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' | grep -v '^dbg: \[.*\]' > tmp.regression
fi
if [ -z "$gdb" ]; then
res="`diff -ub $tst/result.txt tmp.regression`"
if [ -z "$res" ]; then
echo "passed!"
else
echo "failed! Difference:"
echo "$res"
ret=1
fi
fi
rm $tst/info.nut
done
if [ -f scripts/game_start.scr.regression ]; then if [ -f scripts/game_start.scr.regression ]; then
mv scripts/game_start.scr.regression scripts/game_start.scr mv scripts/game_start.scr.regression scripts/game_start.scr

View File

@@ -972,48 +972,7 @@ function Regression::Order()
print(" SetStopLocation(): " + AIOrder.SetStopLocation(20, 0, AIOrder.STOPLOCATION_MIDDLE)); print(" SetStopLocation(): " + AIOrder.SetStopLocation(20, 0, AIOrder.STOPLOCATION_MIDDLE));
print(" GetStopLocation(): " + AIOrder.GetStopLocation(20, 0)); print(" GetStopLocation(): " + AIOrder.GetStopLocation(20, 0));
local list = AIStationList_Vehicle(12); local list = AIVehicleList_Station(3);
print("");
print("--StationList_Vehicle--");
print(" Count(): " + list.Count());
list.Valuate(AIStation.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 0);
print(" CargoWaiting(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 1);
print(" CargoWaiting(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoRating, 1);
print(" CargoRating(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
print(" DistanceManhattanToTile(30000) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
print(" DistanceSquareToTile(30000) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.IsWithinTownInfluence, 0);
print(" IsWithinTownInfluence(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list = AIVehicleList_Station(3);
print(""); print("");
print("--VehicleList_Station--"); print("--VehicleList_Station--");
@@ -1269,25 +1228,23 @@ function Regression::Station()
} }
} }
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
print(""); print("");
print("--StationList--"); print("--CargoPlanned--");
print(" Count(): " + list.Count()); for (local cargo = 0; cargo <= 1000; cargo += 1000) {
list.Valuate(AIStation.GetLocation); for (local station0 = 0; station0 <= 1000; station0 += 1000) {
print(" Location ListDump:"); print(" GetCargoPlanned(" + station0 + ", " + cargo + "): " +
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) { AIStation.GetCargoPlanned(station0, cargo));
print(" " + i + " => " + list.GetValue(i)); for (local station1 = 0; station1 <= 1000; station1 += 1000) {
} print(" GetCargoPlannedFrom(" + station0 + ", " + station1 + ", " + cargo + "): " +
list.Valuate(AIStation.GetCargoWaiting, 0); AIStation.GetCargoPlannedFrom(station0, station1, cargo));
print(" CargoWaiting(0) ListDump:"); print(" GetCargoPlannedVia(" + station0 + ", " + station1 + ", " + cargo + "): " +
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) { AIStation.GetCargoPlannedFrom(station0, station1, cargo));
print(" " + i + " => " + list.GetValue(i)); for (local station2 = 0; station2 <= 1000; station2 += 1000) {
} print(" GetCargoPlannedFromVia(" + station0 + ", " + station1 + ", " + station2 + ", " + cargo + "): " +
list.Valuate(AIStation.GetCargoWaiting, 1); AIStation.GetCargoPlannedFromVia(station0, station1, station2, cargo));
print(" CargoWaiting(1) ListDump:"); }
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) { }
print(" " + i + " => " + list.GetValue(i)); }
} }
} }

View File

@@ -7539,17 +7539,43 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetCargoWaitingFromVia(1000, 1000, 0, 1000): -1 GetCargoWaitingFromVia(1000, 1000, 0, 1000): -1
GetCargoWaitingFromVia(1000, 1000, 1000, 1000): -1 GetCargoWaitingFromVia(1000, 1000, 1000, 1000): -1
--StationList-- --CargoPlanned--
Count(): 2 GetCargoPlanned(0, 0): 0
Location ListDump: GetCargoPlannedFrom(0, 0, 0): 0
5 => 33421 GetCargoPlannedVia(0, 0, 0): 0
4 => 33411 GetCargoPlannedFromVia(0, 0, 0, 0): 0
CargoWaiting(0) ListDump: GetCargoPlannedFromVia(0, 0, 1000, 0): -1
5 => 0 GetCargoPlannedFrom(0, 1000, 0): -1
4 => 0 GetCargoPlannedVia(0, 1000, 0): -1
CargoWaiting(1) ListDump: GetCargoPlannedFromVia(0, 1000, 0, 0): -1
5 => 0 GetCargoPlannedFromVia(0, 1000, 1000, 0): -1
4 => 0 GetCargoPlanned(1000, 0): -1
GetCargoPlannedFrom(1000, 0, 0): -1
GetCargoPlannedVia(1000, 0, 0): -1
GetCargoPlannedFromVia(1000, 0, 0, 0): -1
GetCargoPlannedFromVia(1000, 0, 1000, 0): -1
GetCargoPlannedFrom(1000, 1000, 0): -1
GetCargoPlannedVia(1000, 1000, 0): -1
GetCargoPlannedFromVia(1000, 1000, 0, 0): -1
GetCargoPlannedFromVia(1000, 1000, 1000, 0): -1
GetCargoPlanned(0, 1000): -1
GetCargoPlannedFrom(0, 0, 1000): -1
GetCargoPlannedVia(0, 0, 1000): -1
GetCargoPlannedFromVia(0, 0, 0, 1000): -1
GetCargoPlannedFromVia(0, 0, 1000, 1000): -1
GetCargoPlannedFrom(0, 1000, 1000): -1
GetCargoPlannedVia(0, 1000, 1000): -1
GetCargoPlannedFromVia(0, 1000, 0, 1000): -1
GetCargoPlannedFromVia(0, 1000, 1000, 1000): -1
GetCargoPlanned(1000, 1000): -1
GetCargoPlannedFrom(1000, 0, 1000): -1
GetCargoPlannedVia(1000, 0, 1000): -1
GetCargoPlannedFromVia(1000, 0, 0, 1000): -1
GetCargoPlannedFromVia(1000, 0, 1000, 1000): -1
GetCargoPlannedFrom(1000, 1000, 1000): -1
GetCargoPlannedVia(1000, 1000, 1000): -1
GetCargoPlannedFromVia(1000, 1000, 0, 1000): -1
GetCargoPlannedFromVia(1000, 1000, 1000, 1000): -1
--Tile-- --Tile--
HasTreeOnTile(): false HasTreeOnTile(): false
@@ -9141,30 +9167,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
SetStopLocation(): true SetStopLocation(): true
GetStopLocation(): 1 GetStopLocation(): 1
--StationList_Vehicle--
Count(): 2
Location ListDump:
5 => 33421
4 => 33411
CargoWaiting(0) ListDump:
5 => 0
4 => 0
CargoWaiting(1) ListDump:
5 => 0
4 => 0
CargoRating(1) ListDump:
5 => -1
4 => -1
DistanceManhattanToTile(30000) ListDump:
5 => 106
4 => 96
DistanceSquareToTile(30000) ListDump:
5 => 8818
4 => 7058
IsWithinTownInfluence(0) ListDump:
5 => 0
4 => 0
--VehicleList_Station-- --VehicleList_Station--
Count(): 1 Count(): 1
Location ListDump: Location ListDump:

View File

@@ -0,0 +1,216 @@
/* $Id$ */
class Regression extends AIController {
function Start();
};
function Regression::StationList()
{
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
print("");
print("--StationList--");
print(" Count(): " + list.Count());
list.Valuate(AIStation.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 0);
print(" CargoWaiting(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 1);
print(" CargoWaiting(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_Cargo()
{
print("");
print("--StationList_Cargo--");
for (local mode = AIStationList_Cargo.CM_WAITING; mode <= AIStationList_Cargo.CM_PLANNED; ++mode) {
print(" " + mode);
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA ; ++selector) {
print(" " + selector);
local list = AIStationList_Cargo(mode, selector, 6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
}
};
function Regression::StationList_CargoPlanned()
{
print("");
print("--StationList_CargoPlanned--");
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
print(" " + selector);
local list = AIStationList_CargoPlanned(selector, 6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
};
function Regression::StationList_CargoPlannedByFrom()
{
print("");
print("--StationList_CargoPlannedByFrom--");
local list = AIStationList_CargoPlannedByFrom(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoPlannedByVia()
{
print("");
print("--StationList_CargoPlannedByVia--");
local list = AIStationList_CargoPlannedByVia(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoPlannedViaByFrom()
{
print("");
print("--StationList_CargoPlannedViaByFrom--");
local list = AIStationList_CargoPlannedViaByFrom(6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoPlannedFromByVia()
{
print("");
print("--StationList_CargoPlannedFromByVia--");
local list = AIStationList_CargoPlannedFromByVia(6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaiting()
{
print("");
print("--StationList_CargoWaiting--");
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
print(" " + selector);
local list = AIStationList_CargoWaiting(selector, 6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
};
function Regression::StationList_CargoWaitingByFrom()
{
print("");
print("--StationList_CargoWaitingByFrom--");
local list = AIStationList_CargoWaitingByFrom(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaitingByVia()
{
print("");
print("--StationList_CargoWaitingByVia--");
local list = AIStationList_CargoWaitingByVia(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaitingViaByFrom()
{
print("");
print("--StationList_CargoWaitingViaByFrom--");
local list = AIStationList_CargoWaitingViaByFrom(6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaitingFromByVia()
{
print("");
print("--StationList_CargoWaitingFromByVia--");
local list = AIStationList_CargoWaitingFromByVia(2, 0, 2);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_Vehicle()
{
local list = AIStationList_Vehicle(12);
print("");
print("--StationList_Vehicle--");
print(" Count(): " + list.Count());
list.Valuate(AIStation.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 0);
print(" CargoWaiting(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 1);
print(" CargoWaiting(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoRating, 1);
print(" CargoRating(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
print(" DistanceManhattanToTile(30000) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
print(" DistanceSquareToTile(30000) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.IsWithinTownInfluence, 0);
print(" IsWithinTownInfluence(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
function Regression::Start()
{
StationList();
StationList_Cargo();
StationList_CargoPlanned();
StationList_CargoPlannedByFrom();
StationList_CargoPlannedByVia();
StationList_CargoPlannedViaByFrom();
StationList_CargoPlannedFromByVia();
StationList_CargoWaiting();
StationList_CargoWaitingByFrom();
StationList_CargoWaitingByVia();
StationList_CargoWaitingViaByFrom();
StationList_CargoWaitingFromByVia();
StationList_Vehicle();
}

View File

@@ -0,0 +1,127 @@
--StationList--
Count(): 5
Location ListDump:
6 => 42341
2 => 41831
7 => 41825
5 => 33421
4 => 33411
CargoWaiting(0) ListDump:
7 => 6
6 => 6
2 => 3
5 => 0
4 => 0
CargoWaiting(1) ListDump:
7 => 0
6 => 0
5 => 0
4 => 0
2 => 0
--StationList_Cargo--
0
0
6 => 6
1
6 => 2
2
2 => 4
7 => 2
3
1
0
7 => 18
6 => 16
2 => 7
1
6 => 8
2 => 3
2
2 => 16
6 => 14
7 => 11
3
6 => 10
2 => 8
--StationList_CargoPlanned--
0
7 => 18
6 => 16
2 => 7
1
6 => 8
2 => 3
2
2 => 16
6 => 14
7 => 11
3
6 => 10
2 => 8
--StationList_CargoPlannedByFrom--
7 => 8
6 => 8
2 => 7
--StationList_CargoPlannedByVia--
2 => 16
6 => 7
--StationList_CargoPlannedViaByFrom--
6 => 8
2 => 3
--StationList_CargoPlannedFromByVia--
6 => 10
2 => 8
--StationList_CargoWaiting--
0
6 => 6
1
6 => 2
2
2 => 4
7 => 2
3
--StationList_CargoWaitingByFrom--
2 => 3
--StationList_CargoWaitingByVia--
6 => 3
--StationList_CargoWaitingViaByFrom--
6 => 2
--StationList_CargoWaitingFromByVia--
6 => 3
--StationList_Vehicle--
Count(): 2
Location ListDump:
5 => 33421
4 => 33411
CargoWaiting(0) ListDump:
5 => 0
4 => 0
CargoWaiting(1) ListDump:
5 => 0
4 => 0
CargoRating(1) ListDump:
5 => -1
4 => -1
DistanceManhattanToTile(30000) ListDump:
5 => 106
4 => 96
DistanceSquareToTile(30000) ListDump:
5 => 8818
4 => 7058
IsWithinTownInfluence(0) ListDump:
5 => 0
4 => 0
ERROR: The script died unexpectedly.

Binary file not shown.

View File

@@ -24,6 +24,7 @@ description.es_ES = Un conjunto de música vacío.
description.et_EE = Muusikakogu ilma muusikata. description.et_EE = Muusikakogu ilma muusikata.
description.fi_FI = Musiikkipaketti, jossa ei ole musiikkia. description.fi_FI = Musiikkipaketti, jossa ei ole musiikkia.
description.fr_FR = Un pack de musiques sans musiques. description.fr_FR = Un pack de musiques sans musiques.
description.ga_IE = Pacáiste ceoil gan aon cheol iarbhír ann.
description.gd_GB = Pacaid ciùil anns nach eil fonn sam bith. description.gd_GB = Pacaid ciùil anns nach eil fonn sam bith.
description.gl_ES = Un conxunto de músicas sen ningunha música. description.gl_ES = Un conxunto de músicas sen ningunha música.
description.hr_HR = Muzički paket bez ikakve muzike. description.hr_HR = Muzički paket bez ikakve muzike.
@@ -33,6 +34,7 @@ description.is_IS = Tónlistarpakki sem er í raun án tónlistar.
description.it_IT = Un pacchetto musicale non contenente alcuna musica. description.it_IT = Un pacchetto musicale non contenente alcuna musica.
description.ja_JP = 空の音楽パック description.ja_JP = 空の音楽パック
description.ko_KR = 실제 음악이 없는 음악 목록입니다. description.ko_KR = 실제 음악이 없는 음악 목록입니다.
description.la_VA = Sarcina musicae sine ulla musica.
description.lb_LU = E Musikpack ouni aktuell Musik. description.lb_LU = E Musikpack ouni aktuell Musik.
description.lt_LT = Muzikos pakas be muzikos. description.lt_LT = Muzikos pakas be muzikos.
description.lv_LV = Mūzikas kopa bez mūzikas description.lv_LV = Mūzikas kopa bez mūzikas

View File

@@ -25,6 +25,7 @@ description.et_EE = Helikogu ilma helideta.
description.eu_ES = Soinurik gabeko soinu pakete bat description.eu_ES = Soinurik gabeko soinu pakete bat
description.fi_FI = Äänipaketti, jossa ei ole ääniä. description.fi_FI = Äänipaketti, jossa ei ole ääniä.
description.fr_FR = Un pack de sons sans sons. description.fr_FR = Un pack de sons sans sons.
description.ga_IE = Pacáiste fuaimeanna gan aon fhuaimeanna ann.
description.gd_GB = Pacaid fhuaimean anns nach eil fuaim sam bith. description.gd_GB = Pacaid fhuaimean anns nach eil fuaim sam bith.
description.gl_ES = Un conxunto de sons sen ningún son description.gl_ES = Un conxunto de sons sen ningún son
description.hr_HR = Zvučni paket bez ikakvih zvukova. description.hr_HR = Zvučni paket bez ikakvih zvukova.
@@ -34,7 +35,8 @@ description.is_IS = Hljóðpakki án hljóðs.
description.it_IT = Un pacchetto sonoro non contenente alcun suono. description.it_IT = Un pacchetto sonoro non contenente alcun suono.
description.ja_JP = 空の効果音パック description.ja_JP = 空の効果音パック
description.ko_KR = 아무런 효과음도 없는 효과음 팩입니다. description.ko_KR = 아무런 효과음도 없는 효과음 팩입니다.
description.lb_LU = En Soundpack mat all den Sounds. description.la_VA = Sarcina sonorum sine ullis sonis.
description.lb_LU = E Soundpack ouni iergendee Sound.
description.lt_LT = Garsų pakas be jokių garsų. description.lt_LT = Garsų pakas be jokių garsų.
description.nb_NO = En lydpakke uten noen lyder. description.nb_NO = En lydpakke uten noen lyder.
description.nl_NL = Een geluidset zonder geluid. description.nl_NL = Een geluidset zonder geluid.

Binary file not shown.

Binary file not shown.

View File

@@ -25,6 +25,7 @@ description.es_ES = Gráficos originales de Transport Tycoon Deluxe versión DOS
description.et_EE = Algse Transport Tycoon Deluxe DOSi versiooni graafika. description.et_EE = Algse Transport Tycoon Deluxe DOSi versiooni graafika.
description.fi_FI = Alkuperäiset Transport Tycoon Deluxen DOS-version grafiikat. description.fi_FI = Alkuperäiset Transport Tycoon Deluxen DOS-version grafiikat.
description.fr_FR = Graphiques originaux de Transport Tycoon Deluxe (version DOS). description.fr_FR = Graphiques originaux de Transport Tycoon Deluxe (version DOS).
description.ga_IE = Grafaicí bunaidhTransport Tycoon Deluxe, eagrán DOS.
description.gd_GB = Grafaigeachd aig an deasachadh DOS tùsail aig Transport Tycoon Deluxe. description.gd_GB = Grafaigeachd aig an deasachadh DOS tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Graficos da edición orixinal de Transport Tycoon Deluxe para DOS. description.gl_ES = Graficos da edición orixinal de Transport Tycoon Deluxe para DOS.
description.hr_HR = Originalna grafika za Transport Tycoon Deluxe DOS izdanje. description.hr_HR = Originalna grafika za Transport Tycoon Deluxe DOS izdanje.
@@ -34,6 +35,7 @@ description.is_IS = Upprunalega grafíkin úr Transport Tycoon Deluxe DOS útgá
description.it_IT = Grafica originale di Transport Tycoon Deluxe, edizione DOS. description.it_IT = Grafica originale di Transport Tycoon Deluxe, edizione DOS.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (DOS) description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (DOS)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 도스 에디션의 그래픽입니다. description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 도스 에디션의 그래픽입니다.
description.la_VA = Graphica ex editione originale Transport Tycoon Deluxe DOS.
description.lb_LU = Original Transport Tycoon Deluxe DOS Editioun Grafik. description.lb_LU = Original Transport Tycoon Deluxe DOS Editioun Grafik.
description.lt_LT = Originali Transport Tycoon Deluxe DOS leidimo grafika. description.lt_LT = Originali Transport Tycoon Deluxe DOS leidimo grafika.
description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for DOS. description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for DOS.
@@ -70,7 +72,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9 TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6 TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6
OPENTTD.GRF = 75a93cea2ed455c2fd5dcbda39e53538 OPENTTD.GRF = 505d96061556d3bb5cec6234096ec5bc
[origin] [origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM. default = You can find it on your Transport Tycoon Deluxe CD-ROM.

View File

@@ -24,6 +24,7 @@ description.es_ES = Sonidos originales de Transport Tycoon Deluxe versión DOS.
description.et_EE = Algse Transport Tycoon Deluxe DOSi versiooni helid. description.et_EE = Algse Transport Tycoon Deluxe DOSi versiooni helid.
description.fi_FI = Alkuperäiset Transport Tycoon Deluxen DOS-version äänet. description.fi_FI = Alkuperäiset Transport Tycoon Deluxen DOS-version äänet.
description.fr_FR = Sons originaux de Transport Tycoon Deluxe (version DOS). description.fr_FR = Sons originaux de Transport Tycoon Deluxe (version DOS).
description.ga_IE = Fuaimeanna bunaidh Transport Tycoon Deluxe, eagrán DOS.
description.gd_GB = Fuaimean aig an deasachadh DOS tùsail aig Transport Tycoon Deluxe. description.gd_GB = Fuaimean aig an deasachadh DOS tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Sons da edición orixinal de Transport Tycoon Deluxe para DOS. description.gl_ES = Sons da edición orixinal de Transport Tycoon Deluxe para DOS.
description.hr_HR = Originalni zvukovi za Transport Tycoon Deluxe DOS izdanje. description.hr_HR = Originalni zvukovi za Transport Tycoon Deluxe DOS izdanje.
@@ -33,6 +34,7 @@ description.is_IS = Upprunalega hljóðið úr Transport Tycoon Deluxe DOS útg
description.it_IT = Suoni originali di Transport Tycoon Deluxe, edizione DOS. description.it_IT = Suoni originali di Transport Tycoon Deluxe, edizione DOS.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 効果音 (DOS) description.ja_JP = Transport Tycoon Deluxe オリジナル版 効果音 (DOS)
description.ko_KR = 오리지널 트랜스포트 타이쿤 도스 에디션의 효과음입니다. description.ko_KR = 오리지널 트랜스포트 타이쿤 도스 에디션의 효과음입니다.
description.la_VA = Soni ex editione originale Transport Tycoon Deluxe DOS.
description.lb_LU = Original Transport Tycoon Deluxe DOS Editioun Sound. description.lb_LU = Original Transport Tycoon Deluxe DOS Editioun Sound.
description.lt_LT = Originalūs Transport Tycoon Deluxe DOS leidimo garsai. description.lt_LT = Originalūs Transport Tycoon Deluxe DOS leidimo garsai.
description.nb_NO = Originale lyder fra Transport Tycoon Deluxe for DOS. description.nb_NO = Originale lyder fra Transport Tycoon Deluxe for DOS.

View File

@@ -25,6 +25,7 @@ description.es_ES = Gráficos originales de Transport Tycoon Deluxe versión DOS
description.et_EE = Algse Transport Tycoon Deluxe DOSi (Saksa) versiooni graafika. description.et_EE = Algse Transport Tycoon Deluxe DOSi (Saksa) versiooni graafika.
description.fi_FI = Alkuperäiset Saksassa julkaistun Transport Tycoon Deluxen DOS-version grafiikat. description.fi_FI = Alkuperäiset Saksassa julkaistun Transport Tycoon Deluxen DOS-version grafiikat.
description.fr_FR = Graphiques originaux de Transport Tycoon Deluxe (version DOS allemande). description.fr_FR = Graphiques originaux de Transport Tycoon Deluxe (version DOS allemande).
description.ga_IE = Grafaicí bunaidhTransport Tycoon Deluxe, eagrán DOS (Gearmánach).
description.gd_GB = Grafaigeachd aig an deasachadh DOS (Gearmailteach) tùsail aig Transport Tycoon Deluxe. description.gd_GB = Grafaigeachd aig an deasachadh DOS (Gearmailteach) tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Graficos da edición orixinal (alemá) de Transport Tycoon Deluxe para DOS. description.gl_ES = Graficos da edición orixinal (alemá) de Transport Tycoon Deluxe para DOS.
description.hr_HR = Originalna grafika za Transport Tycoon Deluxe DOS (Njemački) izdanje. description.hr_HR = Originalna grafika za Transport Tycoon Deluxe DOS (Njemački) izdanje.
@@ -34,6 +35,7 @@ description.is_IS = Upprunalega grafíkin úr Transport Tycoon Deluxe DOS (þýs
description.it_IT = Grafica originale di Transport Tycoon Deluxe (tedesco), edizione DOS. description.it_IT = Grafica originale di Transport Tycoon Deluxe (tedesco), edizione DOS.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (DOS・ドイツ版) description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (DOS・ドイツ版)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 도스 에디션(독일)의 그래픽입니다. description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 도스 에디션(독일)의 그래픽입니다.
description.la_VA = Graphica ex editione originale Transport Tycoon Deluxe DOS (Germanica).
description.lb_LU = Original Transport Tycoon Deluxe DOS (Däitsch) Editioun Grafik. description.lb_LU = Original Transport Tycoon Deluxe DOS (Däitsch) Editioun Grafik.
description.lt_LT = Originali Transport Tycoon Deluxe DOS (Vokiečių) leidimo grafika. description.lt_LT = Originali Transport Tycoon Deluxe DOS (Vokiečių) leidimo grafika.
description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for DOS (tysk). description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for DOS (tysk).
@@ -70,7 +72,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9 TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = fcde1d7e8a74197d72a62695884b909e TRGT.GRF = fcde1d7e8a74197d72a62695884b909e
OPENTTD.GRF = 75a93cea2ed455c2fd5dcbda39e53538 OPENTTD.GRF = 505d96061556d3bb5cec6234096ec5bc
[origin] [origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM. default = You can find it on your Transport Tycoon Deluxe CD-ROM.

View File

@@ -25,6 +25,7 @@ description.es_ES = Gráficos originales de Transport Tycoon Deluxe versión Win
description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni graafika. description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni graafika.
description.fi_FI = Alkuperäiset Transport Tycoon Deluxen Windows-version grafiikat. description.fi_FI = Alkuperäiset Transport Tycoon Deluxen Windows-version grafiikat.
description.fr_FR = Graphiques originaux de Transport Tycoon Deluxe (version Windows). description.fr_FR = Graphiques originaux de Transport Tycoon Deluxe (version Windows).
description.ga_IE = Grafaicí bunaidhTransport Tycoon Deluxe, eagrán Windows.
description.gd_GB = Grafaigeachd aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe. description.gd_GB = Grafaigeachd aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Graficos da edición orixinal de Transport Tycoon Deluxe para Windows. description.gl_ES = Graficos da edición orixinal de Transport Tycoon Deluxe para Windows.
description.hr_HR = Originalna grafika za Transport Tycoon Deluxe Windows izdanje. description.hr_HR = Originalna grafika za Transport Tycoon Deluxe Windows izdanje.
@@ -34,6 +35,7 @@ description.is_IS = Upprunalega grafíkin úr Transport Tycoon Deluxe Windows ú
description.it_IT = Grafica originale di Transport Tycoon Deluxe, edizione Windows. description.it_IT = Grafica originale di Transport Tycoon Deluxe, edizione Windows.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (Windows) description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (Windows)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도 에디션의 그래픽입니다. description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도 에디션의 그래픽입니다.
description.la_VA = Graphica ex editione originale Transport Tycoon Deluxe Windows.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Grafik. description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Grafik.
description.lt_LT = Originali Transport Tycoon Deluxe Windows leidimo grafika. description.lt_LT = Originali Transport Tycoon Deluxe Windows leidimo grafika.
description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for Windows. description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for Windows.
@@ -70,7 +72,7 @@ TRGIR.GRF = 0c2484ff6be49fc63a83be6ab5c38f32
TRGCR.GRF = 3668f410c761a050b5e7095a2b14879b TRGCR.GRF = 3668f410c761a050b5e7095a2b14879b
TRGHR.GRF = 06bf2b7a31766f048baac2ebe43457b1 TRGHR.GRF = 06bf2b7a31766f048baac2ebe43457b1
TRGTR.GRF = de53650517fe661ceaa3138c6edb0eb8 TRGTR.GRF = de53650517fe661ceaa3138c6edb0eb8
OPENTTD.GRF = 75a93cea2ed455c2fd5dcbda39e53538 OPENTTD.GRF = 505d96061556d3bb5cec6234096ec5bc
[origin] [origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM. default = You can find it on your Transport Tycoon Deluxe CD-ROM.

View File

@@ -24,6 +24,7 @@ description.es_ES = Música original de Transport Tycoon Deluxe versión Windows
description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni muusika. description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni muusika.
description.fi_FI = Alkuperäinen Transport Tycoon Deluxen Windows-version musiikki. description.fi_FI = Alkuperäinen Transport Tycoon Deluxen Windows-version musiikki.
description.fr_FR = Musiques originales de Transport Tycoon Deluxe (version Windows). description.fr_FR = Musiques originales de Transport Tycoon Deluxe (version Windows).
description.ga_IE = Ceol bunaidh Transport Tycoon Deluxe, eagrán Windows.
description.gd_GB = Ceòl aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe. description.gd_GB = Ceòl aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Música da edición orixinal de Transport Tycoon Deluxe para Windows. description.gl_ES = Música da edición orixinal de Transport Tycoon Deluxe para Windows.
description.hr_HR = Originalna muzika za Transport Tycoon Deluxe Windows izdanje. description.hr_HR = Originalna muzika za Transport Tycoon Deluxe Windows izdanje.
@@ -33,7 +34,8 @@ description.is_IS = Upprunalega tónlistin úr Transport Tycoon Deluxe Windows
description.it_IT = Musica originale di Transport Tycoon Deluxe, edizione Windows. description.it_IT = Musica originale di Transport Tycoon Deluxe, edizione Windows.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 音楽 (Windows) description.ja_JP = Transport Tycoon Deluxe オリジナル版 音楽 (Windows)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도 에디션의 음악입니다. description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도 에디션의 음악입니다.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Music. description.la_VA = Musica ex editione originale Transport Tycoon Deluxe Windows.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Musik.
description.lt_LT = Originali Transport Tycoon Deluxe Windows leidimo muzika. description.lt_LT = Originali Transport Tycoon Deluxe Windows leidimo muzika.
description.lv_LV = Oriģinālā Transport Tycoon Deluxe Windows izdevuma mūzika. description.lv_LV = Oriģinālā Transport Tycoon Deluxe Windows izdevuma mūzika.
description.nb_NO = Original musikk fra Transport Tycoon Deluxe for Windows. description.nb_NO = Original musikk fra Transport Tycoon Deluxe for Windows.

View File

@@ -24,6 +24,7 @@ description.es_ES = Sonidos originales de Transport Tycoon Deluxe versión Windo
description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni helid. description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni helid.
description.fi_FI = Alkuperäiset Transport Tycoon Deluxen Windows-version äänet. description.fi_FI = Alkuperäiset Transport Tycoon Deluxen Windows-version äänet.
description.fr_FR = Sons originaux de Transport Tycoon Deluxe (version Windows). description.fr_FR = Sons originaux de Transport Tycoon Deluxe (version Windows).
description.ga_IE = Fuaimeanna bunaidh Transport Tycoon Deluxe, eagrán Windows.
description.gd_GB = Fuaimean aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe. description.gd_GB = Fuaimean aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Sons da edición orixinal de Transport Tycoon Deluxe para Windows. description.gl_ES = Sons da edición orixinal de Transport Tycoon Deluxe para Windows.
description.hr_HR = Originalni zvukovi za Transport Tycoon Deluxe Windows izdanje. description.hr_HR = Originalni zvukovi za Transport Tycoon Deluxe Windows izdanje.
@@ -33,6 +34,7 @@ description.is_IS = Upprunalega hljóðið úr Transport Tycoon Deluxe Windows
description.it_IT = Suoni originali di Transport Tycoon Deluxe, edizione Windows. description.it_IT = Suoni originali di Transport Tycoon Deluxe, edizione Windows.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 効果音 (Windows) description.ja_JP = Transport Tycoon Deluxe オリジナル版 効果音 (Windows)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도 에디션의 효과음입니다. description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도 에디션의 효과음입니다.
description.la_VA = Soni ex editione originale Transport Tycoon Deluxe Windows.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Sound. description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Sound.
description.lt_LT = Originalūs Transport Tycoon Deluxe Windows leidimo garsai. description.lt_LT = Originalūs Transport Tycoon Deluxe Windows leidimo garsai.
description.nb_NO = Originale lyder fra Transport Tycoon Deluxe for Windows. description.nb_NO = Originale lyder fra Transport Tycoon Deluxe for Windows.

View File

@@ -16,3 +16,10 @@ GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL; if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth); return GSTown._SetGrowthRate(town_id, days_between_town_growth);
} }
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}

View File

@@ -16,3 +16,10 @@ GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL; if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth); return GSTown._SetGrowthRate(town_id, days_between_town_growth);
} }
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}

View File

@@ -8,3 +8,10 @@
*/ */
GSLog.Info("1.4 API compatibility in effect."); GSLog.Info("1.4 API compatibility in effect.");
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}

View File

@@ -1,3 +1,218 @@
1.5.3 (2015-12-01)
------------------------------------------------------------------------
(None)
1.5.3-RC1 (2015-11-01)
------------------------------------------------------------------------
- Fix: When selecting a refit cargo for orders, do not check whether the vehicle is in a depot or station, and do not ask whether the vehicle currently allows station-refitting. Also hide the refit cost for orders, it is not predictable (r27428)
- Fix: Use the NewGRF railtype sorting order in the infrastructure window (r27427)
- Fix: Crash when switching to or taking over companies, when an order window of a vehicle of the new company was opened. Now close those windows [FS#5842] (r27425)
- Fix: Towns did not connect roads to existing roads, unless they had only a single roadbit. Otoh, towns also tried to connect to single roadbit tiles such as tunnels and depots, even though they were not connectable in the direction of interest [FS#6374] (r27424)
- Fix: When towns expanded single-bit roadtiles using a grid-layout, they used the layout position of the neighbouring tile (r27423)
- Fix: Aircraft picked the wrong airport entry point, if airports were rotated by 180 degree [FS#6341] (r27422)
- Fix: Consider text and icon sizes when drawing the client list [FS#6265] (r27421)
- Fix: GrowTownAtRoad sometimes returned false, even when a house was built [FS#6362] (r27420)
- Fix: CmdSellRailWagon did not revert all actions properly when no orderlist could be allocated [FS#6369] (r27419)
- Fix: Desync due to incorrect storage of segments with different railtype in the YAPF cache [FS#6329] [FS#6379] (r27418)
- Fix: When a dedicated server was paused with no clients, the master server advertisement interval was slowed, causing deadvertisement of the server [FS#6368] (r27400)
- Fix: [Makefile] Game script directory and compat*.nut were never installed on *nix (r27399)
- Fix: There are two different availability conditions for fdatasync in the manpage. Use them both, since at least on some MinGW versions one is not enough (r27389)
- Fix: win32 sound driver failed to report errors (r27383)
- Fix: Clickareas in settings tree were misaligned when the filter warning was displayed, if the setting height was defined by the icons instead of the font [FS#6358] (r27366)
- Fix: Center settings filter warning also vertically, and also in case of multiple lines (r27365)
1.5.2 (2015-09-01)
------------------------------------------------------------------------
(None)
1.5.2-RC1 (2015-08-01)
------------------------------------------------------------------------
- Change: Auto-complete partial roads when building level-crossings [FS#6283] (r27309)
- Fix: Do not rerandomise the town name when only cost-estimating the founding [FS#6332] (r27341)
- Fix: Make variety distribution not assume that sea level is at height 0.2 / 3 * TGPGetMaxHeight() [FS#6335] (r27331, r27330, r27329, r27328)
- Fix: Remove corner-case optimisation for line drawing, which failed for dashed lines (r27324)
- Fix: Clipping of inclined lines did not account for the 'horizontal width' being bigger than the 'real width' (r27323, r27322)
- Fix: Incorrect owner assignment when adding/removing road/tram to/from bridges [FS#6317] (r27313, r27312)
- Fix: Mark infrastructure window dirty in more cases (r27311)
- Fix: Prevent breaking of tram-reversal points by adding more road pieces [FS#6283] (r27308)
- Fix: Error message window with manager face failed with GUI zoom [FS#6259] (r27307)
- Fix: Account for road-bridges and drive-through-stops in CanFollowRoad [FS#6320] (r27306, r27305)
- Fix: Password window layout with GUI zoom [FS#6321] (r27304, r27303)
- Fix: Speed-only timetables got assigned times in stations [FS#6313] (r27302, r27301)
- Fix: Enforce the company's default service intervals when purchasing another company [FS#6254] (r27282, r27281)
- Fix: Cloning/autoreplace/autorenew did not copy custom service intervals (r27280)
1.5.1 (2015-06-01)
------------------------------------------------------------------------
(None)
1.5.1-RC1 (2015-05-08)
------------------------------------------------------------------------
- Fix: Do not consider road junctions with trivial dead ends as branch points during town growth [FS#6245] (r27260, r27259, r27244)
- Fix: ScriptList::RemoveList failed to remove a list from itself [FS#6287] (r27258)
- Fix: Combined button+dropdown widgets in order and autoreplace GUI had incorrect hitbox when using GUI zoom [FS#6270] (r27255)
- Fix: When building a lock on DC_AUTO-removable water-based objects, the water class was always set to canal [FS#6264] (r27254)
- Fix: When crossing tram tracks with railroads, cost of extra roads was not being counted [FS#6282] (r27253)
- Fix: Invalid infrastructure counting when crossing tram tracks with railroads [FS#6281] (r27252)
- Fix: Broken error message in configure [FS#6286] (r27250)
- Fix: In some cases town growth failure was considered as success [FS#6240] (r27249, r27247)
- Fix: Town labels on smallmap and zoomed-out viewports were not centered [FS#6257] (r27248)
- Fix: Removing a rail waypoint used the remove-rail-station cost [FS#6251] (r27245)
- Fix: Duplicate frees due to pool item classes not having copy constructors [FS#6285] (r27243)
- Fix: Crash when no AIs were installed due to improper handling of non-ASCII characters by the string pointer lexer [FS#6272] (r27233)
- Fix: Compilation on DragonflyBSD [FS#6274] (r27224, r27223)
- Fix: Use the current maximum speed as limited by bridges, orders etc. for all vehicle types alike when considering increased smoke emissions of vehicles [FS#6278] (r27222)
- Fix: Multi-value keys in the desktop entry shall end with a trailing separator (r27221)
- Fix: Draw path reservation on the whole bridge, not only on the bridge heads (r27209)
- Fix: Draw correct overlay sprites for path reservations on bridges and tunnels (r27208)
1.5.0 (2015-04-01)
------------------------------------------------------------------------
- Fix: [NewGRF] Add Misc. GRF Feature Flag 6 to enable the second rocky tile set [FS#6260] (r27200)
1.5.0-RC1 (2015-03-18)
------------------------------------------------------------------------
- Feature: [NewGRF] Display relative offset changes in the sprite aligner [FS#6236] (r27174)
- Fix: Original road vehicle acceleration crashed for vehicles taking over [FS#6255] (r27190)
- Fix: GCC 5 compilation (r27185, r27183)
- Fix: Data race due to lazy initialisation of objects [FS#5969] (r27178)
- Fix: Compilation with MinGW64 (r27176)
- Fix: Use the regular clipping functions in the sprite aligner instead of some magic [FS#6237] (r27173)
- Fix: Windows randomly drops SetCursorPos calls, breaking the RMB-scrolling [FS#6238] (r27172)
1.5.0-beta2 (2015-02-24)
------------------------------------------------------------------------
- Feature: [NoGo] Game scripts can point to a location, station, industry, or town when publishing news (r27164)
- Feature: Allow changing max heightlevel in scenario editor (r27151)
- Feature: Make use of both rocky tile sets from the base graphics (r27117)
- Change: Scale (non-custom) default window sizes according to GUI zoom (r27147)
- Change: Make statusbar and chat-entry window use the same width as the toolbar (r27146)
- Change: The chatbox-width setting now uses percent of screen width instead of pixels (r27144)
- Change: [NewGRF] Interpret negative positions in industry layouts depending on GRF version (r27138)
- Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped too far, when OpenTTD lagged during mouse event processing (r27167)
- Fix: Toolbars were not invalidated when changing max-vehicles settings [FS#6204] (r27163)
- Fix: Tile selection was drawn outside of map in some cases [FS#6208] (r27162)
- Fix: Reimplement the viewport drawing algorithm [FS#6156] [FS#6206] (r27161)
- Fix: Issues with smallmap and viewport coordinates and transformations (r27160, r27159, r27158)
- Fix: Mark bridge middle tiles dirty when building/removing/changing bridges (r27157)
- Fix: Rounding and unit-conversion inconsistencies in calls to MarkAllViewportsDirty (r27148)
- Fix: Oilrig empty-tile checks were incorrect due to wrong TileIndexDiff->TileIndexDiffC conversion (r27137)
- Fix: Misalignment in generate world window in case of small fonts (r27135)
- Fix: Dragging of free wagons in depot failed with GUI zoom (r27133)
- Fix: Reduce memory footprint of map array by shuffling its members [FS#6218] (r27132, r27126)
- Fix: Dropdown- and tooltip-windows should not steal the focus (r27131)
- Fix: [NewGRF] Action 7/9 condition 0A failed for present, but disabled, NewGRF (r27119)
- Fix: Road vehicles could not reverse to be sent to depots when the following tile has the right type to run on, but could not be entered [FS#6183] (r27107)
- Fix: Use the actual max speed of the vehicle in front when determining if a RV can overtake [FS#6176] (r27106)
- Fix: grow_counter was not properly bounded by growth_rate, but by some other value used to calculate growth_rate [FS#6195] (r27105)
- Fix: [Script] Support 64 bits integers in ScriptLists [FS#6194] (r27104)
- Fix: [Script] Money values would end up wrong in strings when outside the bounds of a 32 bits integer [FS#6194] (r27102)
1.5.0-beta1 (2014-12-24)
------------------------------------------------------------------------
- Feature: Support .txt.gz and -txt.xz changelog, readme and license files in basesets, NewGRFs, etc (r27035, r27034)
- Feature: More height levels [FS#4126] (r27010)
- Feature: Latin translation (r26993)
- Feature: Add option to choose normal, double or quad-size interface (r26990)
- Feature: [Script] Swap method for script lists (r26894)
- Feature: [Script] ScriptStationList_Cargo for sorting cargo by from and via (r26893)
- Feature: [Script] API for retrieving planned flow (r26892)
- Feature: [CargoDist] Predict links for station-autorefitting vehicles (r26889)
- Feature: Setting for limiting the height of bridges (r26882)
- Feature: Make aircraft ascend/descend when they are too close to the ground or too far away (r26866)
- Feature: Allow hiding of non-interesting engines in the GUI (r26805, r26804)
- Feature: Vehicle sorting in autoreplace GUI [FS#1640] (r26800)
- Feature: [NewGRF] Advanced visual effects with multiple effect sprites independent of spawning model (r26988, r26747)
- Feature: Warn about missing industries after generating a map (r26729)
- Feature: Upgrade currently active NewGRFs to newest installed version (r26613)
- Feature: Save and load grfid and md5sum of NewGRFs in config file (r26611)
- Feature: Select an editable preset name for saving (r26610)
- Feature: Cancel cargo delivery from industries/houses to stations after about 21 months of not having picked up any of the cargo (r26582)
- Feature: Give a warning when a plane's orders tell it to use a runway which is too short for it [FS#6009] (r26566)
- Feature: [Script] Extended API for CargoDist (r26557)
- Feature: Show measured order times in timetable GUI also when not timetabled (r26550)
- Feature: Prompt for confirmation when deleting a vehicle group (r26455)
- Feature: Hierarchical vehicle subgroups (r26450)
- Feature: Allow more sound sleep for dedicated servers when there's nothing to do and nobody paying attention (r26449)
- Feature: [NewGRF] Add vehicle modflag 1 (unloading in progress) (r26430)
- Change: Improvements to the man page (r27091, r27012)
- Change: Allow to set the granularity of the tooltip hover time in milliseconds instead of seconds. New default value is 250ms (r26815)
- Change: Follow SI recommendation about spaces between numbers and units [FS#6086] (r26733)
- Change: [CargoDist] Save locations instead of distances in link graphs to reduce size (r26646)
- Change: [Squirrel] Make the internal integer for scripts always 64 bits, so scripts behave the same on 32 and 64 bit architectures and money can be represented properly (r26585, r26584)
- Change: Reshuffle advanced settings tree (r26614, r26536)
- Change: Add backend-independent config-file setting to disable 8bpp video modes, and disable 8bpp by default (r26522)
- Fix: [OS/2] Compile again [FS#6186] (r27092)
- Fix: Compilation with freetype2 version 2.5.4 and newer [FS#6185] (r27079)
- Fix: Variable 47 used the carge translation table of the wrong GRF in case of callback 1D [FS#6182] (r27075)
- Fix: Some lists did not use natural string sorting [FS#6172] (r27063)
- Fix: Mercurial version detection failed if personal presets were configured (r27059)
- Fix: [OSX] Don't require double-press from non-dead console hotkeys [FS#5812] (r27046)
- Fix: Crash when having the vehicle list opened from a buoy or oil rig when the buoy/oil rig is removed (r27030)
- Fix: Unit number was not always fully shown in depots [FS#6102] (r27014)
- Fix: [CargoDist] Reserve cargo only after unloading finished or if the vehicle has the desired cargo already [FS#6110] (r26918)
- Fix: [Squirrel] Loading a value saved as boolean caused it to be of type integer instead of boolean (r26785)
- Fix: [Squirrel] Harden string handling (r26777)
- Fix: [OSX] Implement more of the text editing API to prevent crashes and improve IME support [FS#5972] (r26758)
- Fix: Incorrect saving of order backups [FS#6066] (r26700)
- Fix: Ordering a vehicle to a competitor's rail waypoint displayed an error message. Ignore the click as is done for the other order types to competitor's stuff [FS#6059] (r26692)
- Fix: [Script] Loading/parsing of info .nuts was done in the same VM, causing e.g. constants to break the loading of info of other scripts [FS#5973] (r26617)
- Fix: [CargoDist] Improve estimation of link capacitites (r26549)
- Remove: A bunch of archaic settings from the GUI (r26528, r26526, r26525)
1.4.4 (2014-10-21)
------------------------------------------------------------------------
(None)
1.4.4-RC1 (2014-10-08)
------------------------------------------------------------------------
- Fix: Image widgets stored 32bit SpriteID in uint16 (r26971)
- Fix: Owner of road depot road types were not properly changed upon bankruptcy [FS#6126] (r26955)
- Fix: Compilation on HAIKU (r26922)
- Fix: Crash when enabling 'Full animation' if multiplayer chat text is on screen [FS#6096] (r26919)
- Fix: Height computation of game script text in town GUI did not consider margins [FS#6119] (r26859)
- Fix: [Squirrel] Debian lintian issues (r26853)
- Fix: Compilation of strgen on various platforms like Solaris (r26850)
- Fix: Better display of refit information for articulated vehicles [FS#6113] (r26849, r26848)
- Fix: Do not assign a next hop when returning cargo [FS#6110] (r26847)
- Fix: The ok-button in the OSK for the signs list should just close the OSK [FS#6116] (r26827)
1.4.3 (2014-09-23)
------------------------------------------------------------------------
(None)
1.4.3-RC2 (2014-09-14)
------------------------------------------------------------------------
- Fix: Crashes on joining a server with pending order backups [FS#6112] (r26819)
- Fix: Crashes on start due to dereferencing the -1 index of the file names array of music files (r26809)
1.4.3-RC1 (2014-09-07)
------------------------------------------------------------------------
- Fix: TC_NO_SHADE did not work for 32bpp text rendering (r26792)
- Fix: Loading a game with order backups leaked Orders and left unreachable items in the pool (r26787)
- Fix: Buffer overrun in SQCompiler::Error (r26764)
- Fix: Desync due to not always properly restoring game state from the savegame (r26753)
- Fix: [Script] Crashes and infinite loops when using lists in item-descending order [FS#6085] (r26744)
- Fix: Incorrect CFLAGS when enabling gprof profiling (r26737, r26735)
- Fix: Do not reset the last selected airport or layout, unless it is really necessary [FS#6083] (r26732)
- Fix: Use the normal search path to look for xdg-open at Unix [FS#6077] (r26724)
- Fix: Properly check for cargo acceptance of houses [FS#5997] (r26723)
1.4.2 (2014-08-16) 1.4.2 (2014-08-16)
------------------------------------------------------------------------ ------------------------------------------------------------------------
(None) (None)

View File

@@ -526,10 +526,10 @@ check_params() {
log 1 " PREPROCESSOR is only available for OSX" log 1 " PREPROCESSOR is only available for OSX"
exit 1 exit 1
fi fi
# OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP # OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP)$'`" ]; then if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP)$'`" ]; then
log 1 "configure: error: invalid option --os=$os" log 1 "configure: error: invalid option --os=$os"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP]" log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP]"
exit 1 exit 1
fi fi
# cpu_type can be either 32 or 64 # cpu_type can be either 32 or 64
@@ -1037,7 +1037,7 @@ check_params() {
log 1 "checking revision... svn detection (tag)" log 1 "checking revision... svn detection (tag)"
elif [ -e "$ROOT_DIR/.git" ] && [ -n "`git help 2>/dev/null`" ]; then elif [ -e "$ROOT_DIR/.git" ] && [ -n "`git help 2>/dev/null`" ]; then
log 1 "checking revision... git detection" log 1 "checking revision... git detection"
elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`hg help 2>/dev/null`" ]; then elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`HGPLAIN= hg help 2>/dev/null`" ]; then
log 1 "checking revision... hg detection" log 1 "checking revision... hg detection"
elif [ -f "$ROOT_DIR/.ottdrev" ]; then elif [ -f "$ROOT_DIR/.ottdrev" ]; then
log 1 "checking revision... source tarball" log 1 "checking revision... source tarball"
@@ -1054,7 +1054,7 @@ check_params() {
fi fi
if [ "$doc_dir" = "1" ]; then if [ "$doc_dir" = "1" ]; then
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
doc_dir="share/doc/openttd" doc_dir="share/doc/openttd"
else else
doc_dir="$data_dir/docs" doc_dir="$data_dir/docs"
@@ -1064,7 +1064,7 @@ check_params() {
fi fi
if [ "$icon_theme_dir" = "1" ]; then if [ "$icon_theme_dir" = "1" ]; then
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
icon_theme_dir="share/icons/hicolor" icon_theme_dir="share/icons/hicolor"
else else
icon_theme_dir="" icon_theme_dir=""
@@ -1098,7 +1098,7 @@ check_params() {
if [ "$man_dir" = "1" ]; then if [ "$man_dir" = "1" ]; then
# add manpage on UNIX systems # add manpage on UNIX systems
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX" ]; then if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX" ]; then
man_dir="share/man/man6" man_dir="share/man/man6"
else else
man_dir="" man_dir=""
@@ -1109,7 +1109,7 @@ check_params() {
if [ "$menu_dir" = "1" ]; then if [ "$menu_dir" = "1" ]; then
# add a freedesktop menu item only for some UNIX systems # add a freedesktop menu item only for some UNIX systems
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
menu_dir="share/applications" menu_dir="share/applications"
else else
menu_dir="" menu_dir=""
@@ -1441,6 +1441,7 @@ make_cflags_and_ldflags() {
make_compiler_cflags "$cc_host" "CFLAGS" "CXXFLAGS" "LDFLAGS" "FEATURES" make_compiler_cflags "$cc_host" "CFLAGS" "CXXFLAGS" "LDFLAGS" "FEATURES"
CFLAGS="$CFLAGS -D$os" CFLAGS="$CFLAGS -D$os"
CFLAGS_BUILD="$CFLAGS_BUILD -D$os"
if [ "$enable_debug" = "0" ]; then if [ "$enable_debug" = "0" ]; then
# No debug, add default stuff # No debug, add default stuff
@@ -1537,7 +1538,7 @@ make_cflags_and_ldflags() {
fi fi
fi fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
LIBS="$LIBS -lpthread" LIBS="$LIBS -lpthread"
fi fi
@@ -1564,10 +1565,6 @@ make_cflags_and_ldflags() {
LIBS="$LIBS -pthread" LIBS="$LIBS -pthread"
fi fi
if [ "$os" = "FREEBSD" ]; then
LIBS="$LIBS -lpthread"
fi
if [ "$os" = "OSX" ]; then if [ "$os" = "OSX" ]; then
LDFLAGS="$LDFLAGS -framework Cocoa" LDFLAGS="$LDFLAGS -framework Cocoa"
@@ -1609,7 +1606,7 @@ make_cflags_and_ldflags() {
fi fi
# Most targets act like UNIX, just with some additions # Most targets act like UNIX, just with some additions
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
CFLAGS="$CFLAGS -DUNIX" CFLAGS="$CFLAGS -DUNIX"
fi fi
# And others like Windows # And others like Windows
@@ -2267,52 +2264,54 @@ detect_awk() {
detect_os() { detect_os() {
if [ "$os" = "DETECT" ]; then if [ "$os" = "DETECT" ]; then
# Detect UNIX, OSX, FREEBSD, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP # Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
# Try first via dumpmachine, then via uname # Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk ' os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
/linux/ { print "UNIX"; exit} /linux/ { print "UNIX"; exit}
/darwin/ { print "OSX"; exit} /darwin/ { print "OSX"; exit}
/freebsd/ { print "FREEBSD"; exit} /freebsd/ { print "FREEBSD"; exit}
/openbsd/ { print "OPENBSD"; exit} /dragonfly/ { print "DRAGONFLY"; exit}
/netbsd/ { print "NETBSD"; exit} /openbsd/ { print "OPENBSD"; exit}
/hp-ux/ { print "HPUX"; exit} /netbsd/ { print "NETBSD"; exit}
/morphos/ { print "MORPHOS"; exit} /hp-ux/ { print "HPUX"; exit}
/beos/ { print "BEOS"; exit} /morphos/ { print "MORPHOS"; exit}
/haiku/ { print "HAIKU"; exit} /beos/ { print "BEOS"; exit}
/sunos/ { print "SUNOS"; exit} /haiku/ { print "HAIKU"; exit}
/solaris/ { print "SUNOS"; exit} /sunos/ { print "SUNOS"; exit}
/cygwin/ { print "CYGWIN"; exit} /solaris/ { print "SUNOS"; exit}
/mingw/ { print "MINGW"; exit} /cygwin/ { print "CYGWIN"; exit}
/os2/ { print "OS2"; exit} /mingw/ { print "MINGW"; exit}
/dos/ { print "DOS"; exit} /os2/ { print "OS2"; exit}
/wince/ { print "WINCE"; exit} /dos/ { print "DOS"; exit}
/psp/ { print "PSP"; exit} /wince/ { print "WINCE"; exit}
/psp/ { print "PSP"; exit}
'` '`
if [ -z "$os" ]; then if [ -z "$os" ]; then
os=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | $awk ' os=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | $awk '
/linux/ { print "UNIX"; exit} /linux/ { print "UNIX"; exit}
/darwin/ { print "OSX"; exit} /darwin/ { print "OSX"; exit}
/freebsd/ { print "FREEBSD"; exit} /freebsd/ { print "FREEBSD"; exit}
/openbsd/ { print "OPENBSD"; exit} /dragonfly/ { print "DRAGONFLY"; exit}
/netbsd/ { print "NETBSD"; exit} /openbsd/ { print "OPENBSD"; exit}
/hp-ux/ { print "HPUX"; exit} /netbsd/ { print "NETBSD"; exit}
/morphos/ { print "MORPHOS"; exit} /hp-ux/ { print "HPUX"; exit}
/beos/ { print "BEOS"; exit} /morphos/ { print "MORPHOS"; exit}
/haiku/ { print "HAIKU"; exit} /beos/ { print "BEOS"; exit}
/sunos/ { print "SUNOS"; exit} /haiku/ { print "HAIKU"; exit}
/cygwin/ { print "CYGWIN"; exit} /sunos/ { print "SUNOS"; exit}
/mingw/ { print "MINGW"; exit} /cygwin/ { print "CYGWIN"; exit}
/os\/2/ { print "OS2"; exit} /mingw/ { print "MINGW"; exit}
/gnu/ { print "UNIX"; exit} /os\/2/ { print "OS2"; exit}
/gnu/ { print "UNIX"; exit}
'` '`
fi fi
if [ -z "$os" ]; then if [ -z "$os" ]; then
log 1 "detecting OS... none detected" log 1 "detecting OS... none detected"
log 1 "I couldn't detect your OS. Please use --os=OS to force one" log 1 "I couldn't detect your OS. Please use --os=OS to force one"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP" log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP"
exit 1 exit 1
fi fi
@@ -2941,7 +2940,7 @@ detect_icu() {
# It was forced, so it should be found. # It was forced, so it should be found.
if [ "$with_icu" != "1" ]; then if [ "$with_icu" != "1" ]; then
log 1 "configure: error: icu-config couldn't be found" log 1 "configure: error: icu-config couldn't be found"
log 1 "configure: error: you supplied '$with_icuconfig', but it seems invalid" log 1 "configure: error: you supplied '$with_icu', but it seems invalid"
exit 1 exit 1
fi fi
@@ -3182,9 +3181,9 @@ detect_grfcodec() {
log 2 " returned $version" log 2 " returned $version"
log 2 " exit code $ret" log 2 " exit code $ret"
if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "949" ]; then if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "985" ]; then
if [ -n "$version" ] && [ "$version" -lt "949" ]; then if [ -n "$version" ] && [ "$version" -lt "985" ]; then
log 1 "checking grfcodec... needs at least version 6.0.2 (r949), disabled" log 1 "checking grfcodec... needs at least version 6.0.5 (r985), disabled"
else else
log 1 "checking grfcodec... not found" log 1 "checking grfcodec... not found"
fi fi
@@ -3224,9 +3223,9 @@ detect_nforenum() {
log 2 " returned $version" log 2 " returned $version"
log 2 " exit code $ret" log 2 " exit code $ret"
if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "949" ]; then if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "985" ]; then
if [ -n "$version" ] && [ "$version" -lt "949" ]; then if [ -n "$version" ] && [ "$version" -lt "985" ]; then
log 1 "checking nforenum... needs at least version 6.0.2 (r949), disabled" log 1 "checking nforenum... needs at least version 6.0.5 (r985), disabled"
else else
log 1 "checking nforenum... not found" log 1 "checking nforenum... not found"
fi fi
@@ -3591,9 +3590,9 @@ showhelp() {
echo " --awk=AWK the awk to use in configure [awk]" echo " --awk=AWK the awk to use in configure [awk]"
echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]" echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]"
echo " --os=OS the OS we are compiling for [DETECT]" echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/OPENBSD/NETBSD/" echo " DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/"
echo " MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/MINGW/OS2/" echo " NETBSD/MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/"
echo " DOS/WINCE/PSP/HAIKU" echo " MINGW/OS2/DOS/WINCE/PSP/HAIKU"
echo " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)" echo " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)"
echo "" echo ""
echo "Paths:" echo "Paths:"

View File

@@ -194,6 +194,7 @@ Table of contents
- Get the same version of OpenTTD as the original server was running. - Get the same version of OpenTTD as the original server was running.
- Uncomment/enable the define 'DEBUG_DUMP_COMMANDS' in - Uncomment/enable the define 'DEBUG_DUMP_COMMANDS' in
'src/network/network_func.h'. 'src/network/network_func.h'.
(DEBUG_FAILED_DUMP_COMMANDS is explained later)
- Put the 'commands-out.log' into the root save folder, and rename - Put the 'commands-out.log' into the root save folder, and rename
it to 'commands.log'. it to 'commands.log'.
- Run 'openttd -D -d desync=3 -g startsavegame.sav'. - Run 'openttd -D -d desync=3 -g startsavegame.sav'.
@@ -217,6 +218,11 @@ Table of contents
the last dmp_cmds that reproduces the replay and the first one the last dmp_cmds that reproduces the replay and the first one
that fails. that fails.
If the replay does not succeed without mismatch, you can check the logs
whether there were failed commands. Then you may try to replay with
DEBUG_FAILED_DUMP_COMMANDS enabled. If the replay then fails, the
command test-run of the failed command modified the game state.
If you have the original 'dmp_cmds_*.sav', you can also compare those If you have the original 'dmp_cmds_*.sav', you can also compare those
savegames with your own ones from the replay. You can also comment/disable savegames with your own ones from the replay. You can also comment/disable
the 'NOT_REACHED' mentioned above, to get another 'dmp_cmds_*.sav' from the 'NOT_REACHED' mentioned above, to get another 'dmp_cmds_*.sav' from

View File

@@ -15,20 +15,60 @@
For a graphical representation of the tile-layout have a look at For a graphical representation of the tile-layout have a look at
<a href="landscape_grid.html">Landscape grid</a> page. <a href="landscape_grid.html">Landscape grid</a> page.
</p> </p>
<p>Eight attributes (counting &quot;<span style="font-weight: bold;">type_height</span>&quot;) hold the informations about a tile.<BR> <p>Nine attributes (counting &quot;<span style="font-weight: bold;">type</span>&quot; and
&quot;<span style="font-weight: bold;">height</span>&quot;) hold the informations about a tile.<BR>
These attributes are referred to as These attributes are referred to as
&quot;<span style="font-weight: bold;">type_height</span>", &quot;<span style="font-weight: bold;">type</span>",
&quot;<span style="font-weight: bold;">height</span>",
&quot;<span style="font-weight: bold;">m1</span>&quot;, &quot;<span style="font-weight: bold;">m2</span>&quot;, &quot;<span style="font-weight: bold;">m1</span>&quot;, &quot;<span style="font-weight: bold;">m2</span>&quot;,
&quot;<span style="font-weight: bold;">m3</span>&quot;, &quot;<span style="font-weight: bold;">m4</span>&quot;, &quot;<span style="font-weight: bold;">m3</span>&quot;, &quot;<span style="font-weight: bold;">m4</span>&quot;,
&quot;<span style="font-weight: bold;">m5</span>&quot;, &quot;<span style="font-weight: bold;">m6</span>&quot; &quot;<span style="font-weight: bold;">m5</span>&quot;, &quot;<span style="font-weight: bold;">m6</span>&quot;
and "<span style="font-weight: bold;">m7</span>".<br> and "<span style="font-weight: bold;">m7</span>".<br>
The most important value is the class of a tile, stored in the upper 4 bits The most important value is the class of a tile, stored in the upper 4 bits
of the <span style="font-weight: bold;">type_height</span> attribute. The lower 4 bits are used to encode the height and of the <span style="font-weight: bold;">type</span> attribute.
slope data.
</p> </p>
Frequently repeating patterns: Frequently repeating patterns:
<ul> <ul>
<li><span style="font-weight: bold;">type</span>
<ul>
<li>
<a name="type"></a>
Bits 7..4:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The tile type.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>Ground</td></tr>
<tr><td><tt>01</tt></td><td>Railway tracks</td></tr>
<tr><td><tt>02</tt></td><td>Roads</td></tr>
<tr><td><tt>03</tt></td><td>Town building</td></tr>
<tr><td><tt>04</tt></td><td>Trees</td></tr>
<tr><td><tt>05</tt></td><td>Station tiles</td></tr>
<tr><td><tt>06</tt></td><td>Water</td></tr>
<tr><td><tt>07</tt></td><td>Void</td></tr>
<tr><td><tt>08</tt></td><td>Industries</td></tr>
<tr><td><tt>09</tt></td><td>Tunnel / bridge</td></tr>
<tr><td><tt>0A</tt></td><td>Objects</td></tr>
</table>
</li>
Bits 3..2:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>no bridge</td></tr>
<tr><td><tt>01</tt></td><td>Axis X (North-East)</td></tr>
<tr><td><tt>02</tt></td><td>Axis Y (South-West)</td></tr>
</table>
<li>
<a name="tropic_zone"></a>
Bits 1..0:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningfull in tropic climate. It contains the definition of the available zones</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
<tr><td><tt>01</tt></td><td>desert</td></tr>
<tr><td><tt>02</tt></td><td>rain forest</td></tr>
</table>
In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
</li>
</ul>
<li><span style="font-weight: bold;">m1</span> <li><span style="font-weight: bold;">m1</span>
<ul> <ul>
<li> <li>
@@ -58,32 +98,6 @@
</li> </li>
</ul> </ul>
</li> </li>
<li><span style="font-weight: bold;">m6</span>
<ul>
<li>
<a name="bridge_direction"></a>
Bits 7..6:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above, for tiles that support this.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>no bridge</td></tr>
<tr><td><tt>01</tt></td><td>Axis X (North-East)</td></tr>
<tr><td><tt>02</tt></td><td>Axis Y (South-West)</td></tr>
</table>
Some tiles, such as houses do not support bridges over them and use these bits for other purposes.
</li>
<li>
<a name="tropic_zone"></a>
Bits 1..0:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningfull in tropic climate. It contains the definition of the available zones</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
<tr><td><tt>01</tt></td><td>desert</td></tr>
<tr><td><tt>02</tt></td><td>rain forest</td></tr>
</table>
In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m7:</span><br> <li><span style="font-weight: bold;">m7:</span><br>
Animation frame/state. Used for houses, industries, objects and stations. Animation frame/state. Used for houses, industries, objects and stations.
</li> </li>
@@ -196,9 +210,7 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 4..2: type of hedge on NW border of the tile</li> <li>m6 bits 4..2: type of hedge on NW border of the tile</li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul> </ul>
</td> </td>
</tr> </tr>
@@ -510,8 +522,6 @@
<li>m5 bit 4: pbs reservation state</li> <li>m5 bit 4: pbs reservation state</li>
</ul> </ul>
</li> </li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul> </ul>
</td> </td>
</tr> </tr>
@@ -539,6 +549,7 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
<li>m5 bits 7 clear: road or level-crossing <li>m5 bits 7 clear: road or level-crossing
<ul> <ul>
<li>m6 bits 5..3: <li>m6 bits 5..3:
@@ -573,7 +584,6 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
<li>m5 bit 6 clear: road <li>m5 bit 6 clear: road
<ul> <ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li> <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
@@ -663,10 +673,9 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
</ul> </ul>
</li> </li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul> </ul>
</td> </td>
</tr> </tr>
@@ -713,7 +722,6 @@
<li>bits 7..2 : lift position (for houses type 04 and 05)</li> <li>bits 7..2 : lift position (for houses type 04 and 05)</li>
</ul> </ul>
</li> </li>
<li>bits 1..0 : tropic zone specifier</li>
</ul> </ul>
</li> </li>
<li>m7 : <li>m7 :
@@ -835,7 +843,6 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul> </ul>
</td> </td>
</tr> </tr>
@@ -969,7 +976,6 @@
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li> <li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li> <li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li> <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
<li>m7 bits 7..6: present road types (road stops)</li> <li>m7 bits 7..6: present road types (road stops)</li>
<li>m7: animation frame (railway stations/waypoints, airports)</li> <li>m7: animation frame (railway stations/waypoints, airports)</li>
@@ -1082,8 +1088,6 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul> </ul>
</td> </td>
</tr> </tr>
@@ -1101,7 +1105,7 @@
<tr bgcolor="#CCCCCC"> <tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class8"><tt> 8</tt></a></strong></td> <td valign=top nowrap><strong><a name="Class8"><tt> 8</tt></a></strong></td>
<td><strong>Industry tile </strong></td> <td><strong>Industries </strong></td>
</tr> </tr>
<tr> <tr>
<td valign=top nowrap>&nbsp;</td> <td valign=top nowrap>&nbsp;</td>
@@ -1425,7 +1429,6 @@
</li> </li>
<li>m6 bits 5..3: random triggers (NewGRF)</li> <li>m6 bits 5..3: random triggers (NewGRF)</li>
<li>m6 bit 2: bit 8 of type (see m5)</li> <li>m6 bit 2: bit 8 of type (see m5)</li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7: animation frame</li> <li>m7: animation frame</li>
</ul> </ul>
</td> </td>
@@ -1576,8 +1579,6 @@
</tr> </tr>
</table> </table>
</li> </li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road</li> <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road</li>
<li>m7 bit 5 set = on snow or desert</li> <li>m7 bit 5 set = on snow or desert</li>
<li>m7 bits 7..6: present road types for road</li> <li>m7 bits 7..6: present road types for road</li>
@@ -1598,8 +1599,6 @@
<li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li> <li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li>
<li>m3: random bits</li> <li>m3: random bits</li>
<li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li> <li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7: animation counter</li> <li>m7: animation counter</li>
</ul> </ul>
</td> </td>

View File

@@ -28,13 +28,14 @@ the array so you can quickly see what is used and what is not.
</ul> </ul>
<p> <p>
<ul> <ul>
<li><span style="font-weight: bold;">type_height</span> - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits)</li> <li><span style="font-weight: bold;">type</span> - 8 bits in size, tile class (bits 4..7), bridge (bits 2..3) tropic zone (bits 0..1, only valid in tropic climate)</li>
<li><span style="font-weight: bold;">height</span> - 8 bits in size, stores tile height</li>
<li><span style="font-weight: bold;">m1</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)</li> <li><span style="font-weight: bold;">m1</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)</li>
<li><span style="font-weight: bold;">m2</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array</li> <li><span style="font-weight: bold;">m2</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array</li>
<li><span style="font-weight: bold;">m3</span> - 8 bits in size, is used for general storage</li> <li><span style="font-weight: bold;">m3</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m4</span> - 8 bits in size, is used for general storage</li> <li><span style="font-weight: bold;">m4</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li> <li><span style="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m6</span> - 8 bits in size, special meaning : lower 2 bits only valid in tropic climate, upper 2 bits for bridges</li> <li><span style="font-weight: bold;">m6</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage</li> <li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage</li>
</ul> </ul>
@@ -42,7 +43,8 @@ the array so you can quickly see what is used and what is not.
<tbody> <tbody>
<tr> <tr>
<th colspan=2>class</th> <th colspan=2>class</th>
<th>type_height (8)</th> <th>type (8)</th>
<th>height (8)</th>
<th>m1 (8)</th> <th>m1 (8)</th>
<th>m2 (16)</th> <th>m2 (16)</th>
<th>m3 (8)</th> <th>m3 (8)</th>
@@ -55,6 +57,7 @@ the array so you can quickly see what is used and what is not.
<td colspan=2 class="caption">bits</td> <td colspan=2 class="caption">bits</td>
<td class="bits">7654 3210</td> <td class="bits">7654 3210</td>
<td class="bits">7654 3210</td> <td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">FEDC BA98 7654 3210</td> <td class="bits">FEDC BA98 7654 3210</td>
<td class="bits">7654 3210</td> <td class="bits">7654 3210</td>
<td class="bits">7654 3210</td> <td class="bits">7654 3210</td>
@@ -66,69 +69,75 @@ the array so you can quickly see what is used and what is not.
<td rowspan="2">0</td> <td rowspan="2">0</td>
<td class="caption">ground</td> <td class="caption">ground</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td> <td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits">XXXX <span class="free">OOOO</span></td> <td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits">XXXX XX<span class="free">OO</span></td> <td class="bits">XXXX XX<span class="free">OO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XX<span class="free">O</span>X XXXX</td> <td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td class="caption">farmland</td> <td class="caption">farmland</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">O</span>X XXXX</td> <td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td rowspan=3>1</td> <td rowspan=3>1</td>
<td class="caption">rail</td> <td class="caption">rail</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span>X XXXX</td> <td class="bits"><span class="free">OOO</span>X XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td class="caption">rail with signals</td> <td class="caption">rail with signals</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td class="caption">depot</td> <td class="caption">depot</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XX<span class="free">O</span>X <span class="free">OO</span>XX</td> <td class="bits">XX<span class="free">O</span>X <span class="free">OO</span>XX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td rowspan=3>2</td> <td rowspan=3>2</td>
<td class="caption">road</td> <td class="caption">road</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span>X XXXX</td> <td class="bits"><span class="free">OOO</span>X XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits">XXX<span class="free">O</span> XXXX</td> <td class="bits">XXX<span class="free">O</span> XXXX</td>
</tr> </tr>
<tr> <tr>
@@ -136,10 +145,11 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">XXXX<span class="free"> OOO</span>X</td> <td class="bits">XXXX<span class="free"> OOO</span>X</td>
<td class="bits">XXXX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
</tr> </tr>
<tr> <tr>
@@ -147,46 +157,50 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXX<span class="free">O OOOO</span></td> <td class="bits">XXX<span class="free">O</span> XXXX</td>
</tr> </tr>
<tr> <tr>
<td>3</td> <td>3</td>
<td class="caption">house</td> <td class="caption">house</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td> <td class="bits">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXX<span class="abuse">X XXXX</span></td> <td class="bits">XXX<span class="abuse">X XXXX</span></td>
<td class="bits"><span class="abuse">XXXX XX</span>XX</td> <td class="bits"><span class="abuse">XXXX XX</span><span class="free">OO</span></td>
<td class="bits">XXXX <span class="abuse">XXXX</span></td> <td class="bits">XXXX <span class="abuse">XXXX</span></td>
</tr> </tr>
<tr> <tr>
<td>4</td> <td>4</td>
<td class="caption">trees</td> <td class="caption">trees</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td> <td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td> <td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
<td class="bits"><span class="option">~~</span>XX XXXX</td> <td class="bits"><span class="option">~~</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XX<span class="free">OO O</span>XXX</td> <td class="bits">XX<span class="free">OO O</span>XXX</td>
<td class="bits"><span class="free">OOOO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td rowspan=7>5</td> <td rowspan=7>5</td>
<td class="caption">rail station</td> <td class="caption">rail station</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">O</span>XXX XXXX</td> <td class="bits"><span class="free">O</span>XXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX XXXX</td> <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
</tr> </tr>
<tr> <tr>
@@ -199,16 +213,18 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
</tr> </tr>
<tr> <tr>
<td class="caption">road stop</td> <td class="caption">road stop</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td> <td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~</span>XXX</td> <td class="bits"><span class="option">~~~~ ~</span>XXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits">XX<span class="free">O</span>X XXXX</td> <td class="bits">XX<span class="free">O</span>X XXXX</td>
</tr> </tr>
<tr> <tr>
@@ -216,10 +232,11 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~</span>XXX</td> <td class="bits"><span class="option">~~~~ ~</span>XXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
@@ -227,10 +244,11 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td> <td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
</tr> </tr>
<tr> <tr>
@@ -238,10 +256,11 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td> <td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
@@ -249,68 +268,74 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td> <td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td> <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td rowspan=3>6</td> <td rowspan=3>6</td>
<td class="caption">sea, shore</td> <td class="caption">sea, shore</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">O</span>XXX XXXX</td> <td class="bits"><span class="free">O</span>XXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">X<span class="option">~~</span>X XXXX</td> <td class="bits">X<span class="option">~~</span>X XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td class="caption">canal, river</td> <td class="caption">canal, river</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td class="caption">shipdepot</td> <td class="caption">shipdepot</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
</tr> </tr>
<tr> <tr>
<td>8</td> <td>8</td>
<td class="caption">industry</td> <td class="caption">industry</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td> <td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX XXXX</td> <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
</tr> </tr>
<tr> <tr>
<td rowspan=2>9</td> <td rowspan=2>9</td>
<td class="caption">tunnel entrance</td> <td class="caption">tunnel entrance</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span>X XXXX</td> <td class="bits"><span class="free">OOO</span>X XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">X<span class="free">OO</span>X XXXX</td> <td class="bits">X<span class="free">OO</span>X XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
</tr> </tr>
<tr> <tr>
@@ -321,19 +346,21 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX</td> <td class="bits">-inherit-</td>
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
<td class="bits">-inherit-</td> <td class="bits">-inherit-</td>
</tr> </tr>
<tr> <tr>
<td rowspan=2>A</td> <td rowspan=2>A</td>
<td class="caption">objects</td> <td class="caption">objects</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">O</span>XXX XXXX</td> <td class="bits"><span class="free">O</span>XXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td> <td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -1,112 +1,152 @@
.\" Hey, EMACS: -*- nroff -*- .\" Hey, EMACS: -*- nroff -*-
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.Dd May 31, 2011 .Dd October 13, 2014
.Dt OPENTTD 6 .Dt OPENTTD 6
.Os
.Sh NAME .Sh NAME
.Nm openttd .Nm openttd
.Nd An open source clone of the Microprose game "Transport Tycoon Deluxe" .Nd open source clone of the Microprose game \(lqTransport Tycoon Deluxe\(rq
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl efhx .Op Fl efhx
.Op Fl b Ar blitter .Op Fl b Ar blitter
.Op Fl c Ar config_file .Op Fl c Ar config_file
.Op Fl d Ar [level | cat=lvl[,...]] .Op Fl d Op Ar level | Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
.Op Fl D Ar [host][:port] .Op Fl D Oo Ar host Oc Ns Op : Ns Ar port
.Op Fl g Ar [savegame] .Op Fl g Op Ar savegame
.Op Fl G Ar seed .Op Fl G Ar seed
.Op Fl I Ar graphicsset .Op Fl I Ar graphicsset
.Op Fl l Ar host[:port] .Op Fl l Ar host Ns Op : Ns Ar port
.Op Fl m Ar driver .Op Fl m Ar driver
.Op Fl M Ar musicset .Op Fl M Ar musicset
.Op Fl n Ar host[:port][#player] .Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
.Op Fl p Ar password .Op Fl p Ar password
.Op Fl P Ar password .Op Fl P Ar password
.Op Fl q Ar savegame .Op Fl q Ar savegame
.Op Fl r Ar widthxheight .Op Fl r Ar width Ns x Ns Ar height
.Op Fl s Ar driver .Op Fl s Ar driver
.Op Fl S Ar soundset .Op Fl S Ar soundset
.Op Fl t Ar year .Op Fl t Ar year
.Op Fl v Ar driver .Op Fl v Ar driver
.Sh OPTIONS .Sh OPTIONS
.Bl -tag -width ".Fl n Ar host[:port][#player]" .Bl -tag -width "-n host[:port][#player]"
.It Fl b Ar blitter .It Fl b Ar blitter
Set the blitter, see Select the blitter
.Ar blitter ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl c Ar config_file .It Fl c Ar config_file
Use 'config_file' instead of 'openttd.cfg' Use
.Ar config_file
instead of
.Pa openttd.cfg .
.It Fl d Ar [level] .It Fl d Ar [level]
Set debug verbosity for all categories to Set debug verbosity for all categories to
.Ar level .Ar level ,
or 1 if omitted or 1 if omitted.
.It Fl d Ar cat=level[,...] .It Fl d Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
Set debug verbosity for a specific category Set debug verbosity to
.It Fl D Ar [host][:port] .Ar lvl
Start a dedicated server. Sets network debug level to 6. If you want to change this, use for a specific category
.Ar cat .
.It Fl D Oo Ar host Oc Ns Op : Ns Ar port
Start a dedicated server.
.Pp
Network debug level will be set to 6.
If you want to change this, set
.Fl d .Fl d
after after setting
.Fl D .Fl D .
.It Fl G Ar seed
Seed the pseudo random number generator
.It Fl e .It Fl e
Start in world editor mode Start in world editor mode.
.It Fl f .It Fl f
Fork into background (dedicated server only, see Fork into background (dedicated server only, see
.Fl D ) .Fl D ) .
.It Fl g Ar [savegame] .It Fl g Op Ar savegame
Load Load
.Ar savegame .Ar savegame
at start or start a new game if omitted. The at start or start a new game if omitted.
.Ar savegame .Ar savegame
must be either absolute or relative to the current path or one of the search paths. must be either an absolute path or one relative to the current path or one of
the search paths.
.It Fl G Ar seed
Seed the pseudo random number generator with
.Ar seed .
.It Fl h .It Fl h
Display a summary of all options and lists all the available AIs, blitters, sound, music and video drivers, graphics sets and sound sets. Display a summary of all options and list all the available AIs, blitters,
sound, music and video drivers, graphics sets and sound sets.
.It Fl I Ar graphicsset .It Fl I Ar graphicsset
Set the graphics set, see Select the graphics set
.Ar graphicsset ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl l Ar host[:port] .It Fl l Ar host Ns Op : Ns Ar port
Redirect DEBUG(), See Redirect
.Fl D .Fn DEBUG
output; see
.Fl D .
.It Fl m Ar driver .It Fl m Ar driver
Set the music driver, see Select the music driver
.Ar driver ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl M Ar musicset .It Fl M Ar musicset
Set the music set, see Select the music set
.Ar musicset ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl n Ar host[:port][#player] .It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
Join a network game, optionally specify a port to connect to and player to play as Join a network game, optionally specifying a port to connect to and player to
play as.
.It Fl p Ar password .It Fl p Ar password
Password used to join server. Only useful with Password used to join server.
.Fl n Only useful with
.Fl n .
.It Fl P Ar password .It Fl P Ar password
Password used to join company. Only useful with Password used to join company.
.Fl n Only useful with
.Fl n .
.It Fl q Ar savegame .It Fl q Ar savegame
Write some information about the savegame and exit Write some information about the specified savegame and exit.
.It Fl r Ar widthxheight .It Fl r Ar width Ns x Ns Ar height
Set the resolution Set the resolution to
.Ar width
\(mu
.Ar height
pixels.
.It Fl s Ar driver .It Fl s Ar driver
Set the sound driver, see Select the sound driver
.Ar driver ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl S Ar soundset .It Fl S Ar soundset
Set the sound set, see Select the sound set
.Ar soundset ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl t Ar year .It Fl t Ar year
Set the starting year Set the starting year to
.Ar year .
.It Fl v Ar driver .It Fl v Ar driver
Set the video driver, see Select the video driver
.Ar driver ;
see
.Fl h .Fl h
for a full list for a full list.
.It Fl x .It Fl x
Do not automatically save to config file on exit Do not automatically save to config file on exit.
.El .El
.Sh SEE ALSO .Sh SEE ALSO
http://wiki.openttd.org/, http://www.openttd.org .Lk https://wiki.openttd.org "Wiki"
(includes community maintained manual),
.Lk https://forum.openttd.org "Forum",
.Lk https://www.openttd.org "News"
.Sh HISTORY .Sh HISTORY
Transport Tycoon Deluxe was written by Chris Sawyer and published by Microprose. Transport Tycoon Deluxe was written by Chris Sawyer and published by Microprose.
.Nm .Nm

View File

@@ -67,16 +67,14 @@ fi
cd `dirname "$0"` cd `dirname "$0"`
ROOT_DIR=`pwd` ROOT_DIR=`pwd`
# Override version number, to allow OpenTTD with Android modifications to connect to official servers
if [ -e $ROOT_DIR/version-override ]; then
cat $ROOT_DIR/version-override
exit
fi
# Determine if we are using a modified version # Determine if we are using a modified version
# Assume the dir is not modified # Assume the dir is not modified
MODIFIED="0" MODIFIED="0"
if [ -d "$ROOT_DIR/.svn" ] || [ -d "$ROOT_DIR/../.svn" ]; then if [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev
exit
elif [ -d "$ROOT_DIR/.svn" ] || [ -d "$ROOT_DIR/../.svn" ]; then
# We are an svn checkout # We are an svn checkout
if [ -n "`svnversion | grep 'M'`" ]; then if [ -n "`svnversion | grep 'M'`" ]; then
MODIFIED="2" MODIFIED="2"
@@ -112,26 +110,22 @@ elif [ -e "$ROOT_DIR/.git" ]; then
fi fi
elif [ -d "$ROOT_DIR/.hg" ]; then elif [ -d "$ROOT_DIR/.hg" ]; then
# We are a hg checkout # We are a hg checkout
if [ -n "`hg status | grep -v '^?'`" ]; then if [ -n "`HGPLAIN= hg status | grep -v '^?'`" ]; then
MODIFIED="2" MODIFIED="2"
fi fi
HASH=`LC_ALL=C hg id -i | cut -c1-12` HASH=`LC_ALL=C HGPLAIN= hg id -i | cut -c1-12`
REV="h`echo $HASH | cut -c1-8`" REV="h`echo $HASH | cut -c1-8`"
BRANCH="`hg branch | sed 's@^default$@@'`" BRANCH="`HGPLAIN= hg branch | sed 's@^default$@@'`"
TAG="`hg id -t | grep -v 'tip$'`" TAG="`HGPLAIN= hg id -t | grep -v 'tip$'`"
if [ -n "$TAG" ]; then if [ -n "$TAG" ]; then
BRANCH="" BRANCH=""
REV="$TAG" REV="$TAG"
fi fi
REV_NR=`LC_ALL=C hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"` REV_NR=`LC_ALL=C HGPLAIN= hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
if [ -z "$REV_NR" ]; then if [ -z "$REV_NR" ]; then
# No rev? Maybe it is a custom hgsubversion clone # No rev? Maybe it is a custom hgsubversion clone
REV_NR=`LC_ALL=C hg parent --template="{svnrev}"` REV_NR=`LC_ALL=C HGPLAIN= hg parent --template="{svnrev}"`
fi fi
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev
exit
else else
# We don't know # We don't know
MODIFIED="1" MODIFIED="1"

View File

@@ -1,6 +1,6 @@
OpenTTD's known bugs OpenTTD's known bugs
Last updated: 2014-08-16 Last updated: 2015-12-01
Release version: 1.4.2 Release version: 1.5.3
------------------------------------------------------------------------ ------------------------------------------------------------------------

View File

@@ -104,3 +104,4 @@
#include "rivers/tropic.nfo" #include "rivers/tropic.nfo"
#include "rivers/toyland.nfo" #include "rivers/toyland.nfo"
#include "tunnel_portals.nfo" #include "tunnel_portals.nfo"
#include "palette.nfo"

View File

@@ -0,0 +1,20 @@
//
// $Id$
//
// This file is part of OpenTTD.
// OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
// OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "All black palette"
-1 * 0 05 18 01
-1 * 0 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01

View File

@@ -9,4 +9,4 @@ Exec=!!TTD!!
Terminal=false Terminal=false
Categories=!!MENU_GROUP!! Categories=!!MENU_GROUP!!
Comment=A clone of Transport Tycoon Deluxe Comment=A clone of Transport Tycoon Deluxe
Keywords=game;simulation;transport;tycoon;deluxe;economics;multiplayer;money;train;ship;bus;truck;aircraft;cargo Keywords=game;simulation;transport;tycoon;deluxe;economics;multiplayer;money;train;ship;bus;truck;aircraft;cargo;

View File

@@ -1,3 +1,93 @@
openttd (1.5.3-0) unstable; urgency=low
* New upstream release 1.5.3
-- OpenTTD <info@openttd.org> Tue, 01 Dec 2015 21:00:00 +0100
openttd (1.5.3~RC1-0) unstable; urgency=low
* New upstream release 1.5.3-RC1
-- OpenTTD <info@openttd.org> Sun, 01 Nov 2015 14:00:00 +0100
openttd (1.5.2-0) unstable; urgency=low
* New upstream release 1.5.2
-- OpenTTD <info@openttd.org> Tue, 01 Sep 2015 21:00:00 +0200
openttd (1.5.2~RC1-0) unstable; urgency=low
* New upstream release 1.5.2-RC1
-- OpenTTD <info@openttd.org> Sat, 01 Aug 2015 13:00:00 +0200
openttd (1.5.1-0) unstable; urgency=low
* New upstream release 1.5.1
-- OpenTTD <info@openttd.org> Mon, 01 Jun 2015 21:00:00 +0200
openttd (1.5.1~RC1-0) unstable; urgency=low
* New upstream release 1.5.1-RC1
-- OpenTTD <info@openttd.org> Fri, 08 May 2015 21:00:00 +0200
openttd (1.5.0-0) unstable; urgency=low
* New upstream release 1.5.0
-- OpenTTD <info@openttd.org> Wed, 01 Apr 2015 21:00:00 +0200
openttd (1.5.0~RC1-0) unstable; urgency=low
* New upstream release 1.5.0-RC1
-- OpenTTD <info@openttd.org> Wed, 18 Mar 2015 21:00:00 +0100
openttd (1.5.0~beta2-0) unstable; urgency=low
* New upstream release 1.5.0-beta2
-- OpenTTD <info@openttd.org> Tue, 24 Feb 2015 21:00:00 +0100
openttd (1.5.0~beta1-0) unstable; urgency=low
* New upstream release 1.5.0-beta1
-- OpenTTD <info@openttd.org> Wed, 24 Dec 2014 21:00:00 +0100
openttd (1.4.4-0) unstable; urgency=low
* New upstream release 1.4.4
-- OpenTTD <info@openttd.org> Tue, 21 Oct 2014 21:00:00 +0200
openttd (1.4.4~RC1-0) unstable; urgency=low
* New upstream release 1.4.4-RC1
-- OpenTTD <info@openttd.org> Wed, 08 Oct 2014 19:00:00 +0200
openttd (1.4.3-0) unstable; urgency=low
* New upstream release 1.4.3
-- OpenTTD <info@openttd.org> Tue, 23 Sep 2014 21:00:00 +0200
openttd (1.4.3~RC2-0) unstable; urgency=low
* New upstream release 1.4.3-RC2
-- OpenTTD <info@openttd.org> Sun, 14 Sep 2014 19:00:00 +0200
openttd (1.4.3~RC1-0) unstable; urgency=low
* New upstream release 1.4.3-RC1
-- OpenTTD <info@openttd.org> Sun, 07 Sep 2014 19:00:00 +0200
openttd (1.4.2-0) unstable; urgency=low openttd (1.4.2-0) unstable; urgency=low
* New upstream release 1.4.2 * New upstream release 1.4.2

View File

@@ -1,9 +1,9 @@
# Version numbers to update # Version numbers to update
!define APPV_MAJOR 1 !define APPV_MAJOR 1
!define APPV_MINOR 5 !define APPV_MINOR 5
!define APPV_MAINT 0 !define APPV_MAINT 3
!define APPV_BUILD 0 !define APPV_BUILD 1
!define APPV_EXTRA "-beta1" !define APPV_EXTRA ""
!define APPNAME "OpenTTD" ; Define application name !define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version !define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version

View File

@@ -77,7 +77,7 @@ safety_check() {
done done
} }
grep '\.h' "$ROOT_DIR/source.list" | grep -v '../objs/langs/table/strings.h\|../objs/settings/table/settings.h' | sed 's/ //' | sort > tmp.headers.source.list grep '\.h' "$ROOT_DIR/source.list" | grep -v '../objs/langs/table/strings.h\|../objs/settings/table/settings.h' | sed 's/ //g' | sort > tmp.headers.source.list
find "$ROOT_DIR/src" \( -iname "*.h" -or -iname "*.hpp" \) -and -not -ipath "*/.svn/*" | sed "s~$ROOT_DIR/src/~~" | sort > tmp.headers.src find "$ROOT_DIR/src" \( -iname "*.h" -or -iname "*.hpp" \) -and -not -ipath "*/.svn/*" | sed "s~$ROOT_DIR/src/~~" | sort > tmp.headers.src
if [ -n "`diff tmp.headers.source.list tmp.headers.src`" ]; then if [ -n "`diff tmp.headers.source.list tmp.headers.src`" ]; then
echo "The following headers are missing in source.list and not in /src/ or vice versa." echo "The following headers are missing in source.list and not in /src/ or vice versa."

View File

@@ -227,6 +227,12 @@
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs> <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\korean.lng;%(Outputs)</Outputs> <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\korean.lng;%(Outputs)</Outputs>
</CustomBuild> </CustomBuild>
<CustomBuild Include="..\src\lang\latin.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating latin language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\latin.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\latvian.txt"> <CustomBuild Include="..\src\lang\latvian.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating latvian language file</Message> <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating latvian language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command> <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>

View File

@@ -97,6 +97,9 @@
<CustomBuild Include="..\src\lang\korean.txt"> <CustomBuild Include="..\src\lang\korean.txt">
<Filter>Translations</Filter> <Filter>Translations</Filter>
</CustomBuild> </CustomBuild>
<CustomBuild Include="..\src\lang\latin.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\latvian.txt"> <CustomBuild Include="..\src\lang\latvian.txt">
<Filter>Translations</Filter> <Filter>Translations</Filter>
</CustomBuild> </CustomBuild>

View File

@@ -513,6 +513,21 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\src\lang\latin.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating latin language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\latin.lng"
/>
</FileConfiguration>
</File>
<File <File
RelativePath="..\src\lang\latvian.txt" RelativePath="..\src\lang\latvian.txt"
> >

View File

@@ -514,6 +514,21 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\src\lang\latin.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating latin language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\latin.lng"
/>
</FileConfiguration>
</File>
<File <File
RelativePath="..\src\lang\latvian.txt" RelativePath="..\src\lang\latvian.txt"
> >

View File

@@ -311,6 +311,7 @@
<ClCompile Include="..\src\debug.cpp" /> <ClCompile Include="..\src\debug.cpp" />
<ClCompile Include="..\src\dedicated.cpp" /> <ClCompile Include="..\src\dedicated.cpp" />
<ClCompile Include="..\src\depot.cpp" /> <ClCompile Include="..\src\depot.cpp" />
<ClCompile Include="..\src\disaster_vehicle.cpp" />
<ClCompile Include="..\src\driver.cpp" /> <ClCompile Include="..\src\driver.cpp" />
<ClCompile Include="..\src\economy.cpp" /> <ClCompile Include="..\src\economy.cpp" />
<ClCompile Include="..\src\effectvehicle.cpp" /> <ClCompile Include="..\src\effectvehicle.cpp" />
@@ -437,6 +438,7 @@
<ClInclude Include="..\src\depot_type.h" /> <ClInclude Include="..\src\depot_type.h" />
<ClInclude Include="..\src\direction_func.h" /> <ClInclude Include="..\src\direction_func.h" />
<ClInclude Include="..\src\direction_type.h" /> <ClInclude Include="..\src\direction_type.h" />
<ClInclude Include="..\src\disaster_vehicle.h" />
<ClInclude Include="..\src\music\dmusic.h" /> <ClInclude Include="..\src\music\dmusic.h" />
<ClInclude Include="..\src\driver.h" /> <ClInclude Include="..\src\driver.h" />
<ClInclude Include="..\src\economy_base.h" /> <ClInclude Include="..\src\economy_base.h" />
@@ -806,7 +808,6 @@
<ClCompile Include="..\src\clear_cmd.cpp" /> <ClCompile Include="..\src\clear_cmd.cpp" />
<ClCompile Include="..\src\company_cmd.cpp" /> <ClCompile Include="..\src\company_cmd.cpp" />
<ClCompile Include="..\src\depot_cmd.cpp" /> <ClCompile Include="..\src\depot_cmd.cpp" />
<ClCompile Include="..\src\disaster_cmd.cpp" />
<ClCompile Include="..\src\group_cmd.cpp" /> <ClCompile Include="..\src\group_cmd.cpp" />
<ClCompile Include="..\src\industry_cmd.cpp" /> <ClCompile Include="..\src\industry_cmd.cpp" />
<ClCompile Include="..\src\misc_cmd.cpp" /> <ClCompile Include="..\src\misc_cmd.cpp" />
@@ -883,6 +884,7 @@
<ClInclude Include="..\src\table\elrail_data.h" /> <ClInclude Include="..\src\table\elrail_data.h" />
<ClInclude Include="..\src\table\engines.h" /> <ClInclude Include="..\src\table\engines.h" />
<ClInclude Include="..\src\table\genland.h" /> <ClInclude Include="..\src\table\genland.h" />
<ClInclude Include="..\src\table\heightmap_colours.h" />
<ClInclude Include="..\src\table\industry_land.h" /> <ClInclude Include="..\src\table\industry_land.h" />
<ClInclude Include="..\src\table\landscape_sprite.h" /> <ClInclude Include="..\src\table\landscape_sprite.h" />
<ClInclude Include="..\src\table\newgrf_debug_data.h" /> <ClInclude Include="..\src\table\newgrf_debug_data.h" />
@@ -952,13 +954,8 @@
<ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqpcheader.h" /> <ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqpcheader.h" />
<ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqstate.h" /> <ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqstate.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdaux.h" /> <ClInclude Include="..\src\3rdparty\squirrel\include\sqstdaux.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdblob.h" />
<ClInclude Include="..\src\3rdparty\squirrel\sqstdlib\sqstdblobimpl.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdio.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdmath.h" /> <ClInclude Include="..\src\3rdparty\squirrel\include\sqstdmath.h" />
<ClInclude Include="..\src\3rdparty\squirrel\sqstdlib\sqstdstream.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdstring.h" /> <ClInclude Include="..\src\3rdparty\squirrel\include\sqstdstring.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdsystem.h" />
<ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqstring.h" /> <ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqstring.h" />
<ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqtable.h" /> <ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqtable.h" />
<ClInclude Include="..\src\3rdparty\squirrel\include\squirrel.h" /> <ClInclude Include="..\src\3rdparty\squirrel\include\squirrel.h" />

View File

@@ -162,6 +162,9 @@
<ClCompile Include="..\src\depot.cpp"> <ClCompile Include="..\src\depot.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\disaster_vehicle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\driver.cpp"> <ClCompile Include="..\src\driver.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@@ -540,6 +543,9 @@
<ClInclude Include="..\src\direction_type.h"> <ClInclude Include="..\src\direction_type.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\disaster_vehicle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\music\dmusic.h"> <ClInclude Include="..\src\music\dmusic.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@@ -1647,9 +1653,6 @@
<ClCompile Include="..\src\depot_cmd.cpp"> <ClCompile Include="..\src\depot_cmd.cpp">
<Filter>Command handlers</Filter> <Filter>Command handlers</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\disaster_cmd.cpp">
<Filter>Command handlers</Filter>
</ClCompile>
<ClCompile Include="..\src\group_cmd.cpp"> <ClCompile Include="..\src\group_cmd.cpp">
<Filter>Command handlers</Filter> <Filter>Command handlers</Filter>
</ClCompile> </ClCompile>
@@ -1878,6 +1881,9 @@
<ClInclude Include="..\src\table\genland.h"> <ClInclude Include="..\src\table\genland.h">
<Filter>Tables</Filter> <Filter>Tables</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\table\heightmap_colours.h">
<Filter>Tables</Filter>
</ClInclude>
<ClInclude Include="..\src\table\industry_land.h"> <ClInclude Include="..\src\table\industry_land.h">
<Filter>Tables</Filter> <Filter>Tables</Filter>
</ClInclude> </ClInclude>
@@ -2085,27 +2091,12 @@
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdaux.h"> <ClInclude Include="..\src\3rdparty\squirrel\include\sqstdaux.h">
<Filter>Squirrel headers</Filter> <Filter>Squirrel headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdblob.h">
<Filter>Squirrel headers</Filter>
</ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\sqstdlib\sqstdblobimpl.h">
<Filter>Squirrel headers</Filter>
</ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdio.h">
<Filter>Squirrel headers</Filter>
</ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdmath.h"> <ClInclude Include="..\src\3rdparty\squirrel\include\sqstdmath.h">
<Filter>Squirrel headers</Filter> <Filter>Squirrel headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\sqstdlib\sqstdstream.h">
<Filter>Squirrel headers</Filter>
</ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdstring.h"> <ClInclude Include="..\src\3rdparty\squirrel\include\sqstdstring.h">
<Filter>Squirrel headers</Filter> <Filter>Squirrel headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\include\sqstdsystem.h">
<Filter>Squirrel headers</Filter>
</ClInclude>
<ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqstring.h"> <ClInclude Include="..\src\3rdparty\squirrel\squirrel\sqstring.h">
<Filter>Squirrel headers</Filter> <Filter>Squirrel headers</Filter>
</ClInclude> </ClInclude>

View File

@@ -514,6 +514,10 @@
RelativePath=".\..\src\depot.cpp" RelativePath=".\..\src\depot.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\disaster_vehicle.cpp"
>
</File>
<File <File
RelativePath=".\..\src\driver.cpp" RelativePath=".\..\src\driver.cpp"
> >
@@ -1022,6 +1026,10 @@
RelativePath=".\..\src\direction_type.h" RelativePath=".\..\src\direction_type.h"
> >
</File> </File>
<File
RelativePath=".\..\src\disaster_vehicle.h"
>
</File>
<File <File
RelativePath=".\..\src\music\dmusic.h" RelativePath=".\..\src\music\dmusic.h"
> >
@@ -2514,10 +2522,6 @@
RelativePath=".\..\src\depot_cmd.cpp" RelativePath=".\..\src\depot_cmd.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\disaster_cmd.cpp"
>
</File>
<File <File
RelativePath=".\..\src\group_cmd.cpp" RelativePath=".\..\src\group_cmd.cpp"
> >
@@ -2830,6 +2834,10 @@
RelativePath=".\..\src\table\genland.h" RelativePath=".\..\src\table\genland.h"
> >
</File> </File>
<File
RelativePath=".\..\src\table\heightmap_colours.h"
>
</File>
<File <File
RelativePath=".\..\src\table\industry_land.h" RelativePath=".\..\src\table\industry_land.h"
> >
@@ -3122,34 +3130,14 @@
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdaux.h" RelativePath=".\..\src\3rdparty\squirrel\include\sqstdaux.h"
> >
</File> </File>
<File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdblob.h"
>
</File>
<File
RelativePath=".\..\src\3rdparty\squirrel\sqstdlib\sqstdblobimpl.h"
>
</File>
<File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdio.h"
>
</File>
<File <File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdmath.h" RelativePath=".\..\src\3rdparty\squirrel\include\sqstdmath.h"
> >
</File> </File>
<File
RelativePath=".\..\src\3rdparty\squirrel\sqstdlib\sqstdstream.h"
>
</File>
<File <File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdstring.h" RelativePath=".\..\src\3rdparty\squirrel\include\sqstdstring.h"
> >
</File> </File>
<File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdsystem.h"
>
</File>
<File <File
RelativePath=".\..\src\3rdparty\squirrel\squirrel\sqstring.h" RelativePath=".\..\src\3rdparty\squirrel\squirrel\sqstring.h"
> >

View File

@@ -511,6 +511,10 @@
RelativePath=".\..\src\depot.cpp" RelativePath=".\..\src\depot.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\disaster_vehicle.cpp"
>
</File>
<File <File
RelativePath=".\..\src\driver.cpp" RelativePath=".\..\src\driver.cpp"
> >
@@ -1019,6 +1023,10 @@
RelativePath=".\..\src\direction_type.h" RelativePath=".\..\src\direction_type.h"
> >
</File> </File>
<File
RelativePath=".\..\src\disaster_vehicle.h"
>
</File>
<File <File
RelativePath=".\..\src\music\dmusic.h" RelativePath=".\..\src\music\dmusic.h"
> >
@@ -2511,10 +2519,6 @@
RelativePath=".\..\src\depot_cmd.cpp" RelativePath=".\..\src\depot_cmd.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\disaster_cmd.cpp"
>
</File>
<File <File
RelativePath=".\..\src\group_cmd.cpp" RelativePath=".\..\src\group_cmd.cpp"
> >
@@ -2827,6 +2831,10 @@
RelativePath=".\..\src\table\genland.h" RelativePath=".\..\src\table\genland.h"
> >
</File> </File>
<File
RelativePath=".\..\src\table\heightmap_colours.h"
>
</File>
<File <File
RelativePath=".\..\src\table\industry_land.h" RelativePath=".\..\src\table\industry_land.h"
> >
@@ -3119,34 +3127,14 @@
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdaux.h" RelativePath=".\..\src\3rdparty\squirrel\include\sqstdaux.h"
> >
</File> </File>
<File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdblob.h"
>
</File>
<File
RelativePath=".\..\src\3rdparty\squirrel\sqstdlib\sqstdblobimpl.h"
>
</File>
<File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdio.h"
>
</File>
<File <File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdmath.h" RelativePath=".\..\src\3rdparty\squirrel\include\sqstdmath.h"
> >
</File> </File>
<File
RelativePath=".\..\src\3rdparty\squirrel\sqstdlib\sqstdstream.h"
>
</File>
<File <File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdstring.h" RelativePath=".\..\src\3rdparty\squirrel\include\sqstdstring.h"
> >
</File> </File>
<File
RelativePath=".\..\src\3rdparty\squirrel\include\sqstdsystem.h"
>
</File>
<File <File
RelativePath=".\..\src\3rdparty\squirrel\squirrel\sqstring.h" RelativePath=".\..\src\3rdparty\squirrel\squirrel\sqstring.h"
> >

View File

@@ -1,5 +1,5 @@
Last updated: 2014-08-16 Last updated: 2015-12-01
Release version: 1.4.2 Release version: 1.5.3
------------------------------------------------------------------------ ------------------------------------------------------------------------
@@ -661,6 +661,12 @@ The md5 implementation in src/3rdparty/md5 is licensed under the Zlib
license. See the comments in the source files in src/3rdparty/md5 for license. See the comments in the source files in src/3rdparty/md5 for
the complete license text. the complete license text.
The implementations of Posix getaddrinfo and getnameinfo for OS/2 in
src/3rdparty/os2 are distributed partly under the GNU Lesser General Public
License 2.1, and partly under the (3-clause) BSD license. The exact licensing
terms can be found in src/3rdparty/os2/getaddrinfo.c resp.
src/3rdparty/os2/getnameinfo.c.
The exe2coff implementation in os/dos/exe2coff is available under the The exe2coff implementation in os/dos/exe2coff is available under the
GPL, with a number of additional terms. See os/dos/exe2coff/copying and GPL, with a number of additional terms. See os/dos/exe2coff/copying and
os/dos/exe2coff/copying.dj for the exact licensing terms. os/dos/exe2coff/copying.dj for the exact licensing terms.

View File

@@ -1,13 +0,0 @@
diff --git a/src/rev.cpp.in b/src/rev.cpp.in
index 506e641..3300664 100644
--- a/src/rev.cpp.in
+++ b/src/rev.cpp.in
@@ -70,7 +70,7 @@ const byte _openttd_revision_modified = !!MODIFIED!!;
* final release will always have a lower version number than the released
* version, thus making comparisons on specific revisions easy.
*/
-const uint32 _openttd_newgrf_version = 1 << 28 | 5 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
+const uint32 _openttd_newgrf_version = 1 << 28 | 5 << 24 | 0 << 20 | 1 << 19 | (!!REVISION!! & ((1 << 19) - 1));
#ifdef __MORPHOS__
/**

View File

@@ -19,6 +19,7 @@ date.cpp
debug.cpp debug.cpp
dedicated.cpp dedicated.cpp
depot.cpp depot.cpp
disaster_vehicle.cpp
driver.cpp driver.cpp
economy.cpp economy.cpp
effectvehicle.cpp effectvehicle.cpp
@@ -99,6 +100,10 @@ tutorial_gui.cpp
#else #else
#if OS2 #if OS2
os/os2/os2.cpp os/os2/os2.cpp
3rdparty/os2/getaddrinfo.c
3rdparty/os2/getaddrinfo.h
3rdparty/os2/getnameinfo.c
3rdparty/os2/getnameinfo.h
#else #else
#if OSX #if OSX
os/macosx/crashlog_osx.cpp os/macosx/crashlog_osx.cpp
@@ -173,6 +178,7 @@ depot_map.h
depot_type.h depot_type.h
direction_func.h direction_func.h
direction_type.h direction_type.h
disaster_vehicle.h
music/dmusic.h music/dmusic.h
driver.h driver.h
economy_base.h economy_base.h
@@ -565,7 +571,6 @@ autoreplace_cmd.cpp
clear_cmd.cpp clear_cmd.cpp
company_cmd.cpp company_cmd.cpp
depot_cmd.cpp depot_cmd.cpp
disaster_cmd.cpp
group_cmd.cpp group_cmd.cpp
industry_cmd.cpp industry_cmd.cpp
misc_cmd.cpp misc_cmd.cpp
@@ -646,6 +651,7 @@ table/control_codes.h
table/elrail_data.h table/elrail_data.h
table/engines.h table/engines.h
table/genland.h table/genland.h
table/heightmap_colours.h
table/industry_land.h table/industry_land.h
table/landscape_sprite.h table/landscape_sprite.h
table/newgrf_debug_data.h table/newgrf_debug_data.h
@@ -723,13 +729,8 @@ script/squirrel_std.hpp
3rdparty/squirrel/squirrel/sqpcheader.h 3rdparty/squirrel/squirrel/sqpcheader.h
3rdparty/squirrel/squirrel/sqstate.h 3rdparty/squirrel/squirrel/sqstate.h
3rdparty/squirrel/include/sqstdaux.h 3rdparty/squirrel/include/sqstdaux.h
3rdparty/squirrel/include/sqstdblob.h
3rdparty/squirrel/sqstdlib/sqstdblobimpl.h
3rdparty/squirrel/include/sqstdio.h
3rdparty/squirrel/include/sqstdmath.h 3rdparty/squirrel/include/sqstdmath.h
3rdparty/squirrel/sqstdlib/sqstdstream.h
3rdparty/squirrel/include/sqstdstring.h 3rdparty/squirrel/include/sqstdstring.h
3rdparty/squirrel/include/sqstdsystem.h
3rdparty/squirrel/squirrel/sqstring.h 3rdparty/squirrel/squirrel/sqstring.h
3rdparty/squirrel/squirrel/sqtable.h 3rdparty/squirrel/squirrel/sqtable.h
3rdparty/squirrel/include/squirrel.h 3rdparty/squirrel/include/squirrel.h

299
src/3rdparty/os2/getaddrinfo.c vendored Normal file
View File

@@ -0,0 +1,299 @@
/*
* This file is part of libESMTP, a library for submission of RFC 2822
* formatted electronic mail messages using the SMTP protocol described
* in RFC 2821.
*
* Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* An emulation of the RFC 2553 / Posix getaddrinfo resolver interface.
*/
#if !HAVE_GETADDRINFO
/* Need to turn off Posix features in glibc to build this */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include "getaddrinfo.h"
//#include "compat/inet_pton.h"
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
static struct addrinfo *
dup_addrinfo (struct addrinfo *info, void *addr, size_t addrlen) {
struct addrinfo *ret;
ret = malloc (sizeof (struct addrinfo));
if (ret == NULL)
return NULL;
memcpy (ret, info, sizeof (struct addrinfo));
ret->ai_addr = malloc (addrlen);
if (ret->ai_addr == NULL) {
free (ret);
return NULL;
}
memcpy (ret->ai_addr, addr, addrlen);
ret->ai_addrlen = addrlen;
return ret;
}
int
getaddrinfo (const char *nodename, const char *servname,
const struct addrinfo *hints, struct addrinfo **res)
{
struct hostent *hp;
struct servent *servent;
const char *socktype;
int port;
struct addrinfo hint, result;
struct addrinfo *ai, *sai, *eai;
char **addrs;
if (servname == NULL && nodename == NULL)
return EAI_NONAME;
memset (&result, 0, sizeof result);
/* default for hints */
if (hints == NULL) {
memset (&hint, 0, sizeof hint);
hint.ai_family = PF_UNSPEC;
hints = &hint;
}
if (servname == NULL)
port = 0;
else {
/* check for tcp or udp sockets only */
if (hints->ai_socktype == SOCK_STREAM)
socktype = "tcp";
else if (hints->ai_socktype == SOCK_DGRAM)
socktype = "udp";
else
return EAI_SERVICE;
result.ai_socktype = hints->ai_socktype;
/* Note: maintain port in host byte order to make debugging easier */
if (isdigit (*servname))
port = strtol (servname, NULL, 10);
else if ((servent = getservbyname (servname, socktype)) != NULL)
port = ntohs (servent->s_port);
else
return EAI_NONAME;
}
/* if nodename == NULL refer to the local host for a client or any
for a server */
if (nodename == NULL) {
struct sockaddr_in sin;
/* check protocol family is PF_UNSPEC or PF_INET - could try harder
for IPv6 but that's more code than I'm prepared to write */
if (hints->ai_family == PF_UNSPEC || hints->ai_family == PF_INET)
result.ai_family = AF_INET;
else
return EAI_FAMILY;
sin.sin_family = result.ai_family;
sin.sin_port = htons (port);
if (hints->ai_flags & AI_PASSIVE)
sin.sin_addr.s_addr = htonl (INADDR_ANY);
else
sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
/* Duplicate result and addr and return */
*res = dup_addrinfo (&result, &sin, sizeof sin);
return (*res == NULL) ? EAI_MEMORY : 0;
}
/* If AI_NUMERIC is specified, use inet_pton to translate numbers and
dots notation. */
if (hints->ai_flags & AI_NUMERICHOST) {
struct sockaddr_in sin;
/* check protocol family is PF_UNSPEC or PF_INET */
if (hints->ai_family == PF_UNSPEC || hints->ai_family == PF_INET)
result.ai_family = AF_INET;
else
return EAI_FAMILY;
sin.sin_family = result.ai_family;
sin.sin_port = htons (port);
if (inet_pton(result.ai_family, nodename, &sin.sin_addr)==0)
return EAI_NONAME;
sin.sin_addr.s_addr = inet_addr (nodename);
/* Duplicate result and addr and return */
*res = dup_addrinfo (&result, &sin, sizeof sin);
return (*res == NULL) ? EAI_MEMORY : 0;
}
#if HAVE_H_ERRNO
h_errno = 0;
#endif
errno = 0;
hp = gethostbyname(nodename);
if (hp == NULL) {
#ifdef EAI_SYSTEM
if (errno != 0) {
return EAI_SYSTEM;
}
#endif
switch (h_errno) {
case HOST_NOT_FOUND:
return EAI_NODATA;
case NO_DATA:
return EAI_NODATA;
#if defined(NO_ADDRESS) && NO_ADDRESS != NO_DATA
case NO_ADDRESS:
return EAI_NODATA;
#endif
case NO_RECOVERY:
return EAI_FAIL;
case TRY_AGAIN:
return EAI_AGAIN;
default:
return EAI_FAIL;
}
return EAI_FAIL;
}
/* Check that the address family is acceptable.
*/
switch (hp->h_addrtype) {
case AF_INET:
if (!(hints->ai_family == PF_UNSPEC || hints->ai_family == PF_INET))
return EAI_FAMILY;
break;
#ifndef __OS2__
case AF_INET6:
if (!(hints->ai_family == PF_UNSPEC || hints->ai_family == PF_INET6))
return EAI_FAMILY;
break;
#endif
default:
return EAI_FAMILY;
}
/* For each element pointed to by hp, create an element in the
result linked list. */
sai = eai = NULL;
for (addrs = hp->h_addr_list; *addrs != NULL; addrs++) {
struct sockaddr sa;
size_t addrlen;
if (hp->h_length < 1)
continue;
sa.sa_family = hp->h_addrtype;
switch (hp->h_addrtype) {
case AF_INET:
((struct sockaddr_in *) &sa)->sin_port = htons (port);
memcpy (&((struct sockaddr_in *) &sa)->sin_addr,
*addrs, hp->h_length);
addrlen = sizeof (struct sockaddr_in);
break;
#ifndef __OS2__
case AF_INET6:
#if SIN6_LEN
((struct sockaddr_in6 *) &sa)->sin6_len = hp->h_length;
#endif
((struct sockaddr_in6 *) &sa)->sin6_port = htons (port);
memcpy (&((struct sockaddr_in6 *) &sa)->sin6_addr,
*addrs, hp->h_length);
addrlen = sizeof (struct sockaddr_in6);
break;
#endif
default:
continue;
}
result.ai_family = hp->h_addrtype;
ai = dup_addrinfo (&result, &sa, addrlen);
if (ai == NULL) {
freeaddrinfo (sai);
return EAI_MEMORY;
}
if (sai == NULL)
sai = ai;
else
eai->ai_next = ai;
eai = ai;
}
if (sai == NULL) {
return EAI_NODATA;
}
if (hints->ai_flags & AI_CANONNAME) {
sai->ai_canonname = malloc (strlen (hp->h_name) + 1);
if (sai->ai_canonname == NULL) {
freeaddrinfo (sai);
return EAI_MEMORY;
}
strcpy (sai->ai_canonname, hp->h_name);
}
*res = sai;
return 0;
}
void
freeaddrinfo (struct addrinfo *ai)
{
struct addrinfo *next;
while (ai != NULL) {
next = ai->ai_next;
if (ai->ai_canonname != NULL)
free (ai->ai_canonname);
if (ai->ai_addr != NULL)
free (ai->ai_addr);
free (ai);
ai = next;
}
}
const char *
gai_strerror (int ecode)
{
static const char *eai_descr[] = {
"no error",
"address family for nodename not supported", /* EAI_ADDRFAMILY */
"temporary failure in name resolution", /* EAI_AGAIN */
"invalid value for ai_flags", /* EAI_BADFLAGS */
"non-recoverable failure in name resolution", /* EAI_FAIL */
"ai_family not supported", /* EAI_FAMILY */
"memory allocation failure", /* EAI_MEMORY */
"no address associated with nodename", /* EAI_NODATA */
"nodename nor servname provided, or not known", /* EAI_NONAME */
"servname not supported for ai_socktype", /* EAI_SERVICE */
"ai_socktype not supported", /* EAI_SOCKTYPE */
"system error returned in errno", /* EAI_SYSTEM */
"argument buffer overflow", /* EAI_OVERFLOW */
};
if (ecode < 0 || ecode > (int) (sizeof eai_descr/ sizeof eai_descr[0]))
return "unknown error";
return eai_descr[ecode];
}
#endif /* HAVE_GETADDRINFO */

101
src/3rdparty/os2/getaddrinfo.h vendored Normal file
View File

@@ -0,0 +1,101 @@
#ifndef _getaddrinfo_h
#define _getaddrinfo_h
/*
* Shamelessly duplicated from the fetchmail public sources
* for use by the Squid Project under GNU Public License.
*
* Update/Maintenance History:
*
* 15-Aug-2007 : Copied from fetchmail 6.3.8
* - added protection around libray headers
*
* 16-Aug-2007 : Altered configure checks
* Un-hacked slightly to use system gethostbyname()
*
* Original License and code follows.
*/
/*
* This file is part of libESMTP, a library for submission of RFC 2822
* formatted electronic mail messages using the SMTP protocol described
* in RFC 2821.
*
* Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Structure and prototypes taken from RFC 2553 */
/* SG 23/09/2007:
On Windows the following definitions are already available, may be that
this could be needed on some other platform */
typedef int socklen_t;
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
socklen_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for nodename */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
/* Supposed to be defined in <netdb.h> */
#define AI_ADDRCONFIG 0
#define AI_PASSIVE 1 /* Socket address is intended for `bind'. */
#define AI_CANONNAME 2 /* Request for canonical name. */
#define AI_NUMERICHOST 4 /* Don't use name resolution. */
/* Supposed to be defined in <netdb.h> */
#define EAI_ADDRFAMILY 1 /* address family for nodename not supported */
#define EAI_AGAIN 2 /* temporary failure in name resolution */
#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
#define EAI_FAMILY 5 /* ai_family not supported */
#define EAI_MEMORY 6 /* memory allocation failure */
#define EAI_NODATA 7 /* no address associated with nodename */
#define EAI_NONAME 8 /* nodename nor servname provided, or not known */
#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
#ifndef EAI_SYSTEM
/* Not defined on mingw32. */
#define EAI_SYSTEM 11 /* System error returned in `errno'. */
#endif
#ifndef EAI_OVERFLOW
/* Not defined on mingw32. */
#define EAI_OVERFLOW 12 /* Argument buffer overflow. */
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* RFC 2553 / Posix resolver */
int getaddrinfo (const char *nodename, const char *servname,
const struct addrinfo *hints, struct addrinfo **res);
/* Free addrinfo structure and associated storage */
void freeaddrinfo (struct addrinfo *ai);
/* Convert error return from getaddrinfo() to string */
const char *gai_strerror (int code);
#ifdef __cplusplus
}
#endif
#endif /* _getaddrinfo_h */

367
src/3rdparty/os2/getnameinfo.c vendored Normal file
View File

@@ -0,0 +1,367 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Issues to be discussed:
* - RFC2553 says that we should raise error on short buffer. X/Open says
* we need to truncate the result. We obey RFC2553 (and X/Open should be
* modified). ipngwg rough consensus seems to follow RFC2553. RFC3493 says
* nothing about it, but defines a new error code EAI_OVERFLOW which seems
* to be intended the code for this case.
* - What is "local" in NI_NOFQDN? (see comments in the code)
* - NI_NAMEREQD and NI_NUMERICHOST conflict with each other.
* - (KAME extension) always attach textual scopeid (fe80::1%lo0), if
* sin6_scope_id is filled - standardization status?
* - what should we do if we should do getservbyport("sctp")?
*/
/*
* Considerations about thread-safeness
* The code in this file is thread-safe, and so the thread-safeness of
* getnameinfo() depends on the property of backend functions.
* - getservbyport() is not thread safe for most systems we are targeting.
* - getipnodebyaddr() is thread safe. However, many resolver libraries
* used in the function are not thread safe.
* - gethostbyaddr() is usually not thread safe.
*/
#if !HAVE_GETNAMEINFO
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <netdb.h>
#include <resolv.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include <inttypes.h>
#include "getaddrinfo.h"
#include "getnameinfo.h"
static const struct afd {
int a_af;
int a_addrlen;
int a_socklen;
int a_off;
int a_portoff;
} afdl [] = {
#if INET6
{PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6),
offsetof(struct sockaddr_in6, sin6_addr),
offsetof(struct sockaddr_in6, sin6_port)},
#endif
{PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in),
offsetof(struct sockaddr_in, sin_addr),
offsetof(struct sockaddr_in, sin_port)},
{0, 0, 0, 0, 0},
};
#if INET6
static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *,
size_t, int));
static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int));
#endif
int
getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
const struct sockaddr *sa;
socklen_t salen;
char *host;
size_t hostlen;
char *serv;
size_t servlen;
int flags;
{
const struct afd *afd;
struct servent *sp;
struct hostent *hp;
unsigned short port;
int family, i;
const char *addr;
uint32_t v4a;
char numserv[512];
if (sa == NULL)
return EAI_FAIL;
#if HAVE_SA_LEN /*XXX*/
if (sa->sa_len != salen)
return EAI_FAIL;
#endif
family = sa->sa_family;
for (i = 0; afdl[i].a_af; i++)
if (afdl[i].a_af == family) {
afd = &afdl[i];
goto found;
}
return EAI_FAMILY;
found:
if (salen != afd->a_socklen)
return EAI_FAIL;
/* network byte order */
memcpy(&port, (const char *)sa + afd->a_portoff, sizeof(port));
addr = (const char *)sa + afd->a_off;
if (serv == NULL || servlen == 0) {
/*
* do nothing in this case.
* in case you are wondering if "&&" is more correct than
* "||" here: RFC3493 says that serv == NULL OR servlen == 0
* means that the caller does not want the result.
*/
} else {
if (flags & NI_NUMERICSERV)
sp = NULL;
else {
sp = getservbyport(port,
(flags & NI_DGRAM) ? "udp" : "tcp");
}
if (sp) {
if (strlen(sp->s_name) + 1 > servlen)
return EAI_OVERFLOW;
strncpy(serv, sp->s_name, servlen);
} else {
snprintf(numserv, sizeof(numserv), "%u", ntohs(port));
if (strlen(numserv) + 1 > servlen)
return EAI_OVERFLOW;
strncpy(serv, numserv, servlen);
}
}
switch (sa->sa_family) {
case AF_INET:
v4a = (uint32_t)
ntohl(((const struct sockaddr_in *)sa)->sin_addr.s_addr);
if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
flags |= NI_NUMERICHOST;
v4a >>= IN_CLASSA_NSHIFT;
if (v4a == 0)
flags |= NI_NUMERICHOST;
break;
#if INET6
case AF_INET6: {
const struct sockaddr_in6 *sin6;
sin6 = (const struct sockaddr_in6 *)sa;
switch (sin6->sin6_addr.s6_addr[0]) {
case 0x00:
if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
;
else if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))
;
else
flags |= NI_NUMERICHOST;
break;
default:
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
flags |= NI_NUMERICHOST;
else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
flags |= NI_NUMERICHOST;
break;
}
}
break;
#endif
}
if (host == NULL || hostlen == 0) {
/*
* do nothing in this case.
* in case you are wondering if "&&" is more correct than
* "||" here: RFC3493 says that host == NULL or hostlen == 0
* means that the caller does not want the result.
*/
} else if (flags & NI_NUMERICHOST) {
/* NUMERICHOST and NAMEREQD conflicts with each other */
if (flags & NI_NAMEREQD)
return EAI_NONAME;
goto numeric;
} else {
#if USE_GETIPNODEBY
int h_error = 0;
hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error);
#else
hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af);
#if 0 // getnameinfo.c:161:9: error: variable 'h_error' set but not used
#if HAVE_H_ERRNO
h_error = h_errno;
#else
h_error = EINVAL;
#endif
#endif /* 0 */
#endif
if (hp) {
#if 0
if (flags & NI_NOFQDN) {
/*
* According to RFC3493 section 6.2, NI_NOFQDN
* means "node name portion of the FQDN shall
* be returned for local hosts." The following
* code tries to implement it by returning the
* first label (the part before the first
* period) of the FQDN. However, it is not
* clear if this always makes sense, since the
* given address may be outside of "local
* hosts." Due to the unclear description, we
* disable the code in this implementation.
*/
char *p;
p = strchr(hp->h_name, '.');
if (p)
*p = '\0';
}
#endif
if (strlen(hp->h_name) + 1 > hostlen) {
#if USE_GETIPNODEBY
freehostent(hp);
#endif
return EAI_OVERFLOW;
}
strncpy(host, hp->h_name, hostlen);
#if USE_GETIPNODEBY
freehostent(hp);
#endif
} else {
if (flags & NI_NAMEREQD)
return EAI_NONAME;
numeric:
switch (afd->a_af) {
#if INET6
case AF_INET6: {
int error;
if ((error = ip6_parsenumeric(sa, addr, host,
hostlen,
flags)) != 0)
return(error);
break;
}
#endif
default:
if (inet_ntop(afd->a_af, addr, host,
hostlen) == NULL)
return EAI_SYSTEM;
break;
}
}
}
return(0);
}
#if INET6
static int
ip6_parsenumeric(sa, addr, host, hostlen, flags)
const struct sockaddr *sa;
const char *addr;
char *host;
size_t hostlen;
int flags;
{
int numaddrlen;
char numaddr[512];
if (inet_ntop(AF_INET6, addr, numaddr, sizeof(numaddr)) == NULL)
return EAI_SYSTEM;
numaddrlen = strlen(numaddr);
if (numaddrlen + 1 > hostlen) /* don't forget terminator */
return EAI_OVERFLOW;
strncpy(host, numaddr, hostlen);
if (((const struct sockaddr_in6 *)sa)->sin6_scope_id) {
char zonebuf[SQUIDHOSTNAMELEN];
int zonelen;
zonelen = ip6_sa2str(
(const struct sockaddr_in6 *)(const void *)sa,
zonebuf, sizeof(zonebuf), flags);
if (zonelen < 0)
return EAI_OVERFLOW;
if (zonelen + 1 + numaddrlen + 1 > hostlen)
return EAI_OVERFLOW;
/* construct <numeric-addr><delim><zoneid> */
memcpy(host + numaddrlen + 1, zonebuf,
(size_t)zonelen);
host[numaddrlen] = SCOPE_DELIMITER;
host[numaddrlen + 1 + zonelen] = '\0';
}
return 0;
}
/* ARGSUSED */
static int
ip6_sa2str(sa6, buf, bufsiz, flags)
const struct sockaddr_in6 *sa6;
char *buf;
size_t bufsiz;
int flags;
{
unsigned int ifindex;
const struct in6_addr *a6;
int n;
ifindex = (unsigned int)sa6->sin6_scope_id;
a6 = &sa6->sin6_addr;
#if NI_NUMERICSCOPE
if ((flags & NI_NUMERICSCOPE) != 0) {
n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id);
if (n < 0 || n >= bufsiz)
return -1;
else
return n;
}
#endif
/* if_indextoname() does not take buffer size. not a good api... */
if ((IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
IN6_IS_ADDR_MC_NODELOCAL(a6)) && bufsiz >= IF_NAMESIZE) {
char *p = if_indextoname(ifindex, buf);
if (p)
return (strlen(p));
}
/* last resort */
n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id);
if (n < 0 || n >= bufsiz)
return -1;
else
return n;
}
#endif /* INET6 */
#endif

29
src/3rdparty/os2/getnameinfo.h vendored Normal file
View File

@@ -0,0 +1,29 @@
#ifndef _getnameinfo_h
#define _getnameinfo_h
/*
* Reconstructed from KAME getnameinfo.c (in lib/)
*/
/* getnameinfo flags */
#define NI_NOFQDN 0x0001
#define NI_NUMERICHOST 0x0002 /* return numeric form of address */
#define NI_NAMEREQD 0x0004 /* request DNS name */
#define NI_NUMERICSERV 0x0008
#define NI_DGRAM 0x0010
#ifdef __cplusplus
extern "C" {
#endif
/* RFC 2553 / Posix resolver */
int getnameinfo(const struct sockaddr *sa,
socklen_t salen,
char *host,
size_t hostlen,
char *serv,
size_t servlen,
int flags );
#ifdef __cplusplus
}
#endif
#endif /* _getnameinfo_h */

View File

@@ -1,41 +0,0 @@
Squirrel 2.2.4 stable
--------------------------------------------------------
What is in this distribution?
squirrel
static library implementing the compiler and interpreter of the language
sqstdlib
the standard utility libraries
sq
stand alone interpreter
doc
The manual
etc
a minimalistic embedding sample
samples
samples programs
HOW TO COMPILE
---------------------------------------------------------
GCC USERS
.........................................................
There is a very simple makefile that compiles all libraries and exes
from the root of the project run 'make'
for 32 bits systems
$ make
for 64 bits systems
$ make sq64
VISUAL C++ USERS
.........................................................
Open squirrel.dsw from the root project directory and build(dho!)

View File

@@ -1,357 +0,0 @@
***version 2.2.5 stable***
-sq_getsize() now returns userdatasize for classes and instances
-added parameter 'isstatic' to _newmember metamethod(thx G.Meyer)
-now array.sort() is implemented with heapsort
-added SQUIRREL_VERSION_NUMBER preprocessor definition
-now floats in scientific notation also accept numbers with no '.' (eg. 1e+6 or 1e6)
-fixed some compiler warning
-fixed a minor compiler bug
-fixed some bugs when SQUSEDOUBLE is used in 32bits systems
-fixed bug in GC
***2009-11-15 ***
***version 2.2.4 stable***
-fixed bug in functions with default parameters
***2009-06-30 ***
***version 2.2.3 stable***
-added sq_getfunctioninfo
-added compile time flag SQUSEDOUBLE to use double precision floats
-added global slot _floatsize_ int the base lib to recognize single precision and double precision builds
-sq_wakeupvm can now resume the vm with an exception
-added sqstd_format
-generators can now be instantiated by calling sq_call() or closure.call()
-fixed a bug in sqstd_printcallstack(thx takayuki_h)
-fixed modulo by zero(thx jup)
-fixed negative enums and constants
-fixed generator crash bug if invoked as tail call (thx Mr.Accident)
-fixed some minor bug
***2008-09-24 ***
***version 2.2.2 stable***
-fixed some behaviour inconsistencies in thread.call() and thread.wakeup() (thx Mr.Accident)
-fixed coroutine error propagation
-fixed lingering return value from native function (thx Tom Leonard)
-fixed a bug if array.sort() is given a bad sort function (thx Tom Leonard)
-fixed some minor api bug
-added sq_arrayremove() and sq_arrayinsert()
***2008-05-16 ***
***version 2.2.1 stable***
-fixed a tailcall bug
***2008-02-17 ***
***version 2.2 stable ***
-added _newslot metamethod in classes
-added enums added constants
-added sq_pushconsttable, sq_setconsttable
-added default param
-added octal literals(thx Dinosaur)
-fixed debug hook, 'calls' and 'returns' are properly notified in the same number.
-fixed a coroutine bug
***2007-07-29 ***
***version 2.1.2 stable***
-new behaviour for generators iteration using foreach
now when a generator is iterated by foreach the value returned by a 'return val' statement
will terminate the iteration but will not be returned as foreach iteration
-added sq_setclassudsize()
-added sq_clear()
-added table.clear(), array.clear()
-fixed sq_cmp() (thx jyuill)
-fixed minor bugs
***2006-08-21 ***
***version 2.1.1 stable***
-vm refactoring
-optimized internal function memory layout
-new global symbol _version_ (is the version string)
-code size optimization for float literals(on 32bits float builts)
-now the raw ref API(sq_addref etc...) is fully reentrant.
-fixed a bug in sq_getdelegate() now pushes null if the object doesn't have a delegate(thx MatzeB)
-improved C reference performances in NO_GARBAGE_COLLECTOR builds
-sq_getlocal() now enumerates also outer values.
-fixed regexp library for GCC users.
***2006-03-19 ***
***version 2.1 stable***
-added static class fields, new keyword static
-added 64bits architecture support
-added global slot _intsize_ int the base lib to recognize 32bits and 64bits builds
-added functions with fixed environment, closure.bindenv() built-in function
-all types except userdata and null implement the tostring() method
-string concatenation now invokes metamethod _tostring
-new metamethods for class objects _newmember and _inherited
-sq_call() sq_resume() sq_wakeupvm() have a new signature
-new C referencing implementation(scales more with the amount of references)
-refactored hash table
-new api functions sq_newslot(),sq_tobool(),sq_getbase(), sq_instanceof(), sq_bindenv()
-the api func sq_createslot was deprecated but still supported in form of C macro on top of sq_newslot
-sq_setreleasehook() now also works for classes
-stream.readstr() and stream.writestr() have been deprecated(this affects file and blob)
-fixed squirrel.h undeclared api calls
-fixed few minor bugs
-SQChar is now defined as wchar_t
-removed warning when building with -Wall -pedantic for GCC users
-added new std io function writeclosuretofile()
-added new std string functions strip(),rstrip(),lstrip() and split()
-regular expressions operators (+,*) now have more POSIX greedyness behaviour
-class constructors are now invoked as normal functions
***2005-10-02 ***
***version 2.0.5 stable***
-fixed some 64bits incompatibilities (thx sarge)
-fixed minor bug in the stdlib format() function (thx Rick)
-fixed a bug in dofile() that was preventing to compile empty files
-added new API sq_poptop() & sq_getfreevariable()
-some performance improvements
***2005-08-14 ***
***version 2.0.4 stable***
-weak references and related API calls
-added sq_objtobool()
-class instances memory policies improved(1 mem allocation for the whole instance)
-typetags are now declared as SQUserPointer instead of unsigned int
-first pass for 64bits compatibility
-fixed minor bug in the stdio stream
-fixed a bug in format()
-fixed bug in string.tointeger() and string.tofloat()
***2005-06-24 ***
***version 2.0.3 stable***
-dofile() and loadfile() in the iolib now can decode ASCII, UTF8 files UCS2 big-endian and little-endian
-sq_setparamscheck() : now typemesk can check for null
-added string escape sequence \xhhhh
-fixed some C++ standard incompatibilities
***2005-05-15 ***
***version 2.0.2 stable***
-performances improvements (expecially for GCC users)
-removed all dependencies from C++ exception handling
-various bugfixes
***2005-04-12 ***
***version 2.0.1 stable***
-various bugfixes
-sq_setparamscheck() now allows spaces in the typemask
***2005-04-03 ***
***version 2.0 stable***
-added API sq_gettypetag()
-added built-in function to the bool type(tointeger, tostring etc...)
***2005-02-27 ***
***version 2.0 release candidate 1(RC 1)***
-added API sq_reseterror()
-modified sq_release()
-now class instances can be cloned
-various bufixes
***2005-01-26 ***
***version 2.0 beta 1***
-added bool type
-class properties can be redefined in a derived class
-added ops *= /= and %=
-new syntax for class attributes declaration </ and /> instead of ( and )
-increased the max number of literals per function from 65535 to 16777215
-now free variables have proper lexical scoping
-added API sq_createinstance(), sq_pushbool(), sq_getbool()
-added built-in function type()
-added built-in function obj.rawin(key) in table,class and instance
-sq_rawget() and sq_rawset() now work also on classes and instances
-the VM no longer uses C++ exception handling (more suitable for embedded devices)
-various bufixes
***2004-12-21 ***
***version 2.0 alpha 2***
-globals scoping changed, now if :: is omitted the VM automatically falls back on the root table
-various bufixes
-added class level attributes
***2004-12-12 ***
***version 2.0 alpha 1***
-codebase branch from version 1.x
-added classes
-added functions with variable number of parameters(vargc & vargv and the ...)
-0 and 0.0 are now considered 'false' by all conditional statements(if,while,for,?,do-while)
-added new api functions sq_newclass() sq_setinstanceup() sq_getinstanceup() sq_getattributes() sq_setattributes()
-modified api sq_settypetag()
***2004-11-01 ***
***version 1.0 stable***
-fixed some minor bug
-improoved operator 'delete' performances
-added scientific notation for float numbers( eg. 2.e16 or 2.e-2)
***2004-08-30 ***
***version 1.0 release candidate 2(RC 2)***
-fixed bug in the vm(thx Pierre Renaux)
-fixed bug in the optimizer(thx Pierre Renaux)
-fixed some bug in the documentation(thx JD)
-added new api functions for raw object handling
-removed nested multiline comments
-reduced memory footprint in C references
***2004-08-23 ***
***version 1.0 release candidate 1(RC 1)***
-fixed division by zero
-the 'in' operator and obj.rawget() do not query the default delegate anymore
-added function sq_getprintfunc()
-added new standard library 'auxlib'(implements default error handlers)
***2004-07-12 ***
***version 1.0 beta 4***
-fixed a bug in the integer.tochar() built-in method
-fixed unary minus operator
-fixed bug in dofile()
-fixed inconsistency between != and == operators(on float/integer comparison)
-added javascript style unsigned right shift operator '>>>'
-added array(size) constructor built-in function
-array.resize(size,[fill]) built-in function accepts an optional 'fill' value
-improved debug API, added sq_getclosureinfo() and sq_setnativeclosurename()
***2004-05-23 ***
***version 1.0 beta 3***
-minor vm bug fixes
-string allocation is now faster
-tables and array memory usage is now less conservative(they shrink)
-added regular expression routines in the standard library
-The 'c' expression now accepts only 1 character(thx irbrian)
-multiline strings <[ ]> have been substituted with C# style verbatim strings (eg. @"string")
-added new keyword 'parent' for accessing the delegate of tables and unserdata
-The metamethod '_clone' has been renamed '_cloned'
-the _delslot metamethod's behaviour and prototype have been changed
-new default function in the integer and float object 'tochar()'
-the built-in function chcode2string has been removed
-the default method [table].getdelegate() has been removed
-new api sq_rawdeleteslot()
-new table built-in method rawdelete(key)
-the dynamic mudule loading has been removed from the standard distribution
-some optimizations in the VM
***2004-04-21 ***
***version 1.0 beta 2***
-minor compiler/parser bug fixes
-sq_newclosure has a different prototype, the "paramscheck" of paramter has been moved to the new function sq_setparamscheck()
-sq_setparamscheck allows to add automatic parameters type checking in native closures
-sq_compile() lost the lineinfo parameter
-new api sq_enabledebuginfo() globally sets compiler's debug info generation
-added consistency check on bytecode serialization
-fixed += operator, now works on strings like +
-added global slot in the base lib _charsize_ to recognize unicode builds from ascii builds runtime
-added registry table
-new api call sq_pushregistrytable()
-added type tag to the userdata type sq_settypetag()
-sq_getuserdata now queries the userdata typetag
-the built in function collect_garbage() as been renamed collectgarbage() for consistency reasons
-new standard libraries(sqlibs are now obsolete)
***2004-02-20 ***
***version 1.0 beta 1***
-fixed a bug in the compiler (thanks Martin Kofler)
-fixed bug in the switch case statement
-fixed the _unm metamethod
-fixed minor bugs in the API
-fixed automatic stack resizing
-first beta version
first pass code clean up in the VM and base lib
first pass code coverege test has been done on VM and built-in lib
-new VM creation API sq_open() sq_close() (sq_newvm and sq_releasevm are now obsolete)
-new api allows to specifiy a "print" function to output text(sq_printfunc)
-added some small optimizations
-new cooperative multi-threading capabilities in the base library(coroutines), VMs are now a built in type("thread")
-new built in functions have been added for manipulating the new "thread" type
-friend virtual machines share the same root table, error handler and debug hook by default
-new compile time options
***2004-01-19 ***
***version 0.9 alpha***
-fixed a garbage collection bug
-fixed some API bugs(thanks to Joshua Jensen)
-fixed tail calls (in the version 0.8 the tail call optimization was erroneously disabled)
-new function parameters semantic, now passing a wrong number of parameters generates an exception
-native closures have now a built in parameter number checking
-sq_rawget and sq_rawset now work also on arrays
-sq_getsize now woks also on userdata
-the userdata release hook prototype is changed(now passes the size of the userdata)
-the lexer reader function now returns an integer instead of a char that allows better error checking on the input(thx Joshua Jensen)
-faster compiler
-try/catch blocks do not cause any runtime memory allocation anymore
***2003-12-06 ***
***version 0.8 alpha***
-fixed a bug that was preventing to have callable userdata throught the metamethod _call
-fixed a garbage collection bug
-fixed == operator now can compare correctly different types
-new built in method getstackinfos(level)
-improoved line informations precision for the debug hook
-new api call sq_compilebuffer()
-new built-in api function compilestring()
-new syntactic sugar for function declarations inside tables
-the debug API has been finalized
***2003-11-17 ***
***version 0.7 alpha***
-fixed critical bug SQInteger the tail call system
-fixed bug in the continue statement code generation
-fixed func call param issue(thanks to Rewoonenco Andrew)
-added _delslot metamethod(thanks to Rewoonenco Andrew)
-new multiline string expression ( delimited by <[ and ]> )
-normal strings ("") do not allow embedded new line anymore
-reduced vm memory footprint(C refs are shared between friend VMs)
-new api method sq_deleteslot()
-new debug hook event 'r' is triggered when a function returns
***2003-11-04 ***
***version 0.6 alpha***
-fixed switch statement(was executing the default case after a break)
-sq_call() doesn't pop the closure (just the params)
-the vm execution can be suspended from the C API anytime (micro-threads)
-new api calls sq_suspendvm() sq_wakeupvm() sq_getvmstate() and sq_reservestack()
***2003-10-13 ***
***version 0.5 alpha***
-fixed some minor bug
-tested with non ASCII identifiers in unicode mode(I've tried chinese chars)
-added built-in function string.find()
-the built-in function array.sort() optionally accepts a cmp(a,b) function
-the debug hook function now has a new prototype debug_hook(event_type,sourcefile,line,functionname)
-fixed some debug info imprecision
***2003-10-01 ***
***version 0.4 alpha***
-faster VM
-sq_call will pop arguments and closure also in case of failure
-fixed a bug in sq_remove
-now the VM detects delegation cycles(and throws an exception)
-new operators ++ and --
-new operator ',' comma operator
-fixed some expression precedence issue
-fixed bug in sq_arraypop
***2003-09-15 ***
***version 0.3 alpha***
-fixed a bug in array::insert()
-optional Unicode core(define SQUNICODE or _UNICODE on Win32)
-sq_compiler uses a new reader function SQLEXREADFUNC
-the debug hook passes 'l' instead of 'line' for line callbacks
and 'c' instead of 'call' for call callbacks
-new array.extend() bulit-in function
-new API sq_clone()
***2003-09-10 ***
***version 0.2 pre-alpha***
-new completely reentrant VM (sq_open and sq_close are now obsolete)
-sq_newvm() has a new prototype
-allocators are now global and linked in the VM
-_newslot meta method added
-rawset creates a slot if doesn't exists
-the compiler error callback pass the vm handle(thanks Pierre Renaux)
-sq_setforeignptr() sq_getforeingptr() are now public
-sq_resume() now is possible to resume generators from C
-sq_getlasterror() retrieve the last thrown error
-improved docs
***2003-09-06 ***
***version 0.1 pre-alpha***
first release

View File

@@ -1,23 +0,0 @@
SQUIRREL=.
MAKE=make
sq32:
cd squirrel; $(MAKE)
cd sqstdlib; $(MAKE)
cd sq; $(MAKE)
sqprof:
cd squirrel; $(MAKE) sqprof
cd sqstdlib; $(MAKE) sqprof
cd sq; $(MAKE) sqprof
sq64:
cd squirrel; $(MAKE) sq64
cd sqstdlib; $(MAKE) sq64
cd sq; $(MAKE) sq64
clean:
$(MAKE) -C squirrel clean
$(MAKE) -C sqstdlib clean
$(MAKE) -C sq clean

View File

@@ -1,22 +0,0 @@
The programming language SQUIRREL 2.2.5 stable
--------------------------------------------------
The project has been compiled and run on Windows(Windows XP/2000 on Intel x86 Windows XP Pro on AMD x64) and
Linux(Slackware 9.0 on Intel x86, Fedora Core 4 on AMD x64).
Has been tested with the following compilers:
MS Visual C++ 6.0,7.0,7.1 and 8.0 (32 and 64bits)
MinGW gcc 3.2 (mingw special 20020817-1)
Cygnus gcc 3.2
Linux gcc 3.2.3
Linux gcc 4.0.0 (x86 64bits)
Feedback and suggestions are appreciated
project page - http://www.squirrel-lang.org
community forums - http://www.squirrel-lang.org/Forums
wiki - http://wiki.squirrel-lang.org
author - alberto@demichelis.net
END OF README

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +0,0 @@
#include <stdarg.h>
#include <stdio.h>
#include <squirrel.h>
#include <sqstdio.h>
#include <sqstdaux.h>
#ifdef _MSC_VER
#pragma comment (lib ,"squirrel.lib")
#pragma comment (lib ,"sqstdlib.lib")
#endif
#ifdef SQUNICODE
#define scvprintf vwprintf
#else
#define scvprintf vprintf
#endif
void printfunc(HSQUIRRELVM v, const SQChar *s, ...)
{
va_list arglist;
va_start(arglist, s);
scvprintf(s, arglist);
va_end(arglist);
}
void call_foo(HSQUIRRELVM v, int n,float f,const SQChar *s)
{
SQInteger top = sq_gettop(v); //saves the stack size before the call
sq_pushroottable(v); //pushes the global table
sq_pushstring(v,_SC("foo"),-1);
if(SQ_SUCCEEDED(sq_get(v,-2))) { //gets the field 'foo' from the global table
sq_pushroottable(v); //push the 'this' (in this case is the global table)
sq_pushinteger(v,n);
sq_pushfloat(v,f);
sq_pushstring(v,s,-1);
sq_call(v,4,SQFalse,SQTrue); //calls the function
}
sq_settop(v,top); //restores the original stack size
}
int main(int argc, char* argv[])
{
HSQUIRRELVM v;
v = sq_open(1024); // creates a VM with initial stack size 1024
//sq_pushroottable(v); //push the root table were to register the lib function
//sqstd_register_iolib(v);
sqstd_seterrorhandlers(v); //registers the default error handlers
sq_setprintfunc(v, printfunc); //sets the print function
sq_pushroottable(v); //push the root table(were the globals of the script will be stored)
if(SQ_SUCCEEDED(sqstd_dofile(v, _SC("test.nut"), SQFalse, SQTrue))) // also prints syntax errors if any
{
call_foo(v,1,2.5,_SC("teststring"));
}
sq_pop(v,1); //pops the root table
sq_close(v);
return 0;
}

View File

@@ -1,4 +0,0 @@
function foo(i, f, s)
{
print("Called foo(), i="+i+", f="+f+", s='"+s+"'\n");
}

View File

@@ -2,15 +2,7 @@
#ifndef _SQSTD_AUXLIB_H_ #ifndef _SQSTD_AUXLIB_H_
#define _SQSTD_AUXLIB_H_ #define _SQSTD_AUXLIB_H_
#ifdef __cplusplus void sqstd_seterrorhandlers(HSQUIRRELVM v);
extern "C" { void sqstd_printcallstack(HSQUIRRELVM v);
#endif
SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v);
SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /* _SQSTD_AUXLIB_H_ */ #endif /* _SQSTD_AUXLIB_H_ */

View File

@@ -1,20 +0,0 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTDBLOB_H_
#define _SQSTDBLOB_H_
#ifdef __cplusplus
extern "C" {
#endif
SQUIRREL_API SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size);
SQUIRREL_API SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr);
SQUIRREL_API SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sqstd_register_bloblib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTDBLOB_H_*/

View File

@@ -1,54 +0,0 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTDIO_H_
#define _SQSTDIO_H_
#ifdef __cplusplus
#define SQSTD_STREAM_TYPE_TAG 0x80000000
struct SQStream {
virtual ~SQStream() {}
virtual SQInteger Read(void *buffer, SQInteger size) = 0;
virtual SQInteger Write(void *buffer, SQInteger size) = 0;
virtual SQInteger Flush() = 0;
virtual SQInteger Tell() = 0;
virtual SQInteger Len() = 0;
virtual SQInteger Seek(SQInteger offset, SQInteger origin) = 0;
virtual bool IsValid() = 0;
virtual bool EOS() = 0;
};
extern "C" {
#endif
#define SQ_SEEK_CUR 0
#define SQ_SEEK_END 1
#define SQ_SEEK_SET 2
typedef void* SQFILE;
SQUIRREL_API SQFILE sqstd_fopen(const SQChar *,const SQChar *);
SQUIRREL_API SQInteger sqstd_fread(SQUserPointer, SQInteger, SQInteger, SQFILE);
SQUIRREL_API SQInteger sqstd_fwrite(const SQUserPointer, SQInteger, SQInteger, SQFILE);
SQUIRREL_API SQInteger sqstd_fseek(SQFILE , SQInteger , SQInteger);
SQUIRREL_API SQInteger sqstd_ftell(SQFILE);
SQUIRREL_API SQInteger sqstd_fflush(SQFILE);
SQUIRREL_API SQInteger sqstd_fclose(SQFILE);
SQUIRREL_API SQInteger sqstd_feof(SQFILE);
SQUIRREL_API SQRESULT sqstd_createfile(HSQUIRRELVM v, SQFILE file,SQBool own);
SQUIRREL_API SQRESULT sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file);
//compiler helpers
SQUIRREL_API SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror);
SQUIRREL_API SQRESULT sqstd_dofile(HSQUIRRELVM v,const SQChar *filename,SQBool retval,SQBool printerror);
SQUIRREL_API SQRESULT sqstd_writeclosuretofile(HSQUIRRELVM v,const SQChar *filename);
SQUIRREL_API SQRESULT sqstd_register_iolib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTDIO_H_*/

View File

@@ -2,14 +2,6 @@
#ifndef _SQSTD_MATH_H_ #ifndef _SQSTD_MATH_H_
#define _SQSTD_MATH_H_ #define _SQSTD_MATH_H_
#ifdef __cplusplus SQRESULT sqstd_register_mathlib(HSQUIRRELVM v);
extern "C" {
#endif
SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTD_MATH_H_*/ #endif /*_SQSTD_MATH_H_*/

View File

@@ -2,10 +2,6 @@
#ifndef _SQSTD_STRING_H_ #ifndef _SQSTD_STRING_H_
#define _SQSTD_STRING_H_ #define _SQSTD_STRING_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned int SQRexBool; typedef unsigned int SQRexBool;
typedef struct SQRex SQRex; typedef struct SQRex SQRex;
@@ -14,20 +10,16 @@ typedef struct {
SQInteger len; SQInteger len;
} SQRexMatch; } SQRexMatch;
SQUIRREL_API SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error); SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error);
SQUIRREL_API void sqstd_rex_free(SQRex *exp); void sqstd_rex_free(SQRex *exp);
SQUIRREL_API SQBool sqstd_rex_match(SQRex* exp,const SQChar* text); SQBool sqstd_rex_match(SQRex* exp,const SQChar* text);
SQUIRREL_API SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end); SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end);
SQUIRREL_API SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end); SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end);
SQUIRREL_API SQInteger sqstd_rex_getsubexpcount(SQRex* exp); SQInteger sqstd_rex_getsubexpcount(SQRex* exp);
SQUIRREL_API SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp); SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp);
SQUIRREL_API SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen,SQChar **output); SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen,SQChar **output);
SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v); SQRESULT sqstd_register_stringlib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQSTD_STRING_H_*/ #endif /*_SQSTD_STRING_H_*/

View File

@@ -1,15 +0,0 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_SYSTEMLIB_H_
#define _SQSTD_SYSTEMLIB_H_
#ifdef __cplusplus
extern "C" {
#endif
SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /* _SQSTD_SYSTEMLIB_H_ */

View File

@@ -1,57 +1,36 @@
/* /*
Copyright (c) 2003-2011 Alberto Demichelis * Copyright (c) 2003-2011 Alberto Demichelis
*
This software is provided 'as-is', without any * This software is provided 'as-is', without any
express or implied warranty. In no event will the * express or implied warranty. In no event will the
authors be held liable for any damages arising from * authors be held liable for any damages arising from
the use of this software. * the use of this software.
*
Permission is granted to anyone to use this software * Permission is granted to anyone to use this software
for any purpose, including commercial applications, * for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject * and to alter it and redistribute it freely, subject
to the following restrictions: * to the following restrictions:
*
1. The origin of this software must not be * 1. The origin of this software must not be
misrepresented; you must not claim that * misrepresented; you must not claim that
you wrote the original software. If you * you wrote the original software. If you
use this software in a product, an * use this software in a product, an
acknowledgment in the product * acknowledgment in the product
documentation would be appreciated but is * documentation would be appreciated but is
not required. * not required.
*
2. Altered source versions must be plainly * 2. Altered source versions must be plainly
marked as such, and must not be * marked as such, and must not be
misrepresented as being the original * misrepresented as being the original
software. * software.
*
3. This notice may not be removed or * 3. This notice may not be removed or
altered from any source distribution. * altered from any source distribution.
*/
*/
#ifndef _SQUIRREL_H_ #ifndef _SQUIRREL_H_
#define _SQUIRREL_H_ #define _SQUIRREL_H_
#ifdef __cplusplus #include "../../../string_type.h"
extern "C" {
#endif
#if defined(_MSC_VER)
# define inline __forceinline
#endif /* _MSC_VER */
#if defined(_MSC_VER) && _MSC_VER >= 1400 // MSVC 2005 safety checks
# pragma warning(disable: 4996) // '_wfopen' was declared deprecated
# define _CRT_SECURE_NO_DEPRECATE // all deprecated 'unsafe string functions
# define _CRT_NON_CONFORMING_SWPRINTFS // another deprecated stuff
#endif /* _MSC_VER >= 1400 */
#ifndef SQUIRREL_API
#define SQUIRREL_API extern
#endif
#if defined(__GNUC__)
#define __int64 long long
#endif
typedef __int64 SQInteger; typedef __int64 SQInteger;
typedef unsigned __int64 SQUnsignedInteger; typedef unsigned __int64 SQUnsignedInteger;
@@ -89,84 +68,12 @@ struct SQClass;
struct SQInstance; struct SQInstance;
struct SQDelegable; struct SQDelegable;
#ifdef _UNICODE
#define SQUNICODE
#endif
#ifdef SQUNICODE
#if (defined(_MSC_VER) && _MSC_VER >= 1400) // 1400 = VS8
#ifndef _WCHAR_T_DEFINED //this is if the compiler considers wchar_t as native type
typedef unsigned short wchar_t;
#endif
#endif
typedef wchar_t SQChar;
#define _SC(a) L##a
#define scstrcmp wcscmp
#define scsprintf swprintf
#define scsnprintf _snwprintf
#define scstrlen wcslen
#define scstrtod wcstod
#define scstrtol wcstol
#define scatoi _wtoi
#define scstrtoul wcstoul
#define scvsprintf vswprintf
#define scstrstr wcsstr
#define scisspace iswspace
#define scisdigit iswdigit
#define scisxdigit iswxdigit
#define scisalpha iswalpha
#define sciscntrl iswcntrl
#define scisalnum iswalnum
#define scprintf wprintf
#define scfprintf fwprintf
#define scvprintf vwprintf
#define scvfprintf vfwprintf
#define scvsnprintf _vsnwprintf
#define scstrdup _wcsdup
#define scstrrchr wcsrchr
#define scstrcat wcscat
#define MAX_CHAR 0xFFFF
#else
typedef char SQChar; typedef char SQChar;
#define _SC(a) a
#define scstrcmp strcmp
#define scsprintf sprintf
#define scsnprintf snprintf
#define scstrlen strlen
#define scstrtod strtod
#define scstrtol strtol
#define scatoi atoi
#define scstrtoul strtoul
#define scvsprintf vsprintf
#define scstrstr strstr
#define scisspace isspace
#define scisdigit isdigit
#define scisxdigit isxdigit
#define sciscntrl iscntrl
#define scisalpha isalpha
#define scisalnum isalnum
#define scprintf printf
#define scfprintf fprintf
#define scvprintf vprintf
#define scvfprintf vfprintf
#define scvsnprintf vsnprintf
#define scstrdup strdup
#define scstrrchr strrchr
#define scstrcat strcat
#define MAX_CHAR 0xFFFF #define MAX_CHAR 0xFFFF
#endif
#if defined(_MSC_VER) || defined(__MINGW32__) #define SQUIRREL_VERSION "Squirrel 2.2.5 stable - With custom OpenTTD modifications"
#define SQ_PRINTF64 _SC("%I64d") #define SQUIRREL_COPYRIGHT "Copyright (C) 2003-2010 Alberto Demichelis"
#else #define SQUIRREL_AUTHOR "Alberto Demichelis"
#define SQ_PRINTF64 _SC("%lld")
#endif
#define SQUIRREL_VERSION _SC("Squirrel 2.2.5 stable - With custom OpenTTD modifications")
#define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2010 Alberto Demichelis")
#define SQUIRREL_AUTHOR _SC("Alberto Demichelis")
#define SQUIRREL_VERSION_NUMBER 225 #define SQUIRREL_VERSION_NUMBER 225
#define SQ_VMSTATE_IDLE 0 #define SQ_VMSTATE_IDLE 0
@@ -272,7 +179,7 @@ typedef void (*SQPRINTFUNCTION)(HSQUIRRELVM,const SQChar * ,...);
typedef SQInteger (*SQWRITEFUNC)(SQUserPointer,SQUserPointer,SQInteger); typedef SQInteger (*SQWRITEFUNC)(SQUserPointer,SQUserPointer,SQInteger);
typedef SQInteger (*SQREADFUNC)(SQUserPointer,SQUserPointer,SQInteger); typedef SQInteger (*SQREADFUNC)(SQUserPointer,SQUserPointer,SQInteger);
typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer); typedef WChar (*SQLEXREADFUNC)(SQUserPointer);
typedef struct tagSQRegFunction{ typedef struct tagSQRegFunction{
const SQChar *name; const SQChar *name;
@@ -289,147 +196,147 @@ typedef struct tagSQFunctionInfo {
/*vm*/ /*vm*/
SQUIRREL_API bool sq_can_suspend(HSQUIRRELVM v); bool sq_can_suspend(HSQUIRRELVM v);
SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize); HSQUIRRELVM sq_open(SQInteger initialstacksize);
SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize); HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);
SQUIRREL_API void sq_seterrorhandler(HSQUIRRELVM v); void sq_seterrorhandler(HSQUIRRELVM v);
SQUIRREL_API void sq_close(HSQUIRRELVM v); void sq_close(HSQUIRRELVM v);
SQUIRREL_API void sq_setforeignptr(HSQUIRRELVM v,SQUserPointer p); void sq_setforeignptr(HSQUIRRELVM v,SQUserPointer p);
SQUIRREL_API SQUserPointer sq_getforeignptr(HSQUIRRELVM v); SQUserPointer sq_getforeignptr(HSQUIRRELVM v);
SQUIRREL_API void sq_setprintfunc(HSQUIRRELVM v, SQPRINTFUNCTION printfunc); void sq_setprintfunc(HSQUIRRELVM v, SQPRINTFUNCTION printfunc);
SQUIRREL_API SQPRINTFUNCTION sq_getprintfunc(HSQUIRRELVM v); SQPRINTFUNCTION sq_getprintfunc(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_suspendvm(HSQUIRRELVM v); SQRESULT sq_suspendvm(HSQUIRRELVM v);
SQUIRREL_API bool sq_resumecatch(HSQUIRRELVM v, int suspend = -1); bool sq_resumecatch(HSQUIRRELVM v, int suspend = -1);
SQUIRREL_API bool sq_resumeerror(HSQUIRRELVM v); bool sq_resumeerror(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_wakeupvm(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror,SQBool throwerror); SQRESULT sq_wakeupvm(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror,SQBool throwerror);
SQUIRREL_API SQInteger sq_getvmstate(HSQUIRRELVM v); SQInteger sq_getvmstate(HSQUIRRELVM v);
SQUIRREL_API void sq_decreaseops(HSQUIRRELVM v, int amount); void sq_decreaseops(HSQUIRRELVM v, int amount);
/*compiler*/ /*compiler*/
SQUIRREL_API SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,const SQChar *sourcename,SQBool raiseerror); SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,const SQChar *sourcename,SQBool raiseerror);
SQUIRREL_API SQRESULT sq_compilebuffer(HSQUIRRELVM v,const SQChar *s,SQInteger size,const SQChar *sourcename,SQBool raiseerror); SQRESULT sq_compilebuffer(HSQUIRRELVM v,const SQChar *s,SQInteger size,const SQChar *sourcename,SQBool raiseerror);
SQUIRREL_API void sq_enabledebuginfo(HSQUIRRELVM v, SQBool enable); void sq_enabledebuginfo(HSQUIRRELVM v, SQBool enable);
SQUIRREL_API void sq_notifyallexceptions(HSQUIRRELVM v, SQBool enable); void sq_notifyallexceptions(HSQUIRRELVM v, SQBool enable);
SQUIRREL_API void sq_setcompilererrorhandler(HSQUIRRELVM v,SQCOMPILERERROR f); void sq_setcompilererrorhandler(HSQUIRRELVM v,SQCOMPILERERROR f);
/*stack operations*/ /*stack operations*/
SQUIRREL_API void sq_push(HSQUIRRELVM v,SQInteger idx); void sq_push(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_pop(HSQUIRRELVM v,SQInteger nelemstopop); void sq_pop(HSQUIRRELVM v,SQInteger nelemstopop);
SQUIRREL_API void sq_poptop(HSQUIRRELVM v); void sq_poptop(HSQUIRRELVM v);
SQUIRREL_API void sq_remove(HSQUIRRELVM v,SQInteger idx); void sq_remove(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQInteger sq_gettop(HSQUIRRELVM v); SQInteger sq_gettop(HSQUIRRELVM v);
SQUIRREL_API void sq_settop(HSQUIRRELVM v,SQInteger newtop); void sq_settop(HSQUIRRELVM v,SQInteger newtop);
SQUIRREL_API void sq_reservestack(HSQUIRRELVM v,SQInteger nsize); void sq_reservestack(HSQUIRRELVM v,SQInteger nsize);
SQUIRREL_API SQInteger sq_cmp(HSQUIRRELVM v); SQInteger sq_cmp(HSQUIRRELVM v);
SQUIRREL_API void sq_move(HSQUIRRELVM dest,HSQUIRRELVM src,SQInteger idx); void sq_move(HSQUIRRELVM dest,HSQUIRRELVM src,SQInteger idx);
/*object creation handling*/ /*object creation handling*/
SQUIRREL_API SQUserPointer sq_newuserdata(HSQUIRRELVM v,SQUnsignedInteger size); SQUserPointer sq_newuserdata(HSQUIRRELVM v,SQUnsignedInteger size);
SQUIRREL_API void sq_newtable(HSQUIRRELVM v); void sq_newtable(HSQUIRRELVM v);
SQUIRREL_API void sq_newarray(HSQUIRRELVM v,SQInteger size); void sq_newarray(HSQUIRRELVM v,SQInteger size);
SQUIRREL_API void sq_newclosure(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars); void sq_newclosure(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars);
SQUIRREL_API SQRESULT sq_setparamscheck(HSQUIRRELVM v,SQInteger nparamscheck,const SQChar *typemask); SQRESULT sq_setparamscheck(HSQUIRRELVM v,SQInteger nparamscheck,const SQChar *typemask);
SQUIRREL_API SQRESULT sq_bindenv(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_bindenv(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_pushstring(HSQUIRRELVM v,const SQChar *s,SQInteger len); void sq_pushstring(HSQUIRRELVM v,const SQChar *s,SQInteger len);
SQUIRREL_API void sq_pushfloat(HSQUIRRELVM v,SQFloat f); void sq_pushfloat(HSQUIRRELVM v,SQFloat f);
SQUIRREL_API void sq_pushinteger(HSQUIRRELVM v,SQInteger n); void sq_pushinteger(HSQUIRRELVM v,SQInteger n);
SQUIRREL_API void sq_pushbool(HSQUIRRELVM v,SQBool b); void sq_pushbool(HSQUIRRELVM v,SQBool b);
SQUIRREL_API void sq_pushuserpointer(HSQUIRRELVM v,SQUserPointer p); void sq_pushuserpointer(HSQUIRRELVM v,SQUserPointer p);
SQUIRREL_API void sq_pushnull(HSQUIRRELVM v); void sq_pushnull(HSQUIRRELVM v);
SQUIRREL_API SQObjectType sq_gettype(HSQUIRRELVM v,SQInteger idx); SQObjectType sq_gettype(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQInteger sq_getsize(HSQUIRRELVM v,SQInteger idx); SQInteger sq_getsize(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getbase(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_getbase(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQBool sq_instanceof(HSQUIRRELVM v); SQBool sq_instanceof(HSQUIRRELVM v);
SQUIRREL_API void sq_tostring(HSQUIRRELVM v,SQInteger idx); void sq_tostring(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_tobool(HSQUIRRELVM v, SQInteger idx, SQBool *b); void sq_tobool(HSQUIRRELVM v, SQInteger idx, SQBool *b);
SQUIRREL_API SQRESULT sq_getstring(HSQUIRRELVM v,SQInteger idx,const SQChar **c); SQRESULT sq_getstring(HSQUIRRELVM v,SQInteger idx,const SQChar **c);
SQUIRREL_API SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i); SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i);
SQUIRREL_API SQRESULT sq_getfloat(HSQUIRRELVM v,SQInteger idx,SQFloat *f); SQRESULT sq_getfloat(HSQUIRRELVM v,SQInteger idx,SQFloat *f);
SQUIRREL_API SQRESULT sq_getbool(HSQUIRRELVM v,SQInteger idx,SQBool *b); SQRESULT sq_getbool(HSQUIRRELVM v,SQInteger idx,SQBool *b);
SQUIRREL_API SQRESULT sq_getthread(HSQUIRRELVM v,SQInteger idx,HSQUIRRELVM *thread); SQRESULT sq_getthread(HSQUIRRELVM v,SQInteger idx,HSQUIRRELVM *thread);
SQUIRREL_API SQRESULT sq_getuserpointer(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p); SQRESULT sq_getuserpointer(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p);
SQUIRREL_API SQRESULT sq_getuserdata(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p,SQUserPointer *typetag); SQRESULT sq_getuserdata(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p,SQUserPointer *typetag);
SQUIRREL_API SQRESULT sq_settypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer typetag); SQRESULT sq_settypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer typetag);
SQUIRREL_API SQRESULT sq_gettypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer *typetag); SQRESULT sq_gettypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer *typetag);
SQUIRREL_API void sq_setreleasehook(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook); void sq_setreleasehook(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook);
SQUIRREL_API SQChar *sq_getscratchpad(HSQUIRRELVM v,SQInteger minsize); SQChar *sq_getscratchpad(HSQUIRRELVM v,SQInteger minsize);
SQUIRREL_API SQRESULT sq_getfunctioninfo(HSQUIRRELVM v,SQInteger idx,SQFunctionInfo *fi); SQRESULT sq_getfunctioninfo(HSQUIRRELVM v,SQInteger idx,SQFunctionInfo *fi);
SQUIRREL_API SQRESULT sq_getclosureinfo(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger *nparams,SQUnsignedInteger *nfreevars); SQRESULT sq_getclosureinfo(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger *nparams,SQUnsignedInteger *nfreevars);
SQUIRREL_API SQRESULT sq_setnativeclosurename(HSQUIRRELVM v,SQInteger idx,const SQChar *name); SQRESULT sq_setnativeclosurename(HSQUIRRELVM v,SQInteger idx,const SQChar *name);
SQUIRREL_API SQRESULT sq_setinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer p); SQRESULT sq_setinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer p);
SQUIRREL_API SQRESULT sq_getinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p,SQUserPointer typetag); SQRESULT sq_getinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p,SQUserPointer typetag);
SQUIRREL_API SQRESULT sq_setclassudsize(HSQUIRRELVM v, SQInteger idx, SQInteger udsize); SQRESULT sq_setclassudsize(HSQUIRRELVM v, SQInteger idx, SQInteger udsize);
SQUIRREL_API SQRESULT sq_newclass(HSQUIRRELVM v,SQBool hasbase); SQRESULT sq_newclass(HSQUIRRELVM v,SQBool hasbase);
SQUIRREL_API SQRESULT sq_createinstance(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_createinstance(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_setattributes(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_setattributes(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getattributes(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_getattributes(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getclass(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_getclass(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API void sq_weakref(HSQUIRRELVM v,SQInteger idx); void sq_weakref(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getdefaultdelegate(HSQUIRRELVM v,SQObjectType t); SQRESULT sq_getdefaultdelegate(HSQUIRRELVM v,SQObjectType t);
/*object manipulation*/ /*object manipulation*/
SQUIRREL_API void sq_pushroottable(HSQUIRRELVM v); void sq_pushroottable(HSQUIRRELVM v);
SQUIRREL_API void sq_pushregistrytable(HSQUIRRELVM v); void sq_pushregistrytable(HSQUIRRELVM v);
SQUIRREL_API void sq_pushconsttable(HSQUIRRELVM v); void sq_pushconsttable(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_setroottable(HSQUIRRELVM v); SQRESULT sq_setroottable(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_setconsttable(HSQUIRRELVM v); SQRESULT sq_setconsttable(HSQUIRRELVM v);
SQUIRREL_API SQRESULT sq_newslot(HSQUIRRELVM v, SQInteger idx, SQBool bstatic); SQRESULT sq_newslot(HSQUIRRELVM v, SQInteger idx, SQBool bstatic);
SQUIRREL_API SQRESULT sq_deleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval); SQRESULT sq_deleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
SQUIRREL_API SQRESULT sq_set(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_set(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_get(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_get(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_rawget(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_rawget(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_rawset(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_rawset(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_rawdeleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval); SQRESULT sq_rawdeleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
SQUIRREL_API SQRESULT sq_arrayappend(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_arrayappend(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_arraypop(HSQUIRRELVM v,SQInteger idx,SQBool pushval); SQRESULT sq_arraypop(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
SQUIRREL_API SQRESULT sq_arrayresize(HSQUIRRELVM v,SQInteger idx,SQInteger newsize); SQRESULT sq_arrayresize(HSQUIRRELVM v,SQInteger idx,SQInteger newsize);
SQUIRREL_API SQRESULT sq_arrayreverse(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_arrayreverse(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_arrayremove(HSQUIRRELVM v,SQInteger idx,SQInteger itemidx); SQRESULT sq_arrayremove(HSQUIRRELVM v,SQInteger idx,SQInteger itemidx);
SQUIRREL_API SQRESULT sq_arrayinsert(HSQUIRRELVM v,SQInteger idx,SQInteger destpos); SQRESULT sq_arrayinsert(HSQUIRRELVM v,SQInteger idx,SQInteger destpos);
SQUIRREL_API SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getdelegate(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_getdelegate(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_clone(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_clone(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_setfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval); SQRESULT sq_setfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
SQUIRREL_API SQRESULT sq_next(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_next(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_getweakrefval(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_getweakrefval(HSQUIRRELVM v,SQInteger idx);
SQUIRREL_API SQRESULT sq_clear(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_clear(HSQUIRRELVM v,SQInteger idx);
/*calls*/ /*calls*/
SQUIRREL_API SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror, int suspend = -1); SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror, int suspend = -1);
SQUIRREL_API SQRESULT sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror); SQRESULT sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror);
SQUIRREL_API const SQChar *sq_getlocal(HSQUIRRELVM v,SQUnsignedInteger level,SQUnsignedInteger idx); const SQChar *sq_getlocal(HSQUIRRELVM v,SQUnsignedInteger level,SQUnsignedInteger idx);
SQUIRREL_API const SQChar *sq_getfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval); const SQChar *sq_getfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
SQUIRREL_API SQRESULT sq_throwerror(HSQUIRRELVM v,const SQChar *err); SQRESULT sq_throwerror(HSQUIRRELVM v,const SQChar *err);
SQUIRREL_API void sq_reseterror(HSQUIRRELVM v); void sq_reseterror(HSQUIRRELVM v);
SQUIRREL_API void sq_getlasterror(HSQUIRRELVM v); void sq_getlasterror(HSQUIRRELVM v);
/*raw object handling*/ /*raw object handling*/
SQUIRREL_API SQRESULT sq_getstackobj(HSQUIRRELVM v,SQInteger idx,HSQOBJECT *po); SQRESULT sq_getstackobj(HSQUIRRELVM v,SQInteger idx,HSQOBJECT *po);
SQUIRREL_API void sq_pushobject(HSQUIRRELVM v,HSQOBJECT obj); void sq_pushobject(HSQUIRRELVM v,HSQOBJECT obj);
SQUIRREL_API void sq_addref(HSQUIRRELVM v,HSQOBJECT *po); void sq_addref(HSQUIRRELVM v,HSQOBJECT *po);
SQUIRREL_API SQBool sq_release(HSQUIRRELVM v,HSQOBJECT *po); SQBool sq_release(HSQUIRRELVM v,HSQOBJECT *po);
SQUIRREL_API void sq_resetobject(HSQOBJECT *po); void sq_resetobject(HSQOBJECT *po);
SQUIRREL_API const SQChar *sq_objtostring(HSQOBJECT *o); const SQChar *sq_objtostring(HSQOBJECT *o);
SQUIRREL_API SQBool sq_objtobool(HSQOBJECT *o); SQBool sq_objtobool(HSQOBJECT *o);
SQUIRREL_API SQInteger sq_objtointeger(HSQOBJECT *o); SQInteger sq_objtointeger(HSQOBJECT *o);
SQUIRREL_API SQFloat sq_objtofloat(HSQOBJECT *o); SQFloat sq_objtofloat(HSQOBJECT *o);
SQUIRREL_API SQRESULT sq_getobjtypetag(HSQOBJECT *o,SQUserPointer * typetag); SQRESULT sq_getobjtypetag(HSQOBJECT *o,SQUserPointer * typetag);
/*GC*/ /*GC*/
SQUIRREL_API SQInteger sq_collectgarbage(HSQUIRRELVM v); SQInteger sq_collectgarbage(HSQUIRRELVM v);
/*serialization*/ /*serialization*/
SQUIRREL_API SQRESULT sq_writeclosure(HSQUIRRELVM vm,SQWRITEFUNC writef,SQUserPointer up); SQRESULT sq_writeclosure(HSQUIRRELVM vm,SQWRITEFUNC writef,SQUserPointer up);
SQUIRREL_API SQRESULT sq_readclosure(HSQUIRRELVM vm,SQREADFUNC readf,SQUserPointer up); SQRESULT sq_readclosure(HSQUIRRELVM vm,SQREADFUNC readf,SQUserPointer up);
/*mem allocation*/ /*mem allocation*/
SQUIRREL_API void *sq_malloc(SQUnsignedInteger size); void *sq_malloc(SQUnsignedInteger size);
SQUIRREL_API void *sq_realloc(void* p,SQUnsignedInteger oldsize,SQUnsignedInteger newsize); void *sq_realloc(void* p,SQUnsignedInteger oldsize,SQUnsignedInteger newsize);
SQUIRREL_API void sq_free(void *p,SQUnsignedInteger size); void sq_free(void *p,SQUnsignedInteger size);
/*debug*/ /*debug*/
SQUIRREL_API SQRESULT sq_stackinfos(HSQUIRRELVM v,SQInteger level,SQStackInfos *si); SQRESULT sq_stackinfos(HSQUIRRELVM v,SQInteger level,SQStackInfos *si);
SQUIRREL_API void sq_setdebughook(HSQUIRRELVM v); void sq_setdebughook(HSQUIRRELVM v);
/*UTILITY MACRO*/ /*UTILITY MACRO*/
#define sq_isnumeric(o) ((o)._type&SQOBJECT_NUMERIC) #define sq_isnumeric(o) ((o)._type&SQOBJECT_NUMERIC)
@@ -461,8 +368,4 @@ SQUIRREL_API void sq_setdebughook(HSQUIRRELVM v);
#define SQ_FAILED(res) (res<0) #define SQ_FAILED(res) (res<0)
#define SQ_SUCCEEDED(res) (res>=0) #define SQ_SUCCEEDED(res) (res>=0)
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*_SQUIRREL_H_*/ #endif /*_SQUIRREL_H_*/

View File

@@ -1,23 +0,0 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
function Ack(M, N) {
if (M == 0) return( N + 1 );
if (N == 0) return( Ack(M - 1, 1) );
return( Ack(M - 1, Ack(M, (N - 1))) );
}
local n;
if(ARGS.len()!=0) {
n = ARGS[0].tointeger();
if(n < 1) n = 1;
} else {
n = 1;
}
print("n="+n+"\n");
print("Ack(3,"+ n+ "):"+ Ack(3, n));

View File

@@ -1,28 +0,0 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
local n, i, k;
if(ARGS.len()!=0) {
n = ARGS[0].tointeger();
if(n < 1) n = 1;
} else {
n = 1;
}
local x = []; x.resize(n);
local y = []; y.resize(n);
for (i = 0; i < n; i+=1) {
x[i] = i + 1;
y[i] = 0;
}
for (k = 0 ; k < n; k+=1) {
for (i = n-1; i >= 0; i-=1) {
y[i] = y[i]+ x[i];
}
}
print(y[0].tostring()+" "+y[n-1]);

View File

@@ -1,49 +0,0 @@
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
class BaseVector {
constructor(...)
{
if(vargc >= 3) {
x = vargv[0];
y = vargv[1];
z = vargv[2];
}
}
x = 0;
y = 0;
z = 0;
}
class Vector3 extends BaseVector {
function _add(other)
{
if(other instanceof this.getclass())
return ::Vector3(x+other.x,y+other.y,z+other.z);
else
throw "wrong parameter";
}
function Print()
{
::print(x+","+y+","+z+"\n");
}
}
local v0 = Vector3(1,2,3)
local v1 = Vector3(11,12,13)
local v2 = v0 + v1;
v2.Print();
FakeNamespace <- {
Utils = {}
}
class FakeNamespace.Utils.SuperClass {
constructor()
{
::print("FakeNamespace.Utils.SuperClass")
}
}
local testy = FakeNamespace.Utils.SuperClass();

View File

@@ -1,35 +0,0 @@
class Foo {
//constructor
constructor(a)
{
testy = ["stuff",1,2,3];
}
//attributes of PrintTesty
</ test = "freakin attribute"/>
function PrintTesty()
{
foreach(i,val in testy)
{
::print("idx = "+i+" = "+val+" \n");
}
}
//attributes of testy
</ flippy = 10 , second = [1,2,3] />
testy = null;
}
foreach(member,val in Foo)
{
::print(member+"\n");
local attr;
if((attr = Foo.getattributes(member)) != null) {
foreach(i,v in attr)
{
::print("\t"+i+" = "+(typeof v)+"\n");
}
}
else {
::print("\t<no attributes>\n")
}
}

View File

@@ -1,25 +0,0 @@
function coroutine_test(a,b)
{
::print(a+" "+b+"\n");
local ret = ::suspend("suspend 1");
::print("the coroutine says "+ret+"\n");
ret = ::suspend("suspend 2");
::print("the coroutine says "+ret+"\n");
ret = ::suspend("suspend 3");
::print("the coroutine says "+ret+"\n");
return "I'm done"
}
local coro = ::newthread(coroutine_test);
local susparam = coro.call("test","coroutine"); //starts the coroutine
local i = 1;
do
{
::print("suspend passed ["+susparam+"]\n")
susparam = coro.wakeup("ciao "+i);
++i;
}while(coro.getstatus()=="suspended")
::print("return passed ["+susparam+"]\n")

View File

@@ -1,52 +0,0 @@
PEntity <- {
name="noname"
pos={x=0,y=0,z=0}
type="entity"
//methamethod
_typeof=function()
{
return type;
}
}
function PEntity::PrintPos()
{
::print("x="+pos.x+" y="+pos.y+" z="+pos.z+"\n");
}
function PEntity::new(name,pos)
{
local newentity=clone ::PEntity;
if(name)
newentity.name=name;
if(pos)
newentity.pos=pos;
return newentity;
}
PPlayer <- {
model="warrior.mdl"
weapon="fist"
health=100
armor=0
//overrides the parent type
type="player"
}
function PPlayer::new(name,pos)
{
local newplayer=delegate ::PEntity.new(name,pos) : clone ::PPlayer;
return newplayer;
}
local player=PPlayer.new("godzilla",{x=10,y=20,z=30});
::print("PLAYER NAME"+player.name+"\n");
::print("ENTITY TYPE"+typeof player+"\n");
player.PrintPos();
player.pos.x=123;
player.PrintPos();

View File

@@ -1,15 +0,0 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
function fib(n)
{
if (n < 2) return 1
return fib(n-2) + fib(n-1)
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
print(fib(n)+"\n")

View File

@@ -1,33 +0,0 @@
function min(x,y)
return x<y?x:y;
function max(x,y)
return x>y?x:y;
if(min(100,200)>max(50,20))
print("I'm useless statement just to show up the if/else\n");
else
print("squirrel!!\n");
print("\n")
function typy(obj)
{
switch(typeof obj)
{
case "integer":
case "float":
return "is a number";
case "table":
case "array":
return "is a container";
default:
return "is other stuff"
}
}
local a=1,b={},c=function(a,b){return a+b;}
print("a "+typy(a)+"\n");
print("b "+typy(b)+"\n");
print("c "+typy(c)+"\n");

View File

@@ -1,42 +0,0 @@
/*
*Random number function from The Great Computer Language shootout
*converted to a generator func
*/
function gen_random(max) {
local last=42
local IM = 139968;
local IA = 3877;
local IC = 29573;
for(;;){ //loops forever
yield (max * (last = (last * IA + IC) % IM) / IM);
}
}
local randtor=gen_random(100);
print("RAND NUMBERS \n")
for(local i=0;i<10;i+=1)
print(">"+resume randtor+"\n");
print("FIBONACCI \n")
function fiboz(n)
{
local prev=0;
local curr=1;
yield 1;
for(local i=0;i<n-1;i+=1)
{
local res=prev+curr;
prev=curr;
yield curr=res;
}
return prev+curr;
}
foreach(val in fiboz(10))
{
::print(">"+val+"\n");
}

View File

@@ -1 +0,0 @@
print("Hello World!")

View File

@@ -1,39 +0,0 @@
/*translation of the list test from The Great Computer Language Shootout
*/
function compare_arr(a1,a2)
{
foreach(i,val in a1)
if(val!=a2[i])return null;
return 1;
}
function test()
{
local size=10000
local l1=[]; l1.resize(size);
for(local i=0;i<size;i+=1) l1[i]=i;
local l2=clone l1;
local l3=[]
l2.reverse();
while(l2.len()>0)
l3.append(l2.pop());
while(l3.len()>0)
l2.append(l3.pop());
l1.reverse();
if(compare_arr(l1,l2))
return l1.len();
return null;
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
for(local i=0;i<n;i+=1)
if(!test())
{
print("failed");
return;
}
print("oki doki");

View File

@@ -1,32 +0,0 @@
local arr=["one","two","three"]
::print("FOREACH\n");
foreach(i,val in arr)
{
::print("index ["+i+"]="+val+"\n");
}
::print("FOR\n");
for(local i=0;i<arr.len();i+=1)
{
::print("index ["+i+"]="+arr[i]+"\n");
}
::print("WHILE\n");
local i=0;
while(i<arr.len())
{
::print("index ["+i+"]="+arr[i]+"\n");
i+=1;
}
::print("DO WHILE\n");
local i=0;
do
{
::print("index ["+i+"]="+arr[i]+"\n");
i+=1;
}while(i<arr.len());

View File

@@ -1,44 +0,0 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
local SIZE=30;
function mkmatrix(rows, cols) {
local i, j, count = 1;
local m = []; m.resize(rows);
for (i = 0; i < rows; i+=1) {
m[i] = [];m[i].resize(cols)
for (j = 0; j < cols; j+=1) {
m[i][j] = count+=1;
}
}
return m;
}
function mmult(rows, cols, m1, m2, m3) {
local i, j, k, val;
for (i = 0; i < rows; i+=1) {
for (j = 0; j < cols; j+=1) {
val = 0;
for (k = 0; k < cols; k+=1) {
val += m1[i][k] * m2[k][j];
}
m3[i][j] = val;
}
}
return m3;
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
local m1 = mkmatrix(SIZE, SIZE);
local m2 = mkmatrix(SIZE, SIZE);
local mm = mkmatrix(SIZE, SIZE);
for (local i = 0; i < n; i+=1) {
mmult(SIZE, SIZE, m1, m2, mm);
}
print(mm[0][0]+" "+mm[2][3]+" "+mm[3][2]+" "+mm[4][4]);

View File

@@ -1,115 +0,0 @@
local base_vec={
function _add(n)
{
return {
x=x+n.x,
y=y+n.y,
z=z+n.z,
}
}
function _sub(n)
{
return {
x=x-n.x,
y=y-n.y,
z=z-n.z,
}
}
function _div(n)
{
return {
x=x/n.x,
y=y/n.y,
z=z/n.z,
}
}
function _mul(n)
{
return {
x=x*n.x,
y=y*n.y,
z=z*n.z,
}
}
function _modulo(n)
{
return {
x=x%n,
y=y%n,
z=z%n,
}
}
function _typeof() {return "vector";}
function _get(key)
{
if(key==100)
{
return test_field;
}
},
function _set(key,val)
{
::print("key = "+key+"\n");
::print("val = "+val+"\n")
if(key==100)
{
return test_field=val;
}
}
test_field="nothing"
}
function vector(_x,_y,_z):(base_vec)
{
return delegate base_vec : {x=_x,y=_y,z=_z }
}
////////////////////////////////////////////////////////////
local v1=vector(1.5,2.5,3.5);
local v2=vector(1.5,2.5,3.5);
local r=v1+v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1*v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1/v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1-v2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
r=v1%2;
foreach(i,val in r)
{
print(i+" = "+val+"\n");
}
print(v1[100]+"\n");
v1[100]="set SUCCEEDED";
print(v1[100]+"\n");
if(typeof v1=="vector")
print("<SUCCEEDED>\n");
else
print("<FAILED>\n");

View File

@@ -1,61 +0,0 @@
/*translation of the methcall test from The Great Computer Language Shootout
*/
Toggle <- {
bool=null
}
function Toggle::value() {
return bool;
}
function Toggle::activate() {
bool = !bool;
return this;
}
function Toggle::new(startstate) {
local newo=clone this;
newo.bool = startstate;
return newo;
}
NthToggle <- {
count_max=null
count=0
}
function NthToggle::new(start_state,max_counter)
{
local newo=delegate ::Toggle.new(start_state) : clone this;
newo.count_max <- max_counter
return newo;
}
function NthToggle::activate ()
{
count+=1
if (count >= count_max) {
bool = !bool;
count = 0;
}
return this;
}
local n = ARGS.len()!=0?ARGS[0].tointeger():1
local val = 1;
local toggle = Toggle.new(val);
for (local i=0; i<n; i+=1) {
val = toggle.activate().value();
}
print(toggle.value() ? "true\n" : "false\n");
val = 1;
local ntoggle = NthToggle.new(val, 3);
for (local i=0; i<n; i+=1) {
val = ntoggle.activate().value();
}
print(ntoggle.value() ? "true\n" : "false\n");

View File

@@ -1,24 +0,0 @@
function state1()
{
::suspend("state1");
return state2();
}
function state2()
{
::suspend("state2");
return state3();
}
function state3()
{
::suspend("state3");
return state1();
}
local statethread = ::newthread(state1)
::print(statethread.call()+"\n");
for(local i = 0; i < 10000; i++)
::print(statethread.wakeup()+"\n");

View File

@@ -1,24 +0,0 @@
SQUIRREL= ..
OUT= $(SQUIRREL)/bin/sq
INCZ= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs
LIBZ= -L$(SQUIRREL)/lib
LIB= -lsquirrel -lsqstdlib
OBJS= sq.o
SRCS= sq.c
sq32:
g++ -O2 -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
sqprof:
g++ -O2 -pg -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
sq64:
g++ -O2 -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
clean:
rm -f $(OUT)

View File

@@ -1,324 +0,0 @@
/* see copyright notice in squirrel.h */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if defined(_MSC_VER) && defined(_DEBUG)
#include <crtdbg.h>
#include <conio.h>
#endif
#include <squirrel.h>
#include <sqstdblob.h>
#include <sqstdsystem.h>
#include <sqstdio.h>
#include <sqstdmath.h>
#include <sqstdstring.h>
#include <sqstdaux.h>
#ifdef SQUNICODE
#define scfprintf fwprintf
#define scfopen _wfopen
#define scvprintf vwprintf
#else
#define scfprintf fprintf
#define scfopen fopen
#define scvprintf vprintf
#endif
void PrintVersionInfos();
#if defined(_MSC_VER) && defined(_DEBUG)
int MemAllocHook( int allocType, void *userData, size_t size, int blockType,
long requestNumber, const unsigned char *filename, int lineNumber)
{
// if(requestNumber==585)_asm int 3;
return 1;
}
#endif
SQInteger quit(HSQUIRRELVM v)
{
int *done;
sq_getuserpointer(v,-1,(SQUserPointer*)&done);
*done=1;
return 0;
}
void printfunc(HSQUIRRELVM v,const SQChar *s,...)
{
va_list vl;
va_start(vl, s);
scvprintf( s, vl);
va_end(vl);
}
void PrintVersionInfos()
{
scfprintf(stdout,_SC("%s %s (%d bits)\n"),SQUIRREL_VERSION,SQUIRREL_COPYRIGHT,sizeof(SQInteger)*8);
if(sizeof(SQFloat) != sizeof(float)) {
scfprintf(stdout,_SC("[%d bits floats]\n"),sizeof(SQFloat)*8);
}
}
void PrintUsage()
{
scfprintf(stderr,_SC("usage: sq <options> <scriptpath [args]>.\n")
_SC("Available options are:\n")
_SC(" -c compiles the file to bytecode(default output 'out.cnut')\n")
_SC(" -o specifies output file for the -c option\n")
_SC(" -c compiles only\n")
_SC(" -d generates debug infos\n")
_SC(" -v displays version infos\n")
_SC(" -h prints help\n"));
}
#define _INTERACTIVE 0
#define _DONE 2
//<<FIXME>> this func is a mess
int getargs(HSQUIRRELVM v,int argc, char* argv[])
{
int i;
int compiles_only = 0;
static SQChar temp[500];
const SQChar *ret=NULL;
char * output = NULL;
int lineinfo=0;
if(argc>1)
{
int arg=1,exitloop=0;
while(arg < argc && !exitloop)
{
if(argv[arg][0]=='-')
{
switch(argv[arg][1])
{
case 'd': //DEBUG(debug infos)
sq_enabledebuginfo(v,1);
break;
case 'c':
compiles_only = 1;
break;
case 'o':
if(arg < argc) {
arg++;
output = argv[arg];
}
break;
case 'v':
PrintVersionInfos();
return _DONE;
case 'h':
PrintVersionInfos();
PrintUsage();
return _DONE;
default:
PrintVersionInfos();
scprintf(_SC("unknown prameter '-%c'\n"),argv[arg][1]);
PrintUsage();
return _DONE;
}
}else break;
arg++;
}
// src file
if(arg<argc) {
const SQChar *filename=NULL;
#ifdef SQUNICODE
mbstowcs(temp,argv[arg],strlen(argv[arg]));
filename=temp;
#else
filename=argv[arg];
#endif
arg++;
sq_pushroottable(v);
sq_pushstring(v,_SC("ARGS"),-1);
sq_newarray(v,0);
for(i=arg;i<argc;i++)
{
const SQChar *a;
#ifdef SQUNICODE
int alen=(int)strlen(argv[i]);
a=sq_getscratchpad(v,(int)(alen*sizeof(SQChar)));
mbstowcs(sq_getscratchpad(v,-1),argv[i],alen);
sq_getscratchpad(v,-1)[alen] = _SC('\0');
#else
a=argv[i];
#endif
sq_pushstring(v,a,-1);
sq_arrayappend(v,-2);
}
sq_createslot(v,-3);
sq_pop(v,1);
if(compiles_only) {
if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,SQTrue))){
SQChar *outfile = _SC("out.cnut");
if(output) {
#ifdef SQUNICODE
int len = (int)(strlen(output)+1);
mbstowcs(sq_getscratchpad(v,len*sizeof(SQChar)),output,len);
outfile = sq_getscratchpad(v,-1);
#else
outfile = output;
#endif
}
if(SQ_SUCCEEDED(sqstd_writeclosuretofile(v,outfile)))
return _DONE;
}
}
else {
if(SQ_SUCCEEDED(sqstd_dofile(v,filename,SQFalse,SQTrue))) {
return _DONE;
}
}
//if this point is reached an error occured
{
const SQChar *err;
sq_getlasterror(v);
if(SQ_SUCCEEDED(sq_getstring(v,-1,&err))) {
scprintf(_SC("Error [%s]\n"),err);
return _DONE;
}
}
}
}
return _INTERACTIVE;
}
void Interactive(HSQUIRRELVM v)
{
#define MAXINPUT 1024
SQChar buffer[MAXINPUT];
SQInteger blocks =0;
SQInteger string=0;
SQInteger retval=0;
SQInteger done=0;
PrintVersionInfos();
sq_pushroottable(v);
sq_pushstring(v,_SC("quit"),-1);
sq_pushuserpointer(v,&done);
sq_newclosure(v,quit,1);
sq_setparamscheck(v,1,NULL);
sq_createslot(v,-3);
sq_pop(v,1);
while (!done)
{
SQInteger i = 0;
scprintf(_SC("\nsq>"));
for(;;) {
int c;
if(done)return;
c = getchar();
if (c == _SC('\n')) {
if (i>0 && buffer[i-1] == _SC('\\'))
{
buffer[i-1] = _SC('\n');
}
else if(blocks==0)break;
buffer[i++] = _SC('\n');
}
else if (c==_SC('}')) {blocks--; buffer[i++] = (SQChar)c;}
else if(c==_SC('{') && !string){
blocks++;
buffer[i++] = (SQChar)c;
}
else if(c==_SC('"') || c==_SC('\'')){
string=!string;
buffer[i++] = (SQChar)c;
}
else if (i >= MAXINPUT-1) {
scfprintf(stderr, _SC("sq : input line too long\n"));
break;
}
else{
buffer[i++] = (SQChar)c;
}
}
buffer[i] = _SC('\0');
if(buffer[0]==_SC('=')){
scsprintf(sq_getscratchpad(v,MAXINPUT),_SC("return (%s)"),&buffer[1]);
memcpy(buffer,sq_getscratchpad(v,-1),(scstrlen(sq_getscratchpad(v,-1))+1)*sizeof(SQChar));
retval=1;
}
i=scstrlen(buffer);
if(i>0){
SQInteger oldtop=sq_gettop(v);
if(SQ_SUCCEEDED(sq_compilebuffer(v,buffer,i,_SC("interactive console"),SQTrue))){
sq_pushroottable(v);
if(SQ_SUCCEEDED(sq_call(v,1,retval,SQTrue)) && retval){
scprintf(_SC("\n"));
sq_pushroottable(v);
sq_pushstring(v,_SC("print"),-1);
sq_get(v,-2);
sq_pushroottable(v);
sq_push(v,-4);
sq_call(v,2,SQFalse,SQTrue);
retval=0;
scprintf(_SC("\n"));
}
}
sq_settop(v,oldtop);
}
}
}
int main(int argc, char* argv[])
{
HSQUIRRELVM v;
const SQChar *filename=NULL;
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetAllocHook(MemAllocHook);
#endif
v=sq_open(1024);
sq_setprintfunc(v,printfunc);
sq_pushroottable(v);
sqstd_register_bloblib(v);
sqstd_register_iolib(v);
sqstd_register_systemlib(v);
sqstd_register_mathlib(v);
sqstd_register_stringlib(v);
//aux library
//sets error handlers
sqstd_seterrorhandlers(v);
//gets arguments
switch(getargs(v,argc,argv))
{
case _INTERACTIVE:
Interactive(v);
break;
case _DONE:
default:
break;
}
sq_close(v);
#if defined(_MSC_VER) && defined(_DEBUG)
_getch();
_CrtMemDumpAllObjectsSince( NULL );
#endif
return 0;
}

View File

@@ -1,101 +0,0 @@
# Microsoft Developer Studio Project File - Name="sq" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sq - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "sq.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "sq.mak" CFG="sq - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sq - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sq - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_LocalPath ".."
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "sq - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\sqstdlib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x410 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 squirrel.lib sqstdlib.lib /nologo /subsystem:console /machine:I386 /out:"../bin/sq.exe" /libpath:"../lib"
!ELSEIF "$(CFG)" == "sq - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\sqstdlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x410 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 squirrel.lib sqstdlib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/sq.exe" /pdbtype:sept /libpath:"../lib"
!ENDIF
# Begin Target
# Name "sq - Win32 Release"
# Name "sq - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\sq.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,31 +0,0 @@
SQUIRREL= ..
OUT= $(SQUIRREL)/lib/libsqstdlib.a
INCZ= -I$(SQUIRREL)/include -I. -Iinclude
SRCS= \
sqstdblob.cpp \
sqstdio.cpp \
sqstdstream.cpp \
sqstdmath.cpp \
sqstdsystem.cpp \
sqstdstring.cpp \
sqstdaux.cpp \
sqstdrex.cpp
sq32:
gcc -O2 -fno-rtti -Wall -c $(SRCS) $(INCZ)
ar rc $(OUT) *.o
sqprof:
gcc -O2 -pg -fno-rtti -pie -gstabs -g3 -Wall -c $(SRCS) $(INCZ)
ar rc $(OUT) *.o
sq64:
gcc -O2 -D_SQ64 -fno-rtti -Wall -c $(SRCS) $(INCZ)
ar rc $(OUT) *.o
clean:
rm -f $(OUT) $(SRCS:%.cpp=%.o)

View File

@@ -1,8 +1,11 @@
/* see copyright notice in squirrel.h */ /* see copyright notice in squirrel.h */
#include "../../../stdafx.h"
#include <squirrel.h> #include <squirrel.h>
#include <sqstdaux.h> #include <sqstdaux.h>
#include <assert.h>
#include <string.h> #include "../../../safeguards.h"
void sqstd_printcallstack(HSQUIRRELVM v) void sqstd_printcallstack(HSQUIRRELVM v)
{ {
@@ -16,30 +19,30 @@ void sqstd_printcallstack(HSQUIRRELVM v)
SQInteger level=1; //1 is to skip this function that is level 0 SQInteger level=1; //1 is to skip this function that is level 0
const SQChar *name=0; const SQChar *name=0;
SQInteger seq=0; SQInteger seq=0;
pf(v,_SC("\nCALLSTACK\n")); pf(v,"\nCALLSTACK\n");
while(SQ_SUCCEEDED(sq_stackinfos(v,level,&si))) while(SQ_SUCCEEDED(sq_stackinfos(v,level,&si)))
{ {
const SQChar *fn=_SC("unknown"); const SQChar *fn="unknown";
const SQChar *src=_SC("unknown"); const SQChar *src="unknown";
if(si.funcname)fn=si.funcname; if(si.funcname)fn=si.funcname;
if(si.source) { if(si.source) {
/* We don't want to bother users with absolute paths to all AI files. /* We don't want to bother users with absolute paths to all AI files.
* Since the path only reaches NoAI code in a formatted string we have * Since the path only reaches NoAI code in a formatted string we have
* to strip it here. Let's hope nobody installs openttd in a subdirectory * to strip it here. Let's hope nobody installs openttd in a subdirectory
* of a directory named /ai/. */ * of a directory named /ai/. */
src = scstrstr(si.source, _SC("\\ai\\")); src = strstr(si.source, "\\ai\\");
if (!src) src = scstrstr(si.source, _SC("/ai/")); if (!src) src = strstr(si.source, "/ai/");
if (src) { if (src) {
src += 4; src += 4;
} else { } else {
src = si.source; src = si.source;
} }
} }
pf(v,_SC("*FUNCTION [%s()] %s line [%d]\n"),fn,src,si.line); pf(v,"*FUNCTION [%s()] %s line [%d]\n",fn,src,si.line);
level++; level++;
} }
level=0; level=0;
pf(v,_SC("\nLOCALS\n")); pf(v,"\nLOCALS\n");
for(level=0;level<10;level++){ for(level=0;level<10;level++){
seq=0; seq=0;
@@ -49,56 +52,56 @@ void sqstd_printcallstack(HSQUIRRELVM v)
switch(sq_gettype(v,-1)) switch(sq_gettype(v,-1))
{ {
case OT_NULL: case OT_NULL:
pf(v,_SC("[%s] NULL\n"),name); pf(v,"[%s] NULL\n",name);
break; break;
case OT_INTEGER: case OT_INTEGER:
sq_getinteger(v,-1,&i); sq_getinteger(v,-1,&i);
pf(v,_SC("[%s] %d\n"),name,i); pf(v,"[%s] %d\n",name,i);
break; break;
case OT_FLOAT: case OT_FLOAT:
sq_getfloat(v,-1,&f); sq_getfloat(v,-1,&f);
pf(v,_SC("[%s] %.14g\n"),name,f); pf(v,"[%s] %.14g\n",name,f);
break; break;
case OT_USERPOINTER: case OT_USERPOINTER:
pf(v,_SC("[%s] USERPOINTER\n"),name); pf(v,"[%s] USERPOINTER\n",name);
break; break;
case OT_STRING: case OT_STRING:
sq_getstring(v,-1,&s); sq_getstring(v,-1,&s);
pf(v,_SC("[%s] \"%s\"\n"),name,s); pf(v,"[%s] \"%s\"\n",name,s);
break; break;
case OT_TABLE: case OT_TABLE:
pf(v,_SC("[%s] TABLE\n"),name); pf(v,"[%s] TABLE\n",name);
break; break;
case OT_ARRAY: case OT_ARRAY:
pf(v,_SC("[%s] ARRAY\n"),name); pf(v,"[%s] ARRAY\n",name);
break; break;
case OT_CLOSURE: case OT_CLOSURE:
pf(v,_SC("[%s] CLOSURE\n"),name); pf(v,"[%s] CLOSURE\n",name);
break; break;
case OT_NATIVECLOSURE: case OT_NATIVECLOSURE:
pf(v,_SC("[%s] NATIVECLOSURE\n"),name); pf(v,"[%s] NATIVECLOSURE\n",name);
break; break;
case OT_GENERATOR: case OT_GENERATOR:
pf(v,_SC("[%s] GENERATOR\n"),name); pf(v,"[%s] GENERATOR\n",name);
break; break;
case OT_USERDATA: case OT_USERDATA:
pf(v,_SC("[%s] USERDATA\n"),name); pf(v,"[%s] USERDATA\n",name);
break; break;
case OT_THREAD: case OT_THREAD:
pf(v,_SC("[%s] THREAD\n"),name); pf(v,"[%s] THREAD\n",name);
break; break;
case OT_CLASS: case OT_CLASS:
pf(v,_SC("[%s] CLASS\n"),name); pf(v,"[%s] CLASS\n",name);
break; break;
case OT_INSTANCE: case OT_INSTANCE:
pf(v,_SC("[%s] INSTANCE\n"),name); pf(v,"[%s] INSTANCE\n",name);
break; break;
case OT_WEAKREF: case OT_WEAKREF:
pf(v,_SC("[%s] WEAKREF\n"),name); pf(v,"[%s] WEAKREF\n",name);
break; break;
case OT_BOOL:{ case OT_BOOL:{
sq_getbool(v,-1,&b); sq_getbool(v,-1,&b);
pf(v,_SC("[%s] %s\n"),name,b?_SC("true"):_SC("false")); pf(v,"[%s] %s\n",name,b?"true":"false");
} }
break; break;
default: assert(0); break; default: assert(0); break;
@@ -116,10 +119,10 @@ static SQInteger _sqstd_aux_printerror(HSQUIRRELVM v)
const SQChar *sErr = 0; const SQChar *sErr = 0;
if(sq_gettop(v)>=1) { if(sq_gettop(v)>=1) {
if(SQ_SUCCEEDED(sq_getstring(v,2,&sErr))) { if(SQ_SUCCEEDED(sq_getstring(v,2,&sErr))) {
pf(v,_SC("\nAN ERROR HAS OCCURED [%s]\n"),sErr); pf(v,"\nAN ERROR HAS OCCURED [%s]\n",sErr);
} }
else{ else{
pf(v,_SC("\nAN ERROR HAS OCCURED [unknown]\n")); pf(v,"\nAN ERROR HAS OCCURED [unknown]\n");
} }
sqstd_printcallstack(v); sqstd_printcallstack(v);
} }
@@ -131,7 +134,7 @@ void _sqstd_compiler_error(HSQUIRRELVM v,const SQChar *sErr,const SQChar *sSourc
{ {
SQPRINTFUNCTION pf = sq_getprintfunc(v); SQPRINTFUNCTION pf = sq_getprintfunc(v);
if(pf) { if(pf) {
pf(v,_SC("%s line = (%d) column = (%d) : error %s\n"),sSource,line,column,sErr); pf(v,"%s line = (%d) column = (%d) : error %s\n",sSource,line,column,sErr);
} }
} }

View File

@@ -1,251 +0,0 @@
/* see copyright notice in squirrel.h */
#include <new>
#include <squirrel.h>
#include <sqstdio.h>
#include <string.h>
#include <sqstdblob.h>
#include "sqstdstream.h"
#include "sqstdblobimpl.h"
#define SQSTD_BLOB_TYPE_TAG (SQSTD_STREAM_TYPE_TAG | 0x00000002)
//Blob
#define SETUP_BLOB(v) \
SQBlob *self = NULL; \
{ if(SQ_FAILED(sq_getinstanceup(v,1,(SQUserPointer*)&self,(SQUserPointer)SQSTD_BLOB_TYPE_TAG))) \
return SQ_ERROR; }
static SQInteger _blob_resize(HSQUIRRELVM v)
{
SETUP_BLOB(v);
SQInteger size;
sq_getinteger(v,2,&size);
if(!self->Resize(size))
return sq_throwerror(v,_SC("resize failed"));
return 0;
}
static void __swap_dword(unsigned int *n)
{
*n=(unsigned int)(((*n&0xFF000000)>>24) |
((*n&0x00FF0000)>>8) |
((*n&0x0000FF00)<<8) |
((*n&0x000000FF)<<24));
}
static void __swap_word(unsigned short *n)
{
*n=(unsigned short)((*n>>8)&0x00FF)| ((*n<<8)&0xFF00);
}
static SQInteger _blob_swap4(HSQUIRRELVM v)
{
SETUP_BLOB(v);
SQInteger num=(self->Len()-(self->Len()%4))>>2;
unsigned int *t=(unsigned int *)self->GetBuf();
for(SQInteger i = 0; i < num; i++) {
__swap_dword(&t[i]);
}
return 0;
}
static SQInteger _blob_swap2(HSQUIRRELVM v)
{
SETUP_BLOB(v);
SQInteger num=(self->Len()-(self->Len()%2))>>1;
unsigned short *t = (unsigned short *)self->GetBuf();
for(SQInteger i = 0; i < num; i++) {
__swap_word(&t[i]);
}
return 0;
}
static SQInteger _blob__set(HSQUIRRELVM v)
{
SETUP_BLOB(v);
SQInteger idx,val;
sq_getinteger(v,2,&idx);
sq_getinteger(v,3,&val);
if(idx < 0 || idx >= self->Len())
return sq_throwerror(v,_SC("index out of range"));
((unsigned char *)self->GetBuf())[idx] = (unsigned char) val;
sq_push(v,3);
return 1;
}
static SQInteger _blob__get(HSQUIRRELVM v)
{
SETUP_BLOB(v);
SQInteger idx;
sq_getinteger(v,2,&idx);
if(idx < 0 || idx >= self->Len())
return sq_throwerror(v,_SC("index out of range"));
sq_pushinteger(v,((unsigned char *)self->GetBuf())[idx]);
return 1;
}
static SQInteger _blob__nexti(HSQUIRRELVM v)
{
SETUP_BLOB(v);
if(sq_gettype(v,2) == OT_NULL) {
sq_pushinteger(v, 0);
return 1;
}
SQInteger idx;
if(SQ_SUCCEEDED(sq_getinteger(v, 2, &idx))) {
if(idx+1 < self->Len()) {
sq_pushinteger(v, idx+1);
return 1;
}
sq_pushnull(v);
return 1;
}
return sq_throwerror(v,_SC("internal error (_nexti) wrong argument type"));
}
static SQInteger _blob__typeof(HSQUIRRELVM v)
{
sq_pushstring(v,_SC("blob"),-1);
return 1;
}
static SQInteger _blob_releasehook(SQUserPointer p, SQInteger size)
{
SQBlob *self = (SQBlob*)p;
delete self;
return 1;
}
static SQInteger _blob_constructor(HSQUIRRELVM v)
{
SQInteger nparam = sq_gettop(v);
SQInteger size = 0;
if(nparam == 2) {
sq_getinteger(v, 2, &size);
}
if(size < 0) return sq_throwerror(v, _SC("cannot create blob with negative size"));
SQBlob *b = new SQBlob(size);
if(SQ_FAILED(sq_setinstanceup(v,1,b))) {
delete b;
return sq_throwerror(v, _SC("cannot create blob with negative size"));
}
sq_setreleasehook(v,1,_blob_releasehook);
return 0;
}
#define _DECL_BLOB_FUNC(name,nparams,typecheck) {_SC(#name),_blob_##name,nparams,typecheck}
static SQRegFunction _blob_methods[] = {
_DECL_BLOB_FUNC(constructor,-1,_SC("xn")),
_DECL_BLOB_FUNC(resize,2,_SC("xn")),
_DECL_BLOB_FUNC(swap2,1,_SC("x")),
_DECL_BLOB_FUNC(swap4,1,_SC("x")),
_DECL_BLOB_FUNC(_set,3,_SC("xnn")),
_DECL_BLOB_FUNC(_get,2,_SC("xn")),
_DECL_BLOB_FUNC(_typeof,1,_SC("x")),
_DECL_BLOB_FUNC(_nexti,2,_SC("x")),
{0,0,0,0}
};
//GLOBAL FUNCTIONS
static SQInteger _g_blob_casti2f(HSQUIRRELVM v)
{
SQInteger i;
sq_getinteger(v,2,&i);
sq_pushfloat(v,*((SQFloat *)&i));
return 1;
}
static SQInteger _g_blob_castf2i(HSQUIRRELVM v)
{
SQFloat f;
sq_getfloat(v,2,&f);
sq_pushinteger(v,*((SQInteger *)&f));
return 1;
}
static SQInteger _g_blob_swap2(HSQUIRRELVM v)
{
SQInteger i;
sq_getinteger(v,2,&i);
short s=(short)i;
sq_pushinteger(v,(s<<8)|((s>>8)&0x00FF));
return 1;
}
static SQInteger _g_blob_swap4(HSQUIRRELVM v)
{
SQInteger i;
sq_getinteger(v,2,&i);
unsigned int t4 = (unsigned int)i;
__swap_dword(&t4);
sq_pushinteger(v,(SQInteger)t4);
return 1;
}
static SQInteger _g_blob_swapfloat(HSQUIRRELVM v)
{
SQFloat f;
sq_getfloat(v,2,&f);
__swap_dword((unsigned int *)&f);
sq_pushfloat(v,f);
return 1;
}
#define _DECL_GLOBALBLOB_FUNC(name,nparams,typecheck) {_SC(#name),_g_blob_##name,nparams,typecheck}
static SQRegFunction bloblib_funcs[]={
_DECL_GLOBALBLOB_FUNC(casti2f,2,_SC(".n")),
_DECL_GLOBALBLOB_FUNC(castf2i,2,_SC(".n")),
_DECL_GLOBALBLOB_FUNC(swap2,2,_SC(".n")),
_DECL_GLOBALBLOB_FUNC(swap4,2,_SC(".n")),
_DECL_GLOBALBLOB_FUNC(swapfloat,2,_SC(".n")),
{0,0,0,0}
};
SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr)
{
SQBlob *blob;
if(SQ_FAILED(sq_getinstanceup(v,idx,(SQUserPointer *)&blob,(SQUserPointer)SQSTD_BLOB_TYPE_TAG)))
return -1;
*ptr = blob->GetBuf();
return SQ_OK;
}
SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx)
{
SQBlob *blob;
if(SQ_FAILED(sq_getinstanceup(v,idx,(SQUserPointer *)&blob,(SQUserPointer)SQSTD_BLOB_TYPE_TAG)))
return -1;
return blob->Len();
}
SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size)
{
SQInteger top = sq_gettop(v);
sq_pushregistrytable(v);
sq_pushstring(v,_SC("std_blob"),-1);
if(SQ_SUCCEEDED(sq_get(v,-2))) {
sq_remove(v,-2); //removes the registry
sq_push(v,1); // push the this
sq_pushinteger(v,size); //size
SQBlob *blob = NULL;
if(SQ_SUCCEEDED(sq_call(v,2,SQTrue,SQFalse))
&& SQ_SUCCEEDED(sq_getinstanceup(v,-1,(SQUserPointer *)&blob,(SQUserPointer)SQSTD_BLOB_TYPE_TAG))) {
sq_remove(v,-2);
return blob->GetBuf();
}
}
sq_settop(v,top);
return NULL;
}
SQRESULT sqstd_register_bloblib(HSQUIRRELVM v)
{
return declare_stream(v,_SC("blob"),(SQUserPointer)SQSTD_BLOB_TYPE_TAG,_SC("std_blob"),_blob_methods,bloblib_funcs);
}

View File

@@ -1,108 +0,0 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_BLOBIMPL_H_
#define _SQSTD_BLOBIMPL_H_
struct SQBlob : public SQStream
{
SQBlob(SQInteger size) {
_size = size;
_allocated = size;
_buf = (unsigned char *)sq_malloc(size);
memset(_buf, 0, _size);
_ptr = 0;
_owns = true;
}
virtual ~SQBlob() {
sq_free(_buf, _allocated);
}
SQInteger Write(void *buffer, SQInteger size) {
if(!CanAdvance(size)) {
GrowBufOf(_ptr + size - _size);
}
memcpy(&_buf[_ptr], buffer, size);
_ptr += size;
return size;
}
SQInteger Read(void *buffer,SQInteger size) {
SQInteger n = size;
if(!CanAdvance(size)) {
if((_size - _ptr) > 0)
n = _size - _ptr;
else return 0;
}
memcpy(buffer, &_buf[_ptr], n);
_ptr += n;
return n;
}
bool Resize(SQInteger n) {
if(!_owns) return false;
if(n != _allocated) {
unsigned char *newbuf = (unsigned char *)sq_malloc(n);
memset(newbuf,0,n);
if(_size > n)
memcpy(newbuf,_buf,n);
else
memcpy(newbuf,_buf,_size);
sq_free(_buf,_allocated);
_buf=newbuf;
_allocated = n;
if(_size > _allocated)
_size = _allocated;
if(_ptr > _allocated)
_ptr = _allocated;
}
return true;
}
bool GrowBufOf(SQInteger n)
{
bool ret = true;
if(_size + n > _allocated) {
if(_size + n > _size * 2)
ret = Resize(_size + n);
else
ret = Resize(_size * 2);
}
_size = _size + n;
return ret;
}
bool CanAdvance(SQInteger n) {
if(_ptr+n>_size)return false;
return true;
}
SQInteger Seek(SQInteger offset, SQInteger origin) {
switch(origin) {
case SQ_SEEK_SET:
if(offset > _size || offset < 0) return -1;
_ptr = offset;
break;
case SQ_SEEK_CUR:
if(_ptr + offset > _size || _ptr + offset < 0) return -1;
_ptr += offset;
break;
case SQ_SEEK_END:
if(_size + offset > _size || _size + offset < 0) return -1;
_ptr = _size + offset;
break;
default: return -1;
}
return 0;
}
bool IsValid() {
return _buf?true:false;
}
bool EOS() {
return _ptr == _size;
}
SQInteger Flush() { return 0; }
SQInteger Tell() { return _ptr; }
SQInteger Len() { return _size; }
SQUserPointer GetBuf(){ return _buf; }
private:
SQInteger _size;
SQInteger _allocated;
SQInteger _ptr;
unsigned char *_buf;
bool _owns;
};
#endif //_SQSTD_BLOBIMPL_H_

View File

@@ -1,410 +0,0 @@
/* see copyright notice in squirrel.h */
#include <stdio.h>
#include <squirrel.h>
#include <new>
#include <sqstdio.h>
#include "sqstdstream.h"
#define SQSTD_FILE_TYPE_TAG (SQSTD_STREAM_TYPE_TAG | 0x00000001)
//basic API
SQFILE sqstd_fopen(const SQChar *filename ,const SQChar *mode)
{
#ifndef SQUNICODE
return (SQFILE)fopen(filename,mode);
#else
return (SQFILE)_wfopen(filename,mode);
#endif
}
SQInteger sqstd_fread(void* buffer, SQInteger size, SQInteger count, SQFILE file)
{
return (SQInteger)fread(buffer,size,count,(FILE *)file);
}
SQInteger sqstd_fwrite(const SQUserPointer buffer, SQInteger size, SQInteger count, SQFILE file)
{
return (SQInteger)fwrite(buffer,size,count,(FILE *)file);
}
SQInteger sqstd_fseek(SQFILE file, SQInteger offset, SQInteger origin)
{
SQInteger realorigin;
switch(origin) {
case SQ_SEEK_CUR: realorigin = SEEK_CUR; break;
case SQ_SEEK_END: realorigin = SEEK_END; break;
case SQ_SEEK_SET: realorigin = SEEK_SET; break;
default: return -1; //failed
}
return fseek((FILE *)file,(long)offset,(int)realorigin);
}
SQInteger sqstd_ftell(SQFILE file)
{
return ftell((FILE *)file);
}
SQInteger sqstd_fflush(SQFILE file)
{
return fflush((FILE *)file);
}
SQInteger sqstd_fclose(SQFILE file)
{
return fclose((FILE *)file);
}
SQInteger sqstd_feof(SQFILE file)
{
return feof((FILE *)file);
}
//File
struct SQFile : public SQStream {
SQFile() { _handle = NULL; _owns = false;}
SQFile(SQFILE file, bool owns) { _handle = file; _owns = owns;}
virtual ~SQFile() { Close(); }
bool Open(const SQChar *filename ,const SQChar *mode) {
Close();
if( (_handle = sqstd_fopen(filename,mode)) ) {
_owns = true;
return true;
}
return false;
}
void Close() {
if(_handle && _owns) {
sqstd_fclose(_handle);
_handle = NULL;
_owns = false;
}
}
SQInteger Read(void *buffer,SQInteger size) {
return sqstd_fread(buffer,1,size,_handle);
}
SQInteger Write(void *buffer,SQInteger size) {
return sqstd_fwrite(buffer,1,size,_handle);
}
SQInteger Flush() {
return sqstd_fflush(_handle);
}
SQInteger Tell() {
return sqstd_ftell(_handle);
}
SQInteger Len() {
SQInteger prevpos=Tell();
Seek(0,SQ_SEEK_END);
SQInteger size=Tell();
Seek(prevpos,SQ_SEEK_SET);
return size;
}
SQInteger Seek(SQInteger offset, SQInteger origin) {
return sqstd_fseek(_handle,offset,origin);
}
bool IsValid() { return _handle?true:false; }
bool EOS() { return Tell()==Len()?true:false;}
SQFILE GetHandle() {return _handle;}
private:
SQFILE _handle;
bool _owns;
};
static SQInteger _file__typeof(HSQUIRRELVM v)
{
sq_pushstring(v,_SC("file"),-1);
return 1;
}
static SQInteger _file_releasehook(SQUserPointer p, SQInteger size)
{
SQFile *self = (SQFile*)p;
delete self;
return 1;
}
static SQInteger _file_constructor(HSQUIRRELVM v)
{
const SQChar *filename,*mode;
bool owns = true;
SQFile *f;
SQFILE newf;
if(sq_gettype(v,2) == OT_STRING && sq_gettype(v,3) == OT_STRING) {
sq_getstring(v, 2, &filename);
sq_getstring(v, 3, &mode);
newf = sqstd_fopen(filename, mode);
if(!newf) return sq_throwerror(v, _SC("cannot open file"));
} else if(sq_gettype(v,2) == OT_USERPOINTER) {
owns = !(sq_gettype(v,3) == OT_NULL);
sq_getuserpointer(v,2,&newf);
} else {
return sq_throwerror(v,_SC("wrong parameter"));
}
f = new SQFile(newf,owns);
if(SQ_FAILED(sq_setinstanceup(v,1,f))) {
delete f;
return sq_throwerror(v, _SC("cannot create blob with negative size"));
}
sq_setreleasehook(v,1,_file_releasehook);
return 0;
}
//bindings
#define _DECL_FILE_FUNC(name,nparams,typecheck) {_SC(#name),_file_##name,nparams,typecheck}
static SQRegFunction _file_methods[] = {
_DECL_FILE_FUNC(constructor,3,_SC("x")),
_DECL_FILE_FUNC(_typeof,1,_SC("x")),
{0,0,0,0},
};
SQRESULT sqstd_createfile(HSQUIRRELVM v, SQFILE file,SQBool own)
{
SQInteger top = sq_gettop(v);
sq_pushregistrytable(v);
sq_pushstring(v,_SC("std_file"),-1);
if(SQ_SUCCEEDED(sq_get(v,-2))) {
sq_remove(v,-2); //removes the registry
sq_pushroottable(v); // push the this
sq_pushuserpointer(v,file); //file
if(own){
sq_pushinteger(v,1); //true
}
else{
sq_pushnull(v); //false
}
if(SQ_SUCCEEDED( sq_call(v,3,SQTrue,SQFalse) )) {
sq_remove(v,-2);
return SQ_OK;
}
}
sq_settop(v,top);
return SQ_OK;
}
SQRESULT sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file)
{
SQFile *fileobj = NULL;
if(SQ_SUCCEEDED(sq_getinstanceup(v,idx,(SQUserPointer*)&fileobj,(SQUserPointer)SQSTD_FILE_TYPE_TAG))) {
*file = fileobj->GetHandle();
return SQ_OK;
}
return sq_throwerror(v,_SC("not a file"));
}
static SQInteger _io_file_lexfeed_ASCII(SQUserPointer file)
{
SQInteger ret;
char c;
if( ( ret=sqstd_fread(&c,sizeof(c),1,(FILE *)file )>0) )
return c;
return 0;
}
static SQInteger _io_file_lexfeed_UTF8(SQUserPointer file)
{
#define READ() \
if(sqstd_fread(&inchar,sizeof(inchar),1,(FILE *)file) != 1) \
return 0;
static const SQInteger utf8_lengths[16] =
{
1,1,1,1,1,1,1,1, /* 0000 to 0111 : 1 byte (plain ASCII) */
0,0,0,0, /* 1000 to 1011 : not valid */
2,2, /* 1100, 1101 : 2 bytes */
3, /* 1110 : 3 bytes */
4 /* 1111 :4 bytes */
};
static unsigned char byte_masks[5] = {0,0,0x1f,0x0f,0x07};
unsigned char inchar;
SQInteger c = 0;
READ();
c = inchar;
//
if(c >= 0x80) {
SQInteger tmp;
SQInteger codelen = utf8_lengths[c>>4];
if(codelen == 0)
return 0;
//"invalid UTF-8 stream";
tmp = c&byte_masks[codelen];
for(SQInteger n = 0; n < codelen-1; n++) {
tmp<<=6;
READ();
tmp |= inchar & 0x3F;
}
c = tmp;
}
return c;
}
static SQInteger _io_file_lexfeed_UCS2_LE(SQUserPointer file)
{
SQInteger ret;
wchar_t c;
if( ( ret=sqstd_fread(&c,sizeof(c),1,(FILE *)file )>0) )
return (SQChar)c;
return 0;
}
static SQInteger _io_file_lexfeed_UCS2_BE(SQUserPointer file)
{
SQInteger ret;
unsigned short c;
if( ( ret=sqstd_fread(&c,sizeof(c),1,(FILE *)file )>0) ) {
c = ((c>>8)&0x00FF)| ((c<<8)&0xFF00);
return (SQChar)c;
}
return 0;
}
SQInteger file_read(SQUserPointer file,SQUserPointer buf,SQInteger size)
{
SQInteger ret;
if( ( ret = sqstd_fread(buf,1,size,(SQFILE)file ))!=0 )return ret;
return -1;
}
SQInteger file_write(SQUserPointer file,SQUserPointer p,SQInteger size)
{
return sqstd_fwrite(p,1,size,(SQFILE)file);
}
SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror)
{
SQFILE file = sqstd_fopen(filename,_SC("rb"));
SQInteger ret;
unsigned short us;
unsigned char uc;
SQLEXREADFUNC func = _io_file_lexfeed_ASCII;
if(file){
ret = sqstd_fread(&us,1,2,file);
if(ret != 2) {
//probably an empty file
us = 0;
}
if(us == SQ_BYTECODE_STREAM_TAG) { //BYTECODE
sqstd_fseek(file,0,SQ_SEEK_SET);
if(SQ_SUCCEEDED(sq_readclosure(v,file_read,file))) {
sqstd_fclose(file);
return SQ_OK;
}
}
else { //SCRIPT
switch(us)
{
//gotta swap the next 2 lines on BIG endian machines
case 0xFFFE: func = _io_file_lexfeed_UCS2_BE; break;//UTF-16 little endian;
case 0xFEFF: func = _io_file_lexfeed_UCS2_LE; break;//UTF-16 big endian;
case 0xBBEF:
if(sqstd_fread(&uc,1,sizeof(uc),file) == 0) {
sqstd_fclose(file);
return sq_throwerror(v,_SC("io error"));
}
if(uc != 0xBF) {
sqstd_fclose(file);
return sq_throwerror(v,_SC("Unrecognozed ecoding"));
}
func = _io_file_lexfeed_UTF8;
break;//UTF-8 ;
default: sqstd_fseek(file,0,SQ_SEEK_SET); break; // ascii
}
if(SQ_SUCCEEDED(sq_compile(v,func,file,filename,printerror))){
sqstd_fclose(file);
return SQ_OK;
}
}
sqstd_fclose(file);
return SQ_ERROR;
}
return sq_throwerror(v,_SC("cannot open the file"));
}
SQRESULT sqstd_dofile(HSQUIRRELVM v,const SQChar *filename,SQBool retval,SQBool printerror)
{
if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,printerror))) {
sq_push(v,-2);
if(SQ_SUCCEEDED(sq_call(v,1,retval,SQTrue))) {
sq_remove(v,retval?-2:-1); //removes the closure
return 1;
}
sq_pop(v,1); //removes the closure
}
return SQ_ERROR;
}
SQRESULT sqstd_writeclosuretofile(HSQUIRRELVM v,const SQChar *filename)
{
SQFILE file = sqstd_fopen(filename,_SC("wb+"));
if(!file) return sq_throwerror(v,_SC("cannot open the file"));
if(SQ_SUCCEEDED(sq_writeclosure(v,file_write,file))) {
sqstd_fclose(file);
return SQ_OK;
}
sqstd_fclose(file);
return SQ_ERROR; //forward the error
}
SQInteger _g_io_loadfile(HSQUIRRELVM v)
{
const SQChar *filename;
SQBool printerror = SQFalse;
sq_getstring(v,2,&filename);
if(sq_gettop(v) >= 3) {
sq_getbool(v,3,&printerror);
}
if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,printerror)))
return 1;
return SQ_ERROR; //propagates the error
}
SQInteger _g_io_writeclosuretofile(HSQUIRRELVM v)
{
const SQChar *filename;
sq_getstring(v,2,&filename);
if(SQ_SUCCEEDED(sqstd_writeclosuretofile(v,filename)))
return 1;
return SQ_ERROR; //propagates the error
}
SQInteger _g_io_dofile(HSQUIRRELVM v)
{
const SQChar *filename;
SQBool printerror = SQFalse;
sq_getstring(v,2,&filename);
if(sq_gettop(v) >= 3) {
sq_getbool(v,3,&printerror);
}
sq_push(v,1); //repush the this
if(SQ_SUCCEEDED(sqstd_dofile(v,filename,SQTrue,printerror)))
return 1;
return SQ_ERROR; //propagates the error
}
#define _DECL_GLOBALIO_FUNC(name,nparams,typecheck) {_SC(#name),_g_io_##name,nparams,typecheck}
static SQRegFunction iolib_funcs[]={
_DECL_GLOBALIO_FUNC(loadfile,-2,_SC(".sb")),
_DECL_GLOBALIO_FUNC(dofile,-2,_SC(".sb")),
_DECL_GLOBALIO_FUNC(writeclosuretofile,3,_SC(".sc")),
{0,0,0,0}
};
SQRESULT sqstd_register_iolib(HSQUIRRELVM v)
{
SQInteger top = sq_gettop(v);
//create delegate
declare_stream(v,_SC("file"),(SQUserPointer)SQSTD_FILE_TYPE_TAG,_SC("std_file"),_file_methods,iolib_funcs);
sq_pushstring(v,_SC("stdout"),-1);
sqstd_createfile(v,stdout,SQFalse);
sq_createslot(v,-3);
sq_pushstring(v,_SC("stdin"),-1);
sqstd_createfile(v,stdin,SQFalse);
sq_createslot(v,-3);
sq_pushstring(v,_SC("stderr"),-1);
sqstd_createfile(v,stderr,SQFalse);
sq_createslot(v,-3);
sq_settop(v,top);
return SQ_OK;
}

View File

@@ -1,131 +0,0 @@
# Microsoft Developer Studio Project File - Name="sqstdlib" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=sqstdlib - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "sqstdlib.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "sqstdlib.mak" CFG="sqstdlib - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sqstdlib - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "sqstdlib - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_LocalPath ".."
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "sqstdlib - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x410 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib\sqstdlib.lib"
!ELSEIF "$(CFG)" == "sqstdlib - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x410 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib\sqstdlib.lib"
!ENDIF
# Begin Target
# Name "sqstdlib - Win32 Release"
# Name "sqstdlib - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\sqstdblob.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdio.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdmath.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdrex.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdstream.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdstring.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdaux.cpp
# End Source File
# Begin Source File
SOURCE=.\sqstdsystem.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\sqstdblobimpl.h
# End Source File
# Begin Source File
SOURCE=.\sqstdstream.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -1,9 +1,13 @@
/* see copyright notice in squirrel.h */ /* see copyright notice in squirrel.h */
#include "../../../stdafx.h"
#include <squirrel.h> #include <squirrel.h>
#include <math.h> #include <math.h>
#include <stdlib.h>
#include <sqstdmath.h> #include <sqstdmath.h>
#include "../../../safeguards.h"
#define SINGLE_ARG_FUNC(_funcname, num_ops) static SQInteger math_##_funcname(HSQUIRRELVM v){ \ #define SINGLE_ARG_FUNC(_funcname, num_ops) static SQInteger math_##_funcname(HSQUIRRELVM v){ \
SQFloat f; \ SQFloat f; \
sq_decreaseops(v,num_ops); \ sq_decreaseops(v,num_ops); \
@@ -26,7 +30,7 @@ static SQInteger math_srand(HSQUIRRELVM v)
{ {
SQInteger i; SQInteger i;
if(SQ_FAILED(sq_getinteger(v,2,&i))) if(SQ_FAILED(sq_getinteger(v,2,&i)))
return sq_throwerror(v,_SC("invalid param")); return sq_throwerror(v,"invalid param");
srand((unsigned int)i); srand((unsigned int)i);
return 0; return 0;
} }
@@ -62,28 +66,28 @@ SINGLE_ARG_FUNC(floor, 1)
SINGLE_ARG_FUNC(ceil, 1) SINGLE_ARG_FUNC(ceil, 1)
SINGLE_ARG_FUNC(exp, 100) SINGLE_ARG_FUNC(exp, 100)
#define _DECL_FUNC(name,nparams,tycheck) {_SC(#name),math_##name,nparams,tycheck} #define _DECL_FUNC(name,nparams,tycheck) {#name,math_##name,nparams,tycheck}
static SQRegFunction mathlib_funcs[] = { static SQRegFunction mathlib_funcs[] = {
_DECL_FUNC(sqrt,2,_SC(".n")), _DECL_FUNC(sqrt,2,".n"),
_DECL_FUNC(sin,2,_SC(".n")), _DECL_FUNC(sin,2,".n"),
_DECL_FUNC(cos,2,_SC(".n")), _DECL_FUNC(cos,2,".n"),
_DECL_FUNC(asin,2,_SC(".n")), _DECL_FUNC(asin,2,".n"),
_DECL_FUNC(acos,2,_SC(".n")), _DECL_FUNC(acos,2,".n"),
_DECL_FUNC(log,2,_SC(".n")), _DECL_FUNC(log,2,".n"),
_DECL_FUNC(log10,2,_SC(".n")), _DECL_FUNC(log10,2,".n"),
_DECL_FUNC(tan,2,_SC(".n")), _DECL_FUNC(tan,2,".n"),
_DECL_FUNC(atan,2,_SC(".n")), _DECL_FUNC(atan,2,".n"),
_DECL_FUNC(atan2,3,_SC(".nn")), _DECL_FUNC(atan2,3,".nn"),
_DECL_FUNC(pow,3,_SC(".nn")), _DECL_FUNC(pow,3,".nn"),
_DECL_FUNC(floor,2,_SC(".n")), _DECL_FUNC(floor,2,".n"),
_DECL_FUNC(ceil,2,_SC(".n")), _DECL_FUNC(ceil,2,".n"),
_DECL_FUNC(exp,2,_SC(".n")), _DECL_FUNC(exp,2,".n"),
#ifdef EXPORT_DEFAULT_SQUIRREL_FUNCTIONS #ifdef EXPORT_DEFAULT_SQUIRREL_FUNCTIONS
_DECL_FUNC(srand,2,_SC(".n")), _DECL_FUNC(srand,2,".n"),
_DECL_FUNC(rand,1,NULL), _DECL_FUNC(rand,1,NULL),
#endif /* EXPORT_DEFAULT_SQUIRREL_FUNCTIONS */ #endif /* EXPORT_DEFAULT_SQUIRREL_FUNCTIONS */
_DECL_FUNC(fabs,2,_SC(".n")), _DECL_FUNC(fabs,2,".n"),
_DECL_FUNC(abs,2,_SC(".n")), _DECL_FUNC(abs,2,".n"),
{0,0,0,0}, {0,0,0,0},
}; };
@@ -103,11 +107,11 @@ SQRESULT sqstd_register_mathlib(HSQUIRRELVM v)
i++; i++;
} }
#ifdef EXPORT_DEFAULT_SQUIRREL_FUNCTIONS #ifdef EXPORT_DEFAULT_SQUIRREL_FUNCTIONS
sq_pushstring(v,_SC("RAND_MAX"),-1); sq_pushstring(v,"RAND_MAX",-1);
sq_pushinteger(v,RAND_MAX); sq_pushinteger(v,RAND_MAX);
sq_createslot(v,-3); sq_createslot(v,-3);
#endif /* EXPORT_DEFAULT_SQUIRREL_FUNCTIONS */ #endif /* EXPORT_DEFAULT_SQUIRREL_FUNCTIONS */
sq_pushstring(v,_SC("PI"),-1); sq_pushstring(v,"PI",-1);
sq_pushfloat(v,(SQFloat)M_PI); sq_pushfloat(v,(SQFloat)M_PI);
sq_createslot(v,-3); sq_createslot(v,-3);
return SQ_OK; return SQ_OK;

View File

@@ -1,7 +1,5 @@
/* see copyright notice in squirrel.h */ /* see copyright notice in squirrel.h */
#include <squirrel.h> #include <squirrel.h>
#include <string.h>
#include <ctype.h>
#include <exception> #include <exception>
#include "sqstdstring.h" #include "sqstdstring.h"
@@ -12,14 +10,13 @@
#endif #endif
#ifdef _DEBUG #ifdef _DEBUG
#include <stdio.h>
static const SQChar *g_nnames[] = static const SQChar *g_nnames[] =
{ {
_SC("NONE"),_SC("OP_GREEDY"), _SC("OP_OR"), "NONE","OP_GREEDY", "OP_OR",
_SC("OP_EXPR"),_SC("OP_NOCAPEXPR"),_SC("OP_DOT"), _SC("OP_CLASS"), "OP_EXPR","OP_NOCAPEXPR","OP_DOT", "OP_CLASS",
_SC("OP_CCLASS"),_SC("OP_NCLASS"),_SC("OP_RANGE"),_SC("OP_CHAR"), "OP_CCLASS","OP_NCLASS","OP_RANGE","OP_CHAR",
_SC("OP_EOL"),_SC("OP_BOL"),_SC("OP_WB") "OP_EOL","OP_BOL","OP_WB"
}; };
#endif #endif
@@ -99,7 +96,7 @@ static void sqstd_rex_error(SQRex *exp,const SQChar *error)
static void sqstd_rex_expect(SQRex *exp, SQChar n){ static void sqstd_rex_expect(SQRex *exp, SQChar n){
if((*exp->_p) != n) if((*exp->_p) != n)
sqstd_rex_error(exp, _SC("expected paren")); sqstd_rex_error(exp, "expected paren");
exp->_p++; exp->_p++;
} }
@@ -115,7 +112,7 @@ static SQChar sqstd_rex_escapechar(SQRex *exp)
case 'f': exp->_p++; return '\f'; case 'f': exp->_p++; return '\f';
default: return (*exp->_p++); default: return (*exp->_p++);
} }
} else if(!scisprint(*exp->_p)) sqstd_rex_error(exp,_SC("letter expected")); } else if(!scisprint(*exp->_p)) sqstd_rex_error(exp,"letter expected");
return (*exp->_p++); return (*exp->_p++);
} }
@@ -159,7 +156,7 @@ static SQInteger sqstd_rex_charnode(SQRex *exp,SQBool isclass)
} }
else if(!scisprint(*exp->_p)) { else if(!scisprint(*exp->_p)) {
sqstd_rex_error(exp,_SC("letter expected")); sqstd_rex_error(exp,"letter expected");
} }
t = *exp->_p; exp->_p++; t = *exp->_p; exp->_p++;
return sqstd_rex_newnode(exp,t); return sqstd_rex_newnode(exp,t);
@@ -173,15 +170,15 @@ static SQInteger sqstd_rex_class(SQRex *exp)
exp->_p++; exp->_p++;
}else ret = sqstd_rex_newnode(exp,OP_CLASS); }else ret = sqstd_rex_newnode(exp,OP_CLASS);
if(*exp->_p == ']') sqstd_rex_error(exp,_SC("empty class")); if(*exp->_p == ']') sqstd_rex_error(exp,"empty class");
chain = ret; chain = ret;
while(*exp->_p != ']' && exp->_p != exp->_eol) { while(*exp->_p != ']' && exp->_p != exp->_eol) {
if(*exp->_p == '-' && first != -1){ if(*exp->_p == '-' && first != -1){
SQInteger r; SQInteger r;
if(*exp->_p++ == ']') sqstd_rex_error(exp,_SC("unfinished range")); if(*exp->_p++ == ']') sqstd_rex_error(exp,"unfinished range");
r = sqstd_rex_newnode(exp,OP_RANGE); r = sqstd_rex_newnode(exp,OP_RANGE);
if(exp->_nodes[first].type>*exp->_p) sqstd_rex_error(exp,_SC("invalid range")); if(exp->_nodes[first].type>*exp->_p) sqstd_rex_error(exp,"invalid range");
if(exp->_nodes[first].type == OP_CCLASS) sqstd_rex_error(exp,_SC("cannot use character classes in ranges")); if(exp->_nodes[first].type == OP_CCLASS) sqstd_rex_error(exp,"cannot use character classes in ranges");
exp->_nodes[r].left = exp->_nodes[first].type; exp->_nodes[r].left = exp->_nodes[first].type;
SQInteger t = sqstd_rex_escapechar(exp); SQInteger t = sqstd_rex_escapechar(exp);
exp->_nodes[r].right = t; exp->_nodes[r].right = t;
@@ -220,7 +217,7 @@ static SQInteger sqstd_rex_parsenumber(SQRex *exp)
exp->_p++; exp->_p++;
while(isdigit(*exp->_p)) { while(isdigit(*exp->_p)) {
ret = ret*10+(*exp->_p++-'0'); ret = ret*10+(*exp->_p++-'0');
if(positions==1000000000) sqstd_rex_error(exp,_SC("overflow in numeric constant")); if(positions==1000000000) sqstd_rex_error(exp,"overflow in numeric constant");
positions *= 10; positions *= 10;
}; };
return ret; return ret;
@@ -238,7 +235,7 @@ static SQInteger sqstd_rex_element(SQRex *exp)
if(*exp->_p =='?') { if(*exp->_p =='?') {
exp->_p++; exp->_p++;
sqstd_rex_expect(exp,_SC(':')); sqstd_rex_expect(exp,':');
expr = sqstd_rex_newnode(exp,OP_NOCAPEXPR); expr = sqstd_rex_newnode(exp,OP_NOCAPEXPR);
} }
else else
@@ -246,13 +243,13 @@ static SQInteger sqstd_rex_element(SQRex *exp)
SQInteger newn = sqstd_rex_list(exp); SQInteger newn = sqstd_rex_list(exp);
exp->_nodes[expr].left = newn; exp->_nodes[expr].left = newn;
ret = expr; ret = expr;
sqstd_rex_expect(exp,_SC(')')); sqstd_rex_expect(exp,')');
} }
break; break;
case '[': case '[':
exp->_p++; exp->_p++;
ret = sqstd_rex_class(exp); ret = sqstd_rex_class(exp);
sqstd_rex_expect(exp,_SC(']')); sqstd_rex_expect(exp,']');
break; break;
case SQREX_SYMBOL_END_OF_STRING: exp->_p++; ret = sqstd_rex_newnode(exp,OP_EOL);break; case SQREX_SYMBOL_END_OF_STRING: exp->_p++; ret = sqstd_rex_newnode(exp,OP_EOL);break;
case SQREX_SYMBOL_ANY_CHAR: exp->_p++; ret = sqstd_rex_newnode(exp,OP_DOT);break; case SQREX_SYMBOL_ANY_CHAR: exp->_p++; ret = sqstd_rex_newnode(exp,OP_DOT);break;
@@ -271,7 +268,7 @@ static SQInteger sqstd_rex_element(SQRex *exp)
case SQREX_SYMBOL_GREEDY_ZERO_OR_ONE: p0 = 0; p1 = 1; exp->_p++; isgreedy = SQTrue; break; case SQREX_SYMBOL_GREEDY_ZERO_OR_ONE: p0 = 0; p1 = 1; exp->_p++; isgreedy = SQTrue; break;
case '{': case '{':
exp->_p++; exp->_p++;
if(!isdigit(*exp->_p)) sqstd_rex_error(exp,_SC("number expected")); if(!isdigit(*exp->_p)) sqstd_rex_error(exp,"number expected");
p0 = (unsigned short)sqstd_rex_parsenumber(exp); p0 = (unsigned short)sqstd_rex_parsenumber(exp);
/*******************************/ /*******************************/
switch(*exp->_p) { switch(*exp->_p) {
@@ -284,10 +281,10 @@ static SQInteger sqstd_rex_element(SQRex *exp)
if(isdigit(*exp->_p)){ if(isdigit(*exp->_p)){
p1 = (unsigned short)sqstd_rex_parsenumber(exp); p1 = (unsigned short)sqstd_rex_parsenumber(exp);
} }
sqstd_rex_expect(exp,_SC('}')); sqstd_rex_expect(exp,'}');
break; break;
default: default:
sqstd_rex_error(exp,_SC(", or } expected")); sqstd_rex_error(exp,", or } expected");
} }
/*******************************/ /*******************************/
isgreedy = SQTrue; isgreedy = SQTrue;
@@ -526,7 +523,7 @@ SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error)
SQRex *exp = (SQRex *)sq_malloc(sizeof(SQRex)); SQRex *exp = (SQRex *)sq_malloc(sizeof(SQRex));
exp->_eol = exp->_bol = NULL; exp->_eol = exp->_bol = NULL;
exp->_p = pattern; exp->_p = pattern;
exp->_nallocated = (SQInteger)scstrlen(pattern) * sizeof(SQChar); exp->_nallocated = (SQInteger)strlen(pattern) * sizeof(SQChar);
exp->_nodes = (SQRexNode *)sq_malloc(exp->_nallocated * sizeof(SQRexNode)); exp->_nodes = (SQRexNode *)sq_malloc(exp->_nallocated * sizeof(SQRexNode));
exp->_nsize = 0; exp->_nsize = 0;
exp->_matches = 0; exp->_matches = 0;
@@ -537,23 +534,23 @@ SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error)
SQInteger res = sqstd_rex_list(exp); SQInteger res = sqstd_rex_list(exp);
exp->_nodes[exp->_first].left = res; exp->_nodes[exp->_first].left = res;
if(*exp->_p!='\0') if(*exp->_p!='\0')
sqstd_rex_error(exp,_SC("unexpected character")); sqstd_rex_error(exp,"unexpected character");
#ifdef _DEBUG #ifdef _DEBUG
{ {
SQInteger nsize,i; SQInteger nsize,i;
SQRexNode *t; SQRexNode *t;
nsize = exp->_nsize; nsize = exp->_nsize;
t = &exp->_nodes[0]; t = &exp->_nodes[0];
scprintf(_SC("\n")); printf("\n");
/* XXX -- The (int) casts are needed to silent warnings on 64bit systems (SQInteger is 64bit, %d assumes 32bit, (int) is 32bit) */ /* XXX -- The (int) casts are needed to silent warnings on 64bit systems (SQInteger is 64bit, %d assumes 32bit, (int) is 32bit) */
for(i = 0;i < nsize; i++) { for(i = 0;i < nsize; i++) {
if(exp->_nodes[i].type>MAX_CHAR) if(exp->_nodes[i].type>MAX_CHAR)
scprintf(_SC("[%02d] %10s "),(int)i,g_nnames[exp->_nodes[i].type-MAX_CHAR]); printf("[%02d] %10s ",(int)i,g_nnames[exp->_nodes[i].type-MAX_CHAR]);
else else
scprintf(_SC("[%02d] %10c "),(int)i,exp->_nodes[i].type); printf("[%02d] %10c ",(int)i,exp->_nodes[i].type);
scprintf(_SC("left %02d right %02d next %02d\n"),(int)exp->_nodes[i].left,(int)exp->_nodes[i].right,(int)exp->_nodes[i].next); printf("left %02d right %02d next %02d\n",(int)exp->_nodes[i].left,(int)exp->_nodes[i].right,(int)exp->_nodes[i].next);
} }
scprintf(_SC("\n")); printf("\n");
} }
#endif #endif
exp->_matches = (SQRexMatch *) sq_malloc(exp->_nsubexpr * sizeof(SQRexMatch)); exp->_matches = (SQRexMatch *) sq_malloc(exp->_nsubexpr * sizeof(SQRexMatch));
@@ -579,7 +576,7 @@ SQBool sqstd_rex_match(SQRex* exp,const SQChar* text)
{ {
const SQChar* res = NULL; const SQChar* res = NULL;
exp->_bol = text; exp->_bol = text;
exp->_eol = text + scstrlen(text); exp->_eol = text + strlen(text);
exp->_currsubexp = 0; exp->_currsubexp = 0;
res = sqstd_rex_matchnode(exp,exp->_nodes,text,NULL); res = sqstd_rex_matchnode(exp,exp->_nodes,text,NULL);
if(res == NULL || res != exp->_eol) if(res == NULL || res != exp->_eol)
@@ -618,7 +615,7 @@ SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* t
SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end) SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end)
{ {
return sqstd_rex_searchrange(exp,text,text + scstrlen(text),out_begin,out_end); return sqstd_rex_searchrange(exp,text,text + strlen(text),out_begin,out_end);
} }
SQInteger sqstd_rex_getsubexpcount(SQRex* exp) SQInteger sqstd_rex_getsubexpcount(SQRex* exp)

View File

@@ -1,330 +0,0 @@
/* see copyright notice in squirrel.h */
#include <stdio.h>
#include <new>
#include <stdlib.h>
#include <string.h>
#include <squirrel.h>
#include <sqstdio.h>
#include <sqstdblob.h>
#include "sqstdstream.h"
#include "sqstdblobimpl.h"
#define SETUP_STREAM(v) \
SQStream *self = NULL; \
if(SQ_FAILED(sq_getinstanceup(v,1,(SQUserPointer*)&self,(SQUserPointer)SQSTD_STREAM_TYPE_TAG))) \
return sq_throwerror(v,_SC("invalid type tag")); \
if(!self->IsValid()) \
return sq_throwerror(v,_SC("the stream is invalid"));
SQInteger _stream_readblob(HSQUIRRELVM v)
{
SETUP_STREAM(v);
SQUserPointer data,blobp;
SQInteger size,res;
sq_getinteger(v,2,&size);
if(size > self->Len()) {
size = self->Len();
}
data = sq_getscratchpad(v,size);
res = self->Read(data,size);
if(res <= 0)
return sq_throwerror(v,_SC("no data left to read"));
blobp = sqstd_createblob(v,res);
memcpy(blobp,data,res);
return 1;
}
#define SAFE_READN(ptr,len) { \
if(self->Read(ptr,len) != len) return sq_throwerror(v,_SC("io error")); \
}
SQInteger _stream_readn(HSQUIRRELVM v)
{
SETUP_STREAM(v);
SQInteger format;
sq_getinteger(v, 2, &format);
switch(format) {
case 'l': {
SQInteger i;
SAFE_READN(&i, sizeof(i));
sq_pushinteger(v, i);
}
break;
case 'i': {
SQInt32 i;
SAFE_READN(&i, sizeof(i));
sq_pushinteger(v, i);
}
break;
case 's': {
short s;
SAFE_READN(&s, sizeof(short));
sq_pushinteger(v, s);
}
break;
case 'w': {
unsigned short w;
SAFE_READN(&w, sizeof(unsigned short));
sq_pushinteger(v, w);
}
break;
case 'c': {
char c;
SAFE_READN(&c, sizeof(char));
sq_pushinteger(v, c);
}
break;
case 'b': {
unsigned char c;
SAFE_READN(&c, sizeof(unsigned char));
sq_pushinteger(v, c);
}
break;
case 'f': {
float f;
SAFE_READN(&f, sizeof(float));
sq_pushfloat(v, f);
}
break;
case 'd': {
double d;
SAFE_READN(&d, sizeof(double));
sq_pushfloat(v, (SQFloat)d);
}
break;
default:
return sq_throwerror(v, _SC("invalid format"));
}
return 1;
}
SQInteger _stream_writeblob(HSQUIRRELVM v)
{
SQUserPointer data;
SQInteger size;
SETUP_STREAM(v);
if(SQ_FAILED(sqstd_getblob(v,2,&data)))
return sq_throwerror(v,_SC("invalid parameter"));
size = sqstd_getblobsize(v,2);
if(self->Write(data,size) != size)
return sq_throwerror(v,_SC("io error"));
sq_pushinteger(v,size);
return 1;
}
SQInteger _stream_writen(HSQUIRRELVM v)
{
SETUP_STREAM(v);
SQInteger format, ti;
SQFloat tf;
sq_getinteger(v, 3, &format);
switch(format) {
case 'l': {
SQInteger i;
sq_getinteger(v, 2, &ti);
i = ti;
self->Write(&i, sizeof(SQInteger));
}
break;
case 'i': {
SQInt32 i;
sq_getinteger(v, 2, &ti);
i = (SQInt32)ti;
self->Write(&i, sizeof(SQInt32));
}
break;
case 's': {
short s;
sq_getinteger(v, 2, &ti);
s = (short)ti;
self->Write(&s, sizeof(short));
}
break;
case 'w': {
unsigned short w;
sq_getinteger(v, 2, &ti);
w = (unsigned short)ti;
self->Write(&w, sizeof(unsigned short));
}
break;
case 'c': {
char c;
sq_getinteger(v, 2, &ti);
c = (char)ti;
self->Write(&c, sizeof(char));
}
break;
case 'b': {
unsigned char b;
sq_getinteger(v, 2, &ti);
b = (unsigned char)ti;
self->Write(&b, sizeof(unsigned char));
}
break;
case 'f': {
float f;
sq_getfloat(v, 2, &tf);
f = (float)tf;
self->Write(&f, sizeof(float));
}
break;
case 'd': {
double d;
sq_getfloat(v, 2, &tf);
d = tf;
self->Write(&d, sizeof(double));
}
break;
default:
return sq_throwerror(v, _SC("invalid format"));
}
return 0;
}
SQInteger _stream_seek(HSQUIRRELVM v)
{
SETUP_STREAM(v);
SQInteger offset, origin = SQ_SEEK_SET;
sq_getinteger(v, 2, &offset);
if(sq_gettop(v) > 2) {
SQInteger t;
sq_getinteger(v, 3, &t);
switch(t) {
case 'b': origin = SQ_SEEK_SET; break;
case 'c': origin = SQ_SEEK_CUR; break;
case 'e': origin = SQ_SEEK_END; break;
default: return sq_throwerror(v,_SC("invalid origin"));
}
}
sq_pushinteger(v, self->Seek(offset, origin));
return 1;
}
SQInteger _stream_tell(HSQUIRRELVM v)
{
SETUP_STREAM(v);
sq_pushinteger(v, self->Tell());
return 1;
}
SQInteger _stream_len(HSQUIRRELVM v)
{
SETUP_STREAM(v);
sq_pushinteger(v, self->Len());
return 1;
}
SQInteger _stream_flush(HSQUIRRELVM v)
{
SETUP_STREAM(v);
if(!self->Flush())
sq_pushinteger(v, 1);
else
sq_pushnull(v);
return 1;
}
SQInteger _stream_eos(HSQUIRRELVM v)
{
SETUP_STREAM(v);
if(self->EOS())
sq_pushinteger(v, 1);
else
sq_pushnull(v);
return 1;
}
static SQRegFunction _stream_methods[] = {
_DECL_STREAM_FUNC(readblob,2,_SC("xn")),
_DECL_STREAM_FUNC(readn,2,_SC("xn")),
_DECL_STREAM_FUNC(writeblob,-2,_SC("xx")),
_DECL_STREAM_FUNC(writen,3,_SC("xnn")),
_DECL_STREAM_FUNC(seek,-2,_SC("xnn")),
_DECL_STREAM_FUNC(tell,1,_SC("x")),
_DECL_STREAM_FUNC(len,1,_SC("x")),
_DECL_STREAM_FUNC(eos,1,_SC("x")),
_DECL_STREAM_FUNC(flush,1,_SC("x")),
{0,0,0,0}
};
void init_streamclass(HSQUIRRELVM v)
{
sq_pushregistrytable(v);
sq_pushstring(v,_SC("std_stream"),-1);
if(SQ_FAILED(sq_get(v,-2))) {
sq_pushstring(v,_SC("std_stream"),-1);
sq_newclass(v,SQFalse);
sq_settypetag(v,-1,(SQUserPointer)SQSTD_STREAM_TYPE_TAG);
SQInteger i = 0;
while(_stream_methods[i].name != 0) {
SQRegFunction &f = _stream_methods[i];
sq_pushstring(v,f.name,-1);
sq_newclosure(v,f.f,0);
sq_setparamscheck(v,f.nparamscheck,f.typemask);
sq_createslot(v,-3);
i++;
}
sq_createslot(v,-3);
sq_pushroottable(v);
sq_pushstring(v,_SC("stream"),-1);
sq_pushstring(v,_SC("std_stream"),-1);
sq_get(v,-4);
sq_createslot(v,-3);
sq_pop(v,1);
}
else {
sq_pop(v,1); //result
}
sq_pop(v,1);
}
SQRESULT declare_stream(HSQUIRRELVM v,const SQChar* name,SQUserPointer typetag,const SQChar* reg_name,SQRegFunction *methods,SQRegFunction *globals)
{
if(sq_gettype(v,-1) != OT_TABLE)
return sq_throwerror(v,_SC("table expected"));
SQInteger top = sq_gettop(v);
//create delegate
init_streamclass(v);
sq_pushregistrytable(v);
sq_pushstring(v,reg_name,-1);
sq_pushstring(v,_SC("std_stream"),-1);
if(SQ_SUCCEEDED(sq_get(v,-3))) {
sq_newclass(v,SQTrue);
sq_settypetag(v,-1,typetag);
SQInteger i = 0;
while(methods[i].name != 0) {
SQRegFunction &f = methods[i];
sq_pushstring(v,f.name,-1);
sq_newclosure(v,f.f,0);
sq_setparamscheck(v,f.nparamscheck,f.typemask);
sq_setnativeclosurename(v,-1,f.name);
sq_createslot(v,-3);
i++;
}
sq_createslot(v,-3);
sq_pop(v,1);
i = 0;
while(globals[i].name!=0)
{
SQRegFunction &f = globals[i];
sq_pushstring(v,f.name,-1);
sq_newclosure(v,f.f,0);
sq_setparamscheck(v,f.nparamscheck,f.typemask);
sq_setnativeclosurename(v,-1,f.name);
sq_createslot(v,-3);
i++;
}
//register the class in the target table
sq_pushstring(v,name,-1);
sq_pushregistrytable(v);
sq_pushstring(v,reg_name,-1);
sq_get(v,-2);
sq_remove(v,-2);
sq_createslot(v,-3);
sq_settop(v,top);
return SQ_OK;
}
sq_settop(v,top);
return SQ_ERROR;
}

View File

@@ -1,18 +0,0 @@
/* see copyright notice in squirrel.h */
#ifndef _SQSTD_STREAM_H_
#define _SQSTD_STREAM_H_
SQInteger _stream_readblob(HSQUIRRELVM v);
SQInteger _stream_readline(HSQUIRRELVM v);
SQInteger _stream_readn(HSQUIRRELVM v);
SQInteger _stream_writeblob(HSQUIRRELVM v);
SQInteger _stream_writen(HSQUIRRELVM v);
SQInteger _stream_seek(HSQUIRRELVM v);
SQInteger _stream_tell(HSQUIRRELVM v);
SQInteger _stream_len(HSQUIRRELVM v);
SQInteger _stream_eos(HSQUIRRELVM v);
SQInteger _stream_flush(HSQUIRRELVM v);
#define _DECL_STREAM_FUNC(name,nparams,typecheck) {_SC(#name),_stream_##name,nparams,typecheck}
SQRESULT declare_stream(HSQUIRRELVM v,const SQChar* name,SQUserPointer typetag,const SQChar* reg_name,SQRegFunction *methods,SQRegFunction *globals);
#endif /*_SQSTD_STREAM_H_*/

Some files were not shown because too many files have changed in this diff Show More