its just a test, wait a week...

This commit is contained in:
andrey
2010-02-03 09:10:40 +03:00
parent 835518ce1a
commit d20473731f
72 changed files with 679 additions and 37791 deletions

View File

@@ -2,9 +2,6 @@ hello
this is the source code of wavetrace(base part of game) this is the source code of wavetrace(base part of game)
to compilling this code you must have QT4 library and gcc compiller to compilling this code you must have QT4 library and gcc compiller
to make this project you cad do: to make this project you cad do:
$ qmake
$ make clean
$ make distclean
$ qmake $ qmake
$ make $ make
or open the aliendefender.pro file in Qt-Creator and run aplication. or open the aliendefender.pro file in Qt-Creator and run aplication.

293
Makefile
View File

@@ -1,293 +0,0 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? ????. 12 14:04:38 2009
# Project: aliendefender.pro
# Template: app
# Command: /usr/bin/qmake -Wall -spec ../../share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I../../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 -I/usr/include -I. -I.
LINK = g++
LFLAGS =
LIBS = $(SUBLIBS) -L/usr/lib/qt4 -L/usr/X11R6/lib -lQtOpenGL -L/usr/lib/qt4 -L/usr/X11R6/lib -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -lQtGui -pthread -lpng -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lXrandr -lXinerama -lfontconfig -lXext -lX11 -lQtNetwork -pthread -pthread -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lGLU -lGL -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
SED = sed
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
INSTALL_FILE = install -m 644 -p
INSTALL_DIR = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE = rm -f
SYMLINK = ln -sf
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp moc_mainwindow.cpp \
moc_udpsender.cpp \
qrc_res.cpp
OBJECTS = main.o \
mainwindow.o \
adpainter.o \
aliens.o \
udpsender.o \
towers.o \
moc_mainwindow.o \
moc_udpsender.o \
qrc_res.o
DIST = ../../share/qt4/mkspecs/common/g++.conf \
../../share/qt4/mkspecs/common/unix.conf \
../../share/qt4/mkspecs/common/linux.conf \
../../share/qt4/mkspecs/qconfig.pri \
../../share/qt4/mkspecs/features/qt_functions.prf \
../../share/qt4/mkspecs/features/qt_config.prf \
../../share/qt4/mkspecs/features/exclusive_builds.prf \
../../share/qt4/mkspecs/features/default_pre.prf \
../../share/qt4/mkspecs/features/debug.prf \
../../share/qt4/mkspecs/features/default_post.prf \
../../share/qt4/mkspecs/features/warn_on.prf \
../../share/qt4/mkspecs/features/qt.prf \
../../share/qt4/mkspecs/features/unix/opengl.prf \
../../share/qt4/mkspecs/features/unix/thread.prf \
../../share/qt4/mkspecs/features/moc.prf \
../../share/qt4/mkspecs/features/resources.prf \
../../share/qt4/mkspecs/features/uic.prf \
../../share/qt4/mkspecs/features/yacc.prf \
../../share/qt4/mkspecs/features/lex.prf \
../../share/qt4/mkspecs/features/include_source_dir.prf \
aliendefender.pro
QMAKE_TARGET = aliendefender
DESTDIR =
TARGET = aliendefender
first: all
####### Implicit rules
.SUFFIXES: .o .c .cpp .cc .cxx .C
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
####### Build rules
all: Makefile $(TARGET)
$(TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: aliendefender.pro ../../share/qt4/mkspecs/linux-g++/qmake.conf ../../share/qt4/mkspecs/common/g++.conf \
../../share/qt4/mkspecs/common/unix.conf \
../../share/qt4/mkspecs/common/linux.conf \
../../share/qt4/mkspecs/qconfig.pri \
../../share/qt4/mkspecs/features/qt_functions.prf \
../../share/qt4/mkspecs/features/qt_config.prf \
../../share/qt4/mkspecs/features/exclusive_builds.prf \
../../share/qt4/mkspecs/features/default_pre.prf \
../../share/qt4/mkspecs/features/debug.prf \
../../share/qt4/mkspecs/features/default_post.prf \
../../share/qt4/mkspecs/features/warn_on.prf \
../../share/qt4/mkspecs/features/qt.prf \
../../share/qt4/mkspecs/features/unix/opengl.prf \
../../share/qt4/mkspecs/features/unix/thread.prf \
../../share/qt4/mkspecs/features/moc.prf \
../../share/qt4/mkspecs/features/resources.prf \
../../share/qt4/mkspecs/features/uic.prf \
../../share/qt4/mkspecs/features/yacc.prf \
../../share/qt4/mkspecs/features/lex.prf \
../../share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/qt4/libQtOpenGL.prl \
/usr/lib/qt4/libQtGui.prl \
/usr/lib/qt4/libQtCore.prl \
/usr/lib/qt4/libQtNetwork.prl
$(QMAKE) -Wall -spec ../../share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
../../share/qt4/mkspecs/common/g++.conf:
../../share/qt4/mkspecs/common/unix.conf:
../../share/qt4/mkspecs/common/linux.conf:
../../share/qt4/mkspecs/qconfig.pri:
../../share/qt4/mkspecs/features/qt_functions.prf:
../../share/qt4/mkspecs/features/qt_config.prf:
../../share/qt4/mkspecs/features/exclusive_builds.prf:
../../share/qt4/mkspecs/features/default_pre.prf:
../../share/qt4/mkspecs/features/debug.prf:
../../share/qt4/mkspecs/features/default_post.prf:
../../share/qt4/mkspecs/features/warn_on.prf:
../../share/qt4/mkspecs/features/qt.prf:
../../share/qt4/mkspecs/features/unix/opengl.prf:
../../share/qt4/mkspecs/features/unix/thread.prf:
../../share/qt4/mkspecs/features/moc.prf:
../../share/qt4/mkspecs/features/resources.prf:
../../share/qt4/mkspecs/features/uic.prf:
../../share/qt4/mkspecs/features/yacc.prf:
../../share/qt4/mkspecs/features/lex.prf:
../../share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/qt4/libQtOpenGL.prl:
/usr/lib/qt4/libQtGui.prl:
/usr/lib/qt4/libQtCore.prl:
/usr/lib/qt4/libQtNetwork.prl:
qmake: FORCE
@$(QMAKE) -Wall -spec ../../share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
dist:
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents mainwindow.h adpainter.h aliens.h basestruct.h udpsender.h towers.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents res.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp adpainter.cpp aliens.cpp udpsender.cpp towers.cpp .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .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
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
####### Sub-libraries
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) Makefile
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: moc_mainwindow.cpp moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_mainwindow.cpp moc_udpsender.cpp
moc_mainwindow.cpp: adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
mainwindow.h
/usr/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
moc_udpsender.cpp: udpsender.h
/usr/bin/moc $(DEFINES) $(INCPATH) udpsender.h -o moc_udpsender.cpp
compiler_rcc_make_all: qrc_res.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_res.cpp
qrc_res.cpp: res.qrc \
images/Aliens/Al_0_5.png \
images/Aliens/Al_0_1.png \
images/Aliens/Al_0_9.png \
images/Aliens/Al_0_19.png \
images/Aliens/Al_0_15.png \
images/Aliens/Al_0_11.png \
images/Aliens/Al_0_4.png \
images/Aliens/Al_0_0.png \
images/Aliens/Al_0_8.png \
images/Aliens/Al_0_16.png \
images/Aliens/Al_0_12.png \
images/Aliens/Al_0_3.png \
images/Aliens/Al_0_7.png \
images/Aliens/Al_0_17.png \
images/Aliens/Al_0_13.png \
images/Aliens/Al_0_2.png \
images/Aliens/Al_0_6.png \
images/Aliens/Al_0_18.png \
images/Aliens/Al_0_14.png \
images/Aliens/Al_0_10.png
/usr/bin/rcc -name res res.qrc -o qrc_res.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
/usr/bin/uic mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
main.o: main.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
mainwindow.o: mainwindow.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
adpainter.o: adpainter.cpp adpainter.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o adpainter.o adpainter.cpp
aliens.o: aliens.cpp aliens.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aliens.o aliens.cpp
udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o udpsender.o udpsender.cpp
towers.o: towers.cpp towers.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o towers.o towers.cpp
moc_mainwindow.o: moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
moc_udpsender.o: moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_udpsender.o moc_udpsender.cpp
qrc_res.o: qrc_res.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_res.o qrc_res.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -1,216 +0,0 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? 6. ??? 19:08:54 2009
# Project: aliendefender.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -g -Wall $(DEFINES)
CXXFLAGS = -g -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"..\Qt\2009.03\qt\include\QtCore" -I"..\Qt\2009.03\qt\include\QtNetwork" -I"..\Qt\2009.03\qt\include\QtGui" -I"..\Qt\2009.03\qt\include\QtOpenGL" -I"..\Qt\2009.03\qt\include" -I"..\Qt\2009.03\qt\include\ActiveQt" -I"debug" -I"." -I"..\Qt\2009.03\qt\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L"d:\Qt\2009.03\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtOpenGLd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
QMAKE = d:\Qt\2009.03\qt\bin\qmake.exe
IDC = d:\Qt\2009.03\qt\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = debug
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp debug\moc_mainwindow.cpp \
debug\moc_udpsender.cpp \
debug\qrc_res.cpp
OBJECTS = debug/main.o \
debug/mainwindow.o \
debug/adpainter.o \
debug/aliens.o \
debug/udpsender.o \
debug/towers.o \
debug/moc_mainwindow.o \
debug/moc_udpsender.o \
debug/qrc_res.o
DIST =
QMAKE_TARGET = aliendefender
DESTDIR = debug\ #avoid trailing-slash linebreak
TARGET = aliendefender.exe
DESTDIR_TARGET = debug\aliendefender.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Debug $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)
qmake: FORCE
@$(QMAKE) -Wall -spec ..\Qt\2009.03\qt\mkspecs\win32-g++ -win32 -o Makefile.Debug aliendefender.pro
dist:
$(ZIP) aliendefender.zip $(SOURCES) $(DIST) aliendefender.pro ..\Qt\2009.03\qt\mkspecs\qconfig.pri ..\Qt\2009.03\qt\mkspecs\features\qt_functions.prf ..\Qt\2009.03\qt\mkspecs\features\qt_config.prf ..\Qt\2009.03\qt\mkspecs\features\exclusive_builds.prf ..\Qt\2009.03\qt\mkspecs\features\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\debug.prf ..\Qt\2009.03\qt\mkspecs\features\debug_and_release.prf ..\Qt\2009.03\qt\mkspecs\features\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\build_pass.prf ..\Qt\2009.03\qt\mkspecs\features\win32\rtti.prf ..\Qt\2009.03\qt\mkspecs\features\win32\exceptions.prf ..\Qt\2009.03\qt\mkspecs\features\win32\stl.prf ..\Qt\2009.03\qt\mkspecs\features\shared.prf ..\Qt\2009.03\qt\mkspecs\features\warn_on.prf ..\Qt\2009.03\qt\mkspecs\features\qt.prf ..\Qt\2009.03\qt\mkspecs\features\win32\opengl.prf ..\Qt\2009.03\qt\mkspecs\features\win32\thread.prf ..\Qt\2009.03\qt\mkspecs\features\moc.prf ..\Qt\2009.03\qt\mkspecs\features\win32\windows.prf ..\Qt\2009.03\qt\mkspecs\features\resources.prf ..\Qt\2009.03\qt\mkspecs\features\uic.prf ..\Qt\2009.03\qt\mkspecs\features\yacc.prf ..\Qt\2009.03\qt\mkspecs\features\lex.prf ..\Qt\2009.03\qt\mkspecs\features\include_source_dir.prf d:\Qt\2009.03\qt\lib\qtmaind.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) debug\main.o debug\mainwindow.o debug\adpainter.o debug\aliens.o debug\udpsender.o debug\towers.o debug\moc_mainwindow.o debug\moc_udpsender.o debug\qrc_res.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Debug
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: debug/moc_mainwindow.cpp debug/moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) debug\moc_mainwindow.cpp debug\moc_udpsender.cpp
debug/moc_mainwindow.cpp: adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
mainwindow.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o debug\moc_mainwindow.cpp
debug/moc_udpsender.cpp: udpsender.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 udpsender.h -o debug\moc_udpsender.cpp
compiler_rcc_make_all: debug/qrc_res.cpp
compiler_rcc_clean:
-$(DEL_FILE) debug\qrc_res.cpp
debug/qrc_res.cpp: res.qrc \
images/Aliens/Al_0_5.png \
images/Aliens/Al_0_1.png \
images/Aliens/Al_0_9.png \
images/Aliens/Al_0_19.png \
images/Aliens/Al_0_15.png \
images/Aliens/Al_0_11.png \
images/Aliens/Al_0_4.png \
images/Aliens/Al_0_0.png \
images/Aliens/Al_0_8.png \
images/Aliens/Al_0_16.png \
images/Aliens/Al_0_12.png \
images/Aliens/Al_0_3.png \
images/Aliens/Al_0_7.png \
images/Aliens/Al_0_17.png \
images/Aliens/Al_0_13.png \
images/Aliens/Al_0_2.png \
images/Aliens/Al_0_6.png \
images/Aliens/Al_0_18.png \
images/Aliens/Al_0_14.png \
images/Aliens/Al_0_10.png
d:\Qt\2009.03\qt\bin\rcc.exe -name res res.qrc -o debug\qrc_res.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
d:\Qt\2009.03\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
debug/main.o: main.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\main.o main.cpp
debug/mainwindow.o: mainwindow.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\mainwindow.o mainwindow.cpp
debug/adpainter.o: adpainter.cpp adpainter.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\adpainter.o adpainter.cpp
debug/aliens.o: aliens.cpp aliens.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\aliens.o aliens.cpp
debug/udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\udpsender.o udpsender.cpp
debug/towers.o: towers.cpp towers.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\towers.o towers.cpp
debug/moc_mainwindow.o: debug/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
debug/moc_udpsender.o: debug/moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_udpsender.o debug\moc_udpsender.cpp
debug/qrc_res.o: debug/qrc_res.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\qrc_res.o debug\qrc_res.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -1,216 +0,0 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? 6. ??? 19:08:54 2009
# Project: aliendefender.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -O2 -Wall $(DEFINES)
CXXFLAGS = -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"..\Qt\2009.03\qt\include\QtCore" -I"..\Qt\2009.03\qt\include\QtNetwork" -I"..\Qt\2009.03\qt\include\QtGui" -I"..\Qt\2009.03\qt\include\QtOpenGL" -I"..\Qt\2009.03\qt\include" -I"..\Qt\2009.03\qt\include\ActiveQt" -I"release" -I"." -I"..\Qt\2009.03\qt\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L"d:\Qt\2009.03\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain -lQtOpenGL4 -lQtGui4 -lQtNetwork4 -lQtCore4
QMAKE = d:\Qt\2009.03\qt\bin\qmake.exe
IDC = d:\Qt\2009.03\qt\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = release
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp release\moc_mainwindow.cpp \
release\moc_udpsender.cpp \
release\qrc_res.cpp
OBJECTS = release/main.o \
release/mainwindow.o \
release/adpainter.o \
release/aliens.o \
release/udpsender.o \
release/towers.o \
release/moc_mainwindow.o \
release/moc_udpsender.o \
release/qrc_res.o
DIST =
QMAKE_TARGET = aliendefender
DESTDIR = release\ #avoid trailing-slash linebreak
TARGET = aliendefender.exe
DESTDIR_TARGET = release\aliendefender.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Release $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)
qmake: FORCE
@$(QMAKE) -Wall -spec ..\Qt\2009.03\qt\mkspecs\win32-g++ -win32 -o Makefile.Release aliendefender.pro
dist:
$(ZIP) aliendefender.zip $(SOURCES) $(DIST) aliendefender.pro ..\Qt\2009.03\qt\mkspecs\qconfig.pri ..\Qt\2009.03\qt\mkspecs\features\qt_functions.prf ..\Qt\2009.03\qt\mkspecs\features\qt_config.prf ..\Qt\2009.03\qt\mkspecs\features\exclusive_builds.prf ..\Qt\2009.03\qt\mkspecs\features\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\release.prf ..\Qt\2009.03\qt\mkspecs\features\debug_and_release.prf ..\Qt\2009.03\qt\mkspecs\features\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\build_pass.prf ..\Qt\2009.03\qt\mkspecs\features\win32\rtti.prf ..\Qt\2009.03\qt\mkspecs\features\win32\exceptions.prf ..\Qt\2009.03\qt\mkspecs\features\win32\stl.prf ..\Qt\2009.03\qt\mkspecs\features\shared.prf ..\Qt\2009.03\qt\mkspecs\features\warn_on.prf ..\Qt\2009.03\qt\mkspecs\features\qt.prf ..\Qt\2009.03\qt\mkspecs\features\win32\opengl.prf ..\Qt\2009.03\qt\mkspecs\features\win32\thread.prf ..\Qt\2009.03\qt\mkspecs\features\moc.prf ..\Qt\2009.03\qt\mkspecs\features\win32\windows.prf ..\Qt\2009.03\qt\mkspecs\features\resources.prf ..\Qt\2009.03\qt\mkspecs\features\uic.prf ..\Qt\2009.03\qt\mkspecs\features\yacc.prf ..\Qt\2009.03\qt\mkspecs\features\lex.prf ..\Qt\2009.03\qt\mkspecs\features\include_source_dir.prf d:\Qt\2009.03\qt\lib\qtmain.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) release\main.o release\mainwindow.o release\adpainter.o release\aliens.o release\udpsender.o release\towers.o release\moc_mainwindow.o release\moc_udpsender.o release\qrc_res.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Release
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: release/moc_mainwindow.cpp release/moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) release\moc_mainwindow.cpp release\moc_udpsender.cpp
release/moc_mainwindow.cpp: adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
mainwindow.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o release\moc_mainwindow.cpp
release/moc_udpsender.cpp: udpsender.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 udpsender.h -o release\moc_udpsender.cpp
compiler_rcc_make_all: release/qrc_res.cpp
compiler_rcc_clean:
-$(DEL_FILE) release\qrc_res.cpp
release/qrc_res.cpp: res.qrc \
images/Aliens/Al_0_5.png \
images/Aliens/Al_0_1.png \
images/Aliens/Al_0_9.png \
images/Aliens/Al_0_19.png \
images/Aliens/Al_0_15.png \
images/Aliens/Al_0_11.png \
images/Aliens/Al_0_4.png \
images/Aliens/Al_0_0.png \
images/Aliens/Al_0_8.png \
images/Aliens/Al_0_16.png \
images/Aliens/Al_0_12.png \
images/Aliens/Al_0_3.png \
images/Aliens/Al_0_7.png \
images/Aliens/Al_0_17.png \
images/Aliens/Al_0_13.png \
images/Aliens/Al_0_2.png \
images/Aliens/Al_0_6.png \
images/Aliens/Al_0_18.png \
images/Aliens/Al_0_14.png \
images/Aliens/Al_0_10.png
d:\Qt\2009.03\qt\bin\rcc.exe -name res res.qrc -o release\qrc_res.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
d:\Qt\2009.03\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
release/main.o: main.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\main.o main.cpp
release/mainwindow.o: mainwindow.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\mainwindow.o mainwindow.cpp
release/adpainter.o: adpainter.cpp adpainter.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\adpainter.o adpainter.cpp
release/aliens.o: aliens.cpp aliens.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\aliens.o aliens.cpp
release/udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\udpsender.o udpsender.cpp
release/towers.o: towers.cpp towers.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\towers.o towers.cpp
release/moc_mainwindow.o: release/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_mainwindow.o release\moc_mainwindow.cpp
release/moc_udpsender.o: release/moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_udpsender.o release\moc_udpsender.cpp
release/qrc_res.o: release/qrc_res.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\qrc_res.o release\qrc_res.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -3,123 +3,160 @@
adpainter::adpainter(int width, int height, int adpcellsize) adpainter::adpainter(int width, int height, int adpcellsize)
{ {
cellsize = adpcellsize; QString str;
buff = new QPixmap(width,height); QPixmap tmpAlPixmap;
background = new QPixmap(width,height); int i=1;
pen = new QPen(); cellsize = adpcellsize;
brush = new QBrush(); buff = new QPixmap(width,height);
background = new QPixmap(width,height);
pen = new QPen();
brush = new QBrush();
str.setNum(i);
while (i != 0) {
str.setNum(i);
tmpAlPixmap.load("./images/Aliens/Al_00_" + str + ".png");
//qDebug() << tmpAlPixmap.isNull();
if (!tmpAlPixmap.isNull()) {
AlienPix.push_back(tmpAlPixmap);
tmpAlPixmap = 0;
i++;
}
else i = 0;
}
qDebug() << "pictures:" << AlienPix.size();
AnimAlien = 0;
StepAlien = 0;
} }
void adpainter::clear() void adpainter::clear()
{ {
painter.begin(background); painter.begin(background);
pen->setColor(QColor::fromRgb(qRgb(150,150,150))); pen->setColor(QColor::fromRgb(qRgb(150,150,150)));
painter.setPen(*pen); painter.setPen(*pen);
painter.fillRect(buff->rect(),QColor::fromRgb(qRgb(150,150,150))); painter.fillRect(buff->rect(),QColor::fromRgb(qRgb(150,150,150)));
painter.end(); painter.end();
} }
void adpainter::drawgrid() void adpainter::drawgrid()
{ {
int i; int i;
painter.begin(background); painter.begin(background);
pen->setColor(QColor::fromRgb(qRgb(100,100,100))); pen->setColor(QColor::fromRgb(qRgb(100,100,100)));
painter.setPen(*pen); painter.setPen(*pen);
for (i = 0;i<buff->width()/cellsize;i++) for (i = 0;i<buff->width()/cellsize;i++)
{ {
painter.drawLine(i*cellsize,0,i*cellsize,background->height()); painter.drawLine(i*cellsize,0,i*cellsize,background->height());
} }
for (i = 0;i<buff->height()/cellsize;i++) for (i = 0;i<buff->height()/cellsize;i++)
{ {
painter.drawLine(0,i*cellsize,background->width(),i*cellsize); painter.drawLine(0,i*cellsize,background->width(),i*cellsize);
} }
painter.end(); painter.end();
} }
void adpainter::drawAliens(Alien * al,QVector<QPixmap> * pixmaps) void adpainter::drawAliens(QVector<QPointF> path, FPVector * position)
{ {
//float tmpdx,tmpdy,arctg,tmpdx1,tmpdy1; float tmpdx,tmpdy,arctg,tmpdx1,tmpdy1;
//arctg = 0; //unsigned char dd[4];
QRectF rect; //int gg;
painter.begin(buff); arctg = 0;
pen->setColor(QColor::fromRgb(qRgb(80,200,100))); //qDebug() << path.size();
brush->setColor(QColor::fromRgb(qRgb(230,10,10))); //QTransform rotated;
brush->setStyle(Qt::SolidPattern); painter.begin(buff);
painter.setPen(*pen); pen->setColor(QColor::fromRgb(qRgb(80,200,100)));
painter.setBrush(*brush); brush->setColor(QColor::fromRgb(qRgb(230,10,10)));
painter.drawPixmap(0,0,*background); brush->setStyle(Qt::SolidPattern);
for (int i = 0; i < al->path.size(); i++){ painter.setPen(*pen);
rect.setRect(al->path[i].x() * cellsize +1, al->path[i].y() * cellsize +1, cellsize - 2, cellsize - 2); painter.setBrush(*brush);
painter.drawEllipse(rect); painter.drawPixmap(0,0,*background);
} for (int i = 0; i < path.size(); i++){
//tmpdx = position->pnt.x() - path.at(StepAlien).x()*cellsize; painter.drawEllipse(path[i].x() * cellsize +1, path[i].y() * cellsize +1, cellsize - 2, cellsize - 2);
//tmpdy = position->pnt.y() - path.at(StepAlien).y()*cellsize; }
//if (StepAlien + 1 < path.size()) { tmpdx = position->pnt.x() - path[StepAlien].x()*cellsize;
// tmpdx1 = position->pnt.x() - path.at(StepAlien+1).x()*cellsize; tmpdy = position->pnt.y() - path[StepAlien].y()*cellsize;
// tmpdy1 = position->pnt.y() - path.at(StepAlien+1).y()*cellsize; if (StepAlien + 1 < path.size()) {
//} tmpdx1 = position->pnt.x() - path[StepAlien+1].x()*cellsize;
//arctg = atanf(tmpdx1/tmpdy1); tmpdy1 = position->pnt.y() - path[StepAlien+1].y()*cellsize;
//position->angle = 180*(-arctg)/3.1415; }
//if (tmpdy1 < 0) position->angle = 180 + position->angle; arctg = atanf(tmpdx1/tmpdy1);
//if (AlienPix.size() > 0) { //memcpy(&gg,&arctg,4);
//qDebug() << "angle:" << position->angle; position->angle = 180*(-arctg)/3.1415;
/* if (qAbs(tmpdx) < 1 && qAbs(tmpdy) < 1) StepAlien++; if (tmpdy1 < 0) position->angle = 180 + position->angle;
else { if (AlienPix.size() > 0) {
if (qAbs(tmpdx) <= qAbs(tmpdy)) { //painter.rotate((arctg/3.1415)*180);
if (tmpdy < 0) position->pnt.ry()++; //rotated.rotateRadians(arctg/* + 3.1415/2*/);
else position->pnt.ry()--; //qDebug() << "angle:" << position->angle;
} //rotated.reset();
if (qAbs(tmpdx) >= qAbs(tmpdy)) { if (qAbs(tmpdx) < 1 && qAbs(tmpdy) < 1) StepAlien++;
if (tmpdx < 0) position->pnt.rx()++; else {
else position->pnt.rx()--; if (qAbs(tmpdx) <= qAbs(tmpdy)) {
} if (tmpdy < 0) {
}*/ position->pnt.ry()++;
painter.translate(al->Position.pnt.x()+cellsize/2, al->Position.pnt.y()+cellsize/2); //position->angle = - position->angle;
painter.rotate(al->Position.angle); }
painter.drawPixmap(-cellsize, -cellsize, cellsize*2, cellsize*2, pixmaps->at(al->PicIndex)); else {
//AnimAlien++; position->pnt.ry()--;
//if (AnimAlien >= AlienPix.size()) AnimAlien = 0; }
/*if (StepAlien >= path.size()) { }
StepAlien = 0; if (qAbs(tmpdx) >= qAbs(tmpdy)) {
position->pnt.setX(path.at(0).x()*cellsize); if (tmpdx < 0) {
position->pnt.setY(path.at(0).y()*cellsize); position->pnt.rx()++;
}*/ //position->angle = - position->angle;
//qDebug() << StepAlien; }
//} else position->pnt.rx()--;
painter.end(); }
}
//painter.save();
painter.translate(position->pnt.x()+cellsize/2, position->pnt.y()+cellsize/2);
//if (arctg == 0) painter.rotate(90);
//memcpy(dd,&gg,4);
//dd[0]=0xFF;
//qDebug() << "angle:" << position->angle;
//qDebug() << dd[0] << dd[1] << dd[2] << dd[3];
painter.rotate(position->angle);
//position->pnt.setX(path.at(0).x());
//position->pnt.setY(path.at(0).y());
painter.drawPixmap(-cellsize, -cellsize, cellsize*2, cellsize*2, AlienPix.at(AnimAlien));
AnimAlien++;
//painter.restore();
if (AnimAlien >= AlienPix.size()) AnimAlien = 0;
if (StepAlien >= path.size()) StepAlien = 0;
//qDebug() << StepAlien;
}
painter.end();
} }
void adpainter::drawcell(QPoint pnt) void adpainter::drawcell(QPoint pnt)
{ {
painter.begin(background); painter.begin(background);
pen->setColor(QColor::fromRgb(qRgb(0,0,0))); pen->setColor(QColor::fromRgb(qRgb(0,0,0)));
brush->setColor(QColor::fromRgb(qRgb(0,0,0))); brush->setColor(QColor::fromRgb(qRgb(0,0,0)));
brush->setStyle(Qt::SolidPattern); brush->setStyle(Qt::SolidPattern);
painter.setPen(*pen); painter.setPen(*pen);
painter.setBrush(*brush); painter.setBrush(*brush);
painter.drawRect(pnt.x()*cellsize+1,pnt.y()*cellsize+1,cellsize - 2, cellsize - 2); painter.drawRect(pnt.x()*cellsize+1,pnt.y()*cellsize+1,cellsize - 2, cellsize - 2);
painter.end(); painter.end();
} }
void adpainter::clearcell(QPoint pnt) void adpainter::clearcell(QPoint pnt)
{ {
painter.begin(background); painter.begin(background);
pen->setColor(QColor::fromRgb(qRgb(150,150,150))); pen->setColor(QColor::fromRgb(qRgb(150,150,150)));
brush->setColor(QColor::fromRgb(qRgb(150,150,150))); brush->setColor(QColor::fromRgb(qRgb(150,150,150)));
brush->setStyle(Qt::SolidPattern); brush->setStyle(Qt::SolidPattern);
painter.setPen(*pen); painter.setPen(*pen);
painter.setBrush(*brush); painter.setBrush(*brush);
painter.drawRect(pnt.x()*cellsize+1,pnt.y()*cellsize+1,cellsize - 2, cellsize - 2); painter.drawRect(pnt.x()*cellsize+1,pnt.y()*cellsize+1,cellsize - 2, cellsize - 2);
painter.end(); painter.end();
} }
QPixmap * adpainter::getPixmap() QPixmap * adpainter::getPixmap()
{ {
return buff; return buff;
} }

