added some graphics but only for debug

This commit is contained in:
peri4
2010-08-27 14:04:05 +04:00
parent b3854e867d
commit 95f3fb74fa
37 changed files with 876 additions and 707 deletions

Binary file not shown.

View File

@@ -10,10 +10,19 @@ SOURCES += main.cpp \
../loader.cpp \ ../loader.cpp \
alienmodel.cpp \ alienmodel.cpp \
towermodel.cpp \ towermodel.cpp \
splashmodel.cpp splashmodel.cpp \
../map.cpp \
../game_data.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
../loader.h \ ../loader.h \
alienmodel.h \ alienmodel.h \
towermodel.h \ towermodel.h \
splashmodel.h splashmodel.h \
../base_types.h \
../map.h \
../game_data.h
FORMS += mainwindow.ui FORMS += mainwindow.ui
TRANSLATIONS += adeditor_ru.ts
RESOURCES += \
ADeditor.qrc

View File

@@ -1,254 +1,104 @@
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<qtcreator> <qtcreator>
<data> <data>
<variable>RunConfiguration0-BaseEnvironmentBase</variable> <variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">2</value>
</data>
<data>
<variable>RunConfiguration0-CommandLineArguments</variable>
<valuelist type="QVariantList"/>
</data>
<data>
<variable>RunConfiguration0-ProFile</variable>
<value type="QString">ADeditor.pro</value>
</data>
<data>
<variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString">ADeditor</value>
</data>
<data>
<variable>RunConfiguration0-UseDyldImageSuffix</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UseTerminal</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserEnvironmentChanges</variable>
<valuelist type="QVariantList"/>
</data>
<data>
<variable>RunConfiguration0-UserSetName</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserSetWorkingDirectory</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserWorkingDirectory</variable>
<value type="QString"></value>
</data>
<data>
<variable>RunConfiguration0-type</variable>
<value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
</data>
<data>
<variable>activeRunConfiguration</variable>
<value type="int">0</value> <value type="int">0</value>
</data> </data>
<data> <data>
<variable>activebuildconfiguration</variable> <variable>ProjectExplorer.Project.EditorSettings</variable>
<value type="QString">Debug</value>
</data>
<data>
<variable>buildConfiguration-Debug</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <value key="EditorConfiguration.Codec" type="QByteArray">System</value>
<value key="QtVersionId" type="int">2</value>
<value key="ToolChain" type="int">0</value>
<value key="buildConfiguration" type="int">2</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfiguration-Debug-buildstep0</variable> <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</value>
<valuelist key="abstractProcess.Environment" type="QVariantList"> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value> <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value> <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
<value type="QString">DESKTOP_SESSION=gnome</value> <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<value type="QString">DISPLAY=:0.0</value> <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<value type="QString">GDMSESSION=gnome</value> <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value> <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value type="QString">GDM_LANG=ru_RU.UTF-8</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value> <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/ADeditor/ADeditor.pro</value>
<value type="QString">-spec</value>
<value type="QString">linux-g++</value>
<value type="QString">-r</value>
<value type="QString">CONFIG+=debug</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/qmake-qt4</value>
<value key="abstractProcess.enabled" type="bool">false</value>
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender/ADeditor</value>
</valuemap> </valuemap>
</data> <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
<data> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<variable>buildconfiguration-Debug-buildstep1</variable> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<valuemap type="QVariantMap"> <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<valuelist key="abstractProcess.Environment" type="QVariantList"> <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender/ADeditor</value>
</valuemap> </valuemap>
</data> <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
<data> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Build</value>
<variable>buildconfiguration-Debug-cleanstep0</variable> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
<valuemap type="QVariantMap"> </valuemap>
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
<valuelist key="abstractProcess.Environment" type="QVariantList"> <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value type="QString">DESKTOP_SESSION=gnome</value> <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<value type="QString">DISPLAY=:0.0</value> <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">clean</value>
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender/ADeditor</value>
<value key="cleanConfig" type="bool">true</value>
<valuelist key="makeargs" type="QVariantList">
<value type="QString">clean</value> <value type="QString">clean</value>
</valuelist> </valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Clean</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/peri4/pprojects/aliendefender/ADeditor</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Deploy</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">No deployment</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">ADeditor</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">ADeditor.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>buildconfigurations</variable> <variable>ProjectExplorer.Project.TargetCount</variable>
<valuelist type="QVariantList"> <value type="int">1</value>
<value type="QString">Debug</value>
</valuelist>
</data> </data>
<data> <data>
<variable>buildstep0</variable> <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<valuemap type="QVariantMap"> <value type="QString">{4d5b06df-4184-42d4-9dfd-5c7caaa07ab2}</value>
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="mkspec" type="QString"></value>
</valuemap>
</data> </data>
<data> <data>
<variable>buildstep1</variable> <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<valuemap type="QVariantMap"> <value type="int">8</value>
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
</valuemap>
</data>
<data>
<variable>buildsteps</variable>
<valuelist type="QVariantList">
<value type="QString">trolltech.qt4projectmanager.qmake</value>
<value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="clean" type="bool">true</value>
</valuemap>
</data>
<data>
<variable>cleansteps</variable>
<valuelist type="QVariantList">
<value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>defaultFileEncoding</variable>
<value type="QByteArray">System</value>
</data>
<data>
<variable>project</variable>
<valuemap type="QVariantMap"/>
</data> </data>
</qtcreator> </qtcreator>

View File

@@ -56,27 +56,17 @@
<variable>buildConfiguration-Debug</variable> <variable>buildConfiguration-Debug</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int">0</value> <value key="QtVersionId" type="int">2</value>
<value key="ToolChain" type="int">0</value> <value key="ToolChain" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">2</value> <value key="buildConfiguration" type="int">2</value>
</valuemap> </valuemap>
</data> </data>
<data>
<variable>buildConfiguration-Release</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
<value key="QtVersionId" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">0</value>
</valuemap>
</data>
<data> <data>
<variable>buildconfiguration-Debug-buildstep0</variable> <variable>buildconfiguration-Debug-buildstep0</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList"> <valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value> <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value> <value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value> <value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value> <value type="QString">DISPLAY=:0.0</value>
@@ -84,7 +74,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value> <value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value> <value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value> <value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value> <value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value> <value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value> <value type="QString">LANG=ru_RU.UTF-8</value>
@@ -95,17 +85,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value> <value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value> <value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value> <value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value> <value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value> <value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value> <value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value> <value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value> <value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value> <value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value> <value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value> <value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value> <value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value> <value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value> <value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList"> <valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/ADeditor/ADeditor.pro</value> <value type="QString">/home/andrey/AD/aliendefender/ADeditor/ADeditor.pro</value>
@@ -124,7 +114,7 @@
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList"> <valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value> <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value> <value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value> <value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value> <value type="QString">DISPLAY=:0.0</value>
@@ -132,7 +122,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value> <value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value> <value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value> <value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value> <value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value> <value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value> <value type="QString">LANG=ru_RU.UTF-8</value>
@@ -143,17 +133,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value> <value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value> <value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value> <value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value> <value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value> <value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value> <value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value> <value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value> <value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value> <value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value> <value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value> <value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value> <value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value> <value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value> <value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist> </valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value> <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList"> <valuelist key="abstractProcess.arguments" type="QVariantList">
@@ -169,7 +159,7 @@
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList"> <valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value> <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value> <value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value> <value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value> <value type="QString">DISPLAY=:0.0</value>
@@ -177,7 +167,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value> <value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value> <value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value> <value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value> <value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value> <value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value> <value type="QString">LANG=ru_RU.UTF-8</value>
@@ -188,17 +178,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value> <value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value> <value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value> <value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value> <value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value> <value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value> <value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value> <value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value> <value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value> <value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value> <value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value> <value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value> <value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value> <value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value> <value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist> </valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value> <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList"> <valuelist key="abstractProcess.arguments" type="QVariantList">
@@ -214,29 +204,10 @@
</valuelist> </valuelist>
</valuemap> </valuemap>
</data> </data>
<data>
<variable>buildconfiguration-Release-buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data> <data>
<variable>buildconfigurations</variable> <variable>buildconfigurations</variable>
<valuelist type="QVariantList"> <valuelist type="QVariantList">
<value type="QString">Debug</value> <value type="QString">Debug</value>
<value type="QString">Release</value>
</valuelist> </valuelist>
</data> </data>
<data> <data>

5
ADeditor/ADeditor.qrc Normal file
View File

@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/translates">
<file>adeditor_ru.qm</file>
</qresource>
</RCC>

View File

