diff --git a/.gitignore b/.gitignore
new file mode 100755
index 0000000..94b41b9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,332 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
diff --git a/OpenGTA-win/OpenGTA-win.sln b/OpenGTA-win/OpenGTA-win.sln
new file mode 100755
index 0000000..6c9bd93
--- /dev/null
+++ b/OpenGTA-win/OpenGTA-win.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27428.2015
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenGTA-win", "OpenGTA-win.vcxproj", "{029D8A0B-123A-400E-9954-700F8CFF3F81}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Debug|x64.ActiveCfg = Debug|x64
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Debug|x64.Build.0 = Debug|x64
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Debug|x86.ActiveCfg = Debug|Win32
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Debug|x86.Build.0 = Debug|Win32
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Release|x64.ActiveCfg = Release|x64
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Release|x64.Build.0 = Release|x64
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Release|x86.ActiveCfg = Release|Win32
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {867B0492-13C4-4F6B-8DC5-5DDFEF60B309}
+ EndGlobalSection
+EndGlobal
diff --git a/OpenGTA-win/OpenGTA-win.vcxproj b/OpenGTA-win/OpenGTA-win.vcxproj
new file mode 100755
index 0000000..d6b6555
--- /dev/null
+++ b/OpenGTA-win/OpenGTA-win.vcxproj
@@ -0,0 +1,277 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 15.0
+ {029D8A0B-123A-400E-9954-700F8CFF3F81}
+ OpenGTAwin
+ 10.0.17134.0
+
+
+
+ Application
+ true
+ v141
+ MultiByte
+
+
+ Application
+ false
+ v141
+ true
+ MultiByte
+
+
+ Application
+ true
+ v141
+ Unicode
+ false
+
+
+ Application
+ false
+ v141
+ true
+ Unicode
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(VC_IncludePath);$(WindowsSDK_IncludePath);
+
+
+ $(VC_IncludePath);$(WindowsSDK_IncludePath);
+
+
+
+ Level3
+ Disabled
+ true
+ true
+ ..\;..\math;..\coldet\;..\util;..\..\SDL2-2.0.8\include;..\..\physfs-3.0.1\build\install\include
+
+
+
+
+ Level3
+ Disabled
+ true
+ true
+ ..\;..\math;..\coldet\;..\util;..\..\SDL2-2.0.8\include;..\..\physfs-3.0.1\build\install\include;..\..\loki-0.1.7\include\loki;..\opensteer\include
+ _CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)
+ false
+ MultiThreadedDebugDLL
+
+
+ Console
+ ..\..\SDL2-2.0.8\lib\x64;..\..\loki-0.1.7\lib;..\..\physfs-3.0.1\build\install\lib
+ physfs-static.lib;loki_D.lib;SDL2.lib;SDL2main.lib;opengl32.lib;glu32.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;%(AdditionalDependencies)
+
+
+
+
+
+
+ Level3
+ MaxSpeed
+ true
+ true
+ true
+ true
+ ..\;..\math;..\coldet\;..\util;..\..\SDL2-2.0.8\include;..\..\physfs-3.0.1\build\install\include
+
+
+ true
+ true
+
+
+
+
+ Level3
+ MaxSpeed
+ true
+ true
+ true
+ true
+ ..\;..\math;..\coldet\;..\util;..\..\SDL2-2.0.8\include;..\..\physfs-3.0.1\build\install\include;..\..\loki-0.1.7\include\loki;..\opensteer\include
+ _SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)
+ false
+
+
+ true
+ true
+ Console
+ ..\..\SDL2-2.0.8\lib\x64;..\..\loki-0.1.7\lib;..\..\physfs-3.0.1\build\install\lib
+ physfs-static.lib;loki_D.lib;SDL2.lib;opengl32.lib;glu32.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;%(AdditionalDependencies)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenGTA-win/OpenGTA-win.vcxproj.filters b/OpenGTA-win/OpenGTA-win.vcxproj.filters
new file mode 100755
index 0000000..4a2289c
--- /dev/null
+++ b/OpenGTA-win/OpenGTA-win.vcxproj.filters
@@ -0,0 +1,407 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+ {61d3b438-8ce2-448d-8dd9-378b1eba1e3d}
+
+
+ {29273c88-3c60-4004-a50d-4e73bab65145}
+
+
+ {973c556e-0197-448e-9484-234647c2a827}
+
+
+ {dd602175-4834-4446-99a4-2df1bb9aa58d}
+
+
+ {b411155d-6ed1-42eb-b97b-2236cdffc485}
+
+
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\ogta
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\coldet
+
+
+ Source Files\opensteer
+
+
+ Source Files\opensteer
+
+
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\ogta
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\math
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\util
+
+
+ Source Files\coldet
+
+
+
+
+ Source Files\ogta
+
+
+
\ No newline at end of file
diff --git a/OpenGTA-win/SDL2.dll b/OpenGTA-win/SDL2.dll
new file mode 100755
index 0000000..6cf858c
Binary files /dev/null and b/OpenGTA-win/SDL2.dll differ
diff --git a/coldet/math3d.cpp b/coldet/math3d.cpp
old mode 100644
new mode 100755
index 7a0fb35..166edb5
--- a/coldet/math3d.cpp
+++ b/coldet/math3d.cpp
@@ -24,6 +24,9 @@
#include "sysdep.h"
#include "math3d.h"
+#define _USE_MATH_DEFINES
+#include
+
const Vector3D Vector3D::Zero(0.0f,0.0f,0.0f);
const Matrix3D Matrix3D::Identity(1.0f,0.0f,0.0f,0.0f,
0.0f,1.0f,0.0f,0.0f,
diff --git a/coldet/math3d.h b/coldet/math3d.h
old mode 100644
new mode 100755
index 47d9a73..433cdbf
--- a/coldet/math3d.h
+++ b/coldet/math3d.h
@@ -66,22 +66,6 @@ struct Vector3D
float& operator[] (int i) { return ((float*)&x)[i]; }
};
-#define _11 sclr.s11
-#define _12 sclr.s12
-#define _13 sclr.s13
-#define _14 sclr.s14
-#define _21 sclr.s21
-#define _22 sclr.s22
-#define _23 sclr.s23
-#define _24 sclr.s24
-#define _31 sclr.s31
-#define _32 sclr.s32
-#define _33 sclr.s33
-#define _34 sclr.s34
-#define _41 sclr.s41
-#define _42 sclr.s42
-#define _43 sclr.s43
-#define _44 sclr.s44
struct Matrix3
{
@@ -119,10 +103,10 @@ struct Matrix3D
float f31, float f32, float f33, float f34,
float f41, float f42, float f43, float f44)
{
- _11=f11; _12=f12; _13=f13; _14=f14;
- _21=f21; _22=f22; _23=f23; _24=f24;
- _31=f31; _32=f32; _33=f33; _34=f34;
- _41=f41; _42=f42; _43=f43; _44=f44;
+ sclr.s11=f11; sclr.s12=f12; sclr.s13=f13; sclr.s14=f14;
+ sclr.s21=f21; sclr.s22=f22; sclr.s23=f23; sclr.s24=f24;
+ sclr.s31=f31; sclr.s32=f32; sclr.s33=f33; sclr.s34=f34;
+ sclr.s41=f41; sclr.s42=f42; sclr.s43=f43; sclr.s44=f44;
}
Matrix3D& operator*= (const Matrix3D& m)
@@ -199,16 +183,16 @@ inline Vector3D CrossProduct(const Vector3D& v1, const Vector3D& v2)
inline Vector3D Transform(const Vector3D& v, const Matrix3D& m)
{
- return Vector3D(v.x*m._11 + v.y*m._21 + v.z*m._31 + m._41,
- v.x*m._12 + v.y*m._22 + v.z*m._32 + m._42,
- v.x*m._13 + v.y*m._23 + v.z*m._33 + m._43);
+ return Vector3D(v.x*m.sclr.s11 + v.y*m.sclr.s21 + v.z*m.sclr.s31 + m.sclr.s41,
+ v.x*m.sclr.s12 + v.y*m.sclr.s22 + v.z*m.sclr.s32 + m.sclr.s42,
+ v.x*m.sclr.s13 + v.y*m.sclr.s23 + v.z*m.sclr.s33 + m.sclr.s43);
}
inline Vector3D rotateVector(const Vector3D& v, const Matrix3D& m)
{
- return Vector3D(v.x*m._11 + v.y*m._21 + v.z*m._31,
- v.x*m._12 + v.y*m._22 + v.z*m._32,
- v.x*m._13 + v.y*m._23 + v.z*m._33);
+ return Vector3D(v.x*m.sclr.s11 + v.y*m.sclr.s21 + v.z*m.sclr.s31,
+ v.x*m.sclr.s12 + v.y*m.sclr.s22 + v.z*m.sclr.s32,
+ v.x*m.sclr.s13 + v.y*m.sclr.s23 + v.z*m.sclr.s33);
}
inline Matrix3D operator*(float scalar, const Matrix3D& m)
@@ -222,22 +206,22 @@ inline Matrix3D operator*(float scalar, const Matrix3D& m)
inline Matrix3D operator*(const Matrix3D& m1, const Matrix3D& m2)
{
return Matrix3D(
- m1._11*m2._11 + m1._12*m2._21 + m1._13*m2._31 + m1._14*m2._41,
- m1._11*m2._12 + m1._12*m2._22 + m1._13*m2._32 + m1._14*m2._42,
- m1._11*m2._13 + m1._12*m2._23 + m1._13*m2._33 + m1._14*m2._43,
- m1._11*m2._14 + m1._12*m2._24 + m1._13*m2._34 + m1._14*m2._44,
- m1._21*m2._11 + m1._22*m2._21 + m1._23*m2._31 + m1._24*m2._41,
- m1._21*m2._12 + m1._22*m2._22 + m1._23*m2._32 + m1._24*m2._42,
- m1._21*m2._13 + m1._22*m2._23 + m1._23*m2._33 + m1._24*m2._43,
- m1._21*m2._14 + m1._22*m2._24 + m1._23*m2._34 + m1._24*m2._44,
- m1._31*m2._11 + m1._32*m2._21 + m1._33*m2._31 + m1._34*m2._41,
- m1._31*m2._12 + m1._32*m2._22 + m1._33*m2._32 + m1._34*m2._42,
- m1._31*m2._13 + m1._32*m2._23 + m1._33*m2._33 + m1._34*m2._43,
- m1._31*m2._14 + m1._32*m2._24 + m1._33*m2._34 + m1._34*m2._44,
- m1._41*m2._11 + m1._42*m2._21 + m1._43*m2._31 + m1._44*m2._41,
- m1._41*m2._12 + m1._42*m2._22 + m1._43*m2._32 + m1._44*m2._42,
- m1._41*m2._13 + m1._42*m2._23 + m1._43*m2._33 + m1._44*m2._43,
- m1._41*m2._14 + m1._42*m2._24 + m1._43*m2._34 + m1._44*m2._44);
+ m1.sclr.s11*m2.sclr.s11 + m1.sclr.s12*m2.sclr.s21 + m1.sclr.s13*m2.sclr.s31 + m1.sclr.s14*m2.sclr.s41,
+ m1.sclr.s11*m2.sclr.s12 + m1.sclr.s12*m2.sclr.s22 + m1.sclr.s13*m2.sclr.s32 + m1.sclr.s14*m2.sclr.s42,
+ m1.sclr.s11*m2.sclr.s13 + m1.sclr.s12*m2.sclr.s23 + m1.sclr.s13*m2.sclr.s33 + m1.sclr.s14*m2.sclr.s43,
+ m1.sclr.s11*m2.sclr.s14 + m1.sclr.s12*m2.sclr.s24 + m1.sclr.s13*m2.sclr.s34 + m1.sclr.s14*m2.sclr.s44,
+ m1.sclr.s21*m2.sclr.s11 + m1.sclr.s22*m2.sclr.s21 + m1.sclr.s23*m2.sclr.s31 + m1.sclr.s24*m2.sclr.s41,
+ m1.sclr.s21*m2.sclr.s12 + m1.sclr.s22*m2.sclr.s22 + m1.sclr.s23*m2.sclr.s32 + m1.sclr.s24*m2.sclr.s42,
+ m1.sclr.s21*m2.sclr.s13 + m1.sclr.s22*m2.sclr.s23 + m1.sclr.s23*m2.sclr.s33 + m1.sclr.s24*m2.sclr.s43,
+ m1.sclr.s21*m2.sclr.s14 + m1.sclr.s22*m2.sclr.s24 + m1.sclr.s23*m2.sclr.s34 + m1.sclr.s24*m2.sclr.s44,
+ m1.sclr.s31*m2.sclr.s11 + m1.sclr.s32*m2.sclr.s21 + m1.sclr.s33*m2.sclr.s31 + m1.sclr.s34*m2.sclr.s41,
+ m1.sclr.s31*m2.sclr.s12 + m1.sclr.s32*m2.sclr.s22 + m1.sclr.s33*m2.sclr.s32 + m1.sclr.s34*m2.sclr.s42,
+ m1.sclr.s31*m2.sclr.s13 + m1.sclr.s32*m2.sclr.s23 + m1.sclr.s33*m2.sclr.s33 + m1.sclr.s34*m2.sclr.s43,
+ m1.sclr.s31*m2.sclr.s14 + m1.sclr.s32*m2.sclr.s24 + m1.sclr.s33*m2.sclr.s34 + m1.sclr.s34*m2.sclr.s44,
+ m1.sclr.s41*m2.sclr.s11 + m1.sclr.s42*m2.sclr.s21 + m1.sclr.s43*m2.sclr.s31 + m1.sclr.s44*m2.sclr.s41,
+ m1.sclr.s41*m2.sclr.s12 + m1.sclr.s42*m2.sclr.s22 + m1.sclr.s43*m2.sclr.s32 + m1.sclr.s44*m2.sclr.s42,
+ m1.sclr.s41*m2.sclr.s13 + m1.sclr.s42*m2.sclr.s23 + m1.sclr.s43*m2.sclr.s33 + m1.sclr.s44*m2.sclr.s43,
+ m1.sclr.s41*m2.sclr.s14 + m1.sclr.s42*m2.sclr.s24 + m1.sclr.s43*m2.sclr.s34 + m1.sclr.s44*m2.sclr.s44);
}
inline void
diff --git a/coldet/sysdep.h b/coldet/sysdep.h
old mode 100644
new mode 100755
index 57e1c43..bce7f50
--- a/coldet/sysdep.h
+++ b/coldet/sysdep.h
@@ -24,14 +24,6 @@
#ifndef H_SYSDEP
#define H_SYSDEP
-#ifdef GCC
-
-typedef unsigned long DWORD;
-DWORD GetTickCount();
-#define __CD__BEGIN
-#define __CD__END
-
-#elif defined(WIN32)
#define WIN32_LEAN_AND_MEAN
#include
@@ -42,11 +34,6 @@ DWORD GetTickCount();
#else
#define EXPORT __declspec(dllimport)
#endif
-#else
-
-#error No system specified (WIN32 GCC)
-
-#endif
#ifndef EXPORT
#define EXPORT
diff --git a/common_sdl_gl.cpp b/common_sdl_gl.cpp
old mode 100644
new mode 100755
index d459fec..eea6a95
--- a/common_sdl_gl.cpp
+++ b/common_sdl_gl.cpp
@@ -2,6 +2,11 @@
#include
#include
+
+
+#include "gl/gl.h"
+#include "gl/glu.h"
+
extern int global_EC;
#ifndef VIEWGL_FOVY
@@ -14,7 +19,7 @@ extern int global_EC;
#define VIEWGL_ZFAR 250.0f
#endif
-extern SDL_Surface* screen;
+extern SDL_Window* screen;
int videoFlags = 0;
/*
@@ -43,27 +48,21 @@ int resize(int w, int h) {
}
void initVideo(int w, int h, int bpp) {
- const SDL_VideoInfo *videoInfo;
- /*
- SDL_Rect **modes;
- int i;
-
- videoInfo = SDL_GetVideoInfo( );
- modes=SDL_ListModes(videoInfo->vfmt, SDL_FULLSCREEN|SDL_HWSURFACE);
- if(modes == (SDL_Rect **)0){
- printf("No modes available!\n");
- exit(1);
- }
- if(modes == (SDL_Rect **)-1){
- printf("All resolutions available.\n");
- }
- else{
- printf("Available Modes\n");
- for(i=0;modes[i];++i)
- printf(" %d x %d\n", modes[i]->w, modes[i]->h);
- }
- */
+
+ screen = SDL_CreateWindow("My Game Window",
+ SDL_WINDOWPOS_UNDEFINED,
+ SDL_WINDOWPOS_UNDEFINED,
+ w, h,
+ SDL_WINDOW_FULLSCREEN | SDL_WINDOW_OPENGL);
+
+
+ resize(w, h);
+
+ //Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
+
+ /*
+ const SDL_VideoInfo *videoInfo;
if (!videoInfo)
ERROR("VideoInfo query failed");
@@ -71,7 +70,7 @@ void initVideo(int w, int h, int bpp) {
videoFlags |= SDL_GL_DOUBLEBUFFER;
videoFlags |= SDL_HWPALETTE;
//videoFlags |= SDL_RESIZABLE;
- //videoFlags |= SDL_FULLSCREEN;
+ //videoFlags |= SDL_WINDOW_FULLSCREEN;
if ( videoInfo->hw_available ) {
std::cerr << "Info: Using HWSURFACE" << std::endl;
@@ -91,7 +90,7 @@ void initVideo(int w, int h, int bpp) {
if (!screen)
ERROR("SDL failed to generate requested VideoSurface!");
- resize(w, h);
+ resize(w, h);*/
}
void initGL() {
diff --git a/font_cache.cpp b/font_cache.cpp
old mode 100644
new mode 100755
index 1bd9146..0bdd7bf
--- a/font_cache.cpp
+++ b/font_cache.cpp
@@ -39,8 +39,9 @@ namespace OpenGTA {
if (i == loadedFonts.end()) {
OpenGL::DrawableFont* fnt = createFont(file, scale);
assert(fnt);
- loadedFonts.insert(std::make_pair(
- FontIdentifier(file, scale), fnt));
+
+ loadedFonts[FontIdentifier(file, scale)] = fnt;
+
return *fnt;
}
return *i->second;
diff --git a/fx_sdt.h b/fx_sdt.h
old mode 100644
new mode 100755
index 175a5b5..8ac9f60
--- a/fx_sdt.h
+++ b/fx_sdt.h
@@ -40,6 +40,7 @@ namespace OpenGTA {
~SoundsDB();
void load(const std::string & sdt_file);
struct Entry {
+ Entry();
Entry(PHYSFS_uint32, PHYSFS_uint32, PHYSFS_uint32);
PHYSFS_uint32 rawStart;
PHYSFS_uint32 rawSize;
diff --git a/game_objects.cpp b/game_objects.cpp
old mode 100644
new mode 100755
index 37d2878..e94290c
--- a/game_objects.cpp
+++ b/game_objects.cpp
@@ -30,11 +30,6 @@
#include "ai.h"
#include "localplayer.h"
-// ugly fix for win32
-#ifdef WIN32
-#undef ERROR
-#define ERROR Util::Log::error(__FILE__, __LINE__)
-#endif
#define INT2FLOAT_WRLD(c) (float(c >> 6) + float(c % 64) / 64.0f)
#define INT2F_DIV64(v) (float(v) / 64.0f)
@@ -520,7 +515,8 @@ activeWeapon = chooseWeapon;
void CarSprite::setSirenAnim(bool on) {
if (!(assertDeltaById(15) && assertDeltaById(16))) {
- ERROR << "Trying to set siren anim on car-sprite that has no such delta!" << std::endl;
+ //Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
+ //ERROR << "Trying to set siren anim on car-sprite that has no such delta!" << std::endl;
return;
}
animState.set_item(10, on);
diff --git a/gl_camera.cpp b/gl_camera.cpp
old mode 100644
new mode 100755
index f77b4c2..1af95e4
--- a/gl_camera.cpp
+++ b/gl_camera.cpp
@@ -233,7 +233,11 @@ namespace OpenGL {
h = screen.getHeight() / 2;
int mx, my;
SDL_GetMouseState(&mx, &my);
- SDL_WarpMouse(w, h);
+
+ //Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
+ //SDL_WarpMouse(w, h);
+ SDL_WarpMouseInWindow(screen.surface, w, h);
+
if ((mx == w) && (my == h))
return;
float rot_x = (float(w) - mx) / 100;
diff --git a/gl_screen.cpp b/gl_screen.cpp
old mode 100644
new mode 100755
index 0d3e7ae..0036a2d
--- a/gl_screen.cpp
+++ b/gl_screen.cpp
@@ -27,6 +27,7 @@
#include "m_exceptions.h"
#include "image_loader.h"
+
namespace OpenGL {
#ifndef DEFAULT_SCREEN_WIDTH
#define DEFAULT_SCREEN_WIDTH 640
@@ -86,7 +87,7 @@ namespace OpenGL {
}
bool Screen::getFullscreen() {
- return (videoFlags & SDL_FULLSCREEN);
+ return (videoFlags & SDL_WINDOW_FULLSCREEN);
}
void Screen::setFullScreenFlag(bool v) {
@@ -95,9 +96,9 @@ namespace OpenGL {
else if (!v && !getFullscreen())
return;
if (v)
- videoFlags |= SDL_FULLSCREEN;
+ videoFlags |= SDL_WINDOW_FULLSCREEN;
else
- videoFlags ^= SDL_FULLSCREEN;
+ videoFlags ^= SDL_WINDOW_FULLSCREEN;
}
Screen::~Screen() {
@@ -108,14 +109,40 @@ namespace OpenGL {
}
void Screen::toggleFullscreen() {
- if (videoFlags & SDL_FULLSCREEN)
- videoFlags ^= SDL_FULLSCREEN;
+ if (videoFlags & SDL_WINDOW_FULLSCREEN)
+ videoFlags ^= SDL_WINDOW_FULLSCREEN;
else
- videoFlags |= SDL_FULLSCREEN;
+ videoFlags |= SDL_WINDOW_FULLSCREEN;
resize(width, height);
}
void Screen::initSDL() {
+
+ //Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
+
+ size_t color_depth_triple[3];
+
+ for (int i = 0; i < 3; ++i)
+ color_depth_triple[i] = 8;
+
+
+ SDL_GL_SetAttribute(SDL_GL_RED_SIZE, color_depth_triple[0]);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, color_depth_triple[1]);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, color_depth_triple[2]);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+#ifdef HAVE_SDL_VSYNC
+ if (useVsync == 1) {
+ SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
+ INFO << "enabling vertical sync:" << " SDL" << std::endl;
+ }
+#else
+ if (useVsync == 1)
+ WARN << "Cannot use SDL vsync - option disabled while compiling" << std::endl;
+#endif
+
+
+ /*
int err = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
if (err)
//throw "SDL_Init failed: " + std::string(SDL_GetError());
@@ -189,7 +216,7 @@ namespace OpenGL {
sdl_err = SDL_GetError();
if (strlen(sdl_err) > 0)
ERROR << "setting sdl_gl attributes: " << sdl_err << std::endl;
-
+ */
}
void Screen::initGL() {
@@ -250,6 +277,25 @@ namespace OpenGL {
}
void Screen::resize(Uint32 w, Uint32 h) {
+
+ //Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
+
+ if (h == 0)
+ h = 1;
+
+ surface = SDL_CreateWindow(
+ "SDL2/OpenGL Demo", 0, 0, w, h,
+ SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
+
+ // Create an OpenGL context associated with the window.
+ glcontext = SDL_GL_CreateContext(surface);
+
+ glViewport(0, 0, w, h);
+ width = w;
+ height = h;
+ GL_CHECKERROR;
+
+ /*
if (h == 0)
h = 1;
surface = SDL_SetVideoMode(w, h, bpp, videoFlags);
@@ -259,11 +305,11 @@ namespace OpenGL {
" hw-blit: " << (videoFlags & SDL_HWACCEL == SDL_HWACCEL ? "on" : "off") << std::endl;
throw E_NOTSUPPORTED(SDL_GetError());
}
-
+
glViewport(0, 0, w, h);
width = w;
height = h;
- GL_CHECKERROR;
+ GL_CHECKERROR;*/
}
void Screen::set3DProjection() {
diff --git a/gl_screen.h b/gl_screen.h
old mode 100644
new mode 100755
index 630f95b..fb0fba3
--- a/gl_screen.h
+++ b/gl_screen.h
@@ -28,6 +28,10 @@
#include "Singleton.h"
+#include "gl/gl.h"
+#include "gl/glu.h"
+
+
namespace OpenGL {
class Screen {
public:
@@ -62,11 +66,12 @@ namespace OpenGL {
float fieldOfView;
float nearPlane;
float farPlane;
- static const Uint32 defaultVideoFlags =
- SDL_OPENGL | SDL_GL_DOUBLEBUFFER;// | SDL_HWPALETTE | SDL_HWACCEL;
- //FIXME: use ^ here as well? not just SDL_GL_SetAttribute?
- SDL_Surface *surface;
+ static const Uint32 defaultVideoFlags = SDL_WINDOW_OPENGL | SDL_GL_DOUBLEBUFFER;
+
+ public:
+ SDL_Window *surface;
+ SDL_GLContext glcontext;
};
using namespace Loki;
diff --git a/gl_spritecache.cpp b/gl_spritecache.cpp
old mode 100644
new mode 100755
index 97c4203..dd5aaab
--- a/gl_spritecache.cpp
+++ b/gl_spritecache.cpp
@@ -22,7 +22,7 @@
************************************************************************/
#include