View File

@@ -3,6 +3,8 @@
#include "basestruct.h" #include "basestruct.h"
#include <cmath>
#include <QPainter> #include <QPainter>
#include <QTransform> #include <QTransform>
#include <QPaintEvent> #include <QPaintEvent>
@@ -15,23 +17,27 @@
#include <QPoint> #include <QPoint>
#include <QDebug> #include <QDebug>
using std::atan;
class adpainter class adpainter
{ {
public: public:
adpainter(int width, int height, int adpcellsize); adpainter(int width, int height, int adpcellsize);
void drawgrid(); void drawgrid();
void drawcell(QPoint pnt); void drawcell(QPoint pnt);
void clearcell(QPoint pnt); void clearcell(QPoint pnt);
void clear(); void clear();
QPixmap * getPixmap(); QPixmap * getPixmap();
void drawAliens(Alien * al, QVector<QPixmap> * pixmaps); void drawAliens(QVector<QPointF> path, FPVector * position);
int AnimAlien, StepAlien;
private: private:
QPixmap * buff; QPixmap * buff;
QPixmap * background; QPixmap * background;
QPainter painter; QPainter painter;
QPen * pen; QPen * pen;
QBrush * brush; QBrush * brush;
int cellsize; QVector<QPixmap> AlienPix;
int cellsize;
}; };