@@ -1,9 +1,9 @@
############################################################################# #############################################################################
# Makefile for building: ADeditor # Makefile for building: ADeditor
# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 25 23:57:34 2010 # Generated by qmake (2.01a) (Qt 4.7.0) on: ?? ???. 26 18:09:05 2010
# Project: ADeditor.pro # Project: ADeditor.pro
# Template: app # Template: app
# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile ADeditor.pro # Command: /usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile ADeditor.pro
############################################################################# #############################################################################
####### Compiler, tools and options ####### Compiler, tools and options
@@ -11,15 +11,15 @@
CC = gcc CC = gcc
CXX = g++ CXX = g++
DEFINES = -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED DEFINES = -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) CFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4 -I. -I. INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4 -I. -I.
LINK = g++ LINK = g++
LFLAGS = LFLAGS = -Wl,-rpath,/usr/lib/qt4
LIBS = $(SUBLIBS) -L/usr/lib -lQtXmlPatterns -lQtXml -lQtGui -lQtCore -lpthread LIBS = $(SUBLIBS) -L/usr/lib/qt4 -lQtXmlPatterns -L/usr/lib/qt4 -lQtNetwork -lQtXml -lQtGui -L/usr/X11R6/lib -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lpthread
AR = ar cqs AR = ar cqs
RANLIB = RANLIB =
QMAKE = /usr/bin/qmake-qt4 QMAKE = /usr/bin/qmake
TAR = tar -cf TAR = tar -cf
COMPRESS = gzip -9f COMPRESS = gzip -9f
COPY = cp -f COPY = cp -f
@@ -48,26 +48,37 @@ SOURCES = main.cpp \
../loader.cpp \ ../loader.cpp \
alienmodel.cpp \ alienmodel.cpp \
towermodel.cpp \ towermodel.cpp \
splashmodel.cpp moc_mainwindow.cpp \ splashmodel.cpp \
../map.cpp \
../game_data.cpp moc_mainwindow.cpp \
moc_loader.cpp \ moc_loader.cpp \
moc_alienmodel.cpp \ moc_alienmodel.cpp \
moc_towermodel.cpp \ moc_towermodel.cpp \
moc_splashmodel.cpp moc_splashmodel.cpp \
moc_map.cpp \
moc_game_data.cpp \
qrc_ADeditor.cpp
OBJECTS = main.o \ OBJECTS = main.o \
mainwindow.o \ mainwindow.o \
loader.o \ loader.o \
alienmodel.o \ alienmodel.o \
towermodel.o \ towermodel.o \
splashmodel.o \ splashmodel.o \
map.o \
game_data.o \
moc_mainwindow.o \ moc_mainwindow.o \
moc_loader.o \ moc_loader.o \
moc_alienmodel.o \ moc_alienmodel.o \
moc_towermodel.o \ moc_towermodel.o \
moc_splashmodel.o moc_splashmodel.o \
moc_map.o \
moc_game_data.o \
qrc_ADeditor.o
DIST = /usr/share/qt4/mkspecs/common/g++.conf \ DIST = /usr/share/qt4/mkspecs/common/g++.conf \
/usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -119,6 +130,7 @@ Makefile: ADeditor.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/q
/usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -134,15 +146,17 @@ Makefile: ADeditor.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/q
/usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/libQtXmlPatterns.prl \ /usr/lib/qt4/libQtXmlPatterns.prl \
/usr/lib/libQtXml.prl \ /usr/lib/qt4/libQtNetwork.prl \
/usr/lib/libQtGui.prl \ /usr/lib/qt4/libQtCore.prl \
/usr/lib/libQtCore.prl /usr/lib/qt4/libQtXml.prl \
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile ADeditor.pro /usr/lib/qt4/libQtGui.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile ADeditor.pro
/usr/share/qt4/mkspecs/common/g++.conf: /usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf: /usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf: /usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/qconfig.pri: /usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf: /usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf: /usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf: /usr/share/qt4/mkspecs/features/exclusive_builds.prf:
@@ -158,16 +172,17 @@ Makefile: ADeditor.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/q
/usr/share/qt4/mkspecs/features/yacc.prf: /usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf: /usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf: /usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/libQtXmlPatterns.prl: /usr/lib/qt4/libQtXmlPatterns.prl:
/usr/lib/libQtXml.prl: /usr/lib/qt4/libQtNetwork.prl:
/usr/lib/libQtGui.prl: /usr/lib/qt4/libQtCore.prl:
/usr/lib/libQtCore.prl: /usr/lib/qt4/libQtXml.prl:
/usr/lib/qt4/libQtGui.prl:
qmake: FORCE qmake: FORCE
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile ADeditor.pro @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile ADeditor.pro
dist: dist:
@$(CHK_DIR_EXISTS) .tmp/ADeditor1.0.0 || $(MKDIR) .tmp/ADeditor1.0.0 @$(CHK_DIR_EXISTS) .tmp/ADeditor1.0.0 || $(MKDIR) .tmp/ADeditor1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.h ../loader.h alienmodel.h towermodel.h splashmodel.h .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp ../loader.cpp alienmodel.cpp towermodel.cpp splashmodel.cpp .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/ADeditor1.0.0/ && (cd `dirname .tmp/ADeditor1.0.0` && $(TAR) ADeditor1.0.0.tar ADeditor1.0.0 && $(COMPRESS) ADeditor1.0.0.tar) && $(MOVE) `dirname .tmp/ADeditor1.0.0`/ADeditor1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/ADeditor1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.h ../loader.h alienmodel.h towermodel.h splashmodel.h ../base_types.h ../map.h ../game_data.h .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents ADeditor.qrc .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp ../loader.cpp alienmodel.cpp towermodel.cpp splashmodel.cpp ../map.cpp ../game_data.cpp .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/ADeditor1.0.0/ && $(COPY_FILE) --parents adeditor_ru.ts .tmp/ADeditor1.0.0/ && (cd `dirname .tmp/ADeditor1.0.0` && $(TAR) ADeditor1.0.0.tar ADeditor1.0.0 && $(COMPRESS) ADeditor1.0.0.tar) && $(MOVE) `dirname .tmp/ADeditor1.0.0`/ADeditor1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/ADeditor1.0.0
clean:compiler_clean clean:compiler_clean
@@ -182,13 +197,15 @@ distclean: clean
-$(DEL_FILE) Makefile -$(DEL_FILE) Makefile
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp compiler_moc_header_make_all: moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp moc_map.cpp moc_game_data.cpp
compiler_moc_header_clean: compiler_moc_header_clean:
-$(DEL_FILE) moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp -$(DEL_FILE) moc_mainwindow.cpp moc_loader.cpp moc_alienmodel.cpp moc_towermodel.cpp moc_splashmodel.cpp moc_map.cpp moc_game_data.cpp
moc_mainwindow.cpp: alienmodel.h \ moc_mainwindow.cpp: alienmodel.h \
../loader.h \ ../loader.h \
../game_data.h \ ../game_data.h \
@@ -198,14 +215,14 @@ moc_mainwindow.cpp: alienmodel.h \
towermodel.h \ towermodel.h \
splashmodel.h \ splashmodel.h \
mainwindow.h mainwindow.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp /usr/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
moc_loader.cpp: ../game_data.h \ moc_loader.cpp: ../game_data.h \
../player.h \ ../player.h \
../base_types.h \ ../base_types.h \
../map.h \ ../map.h \
../loader.h ../loader.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) ../loader.h -o moc_loader.cpp /usr/bin/moc $(DEFINES) $(INCPATH) ../loader.h -o moc_loader.cpp
moc_alienmodel.cpp: ../loader.h \ moc_alienmodel.cpp: ../loader.h \
../game_data.h \ ../game_data.h \
@@ -213,7 +230,7 @@ moc_alienmodel.cpp: ../loader.h \
../base_types.h \ ../base_types.h \
../map.h \ ../map.h \
alienmodel.h alienmodel.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) alienmodel.h -o moc_alienmodel.cpp /usr/bin/moc $(DEFINES) $(INCPATH) alienmodel.h -o moc_alienmodel.cpp
moc_towermodel.cpp: ../loader.h \ moc_towermodel.cpp: ../loader.h \
../game_data.h \ ../game_data.h \
@@ -221,7 +238,7 @@ moc_towermodel.cpp: ../loader.h \
../base_types.h \ ../base_types.h \
../map.h \ ../map.h \
towermodel.h towermodel.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) towermodel.h -o moc_towermodel.cpp /usr/bin/moc $(DEFINES) $(INCPATH) towermodel.h -o moc_towermodel.cpp
moc_splashmodel.cpp: ../loader.h \ moc_splashmodel.cpp: ../loader.h \
../game_data.h \ ../game_data.h \
@@ -229,10 +246,25 @@ moc_splashmodel.cpp: ../loader.h \
../base_types.h \ ../base_types.h \
../map.h \ ../map.h \
splashmodel.h splashmodel.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splashmodel.h -o moc_splashmodel.cpp /usr/bin/moc $(DEFINES) $(INCPATH) splashmodel.h -o moc_splashmodel.cpp
compiler_rcc_make_all: moc_map.cpp: ../base_types.h \
../map.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../map.h -o moc_map.cpp
moc_game_data.cpp: ../player.h \
../base_types.h \
../map.h \
../game_data.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../game_data.h -o moc_game_data.cpp
compiler_rcc_make_all: qrc_ADeditor.cpp
compiler_rcc_clean: compiler_rcc_clean:
-$(DEL_FILE) qrc_ADeditor.cpp
qrc_ADeditor.cpp: ADeditor.qrc \
adeditor_ru.qm
/usr/bin/rcc -name ADeditor ADeditor.qrc -o qrc_ADeditor.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean: compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp -$(DEL_FILE) qmake_image_collection.cpp
@@ -242,7 +274,7 @@ compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean: compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h -$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui ui_mainwindow.h: mainwindow.ui
/usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h /usr/bin/uic mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all: compiler_yacc_decl_make_all:
compiler_yacc_decl_clean: compiler_yacc_decl_clean:
@@ -250,7 +282,7 @@ compiler_yacc_impl_make_all:
compiler_yacc_impl_clean: compiler_yacc_impl_clean:
compiler_lex_make_all: compiler_lex_make_all:
compiler_lex_clean: compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile ####### Compile
@@ -308,6 +340,16 @@ splashmodel.o: splashmodel.cpp splashmodel.h \
../map.h ../map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashmodel.o splashmodel.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashmodel.o splashmodel.cpp
map.o: ../map.cpp ../map.h \
../base_types.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o map.o ../map.cpp
game_data.o: ../game_data.cpp ../game_data.h \
../player.h \
../base_types.h \
../map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o ../game_data.cpp
moc_mainwindow.o: moc_mainwindow.cpp moc_mainwindow.o: moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
@@ -323,6 +365,15 @@ moc_towermodel.o: moc_towermodel.cpp
moc_splashmodel.o: moc_splashmodel.cpp moc_splashmodel.o: moc_splashmodel.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_splashmodel.o moc_splashmodel.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_splashmodel.o moc_splashmodel.cpp
moc_map.o: moc_map.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
moc_game_data.o: moc_game_data.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_game_data.o moc_game_data.cpp
qrc_ADeditor.o: qrc_ADeditor.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_ADeditor.o qrc_ADeditor.cpp
####### Install ####### Install
install: FORCE install: FORCE

View File

