###########################################################
# LoadTextures - Railshooter Module
# Preloads Textures
###########################################################

# DESCRIPTION:
# This file pre-loads textures to be used for Animated Texture
# Map movies and other special effects.  Filters are then run
# on these textures to remove any pixelation.


from direct.showbase.ShowBaseGlobal import *
from direct.task import Task
from pandac.PandaModules import *

########################################
# Preload Textures
########################################
white = loader.loadTexture('Textures/white.jpg')

LockOnCrosshair= loader.loadTexture('Models/basics/lockcrosshair.png')
LockOnCrosshair.setMagfilter(1)
LockOnCrosshair.setMinfilter(1)

shockwaveMap = loader.loadTexture('Textures/shockwave.png')
shockwaveMap.setMagfilter(1)
shockwaveMap.setMinfilter(1)

powerupShockwave = loader.loadTexture('Textures/powerupShockwave.png')
powerupShockwave.setMagfilter(1)
powerupShockwave.setMinfilter(1)

plasmaMap = loader.loadTexture('Textures/plasmaExplosion.png')
plasmaMap.setMagfilter(1)
plasmaMap.setMinfilter(1)

pulseMap = loader.loadTexture('Textures/pulseRing.png')
pulseMap.setMagfilter(1)
pulseMap.setMinfilter(1)

greenProjectile = loader.loadTexture('Models/effects/projectilegreen1.png')


########################################
# Preload Portrait Textures
########################################

commanderSide1 = loader.loadTexture('Textures/CommanderSide1.png')
commanderSide1.setMagfilter(1)
commanderSide1.setMinfilter(1)

commanderSide2 = loader.loadTexture('Textures/CommanderSide2.png')
commanderSide2.setMagfilter(1)
commanderSide2.setMinfilter(1)

commanderSide3 = loader.loadTexture('Textures/CommanderSide3.png')
commanderSide3.setMagfilter(1)
commanderSide3.setMinfilter(1)

commanderFront1 = loader.loadTexture('Textures/CommanderFront1.png')
commanderFront1.setMagfilter(1)
commanderFront1.setMinfilter(1)

commanderFront2 = loader.loadTexture('Textures/CommanderFront2.png')
commanderFront2.setMagfilter(1)
commanderFront2.setMinfilter(1)

commanderFront3 = loader.loadTexture('Textures/CommanderFront3.png')
commanderFront3.setMagfilter(1)
commanderFront3.setMinfilter(1)


########################################
# Preload Win Screen
########################################

winMap = loader.loadTexture('Textures/WinScreen.png')
winMap.setMagfilter(1)
winMap.setMinfilter(1)


########################################
# Preload Textures for Texture Map Movies
########################################
# Create a List holding the New Texture Objects
numFrames = 35

explosionMap = {}
explosionMap[0] = loader.loadTexture('Textures/Explosion/Explosion0001.png')
explosionMap[1] = loader.loadTexture('Textures/Explosion/Explosion0002.png')
explosionMap[2] = loader.loadTexture('Textures/Explosion/Explosion0003.png')
explosionMap[3] = loader.loadTexture('Textures/Explosion/Explosion0004.png')
explosionMap[4] = loader.loadTexture('Textures/Explosion/Explosion0005.png')
explosionMap[5] = loader.loadTexture('Textures/Explosion/Explosion0006.png')
explosionMap[6] = loader.loadTexture('Textures/Explosion/Explosion0007.png')
explosionMap[7] = loader.loadTexture('Textures/Explosion/Explosion0008.png')
explosionMap[8] = loader.loadTexture('Textures/Explosion/Explosion0009.png')
explosionMap[9] = loader.loadTexture('Textures/Explosion/Explosion0010.png')
explosionMap[10] = loader.loadTexture('Textures/Explosion/Explosion0011.png')
explosionMap[11] = loader.loadTexture('Textures/Explosion/Explosion0012.png')
explosionMap[12] = loader.loadTexture('Textures/Explosion/Explosion0013.png')
explosionMap[13] = loader.loadTexture('Textures/Explosion/Explosion0014.png')
explosionMap[14] = loader.loadTexture('Textures/Explosion/Explosion0015.png')
explosionMap[15] = loader.loadTexture('Textures/Explosion/Explosion0016.png')
explosionMap[16] = loader.loadTexture('Textures/Explosion/Explosion0017.png')
explosionMap[17] = loader.loadTexture('Textures/Explosion/Explosion0018.png')
explosionMap[18] = loader.loadTexture('Textures/Explosion/Explosion0019.png')
explosionMap[19] = loader.loadTexture('Textures/Explosion/Explosion0020.png')
explosionMap[20] = loader.loadTexture('Textures/Explosion/Explosion0021.png')
explosionMap[21] = loader.loadTexture('Textures/Explosion/Explosion0022.png')
explosionMap[22] = loader.loadTexture('Textures/Explosion/Explosion0023.png')
explosionMap[23] = loader.loadTexture('Textures/Explosion/Explosion0024.png')
explosionMap[24] = loader.loadTexture('Textures/Explosion/Explosion0025.png')
explosionMap[25] = loader.loadTexture('Textures/Explosion/Explosion0026.png')
explosionMap[26] = loader.loadTexture('Textures/Explosion/Explosion0027.png')
explosionMap[27] = loader.loadTexture('Textures/Explosion/Explosion0028.png')
explosionMap[28] = loader.loadTexture('Textures/Explosion/Explosion0029.png')
explosionMap[29] = loader.loadTexture('Textures/Explosion/Explosion0030.png')
explosionMap[30] = loader.loadTexture('Textures/Explosion/Explosion0031.png')
explosionMap[31] = loader.loadTexture('Textures/Explosion/Explosion0032.png')
explosionMap[32] = loader.loadTexture('Textures/Explosion/Explosion0033.png')
explosionMap[33] = loader.loadTexture('Textures/Explosion/Explosion0034.png')
explosionMap[34] = loader.loadTexture('Textures/Explosion/Explosion0035.png')
explosionMap[35] = loader.loadTexture('Textures/Explosion/Explosion0036.png')
# explosionMap[36] = loader.loadTexture('Textures/Explosion/Explosion0037.png')
# explosionMap[37] = loader.loadTexture('Textures/Explosion/Explosion0038.png')
# explosionMap[38] = loader.loadTexture('Textures/Explosion/Explosion0039.png')
# explosionMap[39] = loader.loadTexture('Textures/Explosion/Explosion0040.png')

# Run through the entire list and add nice filters to 
# the textures to get rid of the pixels
for i in range(numFrames):
    explosionMap[i].setMagfilter(1)
    explosionMap[i].setMinfilter(1)