Binary file not shown.

Binary file not shown.

View File

@@ -1,21 +1,24 @@
# ------------------------------------------------- # -------------------------------------------------
# Project created by QtCreator 2009-08-17T19:38:55 # Project created by QtCreator 2009-08-17T19:38:55
# ------------------------------------------------- # -------------------------------------------------
QT += network \ QT += network \
opengl opengl
TARGET = aliendefender TARGET = aliendefender
TEMPLATE = app TEMPLATE = app
SOURCES += main.cpp \ SOURCES += main.cpp \
mainwindow.cpp \ mainwindow.cpp \
adpainter.cpp \ adpainter.cpp \
aliens.cpp \ aliens.cpp \
udpsender.cpp \ udpsender.cpp \
towers.cpp towers.cpp \
HEADERS += mainwindow.h \ map.cpp \
adpainter.h \ game.cpp
aliens.h \ HEADERS += mainwindow.h \
basestruct.h \ adpainter.h \
udpsender.h \ aliens.h \
towers.h basestruct.h \
FORMS += mainwindow.ui udpsender.h \
RESOURCES += res.qrc towers.h \
map.h \
game.h
FORMS += mainwindow.ui

View File

@@ -78,8 +78,7 @@
<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" >0</value>
<value key="addQDumper" type="" ></value> <value key="addQDumper" type="" ></value>
<value key="buildDirectory" type="QString" ></value> <value key="buildDirectory" type="QString" >/home/andrey/documents/sm11/Alien Defender/ad</value>
<value key="useShadowBuild" type="bool" >false</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
@@ -95,64 +94,47 @@
<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" >ANT_HOME=/usr/share/ant</value> <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-S5Q8zKlbhY,guid=6ef5dd4aeeaf9cb3055a39934b629f00</value>
<value type="QString" >CONFIG_PROTECT_MASK=/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-OomOx141X7,guid=4e8fac1ae1f40787aeb1f16e4aa53a4f</value>
<value type="QString" >DESKTOP_SESSION=gnome</value> <value type="QString" >DESKTOP_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value> <value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >EDITOR=/bin/nano</value>
<value type="QString" >GCC_SPECS=</value>
<value type="QString" >GDK_USE_XFT=1</value>
<value type="QString" >GDMSESSION=gnome</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" >GDM_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</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_SOCKET=/tmp/keyring-qB4w8J/socket</value> <value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-116Pb7/socket</value>
<value type="QString" >GTK_MODULES=canberra-gtk-module</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value> <value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</value> <value type="QString" >HOME=/home/andrey</value>
<value type="QString" >INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/info:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info</value>
<value type="QString" >JAVAC=/home/andrey/.gentoo/java-config-2/current-user-vm/bin/javac</value>
<value type="QString" >JAVA_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value>
<value type="QString" >JDK_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value>
<value type="QString" >LANG=ru_RU.UTF-8</value> <value type="QString" >LANG=ru_RU.UTF-8</value>
<value type="QString" >LESS=-R -M --shift 5</value> <value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString" >LESSOPEN=|lesspipe.sh %s</value>
<value type="QString" >LOGNAME=andrey</value> <value type="QString" >LOGNAME=andrey</value>
<value type="QString" >MANPATH=/home/andrey/.gentoo/java-config-2/current-user-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/man:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/man:/etc/java-config/system-vm/man/:/usr/qt/3/doc/man:/opt/opera/share/man</value>
<value type="QString" >OPENGL_PROFILE=xorg-x11</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value> <value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString" >PAGER=/usr/bin/less</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" >PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i486-pc-linux-gnu/gcc-bin/4.1.2:/usr/i686-pc-linux-gnu/gcc-bin/4.3.3:/usr/qt/3/bin:/usr/games/bin</value>
<value type="QString" >PWD=/home/andrey</value> <value type="QString" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</value> <value type="QString" >QTDIR=/usr</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/5720,unix/buull-eeePC:/tmp/.ICE-unix/5720</value> <value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1205,unix/buull-eeePC:/tmp/.ICE-unix/1205</value>
<value type="QString" >SHELL=/bin/bash</value> <value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value> <value type="QString" >SPEECHD_PORT=7560</value>
<value type="QString" >SSH_AGENT_PID=5745</value> <value type="QString" >SSH_AGENT_PID=1318</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-qB4w8J/socket.ssh</value> <value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-116Pb7/socket.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" >WINDOWPATH=7:7</value> <value type="QString" >XAUTHORITY=/var/run/gdm/auth-for-andrey-9AQSnh/database</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value> <value type="QString" >XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value> <value type="QString" >XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1264754424.556816-274237329</value>
<value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1252342350.758829-1556553659</value>
<value type="QString" >XSESSION=icewm</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >/home/andrey/aliendefender/aliendefender.pro</value> <value type="QString" >/home/andrey/documents/sm11/Alien Defender/ad/aliendefender.pro</value>
<value type="QString" >-spec</value> <value type="QString" >-spec</value>
<value type="QString" >/usr/share/qt4/mkspecs/linux-g++</value> <value type="QString" >/usr/share/qt4/mkspecs/linux-g++</value>
<value type="QString" >-r</value> <value type="QString" >-r</value>
<value type="QString" >CONFIG+=debug</value> <value type="QString" >CONFIG+=debug</value>
<value type="QString" >-Wall</value> <value type="QString" >-Wall</value>
</valuelist> </valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/qmake</value> <value key="abstractProcess.command" type="QString" >/usr/bin/qmake-qt4</value>
<value key="abstractProcess.enabled" type="bool" >false</value> <value key="abstractProcess.enabled" type="bool" >false</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/aliendefender</value> <value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/documents/sm11/Alien Defender/ad</value>
<value key="buildConfiguration" type="int" >2</value> <value key="buildConfiguration" type="int" >2</value>
<valuelist key="qmakeArgs" type="QVariantList" > <valuelist key="qmakeArgs" type="QVariantList" >
<value type="QString" >-Wall</value> <value type="QString" >-Wall</value>
@@ -164,52 +146,35 @@
<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" >ANT_HOME=/usr/share/ant</value> <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-S5Q8zKlbhY,guid=6ef5dd4aeeaf9cb3055a39934b629f00</value>
<value type="QString" >CONFIG_PROTECT_MASK=/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-OomOx141X7,guid=4e8fac1ae1f40787aeb1f16e4aa53a4f</value>
<value type="QString" >DESKTOP_SESSION=gnome</value> <value type="QString" >DESKTOP_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value> <value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >EDITOR=/bin/nano</value>
<value type="QString" >GCC_SPECS=</value>
<value type="QString" >GDK_USE_XFT=1</value>
<value type="QString" >GDMSESSION=gnome</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" >GDM_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</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_SOCKET=/tmp/keyring-qB4w8J/socket</value> <value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-116Pb7/socket</value>
<value type="QString" >GTK_MODULES=canberra-gtk-module</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value> <value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</value> <value type="QString" >HOME=/home/andrey</value>
<value type="QString" >INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/info:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info</value>
<value type="QString" >JAVAC=/home/andrey/.gentoo/java-config-2/current-user-vm/bin/javac</value>
<value type="QString" >JAVA_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value>
<value type="QString" >JDK_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value>
<value type="QString" >LANG=ru_RU.UTF-8</value> <value type="QString" >LANG=ru_RU.UTF-8</value>
<value type="QString" >LESS=-R -M --shift 5</value> <value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString" >LESSOPEN=|lesspipe.sh %s</value>
<value type="QString" >LOGNAME=andrey</value> <value type="QString" >LOGNAME=andrey</value>
<value type="QString" >MANPATH=/home/andrey/.gentoo/java-config-2/current-user-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/man:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/man:/etc/java-config/system-vm/man/:/usr/qt/3/doc/man:/opt/opera/share/man</value>
<value type="QString" >OPENGL_PROFILE=xorg-x11</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value> <value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString" >PAGER=/usr/bin/less</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" >PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i486-pc-linux-gnu/gcc-bin/4.1.2:/usr/i686-pc-linux-gnu/gcc-bin/4.3.3:/usr/qt/3/bin:/usr/games/bin</value>
<value type="QString" >PWD=/home/andrey</value> <value type="QString" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</value> <value type="QString" >QTDIR=/usr</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/5720,unix/buull-eeePC:/tmp/.ICE-unix/5720</value> <value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1205,unix/buull-eeePC:/tmp/.ICE-unix/1205</value>
<value type="QString" >SHELL=/bin/bash</value> <value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value> <value type="QString" >SPEECHD_PORT=7560</value>
<value type="QString" >SSH_AGENT_PID=5745</value> <value type="QString" >SSH_AGENT_PID=1318</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-qB4w8J/socket.ssh</value> <value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-116Pb7/socket.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" >WINDOWPATH=7:7</value> <value type="QString" >XAUTHORITY=/var/run/gdm/auth-for-andrey-9AQSnh/database</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value> <value type="QString" >XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value> <value type="QString" >XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1264754424.556816-274237329</value>
<value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1252342350.758829-1556553659</value>
<value type="QString" >XSESSION=icewm</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >-j3</value> <value type="QString" >-j3</value>
@@ -217,7 +182,7 @@
</valuelist> </valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/make</value> <value key="abstractProcess.command" type="QString" >/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool" >true</value> <value key="abstractProcess.enabled" type="bool" >true</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/aliendefender</value> <value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/documents/sm11/Alien Defender/ad</value>
<valuelist key="makeargs" type="QVariantList" > <valuelist key="makeargs" type="QVariantList" >
<value type="QString" >-j3</value> <value type="QString" >-j3</value>
</valuelist> </valuelist>
@@ -228,43 +193,43 @@
<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" >ALLUSERSPROFILE=C:\Documents and Settings\All Users</value> <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-S5Q8zKlbhY,guid=6ef5dd4aeeaf9cb3055a39934b629f00</value>
<value type="QString" >APPDATA=C:\Documents and Settings\Andrey\Application Data</value> <value type="QString" >DESKTOP_SESSION=gnome</value>
<value type="QString" >COMMONPROGRAMFILES=C:\Program Files\Common Files</value> <value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >COMPUTERNAME=COMP</value> <value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >COMSPEC=C:\WINDOWS\system32\cmd.exe</value> <value type="QString" >GDMSESSION=gnome</value>
<value type="QString" >FP_NO_HOST_CHECK=NO</value> <value type="QString" >GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString" >HOMEDRIVE=C:</value> <value type="QString" >GDM_LANG=ru_RU.UTF-8</value>
<value type="QString" >HOMEPATH=\Documents and Settings\Andrey</value> <value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString" >LOGONSERVER=\\COMP</value> <value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-116Pb7/socket</value>
<value type="QString" >NUMBER_OF_PROCESSORS=2</value> <value type="QString" >GTK_MODULES=canberra-gtk-module</value>
<value type="QString" >OS=Windows_NT</value> <value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >PATH=D:\Qt\2009.03\mingw\bin;D:\Qt\2009.03\qt\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem</value> <value type="QString" >HOME=/home/andrey</value>
<value type="QString" >PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH</value> <value type="QString" >LANG=ru_RU.UTF-8</value>
<value type="QString" >PROCESSOR_ARCHITECTURE=x86</value> <value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString" >PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel</value> <value type="QString" >LOGNAME=andrey</value>
<value type="QString" >PROCESSOR_LEVEL=6</value> <value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString" >PROCESSOR_REVISION=1706</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" >PROGRAMFILES=C:\Program Files</value> <value type="QString" >PWD=/home/andrey</value>
<value type="QString" >QTDIR=D:/Qt/2009.03/qt</value> <value type="QString" >QTDIR=/usr</value>
<value type="QString" >SESSIONNAME=Console</value> <value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1205,unix/buull-eeePC:/tmp/.ICE-unix/1205</value>
<value type="QString" >SYSTEMDRIVE=C:</value> <value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SYSTEMROOT=C:\WINDOWS</value> <value type="QString" >SPEECHD_PORT=7560</value>
<value type="QString" >TEMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value> <value type="QString" >SSH_AGENT_PID=1318</value>
<value type="QString" >TMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value> <value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-116Pb7/socket.ssh</value>
<value type="QString" >USERDOMAIN=COMP</value> <value type="QString" >USER=andrey</value>
<value type="QString" >USERNAME=Andrey</value> <value type="QString" >USERNAME=andrey</value>
<value type="QString" >USERPROFILE=C:\Documents and Settings\Andrey</value> <value type="QString" >XAUTHORITY=/var/run/gdm/auth-for-andrey-9AQSnh/database</value>
<value type="QString" >VS90COMNTOOLS=D:\Programming\Microsoft Visual Studio 9.0\Common7\Tools\</value> <value type="QString" >XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString" >WINDIR=C:\WINDOWS</value> <value type="QString" >XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1264754424.556816-274237329</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >clean</value> <value type="QString" >clean</value>
<value type="QString" >-w</value> <value type="QString" >-w</value>
</valuelist> </valuelist>
<value key="abstractProcess.command" type="QString" >D:/Qt/2009.03/mingw/bin/mingw32-make.exe</value> <value key="abstractProcess.command" type="QString" >/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool" >true</value> <value key="abstractProcess.enabled" type="bool" >true</value>
<value key="abstractProcess.workingDirectory" type="QString" >D:/aliendefender</value> <value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/documents/sm11/Alien Defender/ad</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>