@@ -15,22 +15,22 @@
<wave prise="220" timeout="20000" id="3"/> <wave prise="220" timeout="20000" id="3"/>
</waves> </waves>
<levels> <levels>
<level map="1" id="1" score="138978384" name="First Level"/> <level map="1" id="1" score="149859760" name="First Level"/>
</levels> </levels>
<waveParts> <waveParts>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="12" count="5" wave="1"/>
<wavePart alien="10" count="4" wave="1"/> <wavePart alien="10" count="4" wave="1"/>
<wavePart alien="12" count="5" wave="1"/>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="10" count="9" wave="2"/> <wavePart alien="10" count="9" wave="2"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="10" count="1" wave="3"/> <wavePart alien="10" count="1" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="12" count="4" wave="3"/>
</waveParts> </waveParts>
<wavesOnLevels> <wavesOnLevels>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="1" level="1"/> <waveOnLevel wave="1" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="3" level="1"/>
</wavesOnLevels> </wavesOnLevels>
<splashes> <splashes>
<splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/> <splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/>
@@ -50,15 +50,15 @@
<trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/> <trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/>
</triggers> </triggers>
<chains> <chains>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="1" trigger="3" child="4" parent="1"/> <chain tower="1" trigger="3" child="4" parent="1"/>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="2" trigger="2" parent="3"/> <chain tower="2" trigger="2" parent="3"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
<chain tower="3" trigger="3" child="4" parent="2"/> <chain tower="3" trigger="3" child="4" parent="2"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
</chains> </chains>
<towersOnLevels> <towersOnLevels>
<towerOnLevel tower="3" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="1" level="1"/> <towerOnLevel tower="1" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="3" level="1"/>
</towersOnLevels> </towersOnLevels>
</ADdata> </ADdata>

View File

@@ -1,9 +1,13 @@
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QTranslator>
#include "mainwindow.h" #include "mainwindow.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
QTranslator translator;
translator.load(":/translates/" + QString("adeditor_") + QLocale::system().name());
a.installTranslator(&translator);
MainWindow w; MainWindow w;
w.show(); w.show();
return a.exec(); return a.exec();

View File

@@ -10,9 +10,6 @@
<height>489</height> <height>489</height>
</rect> </rect>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
@@ -21,16 +18,28 @@
</property> </property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>2</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tabAliens"> <widget class="QWidget" name="tabAliens">
<attribute name="title"> <attribute name="title">
<string>Aliens</string> <string>Aliens</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_4" columnstretch="1,2"> <layout class="QGridLayout" name="gridLayout_4" columnstretch="1,2">
<property name="margin">
<number>2</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QListView" name="lvAliens"> <widget class="QListView" name="lvAliens">
<property name="editTriggers"> <property name="editTriggers">
@@ -47,6 +56,12 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@@ -222,7 +237,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Prise</string> <string>Prize</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@@ -276,7 +291,7 @@
<item> <item>
<widget class="QCheckBox" name="cbAlIsFly"> <widget class="QCheckBox" name="cbAlIsFly">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@@ -289,23 +304,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="10,4,0,1"> <layout class="QHBoxLayout" name="horizontalLayout_9" stretch="10,0,0">
<item> <item>
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -322,35 +324,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="pushButton_3"> <widget class="QPushButton" name="pushButton_3">
<property name="enabled"> <property name="enabled">
@@ -373,6 +346,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@@ -391,9 +377,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>Add</string> <string>Add</string>
</property> </property>
@@ -426,9 +409,6 @@
</item> </item>
<item row="0" column="1" rowspan="2"> <item row="0" column="1" rowspan="2">
<widget class="QFrame" name="frame_2"> <widget class="QFrame" name="frame_2">
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
@@ -782,9 +762,6 @@
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
@@ -808,9 +785,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>Add</string> <string>Add</string>
</property> </property>
@@ -824,9 +798,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>Delete</string> <string>Delete</string>
</property> </property>
@@ -859,9 +830,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
@@ -986,9 +954,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
@@ -1076,9 +1041,6 @@
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
@@ -1102,9 +1064,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>Add</string> <string>Add</string>
</property> </property>
@@ -1118,9 +1077,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>Delete</string> <string>Delete</string>
</property> </property>
@@ -1139,9 +1095,6 @@
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QPushButton" name="pbSave"> <widget class="QPushButton" name="pbSave">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>Save</string> <string>Save</string>
</property> </property>

136
Makefile
View File

@@ -1,9 +1,9 @@
############################################################################# #############################################################################
# Makefile for building: aliendefender # Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???. 23 12:02:15 2010 # Generated by qmake (2.01a) (Qt 4.7.0) on: ?? ???. 27 13:32:05 2010
# Project: aliendefender.pro # Project: aliendefender.pro
# Template: app # Template: app
# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro # Command: /usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile aliendefender.pro
############################################################################# #############################################################################
####### Compiler, tools and options ####### Compiler, tools and options
@@ -11,15 +11,15 @@
CC = gcc CC = gcc
CXX = g++ CXX = g++
DEFINES = -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED DEFINES = -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) CFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4 -I/usr/X11R6/include -I. INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4 -I/usr/X11R6/include -I.
LINK = g++ LINK = g++
LFLAGS = LFLAGS = -Wl,-rpath,/usr/lib/qt4
LIBS = $(SUBLIBS) -L/usr/lib -L/usr/X11R6/lib -lQtXmlPatterns -lQtXml -lQtOpenGL -lQtGui -lQtNetwork -lQtCore -lGLU -lGL -lpthread LIBS = $(SUBLIBS) -L/usr/lib/qt4 -L/usr/X11R6/lib -lQtXmlPatterns -L/usr/lib/qt4 -lQtXml -lQtOpenGL -L/usr/X11R6/lib -lQtGui -lQtNetwork -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lGLU -lGL -lpthread
AR = ar cqs AR = ar cqs
RANLIB = RANLIB =
QMAKE = /usr/bin/qmake-qt4 QMAKE = /usr/bin/qmake
TAR = tar -cf TAR = tar -cf
COMPRESS = gzip -9f COMPRESS = gzip -9f
COPY = cp -f COPY = cp -f
@@ -51,7 +51,9 @@ SOURCES = map.cpp \
splashes.cpp \ splashes.cpp \
adcore.cpp \ adcore.cpp \
player.cpp \ player.cpp \
loader.cpp moc_map.cpp \ loader.cpp \
animation.cpp \
ad_graphics.cpp moc_map.cpp \
moc_game_data.cpp \ moc_game_data.cpp \
moc_aliens.cpp \ moc_aliens.cpp \
moc_towers.cpp \ moc_towers.cpp \
@@ -59,6 +61,7 @@ SOURCES = map.cpp \
moc_adcore.cpp \ moc_adcore.cpp \
moc_player.cpp \ moc_player.cpp \
moc_loader.cpp \ moc_loader.cpp \
moc_ad_graphics.cpp \
qrc_images.cpp qrc_images.cpp
OBJECTS = map.o \ OBJECTS = map.o \
game_data.o \ game_data.o \
@@ -69,6 +72,8 @@ OBJECTS = map.o \
adcore.o \ adcore.o \
player.o \ player.o \
loader.o \ loader.o \
animation.o \
ad_graphics.o \
moc_map.o \ moc_map.o \
moc_game_data.o \ moc_game_data.o \
moc_aliens.o \ moc_aliens.o \
@@ -77,11 +82,13 @@ OBJECTS = map.o \
moc_adcore.o \ moc_adcore.o \
moc_player.o \ moc_player.o \
moc_loader.o \ moc_loader.o \
moc_ad_graphics.o \
qrc_images.o qrc_images.o
DIST = /usr/share/qt4/mkspecs/common/g++.conf \ DIST = /usr/share/qt4/mkspecs/common/g++.conf \
/usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -134,6 +141,7 @@ Makefile: aliendefender.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/sh
/usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -150,17 +158,18 @@ Makefile: aliendefender.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/sh
/usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/libQtXmlPatterns.prl \ /usr/lib/qt4/libQtXmlPatterns.prl \
/usr/lib/libQtXml.prl \ /usr/lib/qt4/libQtNetwork.prl \
/usr/lib/libQtOpenGL.prl \ /usr/lib/qt4/libQtCore.prl \
/usr/lib/libQtGui.prl \ /usr/lib/qt4/libQtXml.prl \
/usr/lib/libQtNetwork.prl \ /usr/lib/qt4/libQtOpenGL.prl \
/usr/lib/libQtCore.prl /usr/lib/qt4/libQtGui.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile aliendefender.pro
/usr/share/qt4/mkspecs/common/g++.conf: /usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf: /usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf: /usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/qconfig.pri: /usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf: /usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf: /usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf: /usr/share/qt4/mkspecs/features/exclusive_builds.prf:
@@ -177,18 +186,18 @@ Makefile: aliendefender.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/sh
/usr/share/qt4/mkspecs/features/yacc.prf: /usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf: /usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf: /usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/libQtXmlPatterns.prl: /usr/lib/qt4/libQtXmlPatterns.prl:
/usr/lib/libQtXml.prl: /usr/lib/qt4/libQtNetwork.prl:
/usr/lib/libQtOpenGL.prl: /usr/lib/qt4/libQtCore.prl:
/usr/lib/libQtGui.prl: /usr/lib/qt4/libQtXml.prl:
/usr/lib/libQtNetwork.prl: /usr/lib/qt4/libQtOpenGL.prl:
/usr/lib/libQtCore.prl: /usr/lib/qt4/libQtGui.prl:
qmake: FORCE qmake: FORCE
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger -o Makefile aliendefender.pro
dist: dist:
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0 @$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents base_types.h map.h game_data.h aliens.h towers.h splashes.h adcore.h player.h loader.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents images.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents map.cpp game_data.cpp aliens.cpp towers.cpp main.cpp splashes.cpp adcore.cpp player.cpp loader.cpp .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents base_types.h map.h game_data.h aliens.h towers.h splashes.h adcore.h player.h loader.h animation.h ad_graphics.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents images.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents map.cpp game_data.cpp aliens.cpp towers.cpp main.cpp splashes.cpp adcore.cpp player.cpp loader.cpp animation.cpp ad_graphics.cpp .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
clean:compiler_clean clean:compiler_clean
@@ -203,59 +212,80 @@ distclean: clean
-$(DEL_FILE) Makefile -$(DEL_FILE) Makefile
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp compiler_moc_header_make_all: moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp moc_ad_graphics.cpp
compiler_moc_header_clean: compiler_moc_header_clean:
-$(DEL_FILE) moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp -$(DEL_FILE) moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp moc_loader.cpp moc_ad_graphics.cpp
moc_map.cpp: base_types.h \ moc_map.cpp: base_types.h \
map.h map.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) map.h -o moc_map.cpp /usr/bin/moc $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
moc_game_data.cpp: player.h \ moc_game_data.cpp: player.h \
base_types.h \ base_types.h \
map.h \
game_data.h game_data.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) game_data.h -o moc_game_data.cpp /usr/bin/moc $(DEFINES) $(INCPATH) game_data.h -o moc_game_data.cpp
moc_aliens.cpp: game_data.h \ moc_aliens.cpp: game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
aliens.h aliens.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) aliens.h -o moc_aliens.cpp /usr/bin/moc $(DEFINES) $(INCPATH) aliens.h -o moc_aliens.cpp
moc_towers.cpp: game_data.h \ moc_towers.cpp: game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
towers.h towers.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) towers.h -o moc_towers.cpp /usr/bin/moc $(DEFINES) $(INCPATH) towers.h -o moc_towers.cpp
moc_splashes.cpp: game_data.h \ moc_splashes.cpp: game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
splashes.h splashes.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splashes.h -o moc_splashes.cpp /usr/bin/moc $(DEFINES) $(INCPATH) splashes.h -o moc_splashes.cpp
moc_adcore.cpp: aliens.h \ moc_adcore.cpp: aliens.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
towers.h \ towers.h \
splashes.h \ splashes.h \
loader.h \ loader.h \
adcore.h adcore.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) adcore.h -o moc_adcore.cpp /usr/bin/moc $(DEFINES) $(INCPATH) adcore.h -o moc_adcore.cpp
moc_player.cpp: base_types.h \ moc_player.cpp: base_types.h \
player.h player.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) player.h -o moc_player.cpp /usr/bin/moc $(DEFINES) $(INCPATH) player.h -o moc_player.cpp
moc_loader.cpp: game_data.h \ moc_loader.cpp: game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
loader.h loader.h
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) loader.h -o moc_loader.cpp /usr/bin/moc $(DEFINES) $(INCPATH) loader.h -o moc_loader.cpp
moc_ad_graphics.cpp: adcore.h \
aliens.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h \
animation.h \
ad_graphics.h
/usr/bin/moc $(DEFINES) $(INCPATH) ad_graphics.h -o moc_ad_graphics.cpp
compiler_rcc_make_all: qrc_images.cpp compiler_rcc_make_all: qrc_images.cpp
compiler_rcc_clean: compiler_rcc_clean:
@@ -306,19 +336,22 @@ map.o: map.cpp map.h \
game_data.o: game_data.cpp game_data.h \ game_data.o: game_data.cpp game_data.h \
player.h \ player.h \
base_types.h base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o game_data.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o game_data.cpp
aliens.o: aliens.cpp aliens.h \ aliens.o: aliens.cpp aliens.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aliens.o aliens.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o aliens.o aliens.cpp
towers.o: towers.cpp towers.h \ towers.o: towers.cpp towers.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o towers.o towers.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o towers.o towers.cpp
main.o: main.cpp adcore.h \ main.o: main.cpp adcore.h \
@@ -326,15 +359,19 @@ main.o: main.cpp adcore.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
towers.h \ towers.h \
splashes.h \ splashes.h \
loader.h loader.h \
ad_graphics.h \
animation.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
splashes.o: splashes.cpp splashes.h \ splashes.o: splashes.cpp splashes.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashes.o splashes.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashes.o splashes.cpp
adcore.o: adcore.cpp adcore.h \ adcore.o: adcore.cpp adcore.h \
@@ -342,6 +379,7 @@ adcore.o: adcore.cpp adcore.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h \ base_types.h \
map.h \
towers.h \ towers.h \
splashes.h \ splashes.h \
loader.h loader.h
@@ -354,9 +392,26 @@ player.o: player.cpp player.h \
loader.o: loader.cpp loader.h \ loader.o: loader.cpp loader.h \
game_data.h \ game_data.h \
player.h \ player.h \
base_types.h base_types.h \
map.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o loader.o loader.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o loader.o loader.cpp
animation.o: animation.cpp animation.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o animation.o animation.cpp
ad_graphics.o: ad_graphics.cpp ad_graphics.h \
adcore.h \
aliens.h \
game_data.h \
player.h \
base_types.h \
map.h \
towers.h \
splashes.h \
loader.h \
animation.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o ad_graphics.o ad_graphics.cpp
moc_map.o: moc_map.cpp moc_map.o: moc_map.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
@@ -381,6 +436,9 @@ moc_player.o: moc_player.cpp
moc_loader.o: moc_loader.cpp moc_loader.o: moc_loader.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_loader.o moc_loader.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_loader.o moc_loader.cpp
moc_ad_graphics.o: moc_ad_graphics.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_ad_graphics.o moc_ad_graphics.cpp
qrc_images.o: qrc_images.cpp qrc_images.o: qrc_images.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_images.o qrc_images.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_images.o qrc_images.cpp

106
ad_graphics.cpp Normal file
View File

@@ -0,0 +1,106 @@
#include "ad_graphics.h"
AD_Graphics::AD_Graphics(AD_Core *adcore, QWidget *parent) : QGraphicsView(parent)
{
loadImages();
data = adcore->addata;
core = adcore;
//scale(cellSize, cellSize);
setAlignment(Qt::AlignLeft | Qt::AlignTop);
scene = new QGraphicsScene();
setScene(scene);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
//gsw = new QGraphicsWidget();
//scene->addWidget(new QPushButton());
startTimer(25);
show();
}
AD_Graphics::~AD_Graphics()
{
//delete gsw;
delete scene;
}
void AD_Graphics::mouseDoubleClickEvent(QMouseEvent *)
{
core->nextWave();
}
void AD_Graphics::timerEvent(QTimerEvent * )
{
//qDebug() << data->curAliens.size();
draw();
}
void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
{
for (int i=0; i<data->map->cells().size(); i++) {
for (int j=0; j<data->map->cells().at(i).size(); j++) {
QPen pen;
QBrush brush;
pen.setColor(Qt::white);
brush.setColor(Qt::white);
brush.setStyle(Qt::SolidPattern);
int cel = data->map->cells().at(i).at(j);
if (cel == Map::Wall) {
pen.setColor(Qt::black);
brush.setColor(Qt::black);
}
if (cel <= Map::PlayerTower && cel !=Map::Wall) {
pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
}
// if (cel >= Map::PlayerAlien) {
// pen.setColor(Qt::yellow);
// brush.setColor(Qt::yellow);
// }
if (cel >= Map::Player) {
pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255,50));
brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255,50));
}
p->setPen(pen);
p->setBrush(brush);
p->drawRect(i*cellSize,j*cellSize,cellSize,cellSize);
}
}
for (QHash<int, AlienType>::iterator i = data->curAliens.begin(); i != data->curAliens.end(); ++i) {
//qDebug() << "draw alien";
//p->rotate(-90);
//p->scale(cellSize, cellSize);
//p->translate(rec.width()/2, rec.height()/2);
//p->rotate(-90);
//p->translate(-rec.height()/2, -rec.width()/2);
p->translate((*i).pos * cellSize+QPointF(10,10));
p->rotate((*i).angle);
p->drawImage(QRect(-20,-20,40,40), images[itAliens][0]->at(0));
p->resetTransform();
}
}
void AD_Graphics::draw()
{
scene->update();
//resetCachedContent();
//repaint();
}
void AD_Graphics::loadImages()
{
images.resize(3);
for (int i = 0; i < images.size(); i++) {
switch ((imagesType)i) {
case itAliens:
images[i].push_back(new Animation(":/images/images/Aliens/Al_00_"));
break;
default: break;
}
}
}

38
ad_graphics.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef AD_GRAPHICS_H
#define AD_GRAPHICS_H
#include <QGraphicsView>
#include <QGraphicsWidget>
#include <QPushButton>
#include <QMouseEvent>
#include "adcore.h"
#include "animation.h"
const float cellSize = 20.f;
class AD_Graphics: public QGraphicsView
{
Q_OBJECT
public:
explicit AD_Graphics(AD_Core * core, QWidget * parent = 0);
~AD_Graphics();
private:
enum imagesType {itAliens, itTowers, itSplashes};
void draw();
void drawBackground(QPainter * p, const QRectF &);
void loadImages();
void mouseDoubleClickEvent(QMouseEvent *);
QGraphicsScene * scene;
Game_Data * data;
AD_Core * core;
QVector<QVector<Animation * > > images;
//QGraphicsWidget * gsw;
protected:
void timerEvent(QTimerEvent * );
};
#endif // AD_GRAPHICS_H

View File

@@ -1,6 +1,6 @@
#include "adcore.h" #include "adcore.h"
adCore::adCore(QObject *parent) : AD_Core::AD_Core(QObject *parent) :
QThread(parent) QThread(parent)
{ {
step = 0; step = 0;
@@ -8,34 +8,75 @@ adCore::adCore(QObject *parent) :
//addata = new Game_Data(admap); //addata = new Game_Data(admap);
adloader = new Loader(); adloader = new Loader();
adloader->load("data2.xml"); adloader->load("data2.xml");
//adloader->save("data2.xml");
addata = adloader->loadlevel(1); addata = adloader->loadlevel(1);
if (addata != 0) qDebug("Sucsess"); if (addata != 0) qDebug("Sucsess");
else qDebug("Error"); else qFatal("Error");
//admap->load(); Player * pl1 = new Player(0);
//adload->create();
//adload->readAliens();
// Player * pl1 = new Player(0);
// Player * pl2 = new Player(0); // Player * pl2 = new Player(0);
// addata->players.push_back(pl1); addata->players.push_back(pl1);
// addata->players.push_back(pl2); // addata->players.push_back(pl2);
// adaliens = new Aliens(addata); adaliens = new Aliens(addata);
// adtowers = new Towers(addata); adtowers = new Towers(addata);
// adsplashes = new Splashes(addata); adsplashes = new Splashes(addata);
// connect(admap,SIGNAL(RecreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*))); connect(addata->map,SIGNAL(recreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
// adaliens->AddAlien(0); // adaliens->addAlien(0);
// adaliens->AddAlien(0); // adaliens->AddAlien(0);
// adaliens->AddAlien(0); // adaliens->AddAlien(0);
// for (int i=0; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++) // for (int i=0; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++)
// adtowers->AddTower(0,0,QPoint(i,i)); // adtowers->AddTower(0,0,QPoint(i,i));
// for (int i=0; i<admap->mapsize.height();i++) // for (int i=0; i<admap->mapsize.height();i++)
// adtowers->AddTower(1,0,QPoint(admap->mapsize.width()-2,i)); // adtowers->AddTower(1,0,QPoint(admap->mapsize.width()-2,i));
waveInProgress = false;
startTimer(50);
} }
void adCore::next() void AD_Core::next()
{ {
adtowers->update(); adtowers->update();
adsplashes->update(); adsplashes->update();
adaliens->update(); adaliens->update();
waveProcessing();
step++; step++;
} }
void AD_Core::timerEvent(QTimerEvent * )
{
next();
}
void AD_Core::nextWave()
{
if (waveInProgress) return;
if (addata->curWave >= addata->waves.size()) {
qDebug("level finished");
return;
}
//wavetime = addata->waves.at(addata->curWave).timeout;
qDebug() << tr("Next wave %1").arg(addata->curWave+1);
wavetime = 0;
waveInProgress = true;
}
void AD_Core::waveProcessing()
{
if (!waveInProgress) return;
if (wavetime <= 0) {
for (int i=0; i<addata->waves.at(addata->curWave).counts.size(); i++) {
if (addata->waves.at(addata->curWave).counts.at(i) > 0) {
adaliens->addAlien(addata->waves.at(addata->curWave).types.at(i));
addata->waves[addata->curWave].counts[i]--;
wavetime = addata->waves.at(addata->curWave).timeout;
return;
}
}
addata->curWave++;
waveInProgress = false;
} else {
wavetime--;
}
}