View File

@@ -2,442 +2,306 @@
//using std::vector; //using std::vector;
Aliens::Aliens(int TmpDestx, int TmpDesty, int afw, int afh, int alcellsize) Aliens::Aliens(GameData *dataAliens)
{ {
cellsize = alcellsize; data = dataAliens;
DestPoint.setX(TmpDestx - 1); TmpCells = new int*[data->size.width()];
DestPoint.setY(TmpDesty); for (int i = 0; i < data->size.width(); i++) TmpCells[i] = new int[data->size.height()];
fw = afw;
fh = afh;
//AliensCnt = -1;
CurWave = -1;
Cells = new int*[fw];
TmpCells = new int*[fw];
for (int i = 0; i < fw; i++) {
Cells[i] = new int[fh];
TmpCells[i] = new int[fh];
}
clearCells();
Alien al;
al.PicType = 0;
al.PathIndex = 1;
al.PicIndex = 0;
al.PicFrame = 0;
al.Speed = 0.1;
loadPixmaps(&al);
srcAliens.push_back(al);
CurWave = 0;
} }
bool Aliens::loadPixmaps(Alien * al) /*int Aliens::loadAlienImages(int PicType)
{ {
bool load = true; int i = 1;
int i = 0; QString str1,str2;
while(load) { QPixmap tmpAlPixmap;
QVector<QPixmap> pixmaps; str1.setNum(i);
if (loadPixmap(i,&pixmaps) > 0) { str2.setNum(PicType);
AliensPixmaps.push_back(pixmaps); while (i != 0) {
i++; str1.setNum(i);
} tmpAlPixmap.load("./images/Aliens/Al_" + str2 + "_" + str1 + ".png");
else load = false; //qDebug() << tmpAlPixmap.isNull();
} if (!tmpAlPixmap.isNull()) {
qDebug() << "Pictures loaded for" << AliensPixmaps.size() << "alien types!"; //AlienPix.push_back(tmpAlPixmap);
if (AliensPixmaps.size() > 0) return true; tmpAlPixmap = 0;
else return false; i++;
} }
else i = 0;
}
int Aliens::loadPixmap(int PicType, QVector<QPixmap> * pixmaps) //qDebug() << "pictures:" << AlienPix.size();
{ return i;
int i = 1; }*/
QString str1,str2;
QPixmap tmpAlPixmap;
str1.setNum(i);
str2.setNum(PicType);
qDebug() << PicType;
while (i != 0) {
str1.setNum(i-1);
tmpAlPixmap.load(":/images/Aliens/Al_" + str2 + "_" + str1 + ".png");
if (!tmpAlPixmap.isNull()) {
pixmaps->push_back(tmpAlPixmap);
tmpAlPixmap = 0;
i++;
}
else i = 0;
}
qDebug() << "pictures:" << pixmaps->size();
return pixmaps->size();
}
void Aliens::clearCells()
{
for (int i = 0; i < fw; i++) for (int j = 0; j < fh; j++) Cells[i][j] = 0;
}
bool Aliens::AddAlien() bool Aliens::AddAlien()
{ {
//if (CurWave < 0) CurWave = 0; //bool ok;
curAliens.push_back(srcAliens.at(CurWave)); Alien al;
//curAliens[AliensCnt].Level = CurWave + 1; //AliensCnt++;
curAliens[curAliens.size()-1].Position.pnt.setX(0*cellsize); //if (CurWave < 0) CurWave = 0;
curAliens[curAliens.size()-1].Position.pnt.setY(fh/2*cellsize); //(int)(fh/2+(1-0.58)*6); //if (AliensCnt > curAliens.size()) ReDim Preserve Aliens(AliensCnt) As Alien
//DestPoint.setX(fw - 1); //Aliens(AliensCnt) = SrcAliens(CurWave)
//DestPoint.setY(fh / 2); //curAliens[AliensCnt].Position.pnt.y(); curAliens.push_back(al); //srcAliens[CurWave]);
curAliens[curAliens.size()-1].DestPnt = DestPoint; //curAliens[AliensCnt].Level = CurWave + 1;
for (int i = 0; i < fw; i++) { curAliens[0].Position.pnt = data->start*data->cellsize;
for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j]; ; //(int)(fh/2+(1-0.58)*6);
} //DestPoint.setX(fw - 1);
if (CreatePath(&curAliens[curAliens.size()-1])) { //DestPoint.setY(fh / 2); //curAliens[AliensCnt].Position.pnt.y();
curAliens[curAliens.size()-1].Position.pnt.setX( curAliens[0].DestPnt = data->finish;
curAliens[curAliens.size()-1].path[0].x()*cellsize); // curAliens[AliensCnt].MaxFrame = 0; //srcAliens[CurWave].MaxFrame;
curAliens[curAliens.size()-1].Position.pnt.setY( // curAliens[AliensCnt].PicFrame = 0;
curAliens[curAliens.size()-1].path[0].y()*cellsize); return CreatePath(&curAliens[0]);
return true;
}
return false;
} }
bool Aliens::CreatePath(Alien * al) bool Aliens::CreatePath(Alien * al)
{ {
QPointF tp; QPointF tp;
QVector<QPointF> tmpPnt; QVector<QPointF> tmpPnt;
if (WaveTrace(al)) //tmpPnt.clear();
{ // AliensTmpDestX = fw - 1;//al->Destpnt.x();
for (int j=0; j<4; j++) // AliensTmpDestY = fh / 2;//al->Destpnt.y();
{ // al->Position.pnt.x() = 0;
tmpPnt.clear(); // al->Position.pnt.y() = fh / 2;
tp = al->path[0]; for (int i = 0; i < data->size.width(); i++) {
//qDebug() << al->path.at(0); for (int j = 0; j < data->size.height(); j++) TmpCells[i][j] = data->Cells[i][j];
tmpPnt.push_back(tp); }
for (int i = 0; i < al->path.size() - 1; i++) al->path.clear();
{ al->PathIndex = 0;
tp.setX((al->path[i].x() + al->path[i + 1].x()) / 2.0); if (WaveTrace(al))
tp.setY((al->path[i].y() + al->path[i + 1].y()) / 2.0); {
tmpPnt.push_back(tp); for (int j=0; j<4; j++)
} {
tp = al->path[al->path.size() - 1]; tmpPnt.clear();
tmpPnt.push_back(tp); tp = al->path[0];
//qDebug() << tmpPnt.size(); tmpPnt.push_back(tp);
al->path = tmpPnt; for (int i = 0; i < al->path.size() - 1; i++)
} {
tmpPnt.clear(); tp.setX((al->path[i].x() + al->path[i + 1].x()) / 2);
return true; tp.setY((al->path[i].y() + al->path[i + 1].y()) / 2);
} tmpPnt.push_back(tp);
return false; }
} tp = al->path[al->path.size() - 1];
tmpPnt.push_back(tp);
qDebug() << tmpPnt.size();
void Aliens::updateAliens() al->path = tmpPnt;
{ //al->Position.pnt.setX(al->path[0].x()*data->cellsize);
qDebug("*********************"); //al->Position.pnt.setY(al->path[0].y()*data->cellsize);
//qDebug() << curAliens[0].path; }
for (int i = 0; i < curAliens.size(); i++) updateAlienPos(&curAliens[i]); tmpPnt.clear();
qDebug("*********************"); return true;
}
return false;
//return WaveTrace(al);
} }
void Aliens::updateAlienPos(Alien * al) void Aliens::updateAlienPos(Alien * al)
{ {
float arctg = 0;
float px,py,dk;
float dx,dy,fdx,fdy;
//qDebug() << cellsize;
px = al->path[al->PathIndex].x() - al->path[al->PathIndex - 1].x();
py = al->path[al->PathIndex].y() - al->path[al->PathIndex - 1].y();
dx = al->Position.pnt.x() - al->path[al->PathIndex].x() * cellsize;
dy = al->Position.pnt.y() - al->path[al->PathIndex].y() * cellsize;
dk = cellsize / sqrtf(px * px + py * py);
qDebug() << dx << ";" << dy;
qDebug() << px << ";" << py;
//qDebug() << al->path;//[al->PathIndex];
//qDebug() << al->path.size();
qDebug() << "PathIndex" << al->PathIndex;
//qDebug() << al->path[al->PathIndex-1];
if (al->PathIndex + 1 < al->path.size()) {
fdx = al->Position.pnt.x() - al->path[al->PathIndex+1].x() * cellsize;
fdy = al->Position.pnt.y() - al->path[al->PathIndex+1].y() * cellsize;
if (fdy != 0) arctg = atanf(fdx/fdy);
else if (fdx < 0) arctg = -3.1415/2;
else arctg = 3.1415/2;
}
//qDebug() << fdx << ";" << fdy;
al->Position.angle = 180*(-arctg)/3.1415;
if (fdy < 0) al->Position.angle = 180 + al->Position.angle;
//qDebug() << al->Position.angle;
qDebug() << al->Position.pnt;
if (qAbs(dx) <= al->Speed * dk && qAbs(dy) <= al->Speed * dk) {
qDebug("next");
al->Position.pnt.setX(al->path[al->PathIndex].x() * cellsize);
al->Position.pnt.setY(al->path[al->PathIndex].y() * cellsize);
al->PathIndex++;
}
else {
qDebug("go");
al->Position.pnt.setX(al->Position.pnt.x()+px * al->Speed * dk);
al->Position.pnt.setY(al->Position.pnt.y()+py * al->Speed * dk);
}
qDebug() << al->Position.pnt;
al->PicIndex++;
//qDebug() << "PicIndex" << al->PicIndex;
//qDebug() << "PicType" << al->PicType;
//qDebug() << AliensPixmaps[al->PicType].size();
if (al->PicIndex >= AliensPixmaps[al->PicType].size()) al->PicIndex = 0;
if (al->PathIndex >= al->path.size()) {
//qDebug() << "run agan";
al->PathIndex = 1;
al->Position.pnt.setX(al->path.value(0).x()*cellsize);
al->Position.pnt.setY(al->path.value(0).y()*cellsize);
}
} }
/*bool Aliens::PathIntersect(Alien* Al, Rectangle rect) /*bool Aliens::PathIntersect(Alien* Al, Rectangle rect)
{ {
//PathIntersect = False //PathIntersect = False
for (int i = Al->PathIndex; i<=Al->path.size(); i++) // To UBound(Al.path(), 1) for (int i = Al->PathIndex; i<=Al->path.size(); i++) // To UBound(Al.path(), 1)
if (Al->path[i].x + 0.5 >= rect.x0 - 1 && Al->path[i].x + 0.5 <= rect.x1 + 1) if (Al->path[i].x + 0.5 >= rect.x0 - 1 && Al->path[i].x + 0.5 <= rect.x1 + 1)
if (Al->path[i].y + 0.5 >= rect.y0 - 1 && Al->path[i].y + 0.5 <= rect.y1 + 1) if (Al->path[i].y + 0.5 >= rect.y0 - 1 && Al->path[i].y + 0.5 <= rect.y1 + 1)
return true; //PathIntersect = True //Exit Function return true; //PathIntersect = True //Exit Function
return false; return false;
}*/ }*/
bool Aliens::recreatePath() bool Aliens::WaveTrace(Alien * al) {
{ bool stop = false;
QVector <QPointF> tmpPath; int step = 2;
QPointF tmppnt; QPoint cp, tp;
//bool trace; QRect fr(0, 0, data->size.width(), data->size.height());
for (int i = 0; i < fw; i++) QVector<QPoint> tmpp, curp;
for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j]; cp = al->Position.pnt/data->cellsize;
for (int i = 0; i < curAliens.size(); i++) { curp.push_back(cp);
qDebug() << "##############"; TmpCells[cp.x()][cp.y()] = 1;
qDebug() << "Alinen N" << i; while (!stop) {
qDebug() << curAliens[i].Position.pnt; qDebug() << "trace";
qDebug() << curAliens[i].PathIndex; tmpp = curp;
if (curAliens[i].Position.pnt.x() - curAliens[i].path[curAliens[i].PathIndex].x()*cellsize < cellsize/2 curp.clear();
&& curAliens[i].Position.pnt.y() - curAliens[i].path[curAliens[i].PathIndex].y()*cellsize < cellsize/2) qDebug() << tmpp.size();
qDebug() << "Yes!!"; stop = true;
else qDebug() << "NO!!"; for (int i = 0; i < tmpp.size(); i++) {
tmppnt = curAliens[i].Position.pnt; cp = tmpp[i];
curAliens[i].Position.pnt.setX(curAliens[i].path[curAliens[i].PathIndex - 1].x() * cellsize); if (cp == al->DestPnt) {
curAliens[i].Position.pnt.setY(curAliens[i].path[curAliens[i].PathIndex - 1].y() * cellsize); TmpCells[cp.x()][cp.y()] = step;
curAliens[i].PathIndex = 1; qDebug() << "true";
qDebug() << curAliens[i].Position.pnt; InvWaveTrace(cp, step, al);
tmpPath = curAliens[i].path; qDebug() << al->path.size();
curAliens[i].path.clear(); return true;
//trace = CreatePath(&curAliens[i]); }
if (!CreatePath(&curAliens[i])) { tp.setX(cp.x() - 1);
curAliens[i].path = tmpPath; tp.setY(cp.y());
curAliens[i].Position.pnt = tmppnt; if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
tmpPath.clear(); TmpCells[tp.x()][tp.y()] = step;
//trace = false; curp.push_back(tp);
qDebug() << "##############"; stop = false;
return false; }
} tp.setX(cp.x() + 1);
curAliens[i].Position.pnt = tmppnt; if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
qDebug() << curAliens[i].Position.pnt; TmpCells[tp.x()][tp.y()] = step;
qDebug() << "==============="; curp.push_back(tp);
} stop = false;
tmpPath.clear(); }
qDebug() << "Re-create path sucsess!"; tp.setX(cp.x());
return true; tp.setY(cp.y() - 1);
} if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
bool Aliens::WaveTrace(Alien * al) stop = false;
{ }
bool stop = false; tp.setY(cp.y() + 1);
int step = 2; if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
QPoint cp, tp; TmpCells[tp.x()][tp.y()] = step;
QRect fr(0, 0, fw, fh); curp.push_back(tp);
QVector<QPoint> tmpp, curp; stop = false;
cp.setX(al->Position.pnt.x()/cellsize); }
cp.setY(al->Position.pnt.y()/cellsize); }
curp.push_back(cp); step++;
TmpCells[cp.x()][cp.y()] = 1; }
while (!stop) { qDebug() << "false";
//qDebug() << "trace"; return false;
tmpp = curp;
curp.clear();
//qDebug() << tmpp.size();
stop = true;
for (int i = 0; i < tmpp.size(); i++) {
cp = tmpp[i];
if (cp == al->DestPnt) {
TmpCells[cp.x()][cp.y()] = step;
qDebug() << "Wawe trace done";
InvWaveTrace(cp, step, al);
qDebug() << al->path.size();
return true;
}
tp.setX(cp.x() - 1);
tp.setY(cp.y());
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
tp.setX(cp.x() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
tp.setX(cp.x());
tp.setY(cp.y() - 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
tp.setY(cp.y() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp);
stop = false;
}
}
step++;
}
qDebug() << "false wawetrace";
return false;
} }
void Aliens::InvWaveTrace(QPoint cp, int cnt, Alien * al) void Aliens::InvWaveTrace(QPoint cp, int cnt, Alien * al)
{ {
QPoint wp, Ppnt; QPoint wp, Ppnt;
int Ind, c, AliensTmpDestX, AliensTmpDestY, xpp, ypp, xnn, ynn; int Ind, c, AliensTmpDestX, AliensTmpDestY, xpp, ypp, xnn, ynn;
unsigned char chk; unsigned char chk;
Ppnt = wp = cp; Ppnt = wp = cp;
xnn=0; xnn=0;
xpp=0; xpp=0;
ynn=0; ynn=0;
ypp=0; ypp=0;
cnt--; cnt--;
al->path.push_front(Ppnt); al->path.push_front(Ppnt);
AliensTmpDestX = al->Position.pnt.x(); AliensTmpDestX = al->Position.pnt.x();
AliensTmpDestY = al->Position.pnt.y(); AliensTmpDestY = al->Position.pnt.y();
while (cnt > 1) while (cnt > 1)
{ {
cnt--; cnt--;
chk = 0; chk = 0;
Ind = 0; Ind = 0;
c = 0; c = 0;
if (wp.x() - 1 >= 0 && TmpCells[wp.x()-1][wp.y()] == cnt) if (wp.x() - 1 >= 0 && TmpCells[wp.x()-1][wp.y()] == cnt)
{ {
chk = chk | 0x01; chk = chk | 0x01;
c++; c++;
} }
if (wp.x() + 1 < fw && TmpCells[wp.x()+1][wp.y()] == cnt) if (wp.x() + 1 < data->size.width() && TmpCells[wp.x()+1][wp.y()] == cnt)
{ {
chk = chk | 0x02; chk = chk | 0x02;
c++; c++;
} }
if (wp.y() - 1 >= 0 && TmpCells[wp.x()][wp.y()-1] == cnt) if (wp.y() - 1 >= 0 && TmpCells[wp.x()][wp.y()-1] == cnt)
{ {
chk = chk | 0x04; chk = chk | 0x04;
c++; c++;
} }
if (wp.y() + 1 < fh && TmpCells[wp.x()][wp.y()+1] == cnt) if (wp.y() + 1 < data->size.height() && TmpCells[wp.x()][wp.y()+1] == cnt)
{ {
chk = chk | 0x08; chk = chk | 0x08;
c++; c++;
} }
if (c == 0 || chk == 0) qDebug() << "ERROR!!!"; if (c == 0 || chk == 0) qDebug() << "ERROR!!!";
if (c > 1) if (c > 1)
{ {
if ((chk & 0x01)==0x01 && (chk & 0x04)==0x04) if ((chk & 0x01)==0x01 && (chk & 0x04)==0x04)
{ {
if (xnn <= ynn && Ind == 0){ if (xnn <= ynn && Ind == 0){
wp.rx()--; wp.rx()--;
xnn++; xnn++;
if (xnn == ynn) xnn++; if (xnn == ynn) xnn++;
Ind = 1; Ind = 1;
} else if (Ind == 0) { } else if (Ind == 0) {
wp.ry()--; wp.ry()--;
ynn++; ynn++;
ynn++; ynn++;
Ind = 1; Ind = 1;
} }
} }
if ((chk & 0x02)==0x02 && (chk & 0x04)==0x04) if ((chk & 0x02)==0x02 && (chk & 0x04)==0x04)
{ {
if (xpp <= ynn && Ind == 0){ if (xpp <= ynn && Ind == 0){
wp.rx()++; wp.rx()++;
xpp++; xpp++;
if (xpp == ynn) xpp++; if (xpp == ynn) xpp++;
Ind = 1; Ind = 1;
} else if (Ind == 0) { } else if (Ind == 0) {
wp.ry()--; wp.ry()--;
ynn++; ynn++;
ynn++; ynn++;
Ind = 1; Ind = 1;
} }
} }
if ((chk & 0x01)==0x01 && (chk & 0x08)==0x08) if ((chk & 0x01)==0x01 && (chk & 0x08)==0x08)
{ {
if (xnn <= ypp && Ind == 0){ if (xnn <= ypp && Ind == 0){
wp.rx()--; wp.rx()--;
xnn++; xnn++;
if (xnn == ypp) xnn++; if (xnn == ypp) xnn++;
Ind = 1; Ind = 1;
} else if (Ind == 0) { } else if (Ind == 0) {
wp.ry()++; wp.ry()++;
ypp++; ypp++;
ypp++; ypp++;
Ind = 1; Ind = 1;
} }
} }
if ((chk & 0x02)==0x02 && (chk & 0x08)==0x08) if ((chk & 0x02)==0x02 && (chk & 0x08)==0x08)
{ {
if (xpp <= ypp && Ind == 0){ if (xpp <= ypp && Ind == 0){
wp.rx()++; wp.rx()++;
xpp++; xpp++;
if (xpp == ypp) xpp++; if (xpp == ypp) xpp++;
Ind = 1; Ind = 1;
} else if (Ind == 0) { } else if (Ind == 0) {
wp.ry()++; wp.ry()++;
ypp++; ypp++;
ypp++; ypp++;
Ind = 1; Ind = 1;
} }
} }
} }
if (c == 1 || Ind == 0) if (c == 1 || Ind == 0)
{ {
xnn=0; xnn=0;
xpp=0; xpp=0;
ynn=0; ynn=0;
ypp=0; ypp=0;
if ((chk & 0x01)==0x01) { if ((chk & 0x01)==0x01) {
wp.rx()--; wp.rx()--;
xnn++; xnn++;
} }
else if ((chk & 0x02)==0x02) { else if ((chk & 0x02)==0x02) {
wp.rx()++; wp.rx()++;
xpp++; xpp++;
} }
else if ((chk & 0x04)==0x04) { else if ((chk & 0x04)==0x04) {
wp.ry()--; wp.ry()--;
ynn++; ynn++;
} }
else if ((chk & 0x08)==0x08) { else if ((chk & 0x08)==0x08) {
wp.ry()++; wp.ry()++;
ypp++; ypp++;
} }
} }
Ppnt = wp; Ppnt = wp;
al->path.push_front(Ppnt); al->path.push_front(Ppnt);
} }
} }
void Aliens::clearAliens() void Aliens::clearAliens()
{ {
curAliens.clear(); //AliensCnt = - 1;
curAliens.clear();
} }