View File

@@ -8,22 +8,30 @@
#include "splashes.h" #include "splashes.h"
#include "loader.h" #include "loader.h"
class adCore : public QThread class AD_Core : public QThread
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit adCore(QObject *parent = 0); explicit AD_Core(QObject *parent = 0);
Game_Data * addata; Game_Data * addata;
Aliens * adaliens; Aliens * adaliens;
Towers * adtowers; Towers * adtowers;
Splashes * adsplashes; Splashes * adsplashes;
Loader * adloader; Loader * adloader;
unsigned int step; unsigned int step;
signals:
private:
void timerEvent(QTimerEvent * );
void waveProcessing();
bool waveInProgress;
int wavetime;
public slots: public slots:
void next(); void next();
private: void nextWave();
void addTower(QPoint pos) {adtowers->addTower(0, 0, pos);};
signals:
}; };
#endif // ADCORE_H #endif // ADCORE_H

Binary file not shown.

View File

@@ -6,7 +6,9 @@ HEADERS += base_types.h \
splashes.h \ splashes.h \
adcore.h \ adcore.h \
player.h \ player.h \
loader.h loader.h \
animation.h \
ad_graphics.h
SOURCES += map.cpp \ SOURCES += map.cpp \
game_data.cpp \ game_data.cpp \
aliens.cpp \ aliens.cpp \
@@ -15,14 +17,14 @@ SOURCES += map.cpp \
splashes.cpp \ splashes.cpp \
adcore.cpp \ adcore.cpp \
player.cpp \ player.cpp \
loader.cpp loader.cpp \
animation.cpp \
ad_graphics.cpp
RESOURCES += images.qrc RESOURCES += images.qrc
OTHER_FILES += map.conf \ OTHER_FILES += \
example16x16.map \
example16x12.map \
data.xml \ data.xml \
schema.xml \ schema.xml \
example16x16_64.map data2.xml
QT += core \ QT += core \
gui \ gui \
network \ network \

View File

@@ -16,76 +16,65 @@
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value> <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value> <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap"> <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap"> <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/> <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList">
<value type="QString">QMLINSPECTOR_PATH=/usr/share/qtcreator/qmljsdebugger</value>
</valuelist>
</valuemap> </valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap"> <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value> <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/> <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap> </valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value> <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap"> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Build</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value> <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"> <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value> <value type="QString">distclean</value>
</valuelist> </valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap> </valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value> <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Clean</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Отладка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap> </valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap"> <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value> <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/> <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Релиз</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Релиз</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value> <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value> <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/peri4/pprojects/aliendefender</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value> <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value> <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value> <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap> </valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value> <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Deploy</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">No deployment</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap"> <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">aliendefender</value> <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">aliendefender</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value> <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
@@ -96,8 +85,8 @@
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value> <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/> <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value> <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">true</value> <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString">C:\Users\Andrey\Desktop\aliendefender</value> <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap> </valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value> <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap> </valuemap>
@@ -106,8 +95,12 @@
<variable>ProjectExplorer.Project.TargetCount</variable> <variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value> <value type="int">1</value>
</data> </data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{4d5b06df-4184-42d4-9dfd-5c7caaa07ab2}</value>
</data>
<data> <data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">4</value> <value type="int">8</value>
</data> </data>
</qtcreator> </qtcreator>

View File

@@ -9,7 +9,7 @@ Aliens::Aliens(Game_Data *gd, QObject *parent) :
} }
void Aliens::AddAlien(int srcId) void Aliens::addAlien(int srcId)
{ {
if (srcId < 0 || srcId >= gameData->srcAliens.size()) if (srcId < 0 || srcId >= gameData->srcAliens.size())
{ {
@@ -19,12 +19,13 @@ void Aliens::AddAlien(int srcId)
AlienType al;// = gameData->srcAliens.at(srcId); AlienType al;// = gameData->srcAliens.at(srcId);
al.Id = nextId; al.Id = nextId;
al.src = srcId; al.src = srcId;
al.finish = gameData->map->Finishs().at(qrand()%gameData->map->Finishs().size()); al.finish = gameData->map->finishs().at(qrand()%gameData->map->finishs().size());
al.pos = QPointF(gameData->map->Starts().at(qrand()%gameData->map->Starts().size())); al.pos = QPointF(gameData->map->starts().at(qrand()%gameData->map->starts().size()));
al.path = gameData->map->CreatePath(al.pos.toPoint(),al.finish); al.path = gameData->map->createPath(al.pos.toPoint(),al.finish);
al.pathIndex = 1; al.pathIndex = 1;
al.animIndex = 0.f;
if (al.path.isEmpty()) qFatal("ERROR create path"); if (al.path.isEmpty()) qFatal("ERROR create path");
qDebug() << al.path; //qDebug() << al.path;
al.health = gameData->srcAliens.at(srcId).health; al.health = gameData->srcAliens.at(srcId).health;
al.speed = gameData->srcAliens.at(srcId).speed; al.speed = gameData->srcAliens.at(srcId).speed;
al.imgType = gameData->srcAliens.at(srcId).imgType; al.imgType = gameData->srcAliens.at(srcId).imgType;
@@ -40,14 +41,14 @@ void Aliens::retrace(bool * OK)
gameData->map->removeAliensPath(); gameData->map->removeAliensPath();
for (int i=0; i<gameData->curAliens.size(); i++) for (int i=0; i<gameData->curAliens.size(); i++)
{ {
gameData->curAliens.values()[i].path = gameData->map->CreatePath(gameData->curAliens.values()[i].pos.toPoint(),gameData->curAliens.values()[i].finish); gameData->curAliens.values()[i].path = gameData->map->createPath(gameData->curAliens.values()[i].pos.toPoint(),gameData->curAliens.values()[i].finish);
gameData->curAliens.values()[i].pathIndex = 1; gameData->curAliens.values()[i].pathIndex = 1;
if (gameData->curAliens.values()[i].path.isEmpty()) *OK = false; if (gameData->curAliens.values()[i].path.isEmpty()) *OK = false;
} }
} }
void Aliens::DelAlien(int Id) void Aliens::delAlien(int Id)
{ {
gameData->curAliens.remove(Id); gameData->curAliens.remove(Id);
} }
@@ -69,7 +70,7 @@ void Aliens::update()
al.pathIndex++; al.pathIndex++;
if (al.pathIndex >= al.path.size()) if (al.pathIndex >= al.path.size())
{ {
qDebug("Missing alien!"); qDebug() << tr("Missing aliens = %1!").arg(gameData->missingAliens);
missIndex.push_back(al.Id); missIndex.push_back(al.Id);
break; break;
} }
@@ -102,11 +103,11 @@ void Aliens::update()
-al.speed*std::cos(arctg)); -al.speed*std::cos(arctg));
//return true; //return true;
gameData->curAliens.insert(al.Id,al); gameData->curAliens.insert(al.Id,al);
qDebug() <<"alien"<< i << " path index" << al.pathIndex << " pos" << al.pos; //qDebug() <<"alien"<< i << " path index=" << al.pathIndex << ", pos=" << al.pos;
} }
for (int j=0; j<missIndex.size(); j++) for (int j=0; j<missIndex.size(); j++)
{ {
gameData->missingAliens++; gameData->missingAliens++;
DelAlien(missIndex.at(j)); delAlien(missIndex.at(j));
} }
} }

View File

@@ -9,13 +9,12 @@ class Aliens : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit Aliens(Game_Data * gd, QObject *parent = 0); explicit Aliens(Game_Data * gd, QObject *parent = 0);
void AddAlien(int srcId); void addAlien(int srcId);
void nextWave();
void update(); void update();
signals: signals:
public slots: public slots:
void DelAlien(int Id); void delAlien(int Id);
void retrace(bool * OK); void retrace(bool * OK);
private: private:
Game_Data * gameData; Game_Data * gameData;

23
animation.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "animation.h"
#include <QFile>
#include <QDebug>
Animation::Animation(const QString & path)
{
int i = 0;
QString s = path + QString::number(i) + ".png";
//qDebug() << "check " << s;
while (QFile::exists(s)) {
images.push_back(new QImage(s));
s = path + QString::number(++i) + ".png";
}
qDebug() << "found " << images.size() << " images";
}
Animation::~Animation()
{
}

19
animation.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef ANIMATION_H
#define ANIMATION_H
#include <QString>
#include <QImage>
class Animation
{
public:
explicit Animation(const QString & path);
~Animation();
QImage & at(int index) const {return *(images[index]);};
private:
QVector<QImage * > images;
};
#endif // ANIMATION_H

View File

@@ -14,20 +14,6 @@
#include <QRect> #include <QRect>
#include <QRectF> #include <QRectF>
struct AlienType
{
int Id; // uses for QHash
int src;
QPointF pos;
float angle; // -180 .. 180
float speed; // cells per tick (speed=1 is 60cells by 1 sec for 60fps e.g.)
float health;
QPoint finish;
QVector <QPointF> path;
int pathIndex;
int imgType;
};
struct srcAlienType struct srcAlienType
{ {
@@ -43,24 +29,19 @@ struct srcAlienType
}; };
struct TowerType struct AlienType
{ {
int Id; // uses for QHash
int src; int src;
int aim; // aim alien Id QPointF pos;
int oldAim;
int PlayerId; // tower's owner
int imgType;
QPoint pos; // not QPointF because tower fixed on grid
float angle; // -180 .. 180 float angle; // -180 .. 180
unsigned int reload; // time for reload in ticks float speed; // cells per tick (speed=1 is 60cells by 1 sec for 60fps e.g.)
unsigned int build; float health;
}; QPoint finish;
QVector <QPointF> path;
int pathIndex;
struct TriggerType int imgType;
{ float animIndex;
int src;
unsigned int timer;
}; };
@@ -80,7 +61,7 @@ struct srcTriggerType
allSide, allSide,
nearlestAlien nearlestAlien
}; };
int childId; // =-1 for non birth splash (e.q. only damage) int childId; // =-1 for none birth splash (e.q. only damage)
bool delParent; bool delParent;
float damage; float damage;
float radius; float radius;
@@ -91,6 +72,13 @@ struct srcTriggerType
}; };
struct TriggerType
{
int src;
unsigned int timer;
};
struct srcSplashType struct srcSplashType
{ {
QString name; QString name;
@@ -102,6 +90,21 @@ struct srcSplashType
}; };
struct SplashType
{
int Id;
int imgType;
int src;
QPoint TowerId; // parent tower (-1;-1) for null parent
int AlienId; // aim alien (different from tower.AlienId)
QPointF destination;
int life; // in ticks
float angle; // -180 .. 180
QPointF pos;
QList <TriggerType> triggers;
};
struct srcTowerType struct srcTowerType
{ {
QString name; QString name;
@@ -119,18 +122,17 @@ struct srcTowerType
}; };
struct SplashType struct TowerType
{ {
int Id;
int imgType;
int src; int src;
QPoint TowerId; // parent tower (-1;-1) for null parent int aim; // aim alien Id
int AlienId; // aim alien (different from tower.AlienId) int oldAim;
QPointF destination; int PlayerId; // tower's owner
int life; // in ticks int imgType;
QPoint pos; // not QPointF because tower fixed on grid
float angle; // -180 .. 180 float angle; // -180 .. 180
QPointF pos; unsigned int reload; // time for reload in ticks
QList <TriggerType> triggers; unsigned int build;
}; };

View File

@@ -1,36 +1,64 @@
<!DOCTYPE data> <!DOCTYPE data>
<ADdata> <ADdata>
<aliens> <aliens>
<alien flying="true" speed="0.03" imageType="31" prise="15" id="2" score="12" name="Monstr" health="150"/> <alien flying="true" speed="0.3" imageType="31" prise="15" id="2" score="12" name="Monstr" health="150"/>
<alien flying="true" speed="0.01" imageType="-1078580008" prise="1" id="4" score="10" name="test" health="60"/> <alien flying="true" speed="0.15" imageType="-1078580008" prise="1" id="4" score="10" name="test" health="60"/>
<alien speed="0.06" imageType="1" prise="4" id="10" score="99" name="first" health="100"/> <alien speed="0.6" imageType="1" prise="4" id="10" score="99" name="first" health="100"/>
<alien regeneration="3" speed="0.0099" imageType="1" prise="10" armor="1.5" id="12" score="99" name="MONSTR" health="99.99"/> <alien regeneration="3" speed="0.5" imageType="1" prise="10" armor="1.5" id="12" score="99" name="MONSTR" health="99.99"/>
</aliens> </aliens>
<maps> <maps>
<map width="16" imageType="1" height="16" id="1" data="AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=" name="My Map" maxPlayers="2"/> <map width="16" imageType="1" height="16" id="1" data="AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=" name="My Map" maxPlayers="2"/>
</maps> </maps>
<waves> <waves>
<wave prise="100" timeout="20000" id="1"/> <wave prise="100" timeout="5" id="1"/>
<wave prise="200" timeout="20000" id="2"/> <wave prise="200" timeout="5" id="2"/>
<wave prise="220" timeout="20000" id="3"/> <wave prise="220" timeout="5" id="3"/>
<wave prise="220" timeout="2" id="4"/>
<wave prise="220" timeout="1" id="5"/>
<wave prise="220" timeout="10" id="6"/>
<wave prise="220" timeout="1" id="7"/>
<wave prise="220" timeout="1" id="8"/>
<wave prise="220" timeout="1" id="9"/>
<wave prise="220" timeout="1" id="10"/>
<wave prise="220" timeout="5" id="11"/>
</waves> </waves>
<levels> <levels>
<level map="1" id="1" score="138978384" name="First Level"/> <level map="1" id="1" score="152654352" name="First Level"/>
</levels> </levels>
<waveParts> <waveParts>
<wavePart alien="10" count="10" wave="1"/> <wavePart alien="10" count="5" wave="1"/>
<wavePart alien="12" count="5" wave="1"/> <wavePart alien="12" count="6" wave="1"/>
<wavePart alien="10" count="4" wave="1"/> <wavePart alien="10" count="4" wave="1"/>
<wavePart alien="10" count="9" wave="2"/> <wavePart alien="10" count="9" wave="2"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="10" count="1" wave="3"/> <wavePart alien="10" count="1" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="2" count="20" wave="4"/>
<wavePart alien="4" count="6" wave="5"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="12" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
</waveParts> </waveParts>
<wavesOnLevels> <wavesOnLevels>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="1" level="1"/> <waveOnLevel wave="1" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="4" level="1"/>
<waveOnLevel wave="5" level="1"/>
<waveOnLevel wave="6" level="1"/>
</wavesOnLevels> </wavesOnLevels>
<splashes> <splashes>
<splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/> <splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/>
@@ -50,15 +78,15 @@
<trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/> <trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/>
</triggers> </triggers>
<chains> <chains>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="1" trigger="3" child="4" parent="1"/> <chain tower="1" trigger="3" child="4" parent="1"/>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="2" trigger="2" parent="3"/> <chain tower="2" trigger="2" parent="3"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
<chain tower="3" trigger="3" child="4" parent="2"/> <chain tower="3" trigger="3" child="4" parent="2"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
</chains> </chains>
<towersOnLevels> <towersOnLevels>
<towerOnLevel tower="3" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="1" level="1"/> <towerOnLevel tower="1" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="3" level="1"/>
</towersOnLevels> </towersOnLevels>
</ADdata> </ADdata>

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=

View File

@@ -1,5 +1,5 @@
<RCC> <RCC>
<qresource prefix="/aliens"> <qresource prefix="/images">
<file>images/Aliens/Al_00_0.png</file> <file>images/Aliens/Al_00_0.png</file>
<file>images/Aliens/Al_00_1.png</file> <file>images/Aliens/Al_00_1.png</file>
<file>images/Aliens/Al_00_2.png</file> <file>images/Aliens/Al_00_2.png</file>

View File