View File

@@ -2,36 +2,27 @@
#define ALIENS_H #define ALIENS_H
#include "basestruct.h" #include "basestruct.h"
//#include <vector>
class Aliens class Aliens
{ {
public: public:
Aliens(int TmpDestx, int TmpDesty, int afw, int afh, int alcellsize); Aliens(GameData *dataAliens);
QVector<Alien> srcAliens; QVector<Alien> srcAliens;
QVector<Alien> curAliens; QVector<Alien> curAliens;
int ** Cells; //bool PathIntersect(Alien* Al, Rectangle rect);
int CurWave;
//bool PathIntersect(Alien* Al, Rectangle rect);
bool AddAlien(); bool AddAlien();
void clearAliens(); void clearAliens();
void clearCells(); bool CreatePath(Alien* al);
bool recreatePath(); private:
void updateAliens(); int ** TmpCells;
QVector<QVector<QPixmap> > AliensPixmaps; GameData * data;
private: QVector< QVector<QPixmap> > AliensPixmaps;
int cellsize; bool WaveTrace(Alien* al);
int ** TmpCells; void InvWaveTrace(QPoint cp, int cnt, Alien* al);
int fw, fh; void updateAlienPos(Alien * al);
QPoint DestPoint; //int loadAlienImages(int PicType);
bool WaveTrace(Alien* al);
bool CreatePath(Alien* al);
void InvWaveTrace(QPoint cp, int cnt, Alien* al);
void updateAlienPos(Alien * al);
int loadPixmap(int PicType, QVector<QPixmap> * pixmaps);
bool loadPixmaps(Alien * al);
}; };
#endif // ALIENS_H #endif // ALIENS_H