@@ -388,7 +388,7 @@ void Loader::fillTowerChains(QList <tbChain> * chlist, QList <int> * trigIds, sr
} }
} }
QString Loader::CreateMapExample() QString Loader::createMapExample()
{ {
QVector < QVector < int > > Cells; QVector < QVector < int > > Cells;
Cells.resize(16); Cells.resize(16);
@@ -448,11 +448,11 @@ void Loader::readAliens()
al.score = nm.namedItem("score").nodeValue().toInt(); al.score = nm.namedItem("score").nodeValue().toInt();
al.isFlying = (nm.namedItem("flying").nodeValue() == "true"); al.isFlying = (nm.namedItem("flying").nodeValue() == "true");
aliens.insert(al.id,al); aliens.insert(al.id,al);
qDebug() << tr("Alien %1 id=%2 health=%3 speed=%4 prise=%5 imgType=%6 armor=%7 regeneration=%8 score=%10").arg(al.name).arg(al.id).arg(al.health).arg(al.speed).arg(al.prise).arg(al.imgType).arg(al.armor).arg(al.regeneration).arg(al.score); //qDebug() << tr("Alien %1 id=%2 health=%3 speed=%4 prise=%5 imgType=%6 armor=%7 regeneration=%8 score=%10").arg(al.name).arg(al.id).arg(al.health).arg(al.speed).arg(al.prise).arg(al.imgType).arg(al.armor).arg(al.regeneration).arg(al.score);
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 aliens").arg(aliens.size()); qDebug() << tr("Found %1 aliens").arg(aliens.size());
qDebug("================"); //qDebug("================");
} }
@@ -469,11 +469,11 @@ void Loader::readWaves()
w.prise = nm.namedItem("prise").nodeValue().toInt(); w.prise = nm.namedItem("prise").nodeValue().toInt();
w.timeout = nm.namedItem("timeout").nodeValue().toInt(); w.timeout = nm.namedItem("timeout").nodeValue().toInt();
waves.insert(w.id,w); waves.insert(w.id,w);
qDebug() << tr("Wave %1 prise=%2 timeout=%3").arg(w.id).arg(w.prise).arg(w.timeout); //qDebug() << tr("Wave %1 prise=%2 timeout=%3").arg(w.id).arg(w.prise).arg(w.timeout);
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 waves").arg(waves.size()); qDebug() << tr("Found %1 waves").arg(waves.size());
qDebug("================"); //qDebug("================");
} }
@@ -502,12 +502,12 @@ void Loader::readWaveParts()
if (OK) if (OK)
{ {
waveParts.insert(wp.waveId,wp); waveParts.insert(wp.waveId,wp);
qDebug() << tr("Wave=%1 alien=%2 count=%3").arg(wp.waveId).arg(wp.alienId).arg(wp.count); //qDebug() << tr("Wave=%1 alien=%2 count=%3").arg(wp.waveId).arg(wp.alienId).arg(wp.count);
} }
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 waveParts").arg(waveParts.size()); qDebug() << tr("Found %1 waveParts").arg(waveParts.size());
qDebug("================"); //qDebug("================");
} }
@@ -550,12 +550,12 @@ void Loader::readChains()
if (OK) if (OK)
{ {
chains.insert(chain.towerId,chain); chains.insert(chain.towerId,chain);
qDebug() << tr("Tower=%1 parent=%2 child=%3 trigger=%4").arg(chain.towerId).arg(chain.parentSplashId).arg(chain.childSplashId).arg(chain.triggerId); //qDebug() << tr("Tower=%1 parent=%2 child=%3 trigger=%4").arg(chain.towerId).arg(chain.parentSplashId).arg(chain.childSplashId).arg(chain.triggerId);
} }
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 chains").arg(chains.size()); qDebug() << tr("Found %1 chains").arg(chains.size());
qDebug("================"); //qDebug("================");
} }
@@ -583,12 +583,12 @@ void Loader::readLevWaves()
if (OK) if (OK)
{ {
levWaves.insert(lw.levelId,lw); levWaves.insert(lw.levelId,lw);
qDebug() << tr("level=%1 wave=%2").arg(lw.levelId).arg(lw.waveId); //qDebug() << tr("level=%1 wave=%2").arg(lw.levelId).arg(lw.waveId);
} }
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 Waves On Level").arg(levWaves.size()); qDebug() << tr("Found %1 Waves On Level").arg(levWaves.size());
qDebug("================"); //qDebug("================");
} }
@@ -616,12 +616,12 @@ void Loader::readLevTowers()
if (OK) if (OK)
{ {
levTowers.insert(lt.levelId,lt); levTowers.insert(lt.levelId,lt);
qDebug() << tr("level=%1 tower=%2").arg(lt.levelId).arg(lt.towerId); //qDebug() << tr("level=%1 tower=%2").arg(lt.levelId).arg(lt.towerId);
} }
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 Towers On Level").arg(levTowers.size()); qDebug() << tr("Found %1 Towers On Level").arg(levTowers.size());
qDebug("================"); //qDebug("================");
} }
@@ -646,12 +646,12 @@ void Loader::readLevels()
if (OK) if (OK)
{ {
levels.insert(l.id,l); levels.insert(l.id,l);
qDebug() << tr("Level %1 id=%2 map=%3 ").arg(l.name).arg(l.id).arg(l.mapId); //qDebug() << tr("Level %1 id=%2 map=%3 ").arg(l.name).arg(l.id).arg(l.mapId);
} }
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 levels").arg(levels.size()); qDebug() << tr("Found %1 levels").arg(levels.size());
qDebug("================"); //qDebug("================");
} }
@@ -692,12 +692,12 @@ void Loader::readTriggers()
if (str == "nearlestAlien") if (str == "nearlestAlien")
trig.childAim = srcTriggerType::nearlestAlien; trig.childAim = srcTriggerType::nearlestAlien;
triggers.insert(trig.id,trig); triggers.insert(trig.id,trig);
qDebug() << tr("Trigger %1 id=%2 damage=%3 radius=%4 delParent=%5 timer=%6").arg(trig.name).arg(trig.id).arg(trig.damage).arg(trig.radius).arg(trig.delParent).arg(trig.timer) //qDebug() << tr("Trigger %1 id=%2 damage=%3 radius=%4 delParent=%5 timer=%6").arg(trig.name).arg(trig.id).arg(trig.damage).arg(trig.radius).arg(trig.delParent).arg(trig.timer)
<< tr("count=%1 chance=%2 randomPosRadius=%3 type=%4 childAim=%5").arg(trig.count).arg(trig.chance).arg(trig.randomPosRadius).arg(trig.type).arg(trig.childAim); // << tr("count=%1 chance=%2 randomPosRadius=%3 type=%4 childAim=%5").arg(trig.count).arg(trig.chance).arg(trig.randomPosRadius).arg(trig.type).arg(trig.childAim);
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 triggers").arg(triggers.size()); qDebug() << tr("Found %1 triggers").arg(triggers.size());
qDebug("================"); //qDebug("================");
} }
@@ -719,11 +719,11 @@ void Loader::readSplashes()
str = nm.namedItem("autoControl").nodeValue(); str = nm.namedItem("autoControl").nodeValue();
s.autoControl = (str == "true"); s.autoControl = (str == "true");
splashes.insert(s.id,s); splashes.insert(s.id,s);
qDebug() << tr("Splash %1 id=%2 speed=%3 imgType=%4 autoControl=%5 lifetime=%6").arg(s.name).arg(s.id).arg(s.speed).arg(s.imgType).arg(s.autoControl).arg(s.lifetime); //qDebug() << tr("Splash %1 id=%2 speed=%3 imgType=%4 autoControl=%5 lifetime=%6").arg(s.name).arg(s.id).arg(s.speed).arg(s.imgType).arg(s.autoControl).arg(s.lifetime);
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 splashes").arg(splashes.size()); qDebug() << tr("Found %1 splashes").arg(splashes.size());
qDebug("================"); //qDebug("================");
} }
@@ -756,13 +756,13 @@ void Loader::readTowers()
if (OK) if (OK)
{ {
towers.insert(tw.id,tw); towers.insert(tw.id,tw);
qDebug() << tr("Tower %1 id=%2 radius=%3 cost=%4 reload=%5 buildTime=%6 splash=%7").arg(tw.name).arg(tw.id).arg(tw.radius).arg(tw.cost).arg(tw.reload).arg(tw.buildTime).arg(tw.splashId) //qDebug() << tr("Tower %1 id=%2 radius=%3 cost=%4 reload=%5 buildTime=%6 splash=%7").arg(tw.name).arg(tw.id).arg(tw.radius).arg(tw.cost).arg(tw.reload).arg(tw.buildTime).arg(tw.splashId)
<< tr("imgType=%1 expByKill=%2 expByShot=%3 expByDamage=%4").arg(tw.imgType).arg(tw.expByKill).arg(tw.expByShot).arg(tw.expByDamage); // << tr("imgType=%1 expByKill=%2 expByShot=%3 expByDamage=%4").arg(tw.imgType).arg(tw.expByKill).arg(tw.expByShot).arg(tw.expByDamage);
} }
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 towers").arg(towers.size()); qDebug() << tr("Found %1 towers").arg(towers.size());
qDebug("================"); //qDebug("================");
} }
@@ -783,11 +783,11 @@ void Loader::readMaps()
m.size.setWidth(mn.namedItem("width").nodeValue().toInt()); m.size.setWidth(mn.namedItem("width").nodeValue().toInt());
m.size.setHeight(mn.namedItem("height").nodeValue().toInt()); m.size.setHeight(mn.namedItem("height").nodeValue().toInt());
maps.insert(m.id,m); maps.insert(m.id,m);
qDebug() << tr("Map %1 id=%2 imgType=%3 maxPlayers=%5 data=%6 ").arg(m.name).arg(m.id).arg(m.imgType).arg(m.maxPlayers).arg(QString(m.data)) << m.size; //qDebug() << tr("Map %1 id=%2 imgType=%3 maxPlayers=%5 data=%6 ").arg(m.name).arg(m.id).arg(m.imgType).arg(m.maxPlayers).arg(QString(m.data)) << m.size;
} }
qDebug("================"); //qDebug("================");
qDebug() << tr("Found %1 maps").arg(maps.size()); qDebug() << tr("Found %1 maps").arg(maps.size());
qDebug("================"); //qDebug("================");
} }

View File

@@ -179,7 +179,7 @@ private:
void fillTowerChains(QList <tbChain> * chlist, QList <int> * trigIds, srcTowerType * stt, int parId, int parIndex, int * recursiveCheck); void fillTowerChains(QList <tbChain> * chlist, QList <int> * trigIds, srcTowerType * stt, int parId, int parIndex, int * recursiveCheck);
void validate(QString filename); void validate(QString filename);
QString CreateMapExample(); QString createMapExample();
}; };
#endif // LOADER_H #endif // LOADER_H

View File

@@ -2,15 +2,17 @@
#include <QTimer> #include <QTimer>
#include "adcore.h" #include "adcore.h"
#include "ad_graphics.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
adCore core;
QApplication a(argc, argv); QApplication a(argc, argv);
AD_Core core;
AD_Graphics graphics(&core);
graphics.resize(800,600);
//QTimer * timer = new QTimer(); //QTimer * timer = new QTimer();
//QObject::connect(timer,SIGNAL(timeout()),&core,SLOT(next())); //QObject::connect(timer,SIGNAL(timeout()),&core,SLOT(next()));
//timer->start(100); //timer->start(100);
//return a.exec(); return a.exec();
return 0;
} }

View File

@@ -1,3 +0,0 @@
cells path = example16x16.map
max players = 2

41
map.cpp
View File

@@ -27,11 +27,12 @@ Map::Map(QByteArray data, QSize size, QString name, int maxPlayers, int image, Q
} }
for (int j=0; j<Cells[i].size(); j++) for (int j=0; j<Cells[i].size(); j++)
{ {
if (Cells[i][j]==Start) starts.push_back(QPoint(i,j)); if (Cells[i][j]==Start) Starts.push_back(QPoint(i,j));
if (Cells[i][j]==Finish) finishs.push_back(QPoint(i,j)); if (Cells[i][j]==Finish) Finishs.push_back(QPoint(i,j));
} }
} }
if (starts.isEmpty() || finishs.isEmpty()) qFatal("invalid map, not found start/finish"); mapSize.setHeight(chei);
if (Starts.isEmpty() || Finishs.isEmpty()) qFatal("invalid map, not found start/finish");
// TODO: check for maxPlayers // TODO: check for maxPlayers
players = maxPlayers; players = maxPlayers;
imageType = image; imageType = image;
@@ -91,9 +92,9 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
{ {
Cells[pos.x()][pos.y()]=PlayerTower-playerId; Cells[pos.x()][pos.y()]=PlayerTower-playerId;
bool ok=true; bool ok=true;
for (int i=0; i<starts.size(); i++) for (int i=0; i<Starts.size(); i++)
for (int j=0; j<finishs.size(); j++) for (int j=0; j<Finishs.size(); j++)
if (WaveTrace(starts.at(i),finishs.at(j))<0) ok = false; if (waveTrace(Starts.at(i),Finishs.at(j))<0) ok = false;
qDebug()<<"ok="<<ok; qDebug()<<"ok="<<ok;
if (!ok) if (!ok)
{ {
@@ -105,12 +106,12 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
pathOK = new bool(); pathOK = new bool();
*pathOK = true; *pathOK = true;
qDebug("emit"); qDebug("emit");
emit RecreateAlienPath(pathOK); emit recreateAlienPath(pathOK);
qDebug() << *pathOK; qDebug() << *pathOK;
if (!pathOK) if (!pathOK)
{ {
Cells[pos.x()][pos.y()]=PlayerAlien+playerId; Cells[pos.x()][pos.y()]=PlayerAlien+playerId;
emit RecreateAlienPath(pathOK); emit recreateAlienPath(pathOK);
return false; return false;
} }
return true; return true;
@@ -166,7 +167,7 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
//} //}
QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish) QVector<QPointF> Map::createPath(QPoint start, QPoint finish)
{ {
QPointF tp; QPointF tp;
QVector<QPoint> srcPath; QVector<QPoint> srcPath;
@@ -175,7 +176,7 @@ QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish)
//PathIndex = 1; //PathIndex = 1;
if (Cells[start.x()][start.y()] < 0) qDebug("ERROR invalid start"),exit(-1); if (Cells[start.x()][start.y()] < 0) qDebug("ERROR invalid start"),exit(-1);
if (Cells[finish.x()][finish.y()] < 0) qDebug("ERROR invalid finish"),exit(-1); if (Cells[finish.x()][finish.y()] < 0) qDebug("ERROR invalid finish"),exit(-1);
srcPath = InvWaveTrace(finish,WaveTrace(start,finish)); srcPath = invWaveTrace(finish,waveTrace(start,finish));
for (int i=0; i<srcPath.size();i++) for (int i=0; i<srcPath.size();i++)
{ {
int x = Cells.at(srcPath.at(i).x()).at(srcPath.at(i).y()); int x = Cells.at(srcPath.at(i).x()).at(srcPath.at(i).y());
@@ -218,7 +219,7 @@ QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish)
} }
int Map::WaveTrace(QPoint start, QPoint finish) int Map::waveTrace(QPoint start, QPoint finish)
{ {
bool stop = false; bool stop = false;
int step = 2; int step = 2;
@@ -251,31 +252,39 @@ int Map::WaveTrace(QPoint start, QPoint finish)
} }
tp.setX(cp.x() - 1); tp.setX(cp.x() - 1);
tp.setY(cp.y()); tp.setY(cp.y());
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
}
tp.setX(cp.x() + 1); tp.setX(cp.x() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
}
tp.setX(cp.x()); tp.setX(cp.x());
tp.setY(cp.y() - 1); tp.setY(cp.y() - 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
}
tp.setY(cp.y() + 1); tp.setY(cp.y() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp)) {
if (TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
} }
}
step++; step++;
} }
qDebug() << "trace false"; qDebug() << "trace false";
@@ -284,7 +293,7 @@ int Map::WaveTrace(QPoint start, QPoint finish)
} }
QVector<QPoint> Map::InvWaveTrace(QPoint finish, int cnt) QVector<QPoint> Map::invWaveTrace(QPoint finish, int cnt)
{ {
QPoint wp, Ppnt; QPoint wp, Ppnt;
QVector<QPoint> alpath; QVector<QPoint> alpath;

21
map.h
View File

@@ -35,14 +35,15 @@ public:
bool isFreePlace(QPoint pos); bool isFreePlace(QPoint pos);
void delTowerOnMap(QPoint pos); void delTowerOnMap(QPoint pos);
void removeAliensPath(); void removeAliensPath();
QVector <QPointF> CreatePath(QPoint start, QPoint finish); QVector <QPointF> createPath(QPoint start, QPoint finish);
QRect Rect() const {return QRect(QPoint(),mapSize);} QRect rect() const {return QRect(QPoint(),mapSize);}
// QString name() const {return mapName;} // QString name() const {return mapName;}
QList <QPoint> Starts() const {return starts;} QList <QPoint> starts() const {return Starts;}
QList <QPoint> Finishs() const {return finishs;} QList <QPoint> finishs() const {return Finishs;}
int Image() const {return imageType;} QVector < QVector <int> > cells() const {return Cells;}
int image() const {return imageType;}
signals: signals:
void RecreateAlienPath(bool * pathOK); void recreateAlienPath(bool * pathOK);
public slots: public slots:
void printMap(); void printMap();
@@ -52,13 +53,13 @@ private:
int players; int players;
int imageType; int imageType;
QVector < QVector <int> > Cells; QVector < QVector <int> > Cells;
QList <QPoint> starts; QList <QPoint> Starts;
QList <QPoint> finishs; QList <QPoint> Finishs;
QVector < QVector <int> > TmpCells; QVector < QVector <int> > TmpCells;
QVector<QPoint> InvWaveTrace(QPoint finish, int cnt); QVector<QPoint> invWaveTrace(QPoint finish, int cnt);
int WaveTrace(QPoint start, QPoint finish); int waveTrace(QPoint start, QPoint finish);
//void CreateMapExample(); //void CreateMapExample();
//void ReadSettings(); //void ReadSettings();
}; };

View File

@@ -9,7 +9,7 @@ Splashes::Splashes(Game_Data *gd, QObject *parent) :
} }
bool Splashes::AddSplash(int srcId, QPointF pos) bool Splashes::addSplash(int srcId, QPointF pos)
{ {
if (srcId < 0 || srcId >= gameData->srcSplashes.size()) if (srcId < 0 || srcId >= gameData->srcSplashes.size())
{ {
@@ -23,7 +23,7 @@ bool Splashes::AddSplash(int srcId, QPointF pos)
spl.TowerId = QPoint(-1,-1); spl.TowerId = QPoint(-1,-1);
spl.life = 0; spl.life = 0;
spl.imgType = src.imgType; spl.imgType = src.imgType;
if (!gameData->map->Rect().contains(pos.toPoint())) if (!gameData->map->rect().contains(pos.toPoint()))
{ {
qCritical("ERROR splash out of map size"); qCritical("ERROR splash out of map size");
return false; return false;
@@ -33,7 +33,7 @@ bool Splashes::AddSplash(int srcId, QPointF pos)
spl.angle = 0; spl.angle = 0;
spl.destination = pos; spl.destination = pos;
TriggerType trig; TriggerType trig;
for(int i; i<src.triggerIndexes.size(); i++) for(int i=0; i<src.triggerIndexes.size(); i++)
{ {
trig.timer = gameData->srTriggers.at(src.triggerIndexes.at(i)).timer; trig.timer = gameData->srTriggers.at(src.triggerIndexes.at(i)).timer;
trig.src = src.triggerIndexes.at(i); trig.src = src.triggerIndexes.at(i);
@@ -45,7 +45,7 @@ bool Splashes::AddSplash(int srcId, QPointF pos)
} }
void Splashes::AddSplash(srcSplashType src, int index, TowerType tw) void Splashes::addSplash(srcSplashType src, int index, TowerType tw)
{ {
SplashType spl; SplashType spl;
spl.Id = nextId; spl.Id = nextId;
@@ -63,7 +63,7 @@ void Splashes::AddSplash(srcSplashType src, int index, TowerType tw)
spl.life = 0; spl.life = 0;
spl.src = index; spl.src = index;
TriggerType trig; TriggerType trig;
for(int i; i<src.triggerIndexes.size(); i++) for(int i=0; i<src.triggerIndexes.size(); i++)
{ {
trig.timer = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src).triggers.at(src.triggerIndexes.at(i)).timer; trig.timer = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src).triggers.at(src.triggerIndexes.at(i)).timer;
trig.src = src.triggerIndexes.at(i); trig.src = src.triggerIndexes.at(i);
@@ -76,13 +76,13 @@ void Splashes::AddSplash(srcSplashType src, int index, TowerType tw)
void Splashes::update() void Splashes::update()
{ {
for (int i; i<gameData->curSplashes.size(); i++) for (int i=0; i<gameData->curSplashes.size(); i++)
{ {
SplashType spl = gameData->curSplashes.values().at(i); SplashType spl = gameData->curSplashes.values().at(i);
bool isTowerSplash = false; bool isTowerSplash = false;
srcSplashType src; srcSplashType src;
TowerType tw; TowerType tw;
if (gameData->map->Rect().contains(spl.TowerId)) if (gameData->map->rect().contains(spl.TowerId))
{ {
if (gameData->curTowers.contains(spl.TowerId)) if (gameData->curTowers.contains(spl.TowerId))
{ {

View File

@@ -8,13 +8,13 @@ class Splashes : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit Splashes(Game_Data * gd, QObject *parent = 0); explicit Splashes(Game_Data * gd, QObject *parent = 0);
bool AddSplash(int srcId, QPointF pos); bool addSplash(int srcId, QPointF pos);
void DelSplash(int Id); void delSplash(int Id);
void update(); void update();
signals: signals:
public slots: public slots:
void AddSplash(srcSplashType src, int index, TowerType tw); void addSplash(srcSplashType src, int index, TowerType tw);
private: private:
Game_Data *gameData; Game_Data *gameData;

View File

@@ -6,7 +6,7 @@ Towers::Towers(Game_Data *gd, QObject *parent) :
gameData = gd; gameData = gd;
} }
bool Towers::AddTower(int playerId, int srcId, QPoint pos) bool Towers::addTower(int playerId, int srcId, QPoint pos)
{ {
//QByteArray ar; //QByteArray ar;
//ar << pos; //ar << pos;
@@ -40,7 +40,7 @@ bool Towers::AddTower(int playerId, int srcId, QPoint pos)
} }
void Towers::DelTower(QPoint pos) void Towers::delTower(QPoint pos)
{ {
gameData->curTowers.remove(pos); gameData->curTowers.remove(pos);
} }
@@ -48,7 +48,7 @@ void Towers::DelTower(QPoint pos)
void Towers::update() void Towers::update()
{ {
for (int i; i<gameData->curTowers.size(); i++) for (int i=0; i<gameData->curTowers.size(); i++)
{ {
TowerType tw = gameData->curTowers.values().at(i); TowerType tw = gameData->curTowers.values().at(i);
srcTowerType stw = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src); srcTowerType stw = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src);

View File

@@ -8,8 +8,8 @@ class Towers : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit Towers(Game_Data * gd, QObject *parent = 0); explicit Towers(Game_Data * gd, QObject *parent = 0);
bool AddTower(int playerId, int srcId, QPoint pos); bool addTower(int playerId, int srcId, QPoint pos);
void DelTower(QPoint pos); void delTower(QPoint pos);
void update(); void update();
signals: signals:
void shot(srcSplashType src, int index, TowerType tw); void shot(srcSplashType src, int index, TowerType tw);