BIN
aliens.o

Binary file not shown.

View File

@@ -5,23 +5,28 @@
#include <QPoint> #include <QPoint>
#include <QString> #include <QString>
#include <QPixmap> #include <QPixmap>
#include <QPointF>
#include <QRect> #include <QRect>
#include <QSize>
#include <QDebug> #include <QDebug>
#include <cmath>
//#include <deque>
using std::atan;
//using std::deque;
struct FPVector struct FPVector
{ {
QPointF pnt; QPoint pnt;
float angle; float angle;
}; };
struct GameData
{
QSize size;
QPoint start;
QPoint finish;
int cellsize;
int ** Cells;
};
/*struct Effect /*struct Effect
{ {
float Health; float Health;
@@ -33,11 +38,10 @@ struct FPVector
};*/ };*/
struct AlienImages /*struct AlienImages
{ {
QVector<QPixmap> pix; vector<QPixmap> pix;
int type; };*/
};
struct Alien struct Alien
@@ -59,8 +63,8 @@ struct Alien
float PicFrame; float PicFrame;
//float PicI; //float PicI;
//float Regeneration; //float Regeneration;
QVector<QPointF> path;//path() As Point QVector<QPointF> path;//path() As Point
QPoint DestPnt; QPoint DestPnt;
// Effect Effects; // Effect Effects;
}; };
@@ -72,7 +76,7 @@ struct Tower
//float angle; //float angle;
//int flx; //int flx;
//int fly; //int fly;
QPointF Center; QPoint Center;
//Point FirePnt; //Point FirePnt;
//int BaseType; //int BaseType;
//int Damage; //int Damage;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,73 +0,0 @@
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created: Sun 6. Sep 19:03:09 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../mainwindow.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_MainWindow[] = {
// content:
2, // revision
0, // classname
0, 0, // classinfo
1, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
// slots: signature, parameters, type, tag, flags
12, 11, 11, 11, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_MainWindow[] = {
"MainWindow\0\0ADrender()\0"
};
const QMetaObject MainWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow,
qt_meta_data_MainWindow, 0 }
};
const QMetaObject *MainWindow::metaObject() const
{
return &staticMetaObject;
}
void *MainWindow::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow))
return static_cast<void*>(const_cast< MainWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: ADrender(); break;
default: ;
}
_id -= 1;
}
return _id;
}
QT_END_MOC_NAMESPACE

Binary file not shown.

View File

@@ -1,73 +0,0 @@
/****************************************************************************
** Meta object code from reading C++ file 'udpsender.h'
**
** Created: Sun 6. Sep 19:03:10 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../udpsender.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'udpsender.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_UdpSender[] = {
// content:
2, // revision
0, // classname
0, 0, // classinfo
1, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
// slots: signature, parameters, type, tag, flags
11, 10, 10, 10, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_UdpSender[] = {
"UdpSender\0\0slotRead()\0"
};
const QMetaObject UdpSender::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_UdpSender,
qt_meta_data_UdpSender, 0 }
};
const QMetaObject *UdpSender::metaObject() const
{
return &staticMetaObject;
}
void *UdpSender::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_UdpSender))
return static_cast<void*>(const_cast< UdpSender*>(this));
return QObject::qt_metacast(_clname);
}
int UdpSender::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: slotRead(); break;
default: ;
}
_id -= 1;
}
return _id;
}
QT_END_MOC_NAMESPACE

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

15
game.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "game.h"
game::game(QSize size, QPoint start, QPoint finish, int cellsize)
{
data = new GameData();
data->size = size/cellsize;
data->start = start/cellsize;
data->finish = finish/cellsize;
data->cellsize = cellsize;
data->Cells = new int*[data->size.width()];
for (int i = 0; i < data->size.width(); i++) {
data->Cells[i] = new int[data->size.height()];
for (int j = 0; j < data->size.height(); j++) data->Cells[i][j] = 0;
}
}

13
game.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef GAME_H
#define GAME_H
#include "basestruct.h"
class game
{
public:
game(QSize size, QPoint start, QPoint finish, int cellsize);
GameData *data;
};
#endif // GAME_H

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
main.o

Binary file not shown.

View File

@@ -3,108 +3,106 @@
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) : QMainWindow(parent), ui(new Ui::MainWindow)
{ {
qDebug() << "Load START!"; qDebug() << "Load START!";
ui->setupUi(this); ui->setupUi(this);
sndr = new UdpSender("127.0.0.1",10101); sndr = new UdpSender("127.0.0.1",10101);
sndr->connectSend("hellow"); sndr->connectSend("hellow");
cellsize = 16; cellsize = 16;
destx = this->width() / cellsize; destx = this->width() / cellsize;
desty = this->height() / cellsize / 2; desty = this->height() / cellsize / 2;
QTimer *timer = new QTimer(this); timer = new QTimer(this);
adp = new adpainter(this->width(),this->height(),cellsize); adp = new adpainter(this->width(),this->height(),cellsize);
adp->clear(); adp->clear();
adp->drawgrid(); adp->drawgrid();
connect(timer, SIGNAL(timeout()), this, SLOT(ADrender())); connect(timer, SIGNAL(timeout()), this, SLOT(ADrender()));
aliens = new Aliens(destx, desty, this->width() / cellsize ,this->height() / cellsize, cellsize); GameMain = new game(this->size(),QPoint(0,this->height()/2),QPoint(this->width()-cellsize,this->height()/2), cellsize);
if (!aliens->AddAlien()) qDebug() << "Error Loading"; aliens = new Aliens(GameMain->data);
this->setGeometry(100,100,this->width(),this->height()); aliens->AddAlien();
//qDebug() << "QT version" << qVersion(); this->setGeometry(100,100,this->width(),this->height());
timer->start(50); //qDebug() << "QT version" << qVersion();
qDebug() << "Load DONE!"; //AnimAlien = 0;
timer->start(50);
qDebug() << "Load DONE!";
} }
void MainWindow::ADrender() void MainWindow::ADrender()
{ {
//aliens->AddAlien(); adp->drawAliens(aliens->curAliens[0].path, &aliens->curAliens[0].Position);
aliens->updateAliens(); this->repaint();
adp->drawAliens(&aliens->curAliens[0], &aliens->AliensPixmaps[0]);
this->repaint();
} }
void MainWindow::paintEvent(QPaintEvent*) void MainWindow::paintEvent(QPaintEvent*)
{ {
QPainter painter; QPainter painter;
painter.begin(this); painter.begin(this);
painter.drawPixmap(0,0,*adp->getPixmap()); painter.drawPixmap(0,0,*adp->getPixmap());
painter.end(); painter.end();
} }
void MainWindow::mouseMoveEvent ( QMouseEvent * event ) void MainWindow::mouseMoveEvent ( QMouseEvent * event )
{ {
if (mousebt == 1) ClearCell(event->x(),event->y()); if (mousebt == 1) ClearCell(event->x(),event->y());
else SetCell(event->x(),event->y()); else SetCell(event->x(),event->y());
} }
void MainWindow::mousePressEvent ( QMouseEvent * event ) void MainWindow::mousePressEvent ( QMouseEvent * event )
{ {
if (event->button() == Qt::RightButton) { if (event->button() == Qt::RightButton) {
ClearCell(event->x(),event->y()); ClearCell(event->x(),event->y());
mousebt = 1; mousebt = 1;
} else { } else {
SetCell(event->x(),event->y()); SetCell(event->x(),event->y());
mousebt = 0; mousebt = 0;
} }
} }
void MainWindow::SetCell(int x, int y) void MainWindow::SetCell(int x, int y)
{ {
QPoint cp; QPoint cp;
QRect wdrect(0, 0, (this->width() / cellsize) * cellsize, (this->height() / cellsize) * cellsize); QRect wdrect(0, 0, (this->width() / cellsize) * cellsize, (this->height() / cellsize) * cellsize);
if (wdrect.contains(x,y)) { if (wdrect.contains(x,y)) {
cp.setX((int) x / cellsize); cp.setX((int) x / cellsize);
cp.setY((int) y / cellsize); cp.setY((int) y / cellsize);
//qDebug() << "click: " << cp.x() << ";" << cp.y(); //qDebug() << "click: " << cp.x() << ";" << cp.y();
aliens->Cells[cp.x()][cp.y()] = - 1; GameMain->data->Cells[cp.x()][cp.y()] = - 1;
adp->drawcell(cp); adp->drawcell(cp);
//aliens->recreatePath(); //aliens->clearAliens();
//adp->AnimAlien=0; //adp->StepAlien=0;
//aliens->curAliens[aliens->CurWave].Position.pnt = aliens->curAliens[aliens->CurWave-1].path[adp->StepAlien]; //adp->AnimAlien=0;
if (!aliens->recreatePath()) { if (!aliens->CreatePath(&(aliens->curAliens[0]))) ClearCell(x,y);
aliens->Cells[cp.x()][cp.y()] = 0; else adp->StepAlien=0;
adp->clearcell(cp); }
qDebug() << "DONT CLOSE THE PATH";
}
}
} }
void MainWindow::ClearCell(int x, int y) void MainWindow::ClearCell(int x, int y)
{ {
QPoint cp; QPoint cp;
QRect wdrect(0, 0, (this->width() / cellsize) * cellsize, (this->height() / cellsize) * cellsize); QRect wdrect(0, 0, (this->width() / cellsize) * cellsize, (this->height() / cellsize) * cellsize);
if (wdrect.contains(x,y)) { if (wdrect.contains(x,y)) {
cp.setX((int) x / cellsize); cp.setX((int) x / cellsize);
cp.setY((int) y / cellsize); cp.setY((int) y / cellsize);
//qDebug() << "click: " << cp.x() << ";" << cp.y(); //qDebug() << "click: " << cp.x() << ";" << cp.y();
aliens->Cells[cp.x()][cp.y()] = 0; GameMain->data->Cells[cp.x()][cp.y()] = 0;
adp->clearcell(cp); adp->clearcell(cp);
aliens->recreatePath(); //aliens->clearAliens();
//aliens->clearAliens(); //aliens->AddAlien();
//aliens->AddAlien(); aliens->CreatePath(&(aliens->curAliens[0]));
} adp->StepAlien=0;
}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
delete ui; delete ui;
delete aliens; delete aliens;
delete adp; delete adp;
} }

View File

@@ -2,40 +2,42 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include <QtGui/QMainWindow> #include <QtGui/QMainWindow>
#include <QtDebug>
#include <QTimer> #include <QTimer>
#include "adpainter.h" #include "adpainter.h"
#include "aliens.h" #include "aliens.h"
#include "udpsender.h" #include "udpsender.h"
#include "game.h"
namespace Ui namespace Ui
{ {
class MainWindow; class MainWindow;
} }
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget *parent = 0); MainWindow(QWidget *parent = 0);
~MainWindow(); ~MainWindow();
public slots: public slots:
void ADrender(); void ADrender();
private: private:
void paintEvent(QPaintEvent*); void paintEvent(QPaintEvent*);
void SetCell(int x, int y); void SetCell(int x, int y);
void ClearCell(int x, int y); void ClearCell(int x, int y);
void mouseMoveEvent ( QMouseEvent * event ); void mouseMoveEvent ( QMouseEvent * event );
void mousePressEvent ( QMouseEvent * event ); void mousePressEvent ( QMouseEvent * event );
Ui::MainWindow *ui; Ui::MainWindow *ui;
Aliens * aliens; Aliens * aliens;
UdpSender * sndr; UdpSender * sndr;
adpainter * adp; adpainter * adp;
bool mousebt; game * GameMain;
int cellsize, destx, desty; QTimer *timer;
//unsigned int AnimAlien; bool mousebt;
int cellsize, destx, desty;
//unsigned int AnimAlien;
}; };

Binary file not shown.

View File

@@ -31,18 +31,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
<widget class="QWidget" name="widget"> <widget class="QWidget" name="widget"/>
<widget class="QWidget" name="paintWidget" native="true">
<property name="geometry">
<rect>
<x>40</x>
<y>20</y>
<width>361</width>
<height>181</height>
</rect>
</property>
</widget>
</widget>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources/> <resources/>

6
map.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include "map.h"
map::map(GameData *dataMap)
{
}

13
map.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef MAP_H
#define MAP_H
#include "basestruct.h"
class map
{
public:
map(GameData *dataMap);
QPixmap * background;
};
#endif // MAP_H

View File

@@ -1,73 +0,0 @@
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created: Sat Sep 12 14:04:46 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "mainwindow.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_MainWindow[] = {
// content:
2, // revision
0, // classname
0, 0, // classinfo
1, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
// slots: signature, parameters, type, tag, flags
12, 11, 11, 11, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_MainWindow[] = {
"MainWindow\0\0ADrender()\0"
};
const QMetaObject MainWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow,
qt_meta_data_MainWindow, 0 }
};
const QMetaObject *MainWindow::metaObject() const
{
return &staticMetaObject;
}
void *MainWindow::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow))
return static_cast<void*>(const_cast< MainWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: ADrender(); break;
default: ;
}
_id -= 1;
}
return _id;
}
QT_END_MOC_NAMESPACE

Binary file not shown.

View File

@@ -1,73 +0,0 @@
/****************************************************************************
** Meta object code from reading C++ file 'udpsender.h'
**
** Created: Sat Sep 12 14:04:47 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "udpsender.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'udpsender.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_UdpSender[] = {
// content:
2, // revision
0, // classname
0, 0, // classinfo
1, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
// slots: signature, parameters, type, tag, flags
11, 10, 10, 10, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_UdpSender[] = {
"UdpSender\0\0slotRead()\0"
};
const QMetaObject UdpSender::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_UdpSender,
qt_meta_data_UdpSender, 0 }
};
const QMetaObject *UdpSender::metaObject() const
{
return &staticMetaObject;
}
void *UdpSender::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_UdpSender))
return static_cast<void*>(const_cast< UdpSender*>(this));
return QObject::qt_metacast(_clname);
}
int UdpSender::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: slotRead(); break;
default: ;
}
_id -= 1;
}
return _id;
}
QT_END_MOC_NAMESPACE

Binary file not shown.

11970
qrc_res.cpp

File diff suppressed because it is too large Load Diff

BIN
qrc_res.o

Binary file not shown.

24
res.qrc
View File

@@ -1,24 +0,0 @@
<RCC>
<qresource prefix="/" >
<file>images/Aliens/Al_0_0.png</file>
<file>images/Aliens/Al_0_1.png</file>
<file>images/Aliens/Al_0_2.png</file>
<file>images/Aliens/Al_0_3.png</file>
<file>images/Aliens/Al_0_4.png</file>
<file>images/Aliens/Al_0_5.png</file>
<file>images/Aliens/Al_0_6.png</file>
<file>images/Aliens/Al_0_7.png</file>
<file>images/Aliens/Al_0_8.png</file>
<file>images/Aliens/Al_0_9.png</file>
<file>images/Aliens/Al_0_10.png</file>
<file>images/Aliens/Al_0_11.png</file>
<file>images/Aliens/Al_0_12.png</file>
<file>images/Aliens/Al_0_13.png</file>
<file>images/Aliens/Al_0_14.png</file>
<file>images/Aliens/Al_0_15.png</file>
<file>images/Aliens/Al_0_16.png</file>
<file>images/Aliens/Al_0_17.png</file>
<file>images/Aliens/Al_0_18.png</file>
<file>images/Aliens/Al_0_19.png</file>
</qresource>
</RCC>

View File

@@ -1,11 +1,11 @@
#include "towers.h" #include "towers.h"
towers::towers() towers::towers(GameData *dataTowers)
{ {
} }
void towers::AddTower(QPointF point, int ** cells) void towers::AddTower(QPoint point, int type)
{ {
} }

View File

@@ -6,10 +6,10 @@
class towers class towers
{ {
public: public:
towers(); towers(GameData *dataTowers);
QVector<Tower> srcTowers; QVector<Tower> srcTowers;
QVector<Tower> curTowers; QVector<Tower> curTowers;
void AddTower(QPointF point, int ** cells); void AddTower(QPoint point, int type);
}; };
#endif // TOWERS_H #endif // TOWERS_H

BIN
towers.o

Binary file not shown.

View File

@@ -3,12 +3,12 @@
UdpSender::UdpSender(QString IP, quint16 Port) UdpSender::UdpSender(QString IP, quint16 Port)
{ {
sock = new QUdpSocket(); sock = new QUdpSocket();
qDebug() << sock->state(); qDebug() << sock->state();
//cout << sock->socketDescriptor() << endl; //cout << sock->socketDescriptor() << endl;
//qDebug() << sock->socketDescriptor(); //qDebug() << sock->socketDescriptor();
addr = QHostAddress(IP); addr = QHostAddress(IP);
port = Port; port = Port;
connect(sock, SIGNAL(readyRead()),this, SLOT(slotRead())); connect(sock, SIGNAL(readyRead()),this, SLOT(slotRead()));
} }
@@ -16,7 +16,7 @@ UdpSender::UdpSender(QString IP, quint16 Port)
UdpSender::~UdpSender() UdpSender::~UdpSender()
{ {
sock->close(); sock->close();
delete sock; delete sock;
} }
@@ -31,15 +31,16 @@ void UdpSender::slotRead()
//cout << endl; //cout << endl;
//qDebug() << sock->write(recstr.toUtf8()); //qDebug() << sock->write(recstr.toUtf8());
qDebug() << sock->socketDescriptor(); qDebug() << sock->socketDescriptor();
emit dataResieved(recdata);
} }
void UdpSender::connectSend(QString s) void UdpSender::connectSend(QString s)
{ {
sz = s.length(); sz = s.length();
sock->connectToHost(addr,port); sock->connectToHost(addr,port);
//qDebug() << sock->error(); qDebug() << sock->error();
qDebug() << sock->state(); qDebug() << sock->state();
//qDebug() << sock->socketDescriptor(); qDebug() << sock->socketDescriptor();
qDebug() << sock->write(s.toUtf8()) << "writen!"; if (sock->write(s.toUtf8())>0) qDebug() << "writen!";
} }

View File

@@ -21,4 +21,6 @@ class UdpSender : public QObject
quint16 port; quint16 port;
quint32 sz; quint32 sz;
QByteArray * senddata; QByteArray * senddata;
signals:
void dataResieved(QByteArray * data);
}; };

Binary file not shown.

View File

@@ -1,67 +0,0 @@
/********************************************************************************
** Form generated from reading ui file 'mainwindow.ui'
**
** Created: Sat Sep 12 14:04:38 2009
** by: Qt User Interface Compiler version 4.5.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QMainWindow>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QWidget *widget;
QWidget *paintWidget;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(800, 400);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(MainWindow->sizePolicy().hasHeightForWidth());
MainWindow->setSizePolicy(sizePolicy);
MainWindow->setMinimumSize(QSize(800, 400));
MainWindow->setBaseSize(QSize(800, 400));
widget = new QWidget(MainWindow);
widget->setObjectName(QString::fromUtf8("widget"));
paintWidget = new QWidget(widget);
paintWidget->setObjectName(QString::fromUtf8("paintWidget"));
paintWidget->setGeometry(QRect(40, 20, 361, 181));
MainWindow->setCentralWidget(widget);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
Q_UNUSED(MainWindow);
} // retranslateUi
};
namespace Ui {
class MainWindow: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H